public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched
@ 2026-01-27 14:42 Jan Remmet
  2026-01-27 15:10 ` Greg Kroah-Hartman
  2026-02-05 16:18 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Remmet @ 2026-01-27 14:42 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Krishna Kurapati
  Cc: linux-usb, linux-kernel, upstream

Check regulator state as peripheral and detach can disable vbus.
Without this check we will try to disable the regulator twice if
we disconnect host and then connect as device.

Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to be switched")

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
---
This is a fixup from
- Link to v1: https://lore.kernel.org/r/20260115-wip-jremmet-hd3ss3220_vbus-v1-1-b7d9adfbe346@phytec.de
To
- Link to v2: https://lore.kernel.org/r/20260123-wip-jremmet-hd3ss3220_vbus-v2-1-bcad313ce92b@phytec.de
---
Changes in v2:
- added Fixes tag for the patch applied on usb-next
- Link to v1: https://lore.kernel.org/r/20260126-wip-jremmet-hd3ss3220_vbus_split-v1-1-b2f946f1a4ae@phytec.de
---
 drivers/usb/typec/hd3ss3220.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
index a7c54aa8635f70d6979d98c95f80d4dac277fef2..3e39b800e6b5f4d0cbba957c0dd66c18f781ff38 100644
--- a/drivers/usb/typec/hd3ss3220.c
+++ b/drivers/usb/typec/hd3ss3220.c
@@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
 {
 	int ret;
 
+	if (regulator_is_enabled(hd3ss3220->vbus) == on)
+		return;
+
 	if (on)
 		ret = regulator_enable(hd3ss3220->vbus);
 	else

---
base-commit: 8acc379b664ec987dcc7eca25a5f5c4a9a4eb9c4
change-id: 20260126-wip-jremmet-hd3ss3220_vbus_split-946802479e89

Best regards,
-- 
Jan Remmet <j.remmet@phytec.de>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched
  2026-01-27 14:42 [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched Jan Remmet
@ 2026-01-27 15:10 ` Greg Kroah-Hartman
  2026-01-30  8:57   ` Jan Remmet
  2026-02-05 16:18 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-27 15:10 UTC (permalink / raw)
  To: Jan Remmet
  Cc: Heikki Krogerus, Krishna Kurapati, linux-usb, linux-kernel,
	upstream

On Tue, Jan 27, 2026 at 03:42:15PM +0100, Jan Remmet wrote:
> Check regulator state as peripheral and detach can disable vbus.
> Without this check we will try to disable the regulator twice if
> we disconnect host and then connect as device.
> 
> Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to be switched")

I don't see a commit with that id and name in my tree anywhere, nor in
linux-next.  Are you sure it is correct?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched
  2026-01-27 15:10 ` Greg Kroah-Hartman
@ 2026-01-30  8:57   ` Jan Remmet
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Remmet @ 2026-01-30  8:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Heikki Krogerus, Krishna Kurapati, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, upstream@lists.phytec.de

Am 27.01.26 um 16:10 schrieb Greg Kroah-Hartman:
> On Tue, Jan 27, 2026 at 03:42:15PM +0100, Jan Remmet wrote:
>> Check regulator state as peripheral and detach can disable vbus.
>> Without this check we will try to disable the regulator twice if
>> we disconnect host and then connect as device.
>>
>> Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to be switched")
> 
> I don't see a commit with that id and name in my tree anywhere, nor in
> linux-next.  Are you sure it is correct?
> 
> confused,

I send a updated version here: 
https://lore.kernel.org/all/20260127-wip-jremmet-hd3ss3220_vbus_split-v3-1-009772f38265@phytec.de/

Sorry for the wrong reference, I replied too quickly and didn’t properly 
verify the numbering.

Jan

> 
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched
  2026-01-27 14:42 [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched Jan Remmet
  2026-01-27 15:10 ` Greg Kroah-Hartman
@ 2026-02-05 16:18 ` Greg Kroah-Hartman
  2026-02-05 19:37   ` Jan Remmet
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-05 16:18 UTC (permalink / raw)
  To: Jan Remmet
  Cc: Heikki Krogerus, Krishna Kurapati, linux-usb, linux-kernel,
	upstream

On Tue, Jan 27, 2026 at 03:42:15PM +0100, Jan Remmet wrote:
> Check regulator state as peripheral and detach can disable vbus.
> Without this check we will try to disable the regulator twice if
> we disconnect host and then connect as device.
> 
> Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to be switched")

This is not a git id in the tree :(

And how can this "fix" the same commit that this one is?

Totally confused...

How about starting over and picking the commit id, in the tree, that
this is fixing and sending that?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched
  2026-02-05 16:18 ` Greg Kroah-Hartman
@ 2026-02-05 19:37   ` Jan Remmet
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Remmet @ 2026-02-05 19:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Heikki Krogerus, Krishna Kurapati, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, upstream@lists.phytec.de

Am 05.02.26 um 17:18 schrieb Greg Kroah-Hartman:
> On Tue, Jan 27, 2026 at 03:42:15PM +0100, Jan Remmet wrote:
>> Check regulator state as peripheral and detach can disable vbus.
>> Without this check we will try to disable the regulator twice if
>> we disconnect host and then connect as device.
>>
>> Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to be switched")
> 
> This is not a git id in the tree :(
> 
> And how can this "fix" the same commit that this one is?
> 
> Totally confused...
Sorry, I mixed it up :(
I accidentally took the last reference, which was the actual commit...
> 
> How about starting over and picking the commit id, in the tree, that
> this is fixing and sending that?

Yes, I already send v3 with fixed reference.

https://lore.kernel.org/all/20260127-wip-jremmet-hd3ss3220_vbus_split-v3-1-009772f38265@phytec.de/

Jan
> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-05 19:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 14:42 [PATCH v2] usb: typec: hd3ss3220: Check if regulator needs to be switched Jan Remmet
2026-01-27 15:10 ` Greg Kroah-Hartman
2026-01-30  8:57   ` Jan Remmet
2026-02-05 16:18 ` Greg Kroah-Hartman
2026-02-05 19:37   ` Jan Remmet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox