mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Kyrylo Biryuk <illofspeed@gmail.com>
Cc: linux-ide@vger.kernel.org, dlemoal@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] ata: libahci: re-enable FBS after error handling on a port multiplier
Date: Mon, 12 Oct 2026 10:42:49 +0200	[thread overview]
Message-ID: <asydieBd75dkiWzX@ryzen> (raw)
In-Reply-To: <20261011183126.389-1-illofspeed@gmail.com>

On Sun, Oct 11, 2026 at 08:31:26PM +0200, Kyrylo Biryuk wrote:
> An automated review (Sashiko) of this patch pointed out that
> ahci_enable_fbs() writes PxFBS.EN after hpriv->stop_engine(), which
> clears PxCMD.ST but leaves PxCMD.FRE set, and asked whether that could
> upset strict controllers.
> 
> For the record: this patch only adds a third caller of the existing
> helper. ahci_pmp_attach() (every boot with a port multiplier, after
> ahci_start_port() has enabled FIS reception) and ahci_do_softreset()
> (after a successful fan-out softreset) already call ahci_enable_fbs()
> with the port in the same state, so the patch does not change when or
> how PxFBS.EN is written. If the helper should also stop FIS reception
> around the write, that would be a separate change to ahci_enable_fbs()
> and ahci_disable_fbs(); I am happy to look into it if the maintainers
> think it is worth doing.
> 
> Tested on the 88SE9235 + 88SM9705 setup from the commit message: the
> hot-plug now ends with "re-enabling FBS after error handling" and
> "FBS is enabled", and parallel reads behind the multiplier scale again.

Looking at:
3.3.16 Offset 40h: PxFBS: Port x FIS-based Switching Control

Enable (EN): When set to ‘1’, a Port Multiplier is attached and the HBA shall
use FIS-based switching to communicate with it. When cleared to ‘0’, FIS-based
switching is not being used. Software shall only change the value of the EN bit
when PxCMD.ST is cleared to ‘0’


PxCMD.ST will be cleared to 0 by the hpriv->stop_engine() in ahci_enable_fbs().

I don't see any mention that PxCMD.FRE needs to be disabled in addition to
PxCMD.ST.

Presumably, if PxCMD.ST is disabled, why would you receive any FIS?

Sure the spec says that PxCMD.FRE should be set before PxCMD.ST,
but I can't find anywhere in the spec where it says that you need to
clear PxCMD.FRE before each time you re-start the engine (set PxCMD.ST).

So I think Sashiko is hallucinating here.


Kind regards,
Niklas

  reply	other threads:[~2026-10-12  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 18:02 Kyrylo Biryuk
2026-10-11 18:31 ` Kyrylo Biryuk
2026-10-12  8:42   ` Niklas Cassel [this message]
2026-10-12  8:33 ` Niklas Cassel

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=asydieBd75dkiWzX@ryzen \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=illofspeed@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®