Re: [PATCH] drm/bridge: ti-sn65dsi86: Fix multiple instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 18, 2024 at 05:25:22PM +0300, Laurent Pinchart wrote:
> Hi Greg,
> 
> On Fri, Oct 18, 2024 at 04:09:26PM +0200, Greg KH wrote:
> > On Fri, Oct 18, 2024 at 03:36:48PM +0200, Geert Uytterhoeven wrote:
> > > On Fri, Oct 18, 2024 at 3:10 PM Laurent Pinchart wrote:
> > > > On Fri, Oct 18, 2024 at 09:45:52AM +0200, Geert Uytterhoeven wrote:
> > > > > Each bridge instance creates up to four auxiliary devices with different
> > > > > names.  However, their IDs are always zero, causing duplicate filename
> > > > > errors when a system has multiple bridges:
> > > > >
> > > > >     sysfs: cannot create duplicate filename '/bus/auxiliary/devices/ti_sn65dsi86.gpio.0'
> > > > >
> > > > > Fix this by using a unique instance ID per bridge instance.
> > > >
> > > > Isn't this something that should be handled by the AUX core ? The code
> > > > below would otherwise need to be duplicated by all drivers, which seems
> > > > a burden we should avoid.
> > > 
> > > According to the documentation, this is the responsibility of the caller
> > > https://elixir.bootlin.com/linux/v6.11.4/source/include/linux/auxiliary_bus.h#L81
> > > I believe this is the same for platform devices.
> > > See also the example at
> > > https://elixir.bootlin.com/linux/v6.11.4/source/include/linux/auxiliary_bus.h#L116
> > > 
> > > Note: the platform bus supports PLATFORM_DEVID_AUTO, but the auxiliary
> > > bus does not.
> > 
> > Yes, it does not as it's up to the caller to create a unique name, like
> > your patch here does.  I'd argue that platform should also not do
> > automatic device ids, but that's a different argument :)
> 
> __auxiliary_device_add() creates the device name with
> 
> 	dev_set_name(dev, "%s.%s.%d", modname, auxdev->name, auxdev->id);
> 
> I'm not calling for a PLATFORM_DEVID_AUTO-like feature here, but
> shouldn't the first component of the device name use the parent's name
> instead of the module name ?

Why would the parent's name not be the module name?  That name is
guaranteed unique in the system.  If you want "uniqueness" within the
driver/module, use the name and id field please.

That's worked well so far, but to be fair, aux devices are pretty new.
What problem is this naming scheme causing?

thanks,

greg k-h



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux