* Failed to disable WCE for a SATA disk
@ 2019-12-11 3:21 chenxiang (M)
2020-01-13 3:30 ` chenxiang (M)
0 siblings, 1 reply; 3+ messages in thread
From: chenxiang (M) @ 2019-12-11 3:21 UTC (permalink / raw)
To: axboe, Tejun Heo, Martin K. Petersen, Bart Van Assche
Cc: linux-scsi, linux-ide, Linuxarm, John Garry
Hi,
I encounter a issue related to libata and libsas. For hisi_sas driver,
it uses libsas. When disable WCE with tool sdparm (sdparm --clear=WCE
/dev/sda) for a SATA disk,
it fails with error info from hardware (the error info indicates that
the length of transfer data is conflicted with the direction of data,
the length is 0 but
the data of direction is from host to device).
I check the process: When disable WCE, it sends pasthrough IO with sg_io
, req->__data_len is not 0, and scsi_cmd->sc_data_direction = DMA_TO_DEVICE.
But for the command (MODE_SELECT), qc->tf.protocol is set 0 (not
ATA_PROT_DMA) in ->queuecommand()
->ata_sas_queuecmd()->ata_scsi_translate()->ata_scsi_mod_select_xlat()->ata_mselect_caching(),
so it doesn't dma map ata sg in function ata_qc_issue(). While in
function sas_ata_qc_issue(),it calcutes the length with the total sum of
sg_dma_len(sg), as for the
command it doesn't dma map ata sg, so the length is 0.
Do we need to dma map ata sg for the command? Or is it really we need
the data for the command MODE_SELECT?
Thanks,
Shawn
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Failed to disable WCE for a SATA disk
2019-12-11 3:21 Failed to disable WCE for a SATA disk chenxiang (M)
@ 2020-01-13 3:30 ` chenxiang (M)
2020-01-13 10:11 ` John Garry
0 siblings, 1 reply; 3+ messages in thread
From: chenxiang (M) @ 2020-01-13 3:30 UTC (permalink / raw)
To: axboe, Tejun Heo, Martin K. Petersen, Bart Van Assche
Cc: linux-scsi, linux-ide, Linuxarm, John Garry
Hi,
在 2019/12/11 11:21, chenxiang (M) 写道:
> Hi,
>
> I encounter a issue related to libata and libsas. For hisi_sas driver,
> it uses libsas. When disable WCE with tool sdparm (sdparm --clear=WCE
> /dev/sda) for a SATA disk,
> it fails with error info from hardware (the error info indicates that
> the length of transfer data is conflicted with the direction of data,
> the length is 0 but
> the data of direction is from host to device).
>
> I check the process: When disable WCE, it sends pasthrough IO with
> sg_io , req->__data_len is not 0, and scsi_cmd->sc_data_direction =
> DMA_TO_DEVICE.
> But for the command (MODE_SELECT), qc->tf.protocol is set 0 (not
> ATA_PROT_DMA) in ->queuecommand()
> ->ata_sas_queuecmd()->ata_scsi_translate()->ata_scsi_mod_select_xlat()->ata_mselect_caching(),
> so it doesn't dma map ata sg in function ata_qc_issue(). While in
> function sas_ata_qc_issue(),it calcutes the length with the total sum
> of sg_dma_len(sg), as for the
> command it doesn't dma map ata sg, so the length is 0.
>
> Do we need to dma map ata sg for the command? Or is it really we need
> the data for the command MODE_SELECT?
Does anyone have idea about it ?
>
> Thanks,
> Shawn
>
>
>
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Failed to disable WCE for a SATA disk
2020-01-13 3:30 ` chenxiang (M)
@ 2020-01-13 10:11 ` John Garry
0 siblings, 0 replies; 3+ messages in thread
From: John Garry @ 2020-01-13 10:11 UTC (permalink / raw)
To: chenxiang (M), axboe, Tejun Heo, Martin K. Petersen, Bart Van Assche
Cc: linux-scsi, linux-ide, Linuxarm, Jason Yan
On 13/01/2020 03:30, chenxiang (M) wrote:
+ Jason
> Hi,
>
> 在 2019/12/11 11:21, chenxiang (M) 写道:
>> Hi,
>>
>> I encounter a issue related to libata and libsas. For hisi_sas driver,
>> it uses libsas. When disable WCE with tool sdparm (sdparm --clear=WCE
>> /dev/sda) for a SATA disk,
>> it fails with error info from hardware (the error info indicates that
>> the length of transfer data is conflicted with the direction of data,
>> the length is 0 but
>> the data of direction is from host to device).
>>
>> I check the process: When disable WCE, it sends pasthrough IO with
>> sg_io , req->__data_len is not 0, and scsi_cmd->sc_data_direction =
>> DMA_TO_DEVICE.
>> But for the command (MODE_SELECT), qc->tf.protocol is set 0 (not
>> ATA_PROT_DMA) in ->queuecommand()
>> ->ata_sas_queuecmd()->ata_scsi_translate()->ata_scsi_mod_select_xlat()->ata_mselect_caching(),
>>
>> so it doesn't dma map ata sg in function ata_qc_issue(). While in
>> function sas_ata_qc_issue(),it calcutes the length with the total sum
>> of sg_dma_len(sg), as for the
>> command it doesn't dma map ata sg, so the length is 0.
>>
>> Do we need to dma map ata sg for the command? Or is it really we need
>> the data for the command MODE_SELECT?
>
> Does anyone have idea about it ?
>
>>
>> Thanks,
>> Shawn
>>
>>
>>
>>
>> .
>>
>
>
> .
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-13 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 3:21 Failed to disable WCE for a SATA disk chenxiang (M)
2020-01-13 3:30 ` chenxiang (M)
2020-01-13 10:11 ` John Garry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).