On 10/21/19 6:37 PM, Bart Van Assche wrote:
> On 10/21/19 2:53 AM, Hannes Reinecke wrote:
>> @@ -6021,43 +6015,28 @@ static void adv_isr_callback(ADV_DVC_VAR
>> *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
>> ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
>> ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
>> SCSI_SENSE_BUFFERSIZE);
>> - /*
>> - * Note: The 'status_byte()' macro used by
>> - * target drivers defined in scsi.h shifts the
>> - * status byte returned by host drivers right
>> - * by 1 bit. This is why target drivers also
>> - * use right shifted status byte definitions.
>> - * For instance target drivers use
>> - * CHECK_CONDITION, defined to 0x1, instead of
>> - * the SCSI defined check condition value of
>> - * 0x2. Host drivers are supposed to return
>> - * the status byte as it is defined by SCSI.
>> - */
>> - scp->result = DRIVER_BYTE(DRIVER_SENSE) |
>> - STATUS_BYTE(scsiqp->scsi_status);
>> - } else {
>> - scp->result = STATUS_BYTE(scsiqp->scsi_status);
>> }
>> + scp->result = status_byte(scsiqp->scsi_status);
>> break;
>
> Did you really want to delete the code that sets DRIVER_SENSE?
>
Yes. SAM_STAT_CHECK_CONDITION is already set, and the whole point of
this patchset was to drop the DRIVER_SENSE usage.
>> @@ -6789,47 +6768,30 @@ static void asc_isr_callback(ASC_DVC_VAR
>> *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
>> ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
>> ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
>> SCSI_SENSE_BUFFERSIZE);
>> - /*
>> - * Note: The 'status_byte()' macro used by
>> - * target drivers defined in scsi.h shifts the
>> - * status byte returned by host drivers right
>> - * by 1 bit. This is why target drivers also
>> - * use right shifted status byte definitions.
>> - * For instance target drivers use
>> - * CHECK_CONDITION, defined to 0x1, instead of
>> - * the SCSI defined check condition value of
>> - * 0x2. Host drivers are supposed to return
>> - * the status byte as it is defined by SCSI.
>> - */
>> - scp->result = DRIVER_BYTE(DRIVER_SENSE) |
>> - STATUS_BYTE(qdonep->d3.scsi_stat);
>> - } else {
>> - scp->result = STATUS_BYTE(qdonep->d3.scsi_stat);
>> }
>> + scp->result = status_byte(qdonep->d3.scsi_stat);
>> break;
>
> Same comment here: did you really want to delete the code that sets
> DRIVER_SENSE?
>
See above: yes.
That was kinda the point of this patchset.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer