[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbuyVbMEBWKi729y@x1-carbon>
Date: Thu, 1 Feb 2024 16:01:41 +0100
From: Niklas Cassel <cassel@...nel.org>
To: Daniel Drake <drake@...lessos.org>,
Vitalii Solomonov <solomonov.v@...il.com>
Cc: Jian-Hong Pan <jhp@...lessos.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
David Box <david.e.box@...ux.intel.com>,
Damien Le Moal <dlemoal@...nel.org>,
Nirmal Patel <nirmal.patel@...ux.intel.com>,
Jonathan Derrick <jonathan.derrick@...ux.dev>,
linux-ide@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, linux@...lessos.org
Subject: Re: [PATCH 1/2] ata: ahci: Add force LPM policy quirk for ASUS
B1400CEAE
On Wed, Jan 31, 2024 at 11:43:59PM +0100, Niklas Cassel wrote:
> On Wed, Jan 31, 2024 at 07:08:12AM -0400, Daniel Drake wrote:
(snip)
> In libata we perform a reset of the port at boot, see:
> libata-sata.c:sata_link_hardreset()
> after writing to SControl, we call
> libata-core.c:ata_wait_ready() that will poll for the port being ready
> by calling the check_ready callback.
> For AHCI, this callback funcion is set to:
> libahci.c:ahci_check_ready().
>
> A reset should take the device out of deep power state and should be
> sufficient to establish a connection (and that also seems to be the
> case when not using Intel VMD).
>
> However, if you want to debug, I would start by adding prints to
> libata-sata.c:sata_link_hardreset()
> libata-core.c:ata_wait_ready()
> libahci.c:ahci_check_ready().
FWIW, this will dump SStatus.DET every time the check_ready callback function
(ahci_check_ready()) is called:
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 1a63200ea437..0467e150601e 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1533,6 +1533,12 @@ int ahci_check_ready(struct ata_link *link)
{
void __iomem *port_mmio = ahci_port_base(link->ap);
u8 status = readl(port_mmio + PORT_TFDATA) & 0xFF;
+ u32 cur = 0;
+
+ sata_scr_read(link, SCR_STATUS, &cur);
+
+ ata_link_info(link, "BUSY ? %d (status: %#x) SStatus.DET: %#x\n",
+ status & ATA_BUSY, status, cur & 0xf);
return ata_check_ready(status);
}
Powered by blists - more mailing lists