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: <Z73FSWR-DK0HxMb2@smile.fi.intel.com>
Date: Tue, 25 Feb 2025 15:27:37 +0200
From: "andriy.shevchenko@...ux.intel.com" <andriy.shevchenko@...ux.intel.com>
To: Thomas Zimmermann <tzimmermann@...e.de>
Cc: Aditya Garg <gargaditya08@...e.com>,
	"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>,
	"mripard@...nel.org" <mripard@...nel.org>,
	"airlied@...il.com" <airlied@...il.com>,
	"simona@...ll.ch" <simona@...ll.ch>,
	Kerem Karabay <kekrby@...il.com>,
	Atharva Tiwari <evepolonium@...il.com>,
	Aun-Ali Zaidi <admin@...eit.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v5 2/2] drm/tiny: add driver for Apple Touch Bars in x86
 Macs

On Tue, Feb 25, 2025 at 12:59:43PM +0100, Thomas Zimmermann wrote:
> Am 25.02.25 um 12:01 schrieb andriy.shevchenko@...ux.intel.com:
> > On Tue, Feb 25, 2025 at 10:48:53AM +0000, Aditya Garg wrote:
> > > > On 25 Feb 2025, at 4:17 PM, andriy.shevchenko@...ux.intel.com wrote:
> > > > On Tue, Feb 25, 2025 at 10:36:03AM +0000, Aditya Garg wrote:
> > > > > > > On 25 Feb 2025, at 4:03 PM, andriy.shevchenko@...ux.intel.com wrote:
> > > > > > On Tue, Feb 25, 2025 at 10:09:42AM +0000, Aditya Garg wrote:

 ...

> > > > > > > +static int appletbdrm_probe(struct usb_interface *intf,
> > > > > > > +                const struct usb_device_id *id)
> > > > > > > +{
> > > > > > > +    struct usb_endpoint_descriptor *bulk_in, *bulk_out;
> > > > > > > +    struct device *dev = &intf->dev;
> > > > > > > +    struct appletbdrm_device *adev;
> > > > > > > +    struct drm_device *drm;
> > > > > > > +    int ret;
> > > > > > > +
> > > > > > > +    ret = usb_find_common_endpoints(intf->cur_altsetting, &bulk_in, &bulk_out, NULL, NULL);
> > > > > > > +    if (ret) {
> > > > > > > +        drm_err(drm, "Failed to find bulk endpoints\n");
> > > > > > This is simply wrong (and in this case even lead to crash in some circumstances).
> > > > > > drm_err() may not be used here. That's my point in previous discussions.
> > > > > > Independently on the subsystem the ->probe() for the sake of consistency and
> > > > > > being informative should only rely on struct device *dev,
> > > > > I'm not sure how drm_err works,
> > > > It's a macro.
> > > > 
> > > > > but struct drm_device does have a struct device *dev as well.
> > > > Yes, but only when it's initialized.
> > > > 
> > > > > Anyways, this is something I'll leave for Thomas to reply.
> > > > The code above is wrong independently on his reply :-)
> > > I'm kinda stuck between contrasting views of 2 kernel maintainers lol,
> > > so I said let Thomas reply.
> > Sure. I also want him to clarify my question about potential drm_err_probe().
> 
> These threads get a little lengthy. What is the question?

How drm_err_probe() can be (consistently) implemented as there are and will be
cases when we want to return an error code with the message and having DRM devce
not being available, please?

Also, drm_err() has a downside of not checking for deferred probe and
potentially leads to the noisy log floods.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ