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: <Z77nPL_84FgjkDMX@kuha.fi.intel.com>
Date: Wed, 26 Feb 2025 12:04:44 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: gregkh@...uxfoundation.org, andre.draszik@...aro.org,
	linux@...ck-us.net, shufan_lee@...htek.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel@...labora.com, pablo.sun@...iatek.com
Subject: Re: [PATCH v2] usb: typec: tcpci_rt1711h: Unmask alert interrupts to
 fix functionality

On Wed, Feb 19, 2025 at 12:47:00PM +0100, AngeloGioacchino Del Regno wrote:
> During probe, the TCPC alert interrupts are getting masked to
> avoid unwanted interrupts during chip setup: this is ok to do
> but there is no unmasking happening at any later time, which
> means that the chip will not raise any interrupt, essentially
> making it not functional as, while internally it does perform
> all of the intended functions, it won't signal anything to the
> outside.
> 
> Unmask the alert interrupts to fix functionality.
> 
> Fixes: ce08eaeb6388 ("staging: typec: rt1711h typec chip driver")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>

Shouldn't this go to the stable kernels as well?

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
> 
> Changes in v2:
>  - Moved interrupts enablement call to before enabling irq wakeup as
>    enable_irq_wake() cannot fail, and if anything goes wrong, since the
>    interrupt was previously requested with devm, no further action is
>    needed. Thanks Greg!
> 
>  drivers/usb/typec/tcpm/tcpci_rt1711h.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> index 64f6dd0dc660..88c50b984e8a 100644
> --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> @@ -334,6 +334,11 @@ static int rt1711h_probe(struct i2c_client *client)
>  {
>  	int ret;
>  	struct rt1711h_chip *chip;
> +	const u16 alert_mask = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_DISCARDED |
> +			       TCPC_ALERT_TX_FAILED | TCPC_ALERT_RX_HARD_RST |
> +			       TCPC_ALERT_RX_STATUS | TCPC_ALERT_POWER_STATUS |
> +			       TCPC_ALERT_CC_STATUS | TCPC_ALERT_RX_BUF_OVF |
> +			       TCPC_ALERT_FAULT;
>  
>  	chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
>  	if (!chip)
> @@ -382,6 +387,12 @@ static int rt1711h_probe(struct i2c_client *client)
>  					dev_name(chip->dev), chip);
>  	if (ret < 0)
>  		return ret;
> +
> +	/* Enable alert interrupts */
> +	ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask);
> +	if (ret < 0)
> +		return ret;
> +
>  	enable_irq_wake(client->irq);
>  
>  	return 0;
> -- 
> 2.48.1

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ