From: Tejun Heo <tj@kernel.org>
To: Suman Tripathi <stripathi@apm.com>
Cc: olof@lixom.net, arnd@arndb.de, linux-scsi@vger.kernel.org,
linux-ide@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, ddutile@redhat.com,
jcm@redhat.com, patches@apm.com
Subject: Re: [PATCH v2 2/2] ata: Fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command.
Date: Tue, 17 Jun 2014 12:31:44 -0400 [thread overview]
Message-ID: <20140617163144.GJ31819@htj.dyndns.org> (raw)
In-Reply-To: <1402911336-31788-3-git-send-email-stripathi@apm.com>
On Mon, Jun 16, 2014 at 03:05:36PM +0530, Suman Tripathi wrote:
> This patch fixes the dma state machine lockup due to the IDENTIFY DEVICE PIO mode command. The controller is unable to clear the BSY bit after receiving the PIO setup FIS and results the dma state machine to go into the CMFatalErrorUpdate state resulting in the dma state machine lockup.
Ditto on description formatting and SOB. Also, please describe why
this patch is removing the restart from read_id.
> +int ahci_complete_pio_cmd(struct ata_port *ap, u32 cmd_done)
> +{
> + struct ata_queued_cmd *qc;
> +
> + while (cmd_done) {
> + unsigned int tag = __ffs(cmd_done);
> +
> + qc = ata_qc_from_tag(ap, tag);
> + if (qc) {
> + /*
> + * For the IDENTIFY DEVICE PIO command,
> + * some controller's unable to clear the BSY bit after
> + * receiving the PIO Setup FIS from device resulting
> + * the DMA state to go into CMFatalErrorUpdate state.
> + * So need to restart the dma engine to get the
> + * controller out of this state.
> + */
> + if (qc->tf.command == ATA_CMD_ID_ATA)
> + ahci_restart_engine(ap);
> + }
> + cmd_done &= ~(1 << tag);
> + }
> +
> + return 0;
> +}
> +
> static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
> {
> struct ahci_host_priv *hpriv = ap->host->private_data;
> @@ -1778,6 +1804,14 @@ static void ahci_handle_port_interrupt(struct ata_port *ap,
> }
>
>
> + /* Due to HW errata, some controllers need special handling
> + * of the completion of some PIO commands.
> + */
> + if (hpriv->flags & AHCI_HFLAG_BROKEN_PIO_CMD) {
> + u32 cmd_done = ap->qc_active ^ qc_active;
> + ahci_complete_pio_cmd(ap, cmd_done);
> + }
Heh, I feel this is a bit too specific to bury in libahci.c and don't
really like adding this sort workaround in the hot path for everybody.
Then again, ahci interrupt handler isn't exactly structured in a way
which is easy to wrap and create a custom one.
Does this have to happen from interrupt path tho? Can't you just
record the last protocol executed and restart the engine on the next
qc_issue?
Thanks.
--
tejun
next prev parent reply other threads:[~2014-06-17 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 9:35 [PATCH v2 0/2]ata: Fix the dma state machine lockup for APM X-Gene SoC Suman Tripathi
2014-06-16 9:35 ` [PATCH v2 1/2] libahci: Implement the function ahci_restart_engine to restart the port dma engine Suman Tripathi
2014-06-17 16:21 ` Tejun Heo
2014-06-16 9:35 ` [PATCH v2 2/2] ata: Fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command Suman Tripathi
2014-06-17 16:31 ` Tejun Heo [this message]
2014-06-16 15:59 ` [PATCH v2 0/2]ata: Fix the dma state machine lockup for APM X-Gene SoC Ming Lei
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=20140617163144.GJ31819@htj.dyndns.org \
--to=tj@kernel.org \
--cc=arnd@arndb.de \
--cc=ddutile@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=jcm@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=olof@lixom.net \
--cc=patches@apm.com \
--cc=stripathi@apm.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
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).