[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201408102242.FGG43287.FMFFLQJVOHOOSt@I-love.SAKURA.ne.jp>
Date: Sun, 10 Aug 2014 22:42:26 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: gregkh@...uxfoundation.org, mcgrof@...e.com
Cc: davem@...emloft.net, mcgrof@...not-panic.com, tiwai@...e.de,
linux-kernel@...r.kernel.org, joseph.salisbury@...onical.com,
kay@...y.org, gnomes@...rguk.ukuu.org.uk,
tim.gardner@...onical.com, pierre-fersing@...rref.org,
akpm@...ux-foundation.org, oleg@...hat.com, bpoirier@...e.de,
nagalakshmi.nandigama@...gotech.com,
praveen.krishnamoorthy@...gotech.com,
sreekanth.reddy@...gotech.com, abhijit.mahajan@...gotech.com,
hariprasad@...lsio.com, santosh@...lsio.com,
MPT-FusionLinux.pdl@...gotech.com, linux-scsi@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 2/4] driver core: enable drivers to use deferred probefrom init
Greg KH wrote:
> Why doesn't it work? Doesn't modprobe come right back and the init
> sequence still takes a while to run? What exactly fails?
I guess ...
> @@ -5429,9 +5429,19 @@ mptsas_init(void)
> return error;
> }
>
> +static struct task_struct *init_thread;
> +
> +static int __init
> +mptsas_init(void)
> +{
> + init_thread = kthread_run(mptsas_real_init, NULL, "mptsas_init");
> + return 0;
> +}
> +
> static void __exit
> mptsas_exit(void)
> {
> + kthread_stop(init_thread);
> pci_unregister_driver(&mptsas_driver);
> sas_release_transport(mptsas_transport_template);
>
>
kthread_run() can fail. sas_attach_transport() and/or pci_register_driver()
in mptsas_real_init() can fail. Caller process may fail to continue if
sas_attach_transport() and pci_register_driver() in mptsas_real_init() has
not completed yet.
kthread_stop() must not be called when kthread_run() failed.
pci_unregister_driver() and/or sas_release_transport() must not be called
when mptsas_real_init() did not return 0 (or has not returned 0 yet).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists