linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Ashish Kalra <ashish.kalra@freescale.com>,
	"Darrick J. Wong" <djwong@us.ibm.com>,
	Jeff Garzik <jeff@garzik.org>,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>Mark Lord
	<k>
Subject: result_tf handling in sata_fsl and sas_ata
Date: Thu, 14 Oct 2010 11:28:38 +0200	[thread overview]
Message-ID: <4CB6CD46.90303@kernel.org> (raw)

Hello,

result_tf is used, among other things, to report the command
completion status for ATA passthrough commands.  Many controllers
emulate TF registers by updating them according to command progress
and received FISes allowing the respective drivers to simply read the
area; however, some native SATA controllers don't bother to emulate TF
registers and simply dump received FISes into predefined areas.

ahci was one of such controllers and the driver was reading the
receive area for D2H Reg FIS to acquire the result taskfile register.
Unfortunately, this is incorrect as successful ATA PIO data-in
commands don't use D2H Reg FIS to update result TF but the host is
supposed to update the Status part of TF from the E_Status field of
the preceding Setup PIO FIS.  This hack is to satisfy the timing
specified from PATA days.  Anyways, so, the qc_fill_rtf method needs
to consider the command protocol and success of the previous command
if the controller doesn't maintain TF registers itself.

I just submitted a patch to fix ahci.  sata_sil24, sata_fsl and
sas_ata seemed to have similar problems, but sata_sil24 properly
emulates TF regs in the PRB section in D2H Reg FIS layout, leaving
sata_fsl and sas_ata, about which I don't have much idea.  So, please
check and take care of them.

For further details, please read the following thread.

  http://thread.gmane.org/gmane.linux.ide/47627

Thanks.

-- 
tejun

                 reply	other threads:[~2010-10-14  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4CB6CD46.90303@kernel.org \
    --to=tj@kernel.org \
    --cc=ashish.kalra@freescale.com \
    --cc=djwong@us.ibm.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.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).