public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: heikki.krogerus@linux.intel.com, andre.draszik@linaro.org,
	linux@roeck-us.net, shufan_lee@richtek.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com, pablo.sun@mediatek.com
Subject: Re: [PATCH] usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality
Date: Wed, 19 Feb 2025 12:40:35 +0100	[thread overview]
Message-ID: <2e49e0ca-3542-4b6f-b92f-cd5631b14f97@collabora.com> (raw)
In-Reply-To: <2025021424-uncurious-slicer-b35f@gregkh>

Il 14/02/25 09:10, Greg KH ha scritto:
> On Wed, Feb 12, 2025 at 11:40:40AM +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@collabora.com>
>> ---
>>   drivers/usb/typec/tcpm/tcpci_rt1711h.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
>> index 64f6dd0dc660..c71b213b2441 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)
>> @@ -384,6 +389,11 @@ static int rt1711h_probe(struct i2c_client *client)
>>   		return ret;
>>   	enable_irq_wake(client->irq);
>>   
>> +	/* Enable alert interrupts */
>> +	ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask);
>> +	if (ret < 0)
>> +		return ret;
> 
> If this fails, don't you then need to disable the wake irq you just
> enabled?  If not, why not?
> 

Right, that was naive on my side, I was relying on devm_request_threaded_irq
but then the wakeup interrupt stays there, so that needs to be addressed.

Expect a v2 today.

Cheers,
Angelo

> thanks,
> 
> greg k-h



      reply	other threads:[~2025-02-19 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 10:40 [PATCH] usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality AngeloGioacchino Del Regno
2025-02-12 10:47 ` Greg KH
2025-02-14  8:10 ` Greg KH
2025-02-19 11:40   ` AngeloGioacchino Del Regno [this message]

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=2e49e0ca-3542-4b6f-b92f-cd5631b14f97@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=andre.draszik@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pablo.sun@mediatek.com \
    --cc=shufan_lee@richtek.com \
    /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