Re: [PATCH 1/4] dpt_i2o: use midlayer tcq implementation

Hannes Reinecke
2019-11-15T10:29:32Z

On 11/15/19 9:48 AM, Christoph Hellwig wrote:
> On Fri, Nov 15, 2019 at 09:05:52AM +0100, Hannes Reinecke wrote:
> static bool fail_posted_scbs_iter(struct request *rq, void *data, bool reserved)
>> {
>> + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq);
>>
>> + cmd->result = (DID_OK << 16) | SAM_STAT_TASK_SET_FULL;
>
> Not new in this patch, but SAM_STAT_TASK_SET_FULL seems like an odd
> error code for bouncing all commands to the mid layer after an reset.
>
Was'ne me. Personally I would go with DID_ABORTED here,
but who am I to judge ...

>> + cmd->scsi_done(cmd);
>> +
>> + return true;
>> +}
>> +
>> +static void adpt_fail_posted_scbs(adpt_hba* pHba)
>> +{
>> + blk_mq_tagset_busy_iter(&pHba->host->tag_set,
>> + fail_posted_scbs_iter, NULL);
>
> Should this be a scsi layer helper? In the future it also sounds
> like we migh want to move something like this to be called from
> common code, as letting the other command posted to the hardware
> just time out after a host reset is rather silly.
>
Sure, for the common helper.

Moving it to the common layer is probably not going to work, as some
HBAs will complete commands internally during host reset (and hence
triggering a completion), while others don't (or can't, like aacraid).

So not sure about that one.

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer