> -----Original Message-----
> From: Martin Wilck [mailto:mwi...@suse.com]
> Sent: Tuesday, April 11, 2017 7:36 AM
> To: Don Brace <don.br...@microsemi.com>; joseph.szczy...@hpe.com;
> Gerry Morong <gerry.mor...@microsemi.com>; John Hall
> <john.h...@microsemi.com>; j...@linux.vnet.ibm.com; Kevin Barnett
> <kevin.barn...@microsemi.com>; Mahesh Rajashekhara
> <mahesh.rajashekh...@microsemi.com>; Bader Ali - Saleh
> <bader.alisa...@microsemi.com>; h...@infradead.org; Scott Teel
> <scott.t...@microsemi.com>; Viswas G <viswa...@microsemi.com>; Justin
> Lindley <justin.lind...@microsemi.com>; Scott Benesh
> <scott.ben...@microsemi.com>; posw...@suse.com
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 07/12] hpsa: cleanup reset handler
> 
> EXTERNAL EMAIL
> 
> 
> On Fri, 2017-04-07 at 15:06 -0500, Don Brace wrote:
> >  - mark device state sooner.
> >
> > Reviewed-by: Scott Benesh <scott.ben...@microsemi.com>
> > Reviewed-by: Scott Teel <scott.t...@microsemi.com>
> > Reviewed-by: Kevin Barnett <kevin.barn...@microsemi.com>
> > Signed-off-by: Don Brace <don.br...@microsemi.com>
> > ---
> >  drivers/scsi/hpsa.c |   44 ++++++++++++++++++++++++++++++-----------
> > ---
> >  1 file changed, 30 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> > index a2852da..a6a37e0 100644
> > --- a/drivers/scsi/hpsa.c
> > +++ b/drivers/scsi/hpsa.c
> > @@ -5834,7 +5834,7 @@ static int
> > wait_for_device_to_become_ready(struct ctlr_info *h,
> >   */
> >  static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
> >  {
> > -     int rc;
> > +     int rc = SUCCESS;
> >       struct ctlr_info *h;
> >       struct hpsa_scsi_dev_t *dev;
> >       u8 reset_type;
> > @@ -5845,17 +5845,24 @@ static int
> > hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
> >       if (h == NULL) /* paranoia */
> >               return FAILED;
> >
> > -     if (lockup_detected(h))
> > -             return FAILED;
> > +     h->reset_in_progress = 1;
> > +
> > +     if (lockup_detected(h)) {
> > +             rc = FAILED;
> > +             goto return_reset_status;
> > +     }
> 
> if this is meant to communicate host state to other threads, maybe you
> should use an atomic type for h->reset_in_progress, or locking of some
> sort?
> 
> Regards,
> Martin
> 
Agreed.
Thanks for your review. It has actually helped out...a lot.
Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation


> --
> Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)

Reply via email to