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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 May 2019 22:18:49 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Angus Ainslie <angus@...ea.ca>
Cc:     angus.ainslie@...i.sm,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Guenter Roeck <groeck7@...il.com>
Subject: Re: [PATCH v2 1/1] usb: typec: tcpci: Clear the fault status register

On 5/7/19 7:49 PM, Angus Ainslie wrote:
> On 2019-05-07 20:03, Guenter Roeck wrote:
>> 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@...ea.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 ?
> 
> Well that I didn't check. But I know this code gets executed so something must be turning it on.
> 
> Also if I don't clear it I get an unlimited number of interrupts.
> 
>> What am I missing here ?
> 
> Can the power on fault be masked ?
> 

There is a TCPC_ALERT_FAULT mask bit, so I would think so.
Can you dump register contents in the irq function and at the end of
tcpci_init() ?

Thanks,
Guenter

> Angus
> 
>>
>> 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);
>>>
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ