From: Bandan Das <bandan.das@stratus.com>
To: Madhu Iyengar <madhu.iyengar@qlogic.com>
Cc: James Bottomley <James.Bottomley@suse.de>,
Andrew Vasquez <andrew.vasquez@qlogic.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Giridhar Malavali <giridhar.malavali@qlogic.com>
Subject: Re: [PATCH] qla2xxx: Fix possible race that could hang kthread_stop()
Date: Thu, 27 Jan 2011 18:05:51 -0500 [thread overview]
Message-ID: <20110127230551.GH31955@stratus.com> (raw)
In-Reply-To: <5E4F49720D0BAD499EE1F01232234BA87225EF8261@AVEXMB1.qlogic.org>
On 0, Madhu Iyengar <madhu.iyengar@qlogic.com> wrote:
> We at QLogic are fine with James's fix. Here's my ack:
>
> Acked-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
>
> Cheers,
> Madhu
James, You are gonna take care of this or do you want me to send
a new patch ? I am fine either ways.
> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Bandan Das
> Sent: Thursday, January 27, 2011 1:33 PM
> To: James Bottomley
> Cc: Andrew Vasquez; linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] qla2xxx: Fix possible race that could hang kthread_stop()
>
>
> > That's not really the accepted way to fix these race conditions because
> > of the double check of kthread_should_stop(); this is
> > James
> >
> > ---
> > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > index c194c23..15ce69e 100644
> > --- a/drivers/scsi/qla2xxx/qla_os.c
> > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > @@ -3282,10 +3282,10 @@ qla2x00_do_dpc(void *data)
> >
> > set_user_nice(current, -20);
> >
> > + set_current_state(TASK_INTERRUPTIBLE);
> > while (!kthread_should_stop()) {
> > DEBUG3(printk("qla2x00: DPC handler sleeping\n"));
> >
> > - set_current_state(TASK_INTERRUPTIBLE);
> > schedule();
> > __set_current_state(TASK_RUNNING);
> >
> > @@ -3454,7 +3454,9 @@ qla2x00_do_dpc(void *data)
> > qla2x00_do_dpc_all_vps(base_vha);
> >
> > ha->dpc_active = 0;
> > + set_current_state(TASK_INTERRUPTIBLE);
> > } /* End of while(1) */
> > + __set_current_state(TASK_RUNNING);
> >
> > DEBUG(printk("scsi(%ld): DPC handler exiting\n", base_vha->host_no));
> >
> Yes, this looks more clean and will take care of the problem I am hitting.
>
>
> Bandan
> --
> 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
>
>
> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
prev parent reply other threads:[~2011-01-27 23:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 20:59 [PATCH] qla2xxx: Fix possible race that could hang kthread_stop() Bandan Das
2011-01-27 21:12 ` James Bottomley
2011-01-27 21:32 ` Bandan Das
2011-01-27 22:36 ` Madhu Iyengar
2011-01-27 23:05 ` Bandan Das [this message]
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=20110127230551.GH31955@stratus.com \
--to=bandan.das@stratus.com \
--cc=James.Bottomley@suse.de \
--cc=andrew.vasquez@qlogic.com \
--cc=giridhar.malavali@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=madhu.iyengar@qlogic.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox