Re: Failed to disable WCE for a SATA disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




.



.




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux