public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Daniel Drake <drake@endlessos.org>,
	Vitalii Solomonov <solomonov.v@gmail.com>
Cc: Jian-Hong Pan <jhp@endlessos.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	David Box <david.e.box@linux.intel.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	Nirmal Patel <nirmal.patel@linux.intel.com>,
	Jonathan Derrick <jonathan.derrick@linux.dev>,
	linux-ide@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@endlessos.org
Subject: Re: [PATCH 1/2] ata: ahci: Add force LPM policy quirk for ASUS B1400CEAE
Date: Thu, 1 Feb 2024 16:01:41 +0100	[thread overview]
Message-ID: <ZbuyVbMEBWKi729y@x1-carbon> (raw)
In-Reply-To: <ZbrNLxHL03R66PxQ@x1-carbon>

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);
 }

  parent reply	other threads:[~2024-02-01 15:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  9:59 [PATCH 1/2] ata: ahci: Add force LPM policy quirk for ASUS B1400CEAE Jian-Hong Pan
2024-01-30 10:13 ` Mika Westerberg
2024-01-31  8:56   ` Jian-Hong Pan
2024-01-31 10:57     ` Niklas Cassel
2024-01-31 11:08       ` Daniel Drake
2024-01-31 22:43         ` Niklas Cassel
     [not found]           ` <CADMpKLrNmmQ3PRTsiDXWBQ6iiJ9F+93xEk6HpuuK4Ev=n-i7wA@mail.gmail.com>
2024-02-01 10:35             ` Niklas Cassel
2024-02-01 15:01           ` Niklas Cassel [this message]
2024-02-02  8:49             ` Jian-Hong Pan
2024-02-05 11:33               ` Niklas Cassel
2024-02-06  8:39                 ` Jian-Hong Pan
2024-02-06 13:12                   ` Niklas Cassel
2024-02-06 22:07                     ` Niklas Cassel
2024-02-07  6:35                       ` Jian-Hong Pan
2024-02-07  6:31                     ` Jian-Hong Pan

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=ZbuyVbMEBWKi729y@x1-carbon \
    --to=cassel@kernel.org \
    --cc=david.e.box@linux.intel.com \
    --cc=dlemoal@kernel.org \
    --cc=drake@endlessos.org \
    --cc=jhp@endlessos.org \
    --cc=jonathan.derrick@linux.dev \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@endlessos.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=nirmal.patel@linux.intel.com \
    --cc=solomonov.v@gmail.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