Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219966

Re: "scsi: convert host_busy to atomic_t" series causes regressions for some hardware configurations

From Sergio Callegari <sergio.callegari@gmail.com>
Newsgroups linux.kernel
Subject Re: "scsi: convert host_busy to atomic_t" series causes regressions for some hardware configurations
Date 2015-09-07 09:40 +0200
Message-ID <q5ZbY-7oS-7@gated-at.bofh.it> (permalink)
References (2 earlier) <pYJOF-88r-5@gated-at.bofh.it> <pZt58-7r8-29@gated-at.bofh.it> <q13pT-5xE-1@gated-at.bofh.it> <q1kh4-4Fj-29@gated-at.bofh.it> <q38v7-6MF-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Christoph (and those reading!),

I wonder if there might be any update or, most important, anything else for me 
to test in order to provide info to address this issue...

I really would like to find out whether it is a bug in my hardware (which would 
be OK, as I know already how to work around it) or something that may happen on 
any hardware as soon as an unfortunate combination of storage equipment is adopted.

Thanks for the help so far,

Best regards,

Sergio

On 30/08/2015 12:54, Sergio Callegari wrote:
> Hi Christoph,
>
> just checked.
>
> Unfortunately, the patch below, applied on top of Linus' v3.17 (which I am 
> using as a test kernel) *does not fix the issue*.
>
> Best regards,
>
> Sergio
>
> On 25/08/2015 13:00, Christoph Hellwig wrote:
>> Hi Sergio,
>>
>> can you give the patch below a try?
>>
>> libata currently completes the SCSI command before freeing the internal
>> command structure, which could lead to various races that mess with
>> the ATA command state, which might cause issues like the one you see.
>>
>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>> index 641a61a..92cc156 100644
>> --- a/drivers/ata/libata-scsi.c
>> +++ b/drivers/ata/libata-scsi.c
>> @@ -1772,6 +1772,15 @@ nothing_to_do:
>>       return 1;
>>   }
>>   +static void ata_qc_done(struct ata_queued_cmd *qc)
>> +{
>> +    struct scsi_cmnd *cmd = qc->scsicmd;
>> +    void (*done)(struct scsi_cmnd *) = qc->scsidone;
>> +
>> +    ata_qc_free(qc);
>> +    done(cmd);
>> +}
>> +
>>   static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
>>   {
>>       struct ata_port *ap = qc->ap;
>> @@ -1810,9 +1819,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd 
>> *qc)
>>       if (need_sense && !ap->ops->error_handler)
>>           ata_dump_status(ap->print_id, &qc->result_tf);
>>   -    qc->scsidone(cmd);
>> -
>> -    ata_qc_free(qc);
>> +    ata_qc_done(qc);
>>   }
>>     /**
>> @@ -2611,8 +2618,7 @@ static void atapi_sense_complete(struct ata_queued_cmd 
>> *qc)
>>           ata_gen_passthru_sense(qc);
>>       }
>>   -    qc->scsidone(qc->scsicmd);
>> -    ata_qc_free(qc);
>> +    ata_qc_done(qc);
>>   }
>>     /* is it pointless to prefer PIO for "safety reasons"? */
>> @@ -2707,8 +2713,7 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
>>               qc->dev->sdev->locked = 0;
>>             qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;
>> -        qc->scsidone(cmd);
>> -        ata_qc_free(qc);
>> +        ata_qc_done(qc);
>>           return;
>>       }
>>   @@ -2752,8 +2757,7 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
>>           cmd->result = SAM_STAT_GOOD;
>>       }
>>   -    qc->scsidone(cmd);
>> -    ata_qc_free(qc);
>> +    ata_qc_done(qc);
>>   }
>>   /**
>>    *    atapi_xlat - Initialize PACKET taskfile
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: IDE Floppy support for IOMEGA Zip Drive broken in 3.16 -> 3.17  transition Christoph Hellwig <hch@infradead.org> - 2015-08-20 10:10 +0200
  Re: IDE Floppy support for IOMEGA Zip Drive broken in 3.16 -> 3.17  transition Sergio Callegari <sergio.callegari@gmail.com> - 2015-08-20 17:10 +0200
  "scsi: convert host_busy to atomic_t" series causes regressions for  some hardware configurations Sergio Callegari <sergio.callegari@gmail.com> - 2015-08-24 19:10 +0200
    Re: "scsi: convert host_busy to atomic_t" series causes regressions  for some hardware configurations Christoph Hellwig <hch@infradead.org> - 2015-08-25 13:10 +0200
      Re: "scsi: convert host_busy to atomic_t" series causes regressions  for some hardware configurations Sergio Callegari <sergio.callegari@gmail.com> - 2015-08-26 09:20 +0200
      Re: "scsi: convert host_busy to atomic_t" series causes regressions  for some hardware configurations Sergio Callegari <sergio.callegari@gmail.com> - 2015-08-30 13:00 +0200
        Re: "scsi: convert host_busy to atomic_t" series causes regressions  for some hardware configurations Sergio Callegari <sergio.callegari@gmail.com> - 2015-09-07 09:40 +0200
          Re: "scsi: convert host_busy to atomic_t" series causes regressions  for some hardware configurations Christoph Hellwig <hch@infradead.org> - 2015-09-07 20:00 +0200

csiph-web