• Tony Lindgren's avatar
    usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down · ba9a8d9c
    Tony Lindgren authored
    commit 85601b8d upstream.
    
    Commit 249751f2 ("usb: phy: twl4030-usb: poll for ID disconnect")
    added twl4030_id_workaround_work() to deal with lost interrupts
    after ID pin goes down. Looks like commit f1ddc24c ("usb: phy:
    twl4030-usb: remove *set_suspend* and *phy_init* ops") changed
    things around for the generic phy framework, and delayed work no
    longer got called except initially during boot.
    
    The PHY connect and disconnect interrupts for twl4030-usb are not
    working after disconnecting a USB-A cable from the board, and the
    deeper idle states for omap are blocked as the USB controller
    stays busy.
    
    The issue can be solved by calling delayed work from twl4030_usb_irq()
    when ID pin is down and the PHY is not asleep like we already do
    in twl4030_id_workaround_work().
    
    But as both twl4030_usb_irq() and twl4030_id_workaround_work()
    already do pretty much the same thing, let's call twl4030_usb_irq()
    from twl4030_id_workaround_work() instead of adding some more
    duplicate code. We also must call sysfs_notify() only when we have
    an interrupt and not from the delayed work as notified by
    Grazvydas Ignotas <notasas@gmail.com>.
    
    Fixes: f1ddc24c ("usb: phy: twl4030-usb: remove *set_suspend* and *phy_init* ops")
    Acked-by: default avatarFelipe Balbi <balbi@ti.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ba9a8d9c
phy-twl4030-usb.c 21.2 KB