lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSbyHj-keYZWLwDy@black.igk.intel.com>
Date: Wed, 26 Nov 2025 13:27:10 +0100
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Krishna Kurapati <krishna.kurapati@....qualcomm.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Biju Das <biju.das.jz@...renesas.com>,
	Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
	linux-usb@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 2/2] usb: typec: hd3ss3220: Enable VBUS based on ID
 pin state

On Tue, Nov 11, 2025 at 12:50:25PM +0530, Krishna Kurapati wrote:
> There is a ID pin present on HD3SS3220 controller that can be routed
> to SoC. As per the datasheet:
> 
> "Upon detecting a UFP device, HD3SS3220 will keep ID pin high if VBUS is
> not at VSafe0V. Once VBUS is at VSafe0V, the HD3SS3220 will assert ID pin
> low. This is done to enforce Type-C requirement that VBUS must be at
> VSafe0V before re-enabling VBUS"
> 
> Add support to read the ID pin state and enable VBUS accordingly.

...

> +	if (hd3ss3220->vbus) {
> +		hd3ss3220->id_gpiod = devm_gpiod_get_optional(hd3ss3220->dev,
> +							      "id",
> +							      GPIOD_IN);

Can be also

		ret = PTR_ERR_OR_ZERO(hd3ss3220->id_gpiod);
		if (IS_ERR(hd3ss3220->id_gpiod))
			goto err_put_fwnode;

> +		if (IS_ERR(hd3ss3220->id_gpiod)) {

> +		if (IS_ERR(hd3ss3220->id_gpiod)) {
> +			ret = PTR_ERR(hd3ss3220->id_gpiod);
> +			goto err_put_fwnode;
> +		}
> +	}

...

> +		ret = devm_request_threaded_irq(hd3ss3220->dev,
> +						hd3ss3220->id_irq, NULL,
> +						hd3ss3220_id_isr,
> +						IRQF_TRIGGER_RISING |
> +						IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> +						dev_name(hd3ss3220->dev), hd3ss3220);
> +		if (ret < 0) {
> +			dev_err(hd3ss3220->dev, "failed to get ID irq: %d\n", ret);

The above call already prints an error message, no need to repeat it here.

> +			goto err_put_fwnode;
> +		}

Since the patch is already applied, please send a followup for the second one
(the first one is up to you, just a hint for the future code contributions).

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ