Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands

From: James Bottomley
Date: Sun Jan 15 2017 - 12:01:45 EST


On Tue, 2017-01-03 at 15:46 -0500, Jason Baron wrote:
> On 01/01/2017 12:39 PM, James Bottomley wrote:
> > + /*
> > + * Bug work around for firmware SATL handling
> > + */
> > + if (sas_device_priv_data->ata_command_pending) {
> > + scmd->result = SAM_STAT_BUSY;
> > + scmd->scsi_done(scmd);
> > + return 0;
> > + }
> > + set_satl_pending(scmd, true);
> > +
> > sas_target_priv_data = sas_device_priv_data->sas_target;
> >
> > /* invalid device handle */
>
>
> I was also wondering if 2 threads could both fall through and do:
> 'set_satl_pending(scmd, true)'; ?
>
> Afaict there is nothing preventing that race?

Yes, it does look like queuecommand is lockless in the mpt3sas. How
about this version using bitops for atomicity?

James

---