All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: vkoul@kernel.org, olteanv@gmail.com,
	linux-phy@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v16 1/6] phy: core: add notifier infrastructure
Date: Thu, 24 Sep 2026 17:35:31 +0000	[thread overview]
Message-ID: <20260924173531.B38DA1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924-b4-rockchip-dwc3-rockchip-glue-v16-1-126a2e9133c3@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] phy: missing rollback mechanism on PRE_RESET notification failure
--

commit b2bd6d1e7b7d0d73d320775ff3e7dee092787ebc
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

phy: core: add notifier infrastructure

This commit introduces a new PHY notifier API that allows consumer drivers
to hook into reset events from a PHY device. This helps gracefully handle
configuration or cable orientation changes.

> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 21aaf2f76e53e..51d261daae7a9 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c

[ ... ]

> @@ -542,6 +542,70 @@ int phy_notify_state(struct phy *phy, union phy_notify state)

[ ... ]

> +int phy_notify_reset(struct phy *phy, enum phy_notification event)
> +{
> +	int ret;
> +
> +	if (!phy)
> +		return 0;
> +
> +	ret = blocking_notifier_call_chain(&phy->notifier, event, phy);
> +	return notifier_to_errno(ret);

[Severity: Medium]
What happens if one of the consumers in the notifier chain returns an error
during a PHY_NOTIFY_PRE_RESET event?

If a PHY has multiple consumers registered to its notifier chain, and the
first consumer successfully processes the PRE_RESET event but a subsequent
consumer returns an error (such as NOTIFY_BAD), the notification chain will
abort and the provider will receive the error.

This stops the notification chain on the first error, which could leave the
already-notified consumers permanently stranded in a quiesced state since
the reset is aborted without sending a POST_RESET or ABORT_RESET.

Would it be safer to use blocking_notifier_call_chain_robust() here
instead, and introduce a PHY_NOTIFY_ABORT_RESET event to allow previously
notified consumers to roll back their state?

> +}
> +EXPORT_SYMBOL_GPL(phy_notify_reset);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260924-b4-rockchip-dwc3-rockchip-glue-v16-0-126a2e9133c3@collabora.com?part=1

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

  reply	other threads:[~2026-09-24 17:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 17:25 [PATCH v16 0/6] usb: dwc3: introduce Rockchip glue driver Sebastian Reichel
2026-09-24 17:25 ` Sebastian Reichel
2026-09-24 17:25 ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 1/6] phy: core: add notifier infrastructure Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:35   ` sashiko-bot [this message]
2026-09-26  7:47   ` Manivannan Sadhasivam
2026-09-26  7:47     ` Manivannan Sadhasivam
2026-09-26  7:47     ` Manivannan Sadhasivam
2026-10-03  9:04   ` Vinod Koul
2026-10-03  9:04     ` Vinod Koul
2026-10-03  9:04     ` Vinod Koul
2026-10-04 12:44     ` Sebastian Reichel
2026-10-04 12:44       ` Sebastian Reichel
2026-10-04 12:44       ` Sebastian Reichel
2026-10-05  8:30       ` Vinod Koul
2026-10-05  8:30         ` Vinod Koul
2026-10-05  8:30         ` Vinod Koul
2026-10-06  1:11         ` Sebastian Reichel
2026-10-06  1:11           ` Sebastian Reichel
2026-10-06  1:11           ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 2/6] usb: dwc3: rockchip: introduce glue driver Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:36   ` sashiko-bot
2026-09-24 17:25 ` [PATCH v16 3/6] usb: dwc3: core: add post PHY registration hook for platform glue Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 4/6] usb: dwc3: rockchip: support PHY reset notifications Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:38   ` sashiko-bot
2026-09-26  7:51   ` Manivannan Sadhasivam
2026-09-26  7:51     ` Manivannan Sadhasivam
2026-09-26  7:51     ` Manivannan Sadhasivam
2026-10-02 23:39   ` Thinh Nguyen
2026-10-02 23:39     ` Thinh Nguyen
2026-10-02 23:39     ` Thinh Nguyen
2026-09-24 17:25 ` [PATCH v16 5/6] usb: gadget: define stub for usb_udc_vbus_handler Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25 ` [PATCH v16 6/6] usb: dwc3: rockchip: fix USB-C reconnect in gadget mode Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:25   ` Sebastian Reichel
2026-09-24 17:40   ` sashiko-bot
2026-09-27 12:02   ` Igor Paunovic
2026-09-27 12:02     ` Igor Paunovic
2026-09-27 12:02     ` Igor Paunovic
2026-10-02 22:57   ` Thinh Nguyen
2026-10-02 22:57     ` Thinh Nguyen
2026-10-02 22:57     ` Thinh Nguyen
2026-09-27 12:02 ` [PATCH v16 0/6] usb: dwc3: introduce Rockchip glue driver Igor Paunovic
2026-09-27 12:02   ` Igor Paunovic
2026-09-27 12:02   ` Igor Paunovic

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=20260924173531.B38DA1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    --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.