linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] st: set owner in struct device_driver
@ 2014-11-12  4:01 Seymour, Shane M
  2014-11-12 10:31 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Seymour, Shane M @ 2014-11-12  4:01 UTC (permalink / raw)
  To: linux-scsi@vger.kernel.org, Kai.Makisara@kolumbus.fi; +Cc: James Bottomley

After moving from from branch next-20141106 to next-20141111 to pick up recent changes to the st driver I found that the following message was being logged by the kernel (for many other modules as well):

Driver 'st' needs an owner

There was a change in driver_register to check the struct module *owner and if it's not set complain about it, the code path for the st driver is:

static int __init init_st(void)
{
...
        err = scsi_register_driver(&st_template.gendrv);

Which calls:

int scsi_register_driver(struct device_driver *drv)
{
        drv->bus = &scsi_bus_type;

        return driver_register(drv);
}
EXPORT_SYMBOL(scsi_register_driver);

Which calls:

int driver_register(struct device_driver *drv)
{
        int ret;
        struct device_driver *other;

        BUG_ON(!drv->bus->p);

        if (!drv->owner)
                printk(KERN_WARNING "Driver '%s' needs an owner", drv->name);
...

This patch sets the owner field in the struct device_driver contained in the struct scsi_driver for this module. Tested with kernel version 3.18.0-rc4-next-20141111. My assumption here is that the check added in driver_register() is correct and that forces this change and there's a lot of other modules that require a similar change (at least 72 including sd, sr, and osst).

Signed-off-by: Shane Seymour <shane.seymour@hp.com>
---
diff -up a/drivers/scsi/st.c b/drivers/scsi/st.c
--- a/drivers/scsi/st.c	2014-11-10 21:23:27.088567337 -0600
+++ b/drivers/scsi/st.c	2014-11-11 14:07:37.312721375 -0600
@@ -207,6 +207,7 @@ static struct scsi_driver st_template =
 		.name		= "st",
 		.probe		= st_probe,
 		.remove		= st_remove,
+		.owner		= THIS_MODULE,
 	},
 };

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] st: set owner in struct device_driver
  2014-11-12  4:01 [PATCH] st: set owner in struct device_driver Seymour, Shane M
@ 2014-11-12 10:31 ` Christoph Hellwig
  2014-11-12 12:01   ` Seymour, Shane M
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2014-11-12 10:31 UTC (permalink / raw)
  To: Seymour, Shane M
  Cc: linux-scsi@vger.kernel.org, Kai.Makisara@kolumbus.fi,
	James Bottomley

Looks good to me.  Can you also send the equivalent patch for the osst
and ch drivers?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] st: set owner in struct device_driver
  2014-11-12 10:31 ` Christoph Hellwig
@ 2014-11-12 12:01   ` Seymour, Shane M
  2014-11-12 17:25     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Seymour, Shane M @ 2014-11-12 12:01 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-scsi@vger.kernel.org, Kai.Makisara@kolumbus.fi,
	James Bottomley

I can, but at this point it will be tomorrow (11pm where I am).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] st: set owner in struct device_driver
  2014-11-12 12:01   ` Seymour, Shane M
@ 2014-11-12 17:25     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2014-11-12 17:25 UTC (permalink / raw)
  To: Seymour, Shane M
  Cc: Christoph Hellwig, linux-scsi@vger.kernel.org,
	Kai.Makisara@kolumbus.fi, James Bottomley

On Wed, Nov 12, 2014 at 12:01:31PM +0000, Seymour, Shane M wrote:
> I can, but at this point it will be tomorrow (11pm where I am).

Looks like none of th scsi_driver intances sets the owner field.  Let me
sort this out in a generic way, and thanks for the initial patch!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-12 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  4:01 [PATCH] st: set owner in struct device_driver Seymour, Shane M
2014-11-12 10:31 ` Christoph Hellwig
2014-11-12 12:01   ` Seymour, Shane M
2014-11-12 17:25     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).