From: Guenter Roeck <linux@roeck-us.net>
To: "Angus Ainslie (Purism)" <angus@akkea.ca>, angus.ainslie@puri.sm
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] usb: typec: tcpci: Clear the fault status register
Date: Tue, 7 May 2019 19:03:33 -0700 [thread overview]
Message-ID: <aed487a4-3f7c-55e8-9c84-feaa1c7f583d@roeck-us.net> (raw)
In-Reply-To: <20190508002749.14816-2-angus@akkea.ca>
On 5/7/19 5:27 PM, Angus Ainslie (Purism) wrote:
> If the fault status register doesn't get cleared then
> the ptn5110 interrupt gets stuck on. As the fault register gets
> set everytime the ptn5110 powers on the interrupt is always stuck.
>
> Fixes: fault status register stuck
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> ---
> drivers/usb/typec/tcpm/tcpci.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index c1f7073a56de..a5746657b190 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -463,6 +463,17 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
> else if (status & TCPC_ALERT_TX_FAILED)
> tcpm_pd_transmit_complete(tcpci->port, TCPC_TX_FAILED);
>
> + if (status & TCPC_ALERT_FAULT) {
Wait - the driver doesn't set TCPC_ALERT_FAULT in the alert mask
register. How can the chip report it if fault alerts are not enabled ?
What am I missing here ?
Thanks,
Guenter
> + u16 fault_status;
> +
> + tcpci_read16(tcpci, TCPC_FAULT_STATUS, &fault_status);
> +
> + dev_warn(tcpci->dev, "FAULT ALERT status 0x%x\n", fault_status);
> +
> + /* clear the fault status */
> + tcpci_write16(tcpci, TCPC_FAULT_STATUS, fault_status);
> + }
> +
> return IRQ_HANDLED;
> }
> EXPORT_SYMBOL_GPL(tcpci_irq);
>
next prev parent reply other threads:[~2019-05-08 2:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 0:27 [PATCH v2 0/1] usb: typec: tcpm: Add some FAULT_STATUS processing Angus Ainslie (Purism)
2019-05-08 0:27 ` [PATCH v2 1/1] usb: typec: tcpci: Clear the fault status register Angus Ainslie (Purism)
2019-05-08 0:49 ` Guenter Roeck
2019-05-08 6:37 ` Greg Kroah-Hartman
2019-05-08 2:03 ` Guenter Roeck [this message]
2019-05-08 2:49 ` Angus Ainslie
2019-05-08 5:18 ` Guenter Roeck
2019-05-08 13:48 ` Angus Ainslie
2019-05-08 16:22 ` Guenter Roeck
2019-05-08 16:33 ` Angus Ainslie
2019-05-08 16:51 ` Guenter Roeck
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=aed487a4-3f7c-55e8-9c84-feaa1c7f583d@roeck-us.net \
--to=linux@roeck-us.net \
--cc=angus.ainslie@puri.sm \
--cc=angus@akkea.ca \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.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
all inboxes | Powered by JetHome®