From: Damien Le Moal <dlemoal@kernel.org>
To: Szuying Chen <chensiying21@gmail.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jesse1_Chang@asmedia.com.tw, Richard_Hsu@asmedia.com.tw,
Chloe_chen@asmedia.com.tw
Subject: Re: [PATCH] ahci: libahci: clear pending interrupt status
Date: Thu, 10 Aug 2023 14:12:12 +0900 [thread overview]
Message-ID: <23cc546e-bf87-b3c7-6b75-b895c1241a4b@kernel.org> (raw)
In-Reply-To: <20230810050531.43505-1-Chloe_Chen@asmedia.com.tw>
On 8/10/23 14:05, Szuying Chen wrote:
> When ISR handle interface fatal error with error recovery after clear PxIS
> and PxIE. Another FIS(SDB FIS with err) that set PxIS.IFS to 1 is recevied
> during error recovery, which causing the HBA not issue any new commands
> after cmd.ST set 1.
This is not very clear. If there was a fatal error, the drive should be in
error state and no other SDB FIS can be received as the drive does absolutely
nothing while in error state (it only waits for a read log 10h command to be
issued to get it out of error state). So if you are seeing 2 SDB FIS with
errors one after the other, you have a buggy device...
However, I may be misunderstanding your issue here. Could you provide more
details and a dmesg output example of the issue ?
>
> Signed-off-by: Szuying Chen <Chloe_Chen@asmedia.com.tw>
> ---
> drivers/ata/libahci.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index 06aec35f88f2..0ae51fd95d46 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -679,9 +679,21 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
>
> void ahci_start_engine(struct ata_port *ap)
> {
> + struct ahci_host_priv *hpriv = ap->host->private_data;
> void __iomem *port_mmio = ahci_port_base(ap);
> u32 tmp;
>
> + /* clear SError */
> + tmp = readl(port_mmio + PORT_SCR_ERR);
> + writel(tmp, port_mmio + PORT_SCR_ERR);
> +
> + /* clear port IRQ */
> + tmp = readl(port_mmio + PORT_IRQ_STAT);
> + if (tmp)
> + writel(tmp, port_mmio + PORT_IRQ_STAT);
> +
> + writel(1 << ap->port_no, hpriv->mmio + PORT_IRQ_STAT);
> +
> /* start DMA */
> tmp = readl(port_mmio + PORT_CMD);
> tmp |= PORT_CMD_START;
> --
> 2.39.2
>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2023-08-10 5:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 5:05 Szuying Chen
2023-08-10 5:12 ` Damien Le Moal [this message]
2023-08-10 9:31 Szuying Chen
2023-08-10 9:59 ` Damien Le Moal
2023-08-31 3:09 Szuying Chen
2023-08-31 5:22 ` Damien Le Moal
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=23cc546e-bf87-b3c7-6b75-b895c1241a4b@kernel.org \
--to=dlemoal@kernel.org \
--cc=Chloe_chen@asmedia.com.tw \
--cc=Jesse1_Chang@asmedia.com.tw \
--cc=Richard_Hsu@asmedia.com.tw \
--cc=chensiying21@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®