linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "chenxiang (M)" <chenxiang66@hisilicon.com>
To: "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>,
	John Garry <john.garry@huawei.com>
Subject: Failed to disable WCE for a SATA disk
Date: Wed, 11 Dec 2019 11:21:49 +0800	[thread overview]
Message-ID: <a3624979-0917-4b66-ca18-89e0e2dd3bf2@hisilicon.com> (raw)

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




             reply	other threads:[~2019-12-11  3:22 UTC|newest]

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

Reply instructions:

You may reply publicly 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=a3624979-0917-4b66-ca18-89e0e2dd3bf2@hisilicon.com \
    --to=chenxiang66@hisilicon.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=john.garry@huawei.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 \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).