All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Peter <sven@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: linux-phy@lists.infradead.org, vkoul@kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH 3/3] phy: apple: atc: Implement the USB4 pipehandler state
Date: Fri, 21 Aug 2026 16:05:00 +0200	[thread overview]
Message-ID: <12b4ad0b-5323-4eee-8772-2bf07ad89a16@kernel.org> (raw)
In-Reply-To: <20260821140146.0D53A1F000E9@smtp.kernel.org>



On 8/21/26 16:01, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
>
> New issues:
> - [High] Missing cleanup of `PIPEHANDLER_OVERRIDE` registers on lock failure leaves link detection permanently disabled.
>
> Pre-existing issues:
> - [High] Unconditional state update of `atcphy->pipehandler_up = true` on the error path masks hardware configuration failures.
> --
>
> --- Patch [3]: [PATCH 3/3] phy: apple: atc: Implement the USB4 pipehandler state ---
> commit 6b90c04f8cd4e7a3f818a4bc0eb1057996bb1845
> Author: Sven Peter <sven@kernel.org>
>
> phy: apple: atc: Implement the USB4 pipehandler state
>
> This commit implements the USB4 pipehandler state for the Apple ATC PHY driver.
> It switches the dwc3's PIPE interface to the USB4 NHI which takes care of
> tunneling USB3 over USB4.
>
>> diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
>> index 96158d3486560..613bcd0ae8865 100644
>> --- a/drivers/phy/apple/atc.c
>> +++ b/drivers/phy/apple/atc.c
>> @@ -1084,6 +1084,41 @@ static int atcphy_configure_pipehandler_usb3(struct apple_atcphy *atcphy, bool h
>>   	return 0;
>>   }
>>   
>> +static int atcphy_configure_pipehandler_usb4(struct apple_atcphy *atcphy)
>> +{
>> +	int ret;
>> +
>> +	ret = atcphy_pipehandler_check(atcphy);
>> +	if (ret)
>> +		return ret;
>> +
>> +	/* Force disable link detection */
>> +	clear32(atcphy->regs.pipehandler + PIPEHANDLER_OVERRIDE_VALUES,
>> +		PIPEHANDLER_OVERRIDE_VAL_RXDETECT0 | PIPEHANDLER_OVERRIDE_VAL_RXDETECT1);
>> +	set32(atcphy->regs.pipehandler + PIPEHANDLER_OVERRIDE, PIPEHANDLER_OVERRIDE_RXVALID);
>> +	set32(atcphy->regs.pipehandler + PIPEHANDLER_OVERRIDE, PIPEHANDLER_OVERRIDE_RXDETECT);
>> +
>> +	ret = atcphy_pipehandler_lock(atcphy);
>> +	if (ret) {
>> +		dev_err(atcphy->dev, "Failed to lock pipehandler\n");
>> +		return ret;
>> +	}
> [Severity: High]
> If atcphy_pipehandler_lock() fails and returns early, the link detection
> override bits (PIPEHANDLER_OVERRIDE_RXVALID and
> PIPEHANDLER_OVERRIDE_RXDETECT) are left set.
>
> Does this permanently disable link detection on the PHY hardware for
> subsequent retries until a hard reset occurs?

No, if this fails the port will be broken until the next unplug/plug 
which resets everything anyway.
Same pattern has been working in the other paths and since we have no 
documentation for this PHY I won't touch it or do anything else here.



Sven


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-08-21 14:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 13:50 [PATCH 0/3] phy: apple: atc: Prepare USB3-via-4 tunneling Sven Peter
2026-08-21 13:50 ` Sven Peter
2026-08-21 13:50 ` [PATCH 1/3] phy: apple: atc: Support DUMMY PIPEHANDLER state in configure_pipehandler Sven Peter
2026-08-21 13:50   ` Sven Peter
2026-08-21 14:01   ` sashiko-bot
2026-08-21 13:50 ` [PATCH 2/3] phy: apple: atc: Factor out the PIPE mux sequence Sven Peter
2026-08-21 13:50   ` Sven Peter
2026-08-21 13:50 ` [PATCH 3/3] phy: apple: atc: Implement the USB4 pipehandler state Sven Peter
2026-08-21 13:50   ` Sven Peter
2026-08-21 14:01   ` sashiko-bot
2026-08-21 14:05     ` Sven Peter [this message]
2026-09-07 10:45 ` [PATCH 0/3] phy: apple: atc: Prepare USB3-via-4 tunneling Janne Grunau
2026-09-07 10:45   ` Janne Grunau
2026-10-03 15:25 ` Vinod Koul
2026-10-03 15:25   ` Vinod Koul

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=12b4ad0b-5323-4eee-8772-2bf07ad89a16@kernel.org \
    --to=sven@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.