All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Bo" <Bo.Yang@lsi.com>
To: Tomas Henzl <thenzl@redhat.com>
Cc: "'James.Bottomley@HansenPartnership.com'" 
	<James.Bottomley@HansenPartnership.com>,
	"'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>,
	"'akpm@osdl.org'" <akpm@osdl.org>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 7/9] scsi: megaraid_sas - Driver created the self work queue for OCR
Date: Wed, 1 Dec 2010 08:55:00 -0700	[thread overview]
Message-ID: <4B6A08C587958942AA3002690DD4F8C30106BC0277@cosmail02.lsi.com> (raw)
In-Reply-To: <4CF63D45.8020608@redhat.com>

Tomas,

The megasas_ocr_wq only used by online controller reset.  Driver can either do return error or continue load by disabling the Online controller reset bit.  I will discuss internally and post back today for the changes.

Regards,

Bo Yang   

-----Original Message-----
From: Tomas Henzl [mailto:thenzl@redhat.com] 
Sent: Wednesday, December 01, 2010 7:19 AM
To: Yang, Bo
Cc: 'James.Bottomley@HansenPartnership.com'; 'linux-scsi@vger.kernel.org'; 'akpm@osdl.org'; 'linux-kernel@vger.kernel.org'
Subject: Re: [PATCH 7/9] scsi: megaraid_sas - Driver created the self work queue for OCR

On 11/30/2010 07:05 PM, Yang, Bo wrote:
> Tomas,
>
> In which case megasas_ocr_wq will hit NULL if create_workqueue create work queue success? If create_workqueue failed, OCR may have the problem.  But do you know if create_workqueue has the number limitation for creating work queues (how many work queue can it created? 10 or 20)?
>   
+	megasas_ocr_wq = create_workqueue("megasas_ocr");
+
+	if ( !megasas_ocr_wq )
+		printk(KERN_DEBUG "megasas: Failed to create workqueue.\n");

Then why do you check the return value if it can not fail?

You are allocating a lot of resources in the init function and when some of them is not 
available (which is unlikely) you return with an error value. Why don't you want that for 
create_workqueue too?

Is it safe enter the suspend mode with the workqueue still doing some job?
Shouldn't be the workqueue flushed in the suspend function?
 

> Thanks,
>
> Bo Yang
>
> -----Original Message-----
> From: Tomas Henzl [mailto:thenzl@redhat.com]
> Sent: Tuesday, November 30, 2010 11:11 AM 
> To: Yang, Bo
> Cc: 'James.Bottomley@HansenPartnership.com'; 'linux-scsi@vger.kernel.org'; 'akpm@osdl.org'; 'linux-kernel@vger.kernel.org'
> Subject: Re: [PATCH 7/9] scsi: megaraid_sas - Driver created the self work queue for OCR
>
> On 11/19/2010 06:37 PM, Yang, Bo wrote:
>   
>> Driver created the owner work queue (don't use global work queue). This queue will be used for online controller reset routine.
>>
>> Signed-off-by Bo Yang<bo.yang@lsi.com>
>>
>> ---
>> drivers/scsi/megaraid/megaraid_sas.c |   13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>   
>> diff -rupN old/drivers/scsi/megaraid/megaraid_sas.c
>> new/drivers/scsi/megaraid/megaraid_sas.c ---
>> old/drivers/scsi/megaraid/megaraid_sas.c 2010-11-17 13:46:11.000000000
>> -0500 +++ new/drivers/scsi/megaraid/megaraid_sas.c 2010-11-17
>> 13:47:46.000000000 -0500 @@ -108,6 +108,7 @@ static struct
>> megasas_mgmt_info megasas_ static struct fasync_struct
>> *megasas_async_queue; static DEFINE_MUTEX(megasas_async_queue_mutex);
>> +static struct workqueue_struct *megasas_ocr_wq; static int
>> megasas_poll_wait_aen; static
>> DECLARE_WAIT_QUEUE_HEAD(megasas_poll_wait); static u32
>> support_poll_for_event; @@ -2435,7 +2436,7 @@
>> megasas_deplete_reply_queue(struct megas printk(KERN_NOTICE "megasas:
>> fwState=%x, stage:%d\n", fw_state, instance->adprecovery); -
>> schedule_work(&instance->work_init); + queue_work(megasas_ocr_wq,
>> &instance->work_init); return IRQ_HANDLED; } else { @@ -5157,6
>> +5158,11 @@ static int __init megasas_init(void) goto err_pcidrv; } +
>> megasas_ocr_wq = create_workqueue("megasas_ocr"); + + if (
>> !megasas_ocr_wq ) + printk(KERN_DEBUG "megasas: Failed to create
>> workqueue.\n"); + 
>>     
> What happens later, when you pass the null pointer to the queue_work ?
> I'm not sure this will work.
>
>   
>> rval = driver_create_file(&megasas_pci_driver.driver,
>> &driver_attr_version); if (rval) @@ -5228,6 +5234,11 @@ static void
>> __exit megasas_exit(void) &driver_attr_release_date);
>> driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version);
>> + if (megasas_ocr_wq) { + destroy_workqueue(megasas_ocr_wq); +
>> megasas_ocr_wq = NULL; + } +
>> pci_unregister_driver(&megasas_pci_driver);
>> unregister_chrdev(megasas_mgmt_majorno, "megaraid_sas_ioctl"); } 
>>     
> --
> 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
>   


  reply	other threads:[~2010-12-01 15:54 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10  2:34 [PATCH 1/12] scsi: megaraid_sas - Online Controller Reset - I: Enable Online Controller Reset Bit in register related functions Yang, Bo
2010-06-10  2:34 ` Yang, Bo
2010-06-18 21:18 ` Yinghai Lu
2010-06-18 21:18   ` Yinghai Lu
2010-06-18 21:21   ` Yang, Bo
2010-06-18 21:21     ` Yang, Bo
2010-06-18 21:37     ` Yinghai Lu
2010-06-18 21:37       ` Yinghai Lu
2010-06-18 21:56       ` Yang, Bo
2010-06-18 21:56         ` Yang, Bo
2010-06-20 14:54         ` James Bottomley
2010-06-20 15:01   ` James Bottomley
2010-06-20 19:27     ` Yang, Bo
2010-06-20 19:27       ` Yang, Bo
2010-06-20 19:47       ` James Bottomley
2010-06-20 20:19         ` Yang, Bo
2010-06-20 20:19           ` Yang, Bo
2010-06-20 20:48           ` James Bottomley
2010-06-21 15:35             ` Yang, Bo
2010-06-21 15:35               ` Yang, Bo
2010-07-20 13:08             ` Yang, Bo
2010-07-20 13:08               ` Yang, Bo
2010-07-30 18:53             ` Yang, Bo
2010-07-30 18:53               ` Yang, Bo
2010-07-31 17:46               ` James Bottomley
2010-08-05 20:44                 ` Yang, Bo
2010-08-05 20:44                   ` Yang, Bo
2010-08-06  0:36                   ` James Bottomley
2010-08-12 15:20                 ` Yang, Bo
2010-08-12 15:20                   ` Yang, Bo
2010-08-16 14:22                 ` Yang, Bo
2010-08-16 14:22                   ` Yang, Bo
2010-08-16 15:06                   ` James Bottomley
2010-08-05 19:47 ` Yang, Bo
2010-08-05 19:47   ` Yang, Bo
2010-11-19 16:33   ` [PATCH 1/9] scsi: megaraid_sas - Change the time format during the driver online controller reset Yang, Bo
2010-11-19 16:33     ` Yang, Bo
2010-11-19 16:53     ` [PATCH 2/9] scsi: megaraid_sas - Driver only report tape drive, JBOD and logic drives Yang, Bo
2010-11-19 16:53       ` Yang, Bo
2010-11-19 17:03       ` [PATCH 3/9] scsi: megaraid_sas - Driver will scan device after receive event MR_EVT_LD_STATE_CHANGE Yang, Bo
2010-11-19 17:03         ` Yang, Bo
2010-11-19 17:08         ` [PATCH 4/9] scsi: megaraid_sas - Driver provide the version to FW Yang, Bo
2010-11-19 17:08           ` Yang, Bo
2010-11-19 17:23           ` [PATCH 5/9] scsi: megaraid_sas - report different io sectors for ieee support Yang, Bo
2010-11-19 17:23             ` Yang, Bo
2010-11-19 17:29             ` [PATCH 6/9] scsi: megaraid_sas - Add the online reset to iMR chip Yang, Bo
2010-11-19 17:29               ` Yang, Bo
2010-11-19 17:37               ` [PATCH 7/9] scsi: megaraid_sas - Driver created the self work queue for OCR Yang, Bo
2010-11-19 17:37                 ` Yang, Bo
2010-11-19 17:43                 ` [PATCH 8/9] scsi: megaraid_sas - Driver take some workloads from FW Yang, Bo
2010-11-19 17:43                   ` Yang, Bo
2010-11-19 17:53                   ` James Bottomley
2010-11-24 15:22                     ` Yang, Bo
2010-11-24 15:22                       ` Yang, Bo
2010-11-30 15:57                       ` Tomas Henzl
2010-11-30 16:11                 ` [PATCH 7/9] scsi: megaraid_sas - Driver created the self work queue for OCR Tomas Henzl
2010-11-30 16:11                   ` Tomas Henzl
2010-11-30 18:05                   ` Yang, Bo
2010-11-30 18:05                     ` Yang, Bo
2010-12-01 12:19                     ` Tomas Henzl
2010-12-01 12:19                       ` Tomas Henzl
2010-12-01 15:55                       ` Yang, Bo [this message]
2010-12-01 15:55                         ` Yang, Bo
2010-11-30 15:36               ` [PATCH 6/9] scsi: megaraid_sas - Add the online reset to iMR chip Tomas Henzl
2010-11-30 15:36                 ` Tomas Henzl
2010-11-19 17:50         ` [PATCH 9/9] scsi: megaraid_sas - Documentation and driver version update Yang, Bo
2010-11-19 17:50           ` Yang, Bo
2010-12-09 17:07       ` [PATCH 2/9] scsi: megaraid_sas - Driver only report tape drive, JBOD and logic drives James Bottomley
2010-11-30 15:21     ` [PATCH 1/9] scsi: megaraid_sas - Change the time format during the driver online controller reset Tomas Henzl
2010-11-30 15:21       ` Tomas Henzl

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=4B6A08C587958942AA3002690DD4F8C30106BC0277@cosmail02.lsi.com \
    --to=bo.yang@lsi.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=thenzl@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.