Linux-ide Archive on lore.kernel.org
 help / color / Atom feed
From: John Garry <john.garry@huawei.com>
To: "chenxiang (M)" <chenxiang66@hisilicon.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bvanassche@acm.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	<linux-ide@vger.kernel.org>, Linuxarm <linuxarm@huawei.com>,
	Jason Yan <yanaijie@huawei.com>
Subject: Re: Failed to disable WCE for a SATA disk
Date: Mon, 13 Jan 2020 10:11:39 +0000
Message-ID: <55db2e1d-5a3c-55e1-1513-25506ebf3d8f@huawei.com> (raw)
In-Reply-To: <d6e8987b-e44e-661e-7338-321583e9fb75@hisilicon.com>

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
>>
>>
>>
>>
>> .
>>
> 
> 
> .


      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  3:21 chenxiang (M)
2020-01-13  3:30 ` chenxiang (M)
2020-01-13 10:11   ` John Garry [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55db2e1d-5a3c-55e1-1513-25506ebf3d8f@huawei.com \
    --to=john.garry@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.com \
    --cc=tj@kernel.org \
    --cc=yanaijie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ide Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ide/0 linux-ide/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ide linux-ide/ https://lore.kernel.org/linux-ide \
		linux-ide@vger.kernel.org
	public-inbox-index linux-ide

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ide


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git