mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	JC Kuo <jckuo@nvidia.com>, Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>
Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 6/6] phy: tegra: xusb: Move T186 .set_mode() to common implementation
Date: Fri, 27 Mar 2026 17:46:49 +0000	[thread overview]
Message-ID: <708f6104-f907-43e3-ad0a-0d124338362b@nvidia.com> (raw)
In-Reply-To: <2c7fa782-f7f1-43c6-bda4-296fa7ab88c2@tecnico.ulisboa.pt>


On 24/03/2026 14:36, Diogo Ivo wrote:

...

> Ok, I can make it common there as well. However I still feel like
> reverting cefc1caee9dd leads to cleaner code since vbus_override() and
> id_override() will look similar and only do exactly what they state in
> their names and the overall logic looks cleaner.

Just so you know that while commit cefc1caee9dd was being prepared for
upstream submission, the following had been proposed for this ...

@@ -825,11 +826,11 @@ static int tegra186_utmi_phy_set_mode(struct phy *phy, enum phy_mode mode,
  			tegra186_xusb_padctl_vbus_override(padctl, true);
  		} else if (submode == USB_ROLE_NONE) {
  			/*
-			 * When port is peripheral only or role transitions to
-			 * USB_ROLE_NONE from USB_ROLE_DEVICE, regulator is not
-			 * enabled.
+			 * The regulator is disabled only when the role transitions
+			 * from USB_ROLE_HOST to USB_ROLE_NONE.
  			 */
-			if (regulator_is_enabled(port->supply))
+			value = padctl_readl(padctl, USB2_VBUS_ID);
+			if (!(value & ID_OVERRIDE_FLOATING))
  				regulator_disable(port->supply);

This shows the relationship between ID override and the regulator and
hence it was moved into id_override(). This is different to your fix
in patch 5/6. So given that we have been using cefc1caee9dd now for
sometime, I don't wish to change the implementation unless there is a
valid reason.

Jon

-- 
nvpublic


  reply	other threads:[~2026-03-27 17:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 15:11 [PATCH v2 0/6] Fixes to Tegra USB role switching and phy handling Diogo Ivo
2026-01-27 15:11 ` [PATCH v2 1/6] phy: tegra: xusb: Fix USB2 port regulator disable logic Diogo Ivo
2026-01-27 15:11 ` [PATCH v2 2/6] usb: xhci: tegra: Remove redundant mutex when setting phy mode Diogo Ivo
2026-03-24 11:48   ` Thierry Reding
2026-03-24 12:28     ` Diogo Ivo
2026-03-26 14:17     ` Diogo Ivo
2026-03-27 14:06       ` Thierry Reding
2026-01-27 15:11 ` [PATCH v2 3/6] phy: tegra: xusb: Fix ordering issue when switching roles on USB2 ports Diogo Ivo
2026-01-27 15:11 ` [PATCH v2 4/6] phy: tegra: xusb: Add ID override support to padctl Diogo Ivo
2026-01-27 15:11 ` [PATCH v2 5/6] phy: tegra: xusb: Move .set_mode() to a shared location Diogo Ivo
2026-01-27 15:11 ` [PATCH v2 6/6] phy: tegra: xusb: Move T186 .set_mode() to common implementation Diogo Ivo
2026-03-24 10:16   ` Jon Hunter
2026-03-24 11:31     ` Diogo Ivo
2026-03-24 13:33       ` Jon Hunter
2026-03-24 14:36         ` Diogo Ivo
2026-03-27 17:46           ` Jon Hunter [this message]
2026-03-02  9:10 ` [PATCH v2 0/6] Fixes to Tegra USB role switching and phy handling Diogo Ivo
2026-03-02  9:59 ` Vinod Koul
2026-03-23 16:15 ` Diogo Ivo

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=708f6104-f907-43e3-ad0a-0d124338362b@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=diogo.ivo@tecnico.ulisboa.pt \
    --cc=gregkh@linuxfoundation.org \
    --cc=jckuo@nvidia.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox