All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: bo yang <boyang1288@gmail.com>,
	linux-scsi@vger.kernel.org, akpm@osdl.org,
	linux-kernel@vger.kernel.org, bo.yang@lsi.com
Subject: Re: PATCH 1/5] scsi: megaraid_sas - Add Online Controller Reset to MegaRAID SAS drive
Date: Fri, 08 Oct 2010 21:28:13 +0200	[thread overview]
Message-ID: <4CAF70CD.6020307@redhat.com> (raw)
In-Reply-To: <1286555954.2985.110.camel@mulgrave.site>

On 10/08/2010 06:39 PM, James Bottomley wrote:
> On Fri, 2010-10-08 at 17:51 +0200, Tomas Henzl wrote:
>   
>> On 09/23/2010 04:36 AM, bo yang wrote:
>>     
>>> This patch is too big.  I am using attachment to submit.  Please
>>> use attached file to apply.  Also let me know if it can't be accepted.
>>>
>>> To add the Online controller reset support, driver need to do:
>>> a). reset the controller chips -- Xscale and Gen2 which will change
>>> the function calls and add the reset function related to this two
>>> chips.
>>> b). during the reset, driver will store the pending cmds which not
>>> returned by FW to driver's pending queue.  Driver will re-issue those
>>> pending cmds again to FW after the OCR finished.
>>> c). In driver's timeout routine, driver will report to OS as reset.
>>> Also driver's queue routine will block the cmds until the OCR
>>> finished.
>>> d). in Driver's ISR routine, if driver get the FW state as state
>>> change, FW in Failure status and FW support online controller
>>> reset (OCR), driver will start to do the controller reset.
>>> e). In driver's IOCTL routine, the application cmds will wait for the
>>> OCR to finish, then issue the cmds to FW.
>>>
>>> Signed-off-by Bo Yang<bo.yang@lsi.com>
>>>
>>> ---
>>>  drivers/scsi/megaraid/megaraid_sas.c |  756 ++++++++++++++++++++++++++++++++---
>>>  drivers/scsi/megaraid/megaraid_sas.h |   88 +++-
>>>  2 files changed, 787 insertions(+), 57 deletions(-)
>>>       
>> Hi Bo,
>> in the workqueue function you sleep for 30s,
>> it's scheduled here - schedule_work(&instance->work_init);
>>
>> +process_fw_state_change_wq(struct work_struct *work)
>> +{
>> ...
>> +		/*waitting for about 20 second before start the second init*/
>> +		for (wait = 0; wait < 30; wait++) {
>> +			msleep(1000);
>> +		}
>>     
> this lot should be ssleep(20) if you want a 20 sec sleep.
>   
please do that on every place where you use the 
"for (wait = 0; wait < n; wait++) msleep(1000);" construction

>> - this is not a good practice to sleep for a so long time I think
>>     
this long sleep might might be ok, if the workqueue is used only rarely
is it so?

>> - you should use in your exit function some synchronization 
>>   for example 'cancel_work_sync', without that if someone rmmods your 
>>   module, it could then lead to a memory corruption
>>     
> Actually flush_scheduled_work() should be fine ... it will force the
> module removal to wait for completion ... cancellation can be error
> prone, so just forcing the wait sounds easier.
>   
someone told that cancel_work_sync is safer then flush_scheduled_work
but I'm not an expert, so ok 

Tomas

> 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
>   


  reply	other threads:[~2010-10-08 19:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23  2:36 PATCH 1/5] scsi: megaraid_sas - Add Online Controller Reset to MegaRAID SAS drive bo yang
2010-10-08 15:51 ` Tomas Henzl
2010-10-08 16:39   ` James Bottomley
2010-10-08 19:28     ` Tomas Henzl [this message]
2010-10-09 20:38       ` Tomas Henzl
2010-10-11 12:55         ` Yang, Bo
2010-10-11 12:55           ` Yang, Bo
2010-10-11 13:20           ` Tomas Henzl
2010-10-11 13:20             ` Tomas Henzl
2010-10-11 15:37             ` Yang, Bo
2010-10-11 15:37               ` Yang, Bo
2010-10-12 14:28               ` Tomas Henzl
2010-10-12 14:57                 ` Yang, Bo
2010-10-12 14:57                   ` Yang, Bo
2010-10-12 15:33                   ` 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=4CAF70CD.6020307@redhat.com \
    --to=thenzl@redhat.com \
    --cc=James.Bottomley@suse.de \
    --cc=akpm@osdl.org \
    --cc=bo.yang@lsi.com \
    --cc=boyang1288@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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.