Message ID | 1434102153-38581-18-git-send-email-Sreekanth.Reddy@avagotech.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: ... > +#if defined(alloc_ordered_workqueue) > + ioc->firmware_event_thread = alloc_ordered_workqueue( > + ioc->firmware_event_name, WQ_MEM_RECLAIM); > +#else > + ioc->firmware_event_thread = create_singlethread_workqueue( > ioc->firmware_event_name); > +#endif Hi Sreekanth, I think the upstream version of this code can safely assume alloc_ordered_workqueue is defined, no? Regards, -- Joe -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, Jun 13, 2015 at 2:33 AM, Joe Lawrence <joe.lawrence@stratus.com> wrote: > On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: > ... >> +#if defined(alloc_ordered_workqueue) >> + ioc->firmware_event_thread = alloc_ordered_workqueue( >> + ioc->firmware_event_name, WQ_MEM_RECLAIM); >> +#else >> + ioc->firmware_event_thread = create_singlethread_workqueue( >> ioc->firmware_event_name); >> +#endif > > Hi Sreekanth, > > I think the upstream version of this code can safely assume > alloc_ordered_workqueue is defined, no? yes, upstream version of this code can safely assume that alloc_ordered_workqueue is defined. While working in-house, I observed that some of the older kernels doesn't defined this macro, so I have added this else section. > > Regards, > > -- Joe
On Mon, 2015-06-15 at 16:26 +0530, Sreekanth Reddy wrote: > On Sat, Jun 13, 2015 at 2:33 AM, Joe Lawrence <joe.lawrence@stratus.com> wrote: > > On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: > > ... > >> +#if defined(alloc_ordered_workqueue) > >> + ioc->firmware_event_thread = alloc_ordered_workqueue( > >> + ioc->firmware_event_name, WQ_MEM_RECLAIM); > >> +#else > >> + ioc->firmware_event_thread = create_singlethread_workqueue( > >> ioc->firmware_event_name); > >> +#endif > > > > Hi Sreekanth, > > > > I think the upstream version of this code can safely assume > > alloc_ordered_workqueue is defined, no? > > yes, upstream version of this code can safely assume that > alloc_ordered_workqueue is defined. > > While working in-house, I observed that some of the older kernels > doesn't defined this macro, so I have added this else section. The driver has to be defined for the current kernel. If you maintain a backport, that's fine, but not in the upstream driver. The reasons are fairly pragmatic: this code in the #else clause can't be compiled so it's just junk to the upstream driver and the static checkers will find it and you'll attract a flock of patches removing dead code. James -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Jun 16, 2015 at 2:35 AM, James Bottomley <James.Bottomley@hansenpartnership.com> wrote: > On Mon, 2015-06-15 at 16:26 +0530, Sreekanth Reddy wrote: >> On Sat, Jun 13, 2015 at 2:33 AM, Joe Lawrence <joe.lawrence@stratus.com> wrote: >> > On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: >> > ... >> >> +#if defined(alloc_ordered_workqueue) >> >> + ioc->firmware_event_thread = alloc_ordered_workqueue( >> >> + ioc->firmware_event_name, WQ_MEM_RECLAIM); >> >> +#else >> >> + ioc->firmware_event_thread = create_singlethread_workqueue( >> >> ioc->firmware_event_name); >> >> +#endif >> > >> > Hi Sreekanth, >> > >> > I think the upstream version of this code can safely assume >> > alloc_ordered_workqueue is defined, no? >> >> yes, upstream version of this code can safely assume that >> alloc_ordered_workqueue is defined. >> >> While working in-house, I observed that some of the older kernels >> doesn't defined this macro, so I have added this else section. > > The driver has to be defined for the current kernel. If you maintain a > backport, that's fine, but not in the upstream driver. The reasons are > fairly pragmatic: this code in the #else clause can't be compiled so > it's just junk to the upstream driver and the static checkers will find > it and you'll attract a flock of patches removing dead code. > Accepted. I will post next version of this patch by removing the else section. Thanks, Sreekanth > James > >
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 837c22a..42bb731 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -8024,8 +8024,13 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* event thread */ snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name), "fw_event%d", ioc->id); - ioc->firmware_event_thread = create_singlethread_workqueue( +#if defined(alloc_ordered_workqueue) + ioc->firmware_event_thread = alloc_ordered_workqueue( + ioc->firmware_event_name, WQ_MEM_RECLAIM); +#else + ioc->firmware_event_thread = create_singlethread_workqueue( ioc->firmware_event_name); +#endif if (!ioc->firmware_event_thread) { pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, __func__);
Created a thread using alloc_ordered_workqueue() API in order to process the works from firmware Work-queue sequentially instead of create_singlethread_workqueue() API. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)