From: Greg KH <gregkh@linuxfoundation.org>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: Santosh Rastapur <santosh@chelsio.com>,
Hariprasad S <hariprasad@chelsio.com>,
Takashi Iwai <tiwai@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Joseph Salisbury <joseph.salisbury@canonical.com>,
Kay Sievers <kay@vrfy.org>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Tim Gardner <tim.gardner@canonical.com>,
Pierre Fersing <pierre-fersing@pierref.org>,
Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>,
Benjamin Poirier <bpoirier@suse.de>,
Nagalakshmi Nandigama <nagalakshmi.nandigama@avagotech.com>,
Praveen Krishnamoorthy <praveen.krishnamoorthy@avagotech.com>,
Sreekanth Reddy <sreekanth.reddy@avagotech.com>,
Abhijit Mahajan <abhijit.mahajan@avagotech.com>,
MPT-FusionLinux.pdl@avagotech.com,
Linux SCSI List <linux-scsi@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 2/4] driver core: enable drivers to use deferred probe from init
Date: Tue, 29 Jul 2014 16:14:22 -0700 [thread overview]
Message-ID: <20140729231422.GA14494@kroah.com> (raw)
In-Reply-To: <CAB=NE6XMzU+zJ0RMDKaPuSxfXBvN2vZ1DnbgxCjWHJquTD1iqg@mail.gmail.com>
On Mon, Jul 28, 2014 at 06:13:43PM -0700, Luis R. Rodriguez wrote:
> >> > Why not just put the initial "register the device" in a single-shot
> >> > workqueue or thread or something like that so that modprobe returns
> >> > instantly back with a success and all is fine?
> >>
> >> That surely is possible but why not a general solution for such kludges?
> >
> > Because the driver should be fixed. How hard would it be to do what I
> > just suggested here, 20 lines added at most?
>
> I appreciate the feedback, but don't look at me, I'd happy to go nutty
> on ripping things apart from hairy drivers, however Chelsie folks
> expressed concerns over major rework on the driver... so even if we
> did have something I expect things to take a while to bake / gain
> confidence from others.
"rework"? Heh, here's a patch that adds 10 lines to the mptsas driver
that should also work for any other driver as well. Why not just do
this instead?
> This also just addresses this *one* Ethernet driver, there was that
> SCSI driver that created the original report -- Canonical merged
> Joseph's fix as a work around,
What fix was that?
> there is no general solution for this yet, and again with that work
> around you won't find which drivers run into this issue.
Great, fix them as they are found, that's fine. Again, don't add stuff
to the driver core to paper over crappy drivers, I'm not going to take
that type of change. I _only_ took the defer binding code as there was
no other way for an individual driver to deal with things if it's
resources were not present yet due to binding order in the system.
So, anyone care to test the patch below on a system that has this
problem to let me know if it would work or not? Odds are, this should
be a workqueue, to make it cleaner, but a kthread is just so easy to
use...
thanks,
greg k-h
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 711fcb5cec87..4fd4f36a2d9e 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -51,6 +51,7 @@
#include <linux/jiffies.h>
#include <linux/workqueue.h>
#include <linux/delay.h> /* for mdelay */
+#include <linux/kthread.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
@@ -5393,8 +5394,7 @@ static struct pci_driver mptsas_driver = {
#endif
};
-static int __init
-mptsas_init(void)
+static int mptsas_real_init(void *data)
{
int error;
@@ -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);
next prev parent reply other threads:[~2014-07-29 23:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 18:28 [PATCH v2 0/4] driver core: allow explicit deferred probe preference Luis R. Rodriguez
2014-07-28 18:28 ` [PATCH v2 1/4] driver core: move deferred probe add / remove helpers down a bit Luis R. Rodriguez
2014-07-28 18:28 ` [PATCH v2 2/4] driver core: enable drivers to use deferred probe from init Luis R. Rodriguez
2014-07-28 18:55 ` Greg KH
2014-07-28 19:04 ` Luis R. Rodriguez
2014-07-28 19:48 ` Luis R. Rodriguez
2014-07-28 23:46 ` Greg KH
2014-07-29 0:26 ` Luis R. Rodriguez
2014-07-29 0:35 ` Greg KH
2014-07-29 1:13 ` Luis R. Rodriguez
2014-07-29 6:53 ` Hannes Reinecke
2014-07-29 12:07 ` [PATCH v2 2/4] driver core: enable drivers to use deferred probefrom init Tetsuo Handa
2014-07-29 22:25 ` Benjamin Poirier
2014-07-30 0:14 ` Luis R. Rodriguez
2014-07-30 2:22 ` Tetsuo Handa
2014-07-30 14:26 ` Luis R. Rodriguez
2014-07-29 23:14 ` Greg KH [this message]
2014-07-30 0:05 ` [PATCH v2 2/4] driver core: enable drivers to use deferred probe from init Luis R. Rodriguez
2014-07-30 0:13 ` Greg KH
2014-07-30 22:11 ` David Miller
2014-08-09 16:41 ` Luis R. Rodriguez
2014-08-10 12:43 ` Greg KH
2014-08-10 13:42 ` [PATCH v2 2/4] driver core: enable drivers to use deferred probefrom init Tetsuo Handa
2014-08-10 14:58 ` [PATCH v2 2/4] driver core: enable drivers to use deferred probe from init Luis R. Rodriguez
2014-08-11 15:27 ` Takashi Iwai
2014-08-11 17:20 ` Luis R. Rodriguez
2014-07-28 18:28 ` [PATCH v2 3/4] cxgb4: ask for deferred probe Luis R. Rodriguez
2014-07-28 18:28 ` [PATCH v2 4/4] mptsas: " Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140729231422.GA14494@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=MPT-FusionLinux.pdl@avagotech.com \
--cc=abhijit.mahajan@avagotech.com \
--cc=akpm@linux-foundation.org \
--cc=bpoirier@suse.de \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=hariprasad@chelsio.com \
--cc=joseph.salisbury@canonical.com \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mcgrof@suse.com \
--cc=nagalakshmi.nandigama@avagotech.com \
--cc=netdev@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=pierre-fersing@pierref.org \
--cc=praveen.krishnamoorthy@avagotech.com \
--cc=santosh@chelsio.com \
--cc=sreekanth.reddy@avagotech.com \
--cc=tim.gardner@canonical.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox