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  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]
Date:   Wed, 27 May 2020 18:40:05 -0700
From:   Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net,
        gregkh@...uxfoundation.org, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, nhorman@...hat.com,
        sassmann@...hat.com, pierre-louis.bossart@...ux.intel.com,
        Fred Oh <fred.oh@...ux.intel.com>
Subject: Re: [net-next v4 11/12] ASoC: SOF: Create client driver for IPC test

On Wed, 2020-05-27 at 21:12 -0300, Jason Gunthorpe wrote:
> On Wed, May 27, 2020 at 01:18:35PM -0700, Ranjani Sridharan wrote:
> > On Wed, 2020-05-20 at 09:56 -0300, Jason Gunthorpe wrote:
> > > On Wed, May 20, 2020 at 12:02:26AM -0700, Jeff Kirsher wrote:
> > > > +static const struct virtbus_dev_id sof_ipc_virtbus_id_table[]
> > > > = {
> > > > +	{"sof-ipc-test"},
> > > > +	{},
> > > > +};
> > > > +
> > > > +static struct sof_client_drv sof_ipc_test_client_drv = {
> > > > +	.name = "sof-ipc-test-client-drv",
> > > > +	.type = SOF_CLIENT_IPC,
> > > > +	.virtbus_drv = {
> > > > +		.driver = {
> > > > +			.name = "sof-ipc-test-virtbus-drv",
> > > > +		},
> > > > +		.id_table = sof_ipc_virtbus_id_table,
> > > > +		.probe = sof_ipc_test_probe,
> > > > +		.remove = sof_ipc_test_remove,
> > > > +		.shutdown = sof_ipc_test_shutdown,
> > > > +	},
> > > > +};
> > > > +
> > > > +module_sof_client_driver(sof_ipc_test_client_drv);
> > > > +
> > > > +MODULE_DESCRIPTION("SOF IPC Test Client Driver");
> > > > +MODULE_LICENSE("GPL v2");
> > > > +MODULE_IMPORT_NS(SND_SOC_SOF_CLIENT);
> > > > +MODULE_ALIAS("virtbus:sof-ipc-test");
> > > 
> > > Usually the MODULE_ALIAS happens automatically rhough the struct
> > > virtbus_dev_id - is something missing in the enabling patches?
> > 
> > Hi Jason,
> > 
> > Without the MODULE_ALIAS,  the driver never probes when the virtual
> > bus
> > device is registered. The MODULE_ALIAS is not different from the
> > ones
> > we typically have in the platform drivers. Could you please give me
> > some pointers on what you think might be missing?
> 
> Look at how the stuff in include/linux/mod_devicetable.h works and do
> the same for virtbus
It looks like include/linux/mod_devicetable.h has everything needed for
virtbus already.
> 
> Looks like you push a MODALIAS= uevent when creating the device and
> the generic machinery does the rest based on the matching table, once
> mod_devicetable.h and related is updated. But it has been a long time
> since I looked at this..

This is also done with uevent callback in the bus_type definition for
the virtual_bus.

Is your expectation that with the above changes, we should not be
needing the MODULE_ALIAS() in the driver?

Thanks,
Ranjani

Powered by blists - more mailing lists