lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YQ0MU/GcLkPLiy5C@kroah.com>
Date:   Fri, 6 Aug 2021 12:17:55 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Paul Cercueil <paul@...pouillou.net>
Cc:     Rob Herring <robh@...nel.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Sam Ravnborg <sam@...nborg.org>, list@...ndingux.net,
        linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers

On Thu, Aug 05, 2021 at 10:05:27PM +0200, Paul Cercueil wrote:
> Hi Greg,
> 
> Le jeu., août 5 2021 at 21:35:34 +0200, Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> a écrit :
> > On Thu, Aug 05, 2021 at 09:21:09PM +0200, Paul Cercueil wrote:
> > >  When the drivers of remote devices (e.g. HDMI chip) are disabled in
> > > the
> > >  config, we want the ingenic-drm driver to be able to probe
> > > nonetheless
> > >  with the other devices (e.g. internal LCD panel) that are enabled.
> > > 
> > >  Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> > >  ---
> > >   drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 12 ++++++++++++
> > >   1 file changed, 12 insertions(+)
> > > 
> > >  diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> > > b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> > >  index d261f7a03b18..5e1fdbb0ba6b 100644
> > >  --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> > >  +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> > >  @@ -1058,6 +1058,18 @@ static int ingenic_drm_bind(struct device
> > > *dev, bool has_components)
> > >   	for (i = 0; ; i++) {
> > >   		ret = drm_of_find_panel_or_bridge(dev->of_node, 0, i, &panel,
> > > &bridge);
> > >   		if (ret) {
> > >  +			/*
> > >  +			 * Workaround for the case where the drivers for the
> > >  +			 * remote devices are not enabled. When that happens,
> > >  +			 * drm_of_find_panel_or_bridge() returns -EPROBE_DEFER
> > >  +			 * endlessly, which prevents the ingenic-drm driver from
> > >  +			 * working at all.
> > >  +			 */
> > >  +			if (ret == -EPROBE_DEFER) {
> > >  +				ret = driver_deferred_probe_check_state(dev);
> > >  +				if (ret == -ENODEV || ret == -ETIMEDOUT)
> > >  +					continue;
> > >  +			}
> > 
> > So you are mucking around with devices on other busses within this
> > driver?  What could go wrong?  :(
> 
> I'm doing the same thing as everybody else. This is the DRM driver, and
> there is a driver for the external HDMI chip which gives us a DRM bridge
> that we can obtain from the device tree.

But then why do you need to call this function that is there for a bus,
not for a driver.

> > Please use the existing driver core functionality for this type of
> > thing, it is not unique, no need for this function to be called.
> 
> I'm not sure you understand what I'm doing here. This driver calls
> drm_of_find_panel_or_bridge(), without guarantee that the driver for the
> remote device (connected via DT graph) has been enabled in the kernel
> config. In that case it will always return -EPROBE_DEFER and the ingenic-drm
> driver will never probe.
> 
> This patch makes sure that the driver can probe if the HDMI driver has been
> disabled in the kernel config, nothing more.

That should not be an issue as you do not care if the config is enabled,
you just want to do something in the future if the driver shows up,
right?

Much like the device link code, have you looked at that?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ