Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1095922imc; Mon, 11 Mar 2019 06:26:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiB+ClKsOmunaD1+YiavfR8EpPmBgXSaS7NFClspW2t6wLdLqbx0UZn84E0Kh0ImcaLaEo X-Received: by 2002:a62:e204:: with SMTP id a4mr32722284pfi.225.1552310819588; Mon, 11 Mar 2019 06:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552310819; cv=none; d=google.com; s=arc-20160816; b=uCnbSovNqC/N/Dx4YrnwGzO2lGlhNJbS9ZHi8BWfIz2U1l5DNUmGv2H4t2UePFySI5 XOM/bXv/7W06WBkvS8vGuhImrN/s0HNMMZR4hed/fD+/I/YDclAf8frBtibi65KqJ4h8 MXU3xeFMh1DwLxaJOV1faUR0Zaa3RK2btZNeFBaVdMMyCfYJvs3u9vFbJHfxai9Fc+ND ob1V/5Q/n1eGa3j/M8Qgju6J5lrpOAXf5n7K93Q2NRObyOcbDhCUWm0CLVI3iRuA1u4E aB44v5qN3fgKe3v4GAHyH+DD07VdURtYJE0uZAZ3sV4r6P1I+z2cGKd/0H5FOKEqiDBH YMgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=PZF5lWUEY+LMwRBVuoqH3/fkw3bGcuiGAdYFuVZ7LPQ=; b=VExqZvB1iO0WARPlor/BMigjwQRdS0sRjIkog+qHVBhaHJeZfyFcSZNTP8s+QOxx44 OcV6tsLOcsCMnPe0BiwOPOjSthUDNJRxaS3mb08n1qzYgukdO7AE/ZUT3x+YwIw4FHnC l9m504Dh3OP5DZovBa5+E5IfIijnlEKOVR7N0xhNWOz8lXMd69VGzLGJhObI0BoxZwD8 uznKqG4BUrSO2Gzo0gbSYpij66HNdvIfi/XF8TQm33x5qJAG67AR6ZJwNWUIWoK10Pea tEdTsqAeLqxalBDsBlE/06f+bk+vBVox/wzhaD3RGnpxN3b4WCPWbBnTOU1Ps7qozh9e fQLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=Zh2e6nbJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si5300545plb.278.2019.03.11.06.26.43; Mon, 11 Mar 2019 06:26:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=Zh2e6nbJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbfCKNYI (ORCPT + 99 others); Mon, 11 Mar 2019 09:24:08 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33398 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbfCKNYC (ORCPT ); Mon, 11 Mar 2019 09:24:02 -0400 Received: by mail-ed1-f66.google.com with SMTP id d12so4002081edp.0 for ; Mon, 11 Mar 2019 06:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PZF5lWUEY+LMwRBVuoqH3/fkw3bGcuiGAdYFuVZ7LPQ=; b=Zh2e6nbJJ8zHh1oalJbr/VF2+0jTnYBZLRVhNsdP+4WGyQVZXVkkPnXiU2yP/zjdJR 6KtxnXafWXzdRAOMVVzhZI3WVOONMZ28VWWg8IxVM8+TmnCb0kxolkij2pdBkeEVEyGI gvMn3nZYYF0rJTXg2nxjTbEkYd6TZ01/Kc+Qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=PZF5lWUEY+LMwRBVuoqH3/fkw3bGcuiGAdYFuVZ7LPQ=; b=ke+Qa0DNET22WWP2T+CiIwAJY/nf50k6yyyT9mJYu0tR+emuU5NMmFZTLsQ24ACAQm z5/rl2vkgvaISytXlr05/jOzhOcpFRptuoonnLgG79BjWrZ1rc6trRWnI5KYQX/XOPH0 j3/6lYh9ip1RdVQ7TGmxEaoFdHviF9Wg/7FuVRvqJSbhp1+NZH2Tu8qhz5ZsOvwznCvF mO3J8v+WgUp1WD0C4fmNP4tRqAZjmtdA4EtB1wbv1eyLxnQvAwhyknBfDjQFbwy7NNTo Wi4OnvP1FXgQrIXfHs7bE2y8Byo+Sofke6yrjmteOyQ/lOXuret2eE6XxD825H0+C2KC wJ8w== X-Gm-Message-State: APjAAAWIRfV9jaFelkSMJRlKuLKcA7dJtEaohcgwTiPUT2+bKuBgG/T2 psgqrWyeWhY5fhLvzVuQXM3Aiw== X-Received: by 2002:a17:906:512:: with SMTP id j18mr9584026eja.12.1552310640979; Mon, 11 Mar 2019 06:24:00 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id 3sm3058450ejx.2.2019.03.11.06.23.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 06:24:00 -0700 (PDT) Date: Mon, 11 Mar 2019 14:23:58 +0100 From: Daniel Vetter To: Gerd Hoffmann Cc: Rodrigo Siqueira , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bochs: Fix NULL dereference on atomic_disable helper Message-ID: <20190311132358.GF2665@phenom.ffwll.local> Mail-Followup-To: Gerd Hoffmann , Rodrigo Siqueira , David Airlie , virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> <20190311101159.t6mbzm5sdwuh5muc@smtp.gmail.com> <20190311130716.6hjqci43clic5lxx@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311130716.6hjqci43clic5lxx@sirius.home.kraxel.org> X-Operating-System: Linux phenom 4.19.0-1-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 11, 2019 at 02:07:16PM +0100, Gerd Hoffmann wrote: > Hi, > > > > > static void bochs_crtc_atomic_flush(struct drm_crtc *crtc, > > > > struct drm_crtc_state *old_crtc_state) > > > > { > > > > @@ -66,6 +71,7 @@ static const struct drm_crtc_funcs bochs_crtc_funcs = { > > > > static const struct drm_crtc_helper_funcs bochs_helper_funcs = { > > > > .mode_set_nofb = bochs_crtc_mode_set_nofb, > > > > .atomic_enable = bochs_crtc_atomic_enable, > > > > + .atomic_disable = bochs_crtc_atomic_disable, > > > > > > Shouldn't we make the callback optional instead of adding empty dummy > > > functions to drivers? > > > > Hi Gerd, > > > > I agree, and I can work in this issue. > > Just one question, should we make atomic_enable optional as well? > > IIRC the drm code checks for the atomic_enable callback presence to > figure whenever it should take the atomic or legacy code paths. It should check for drm_driver->mode_config.funcs.atomic_commit for that, see drm_drv_uses_atomic_modeset(). Anything else should be a bug. Or do you mean the fallback to the old crtc helper prepare/commit callbacks? We'd need to make all of them optional ofc, with atomic_ variants being preferred ofc. -Daniel > > So, I think that will not work. > > cheers, > Gerd > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch