Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/arch/arm/ti Pull up following revision(s) (requested ...
details: https://anonhg.NetBSD.org/src/rev/7492593e34fc
branches: netbsd-9
changeset: 963929:7492593e34fc
user: martin <martin%NetBSD.org@localhost>
date: Sun Jun 07 16:37:53 2020 +0000
description:
Pull up following revision(s) (requested by jmcneill in ticket #945):
sys/arch/arm/ti/ti_motg.c: revision 1.2
PR# port-evbarm/55263: BeagleBone Black too many interrupts on CPU when
using 5V DC power cable
Handle vbus status change events, and don't busy spin in the hard intr
handler when we see a vbus error (this will always be set when VBUS is not
present).
diffstat:
sys/arch/arm/ti/ti_motg.c | 33 ++++++++-------------------------
1 files changed, 8 insertions(+), 25 deletions(-)
diffs (68 lines):
diff -r d185856c032b -r 7492593e34fc sys/arch/arm/ti/ti_motg.c
--- a/sys/arch/arm/ti/ti_motg.c Sun Jun 07 13:28:02 2020 +0000
+++ b/sys/arch/arm/ti/ti_motg.c Sun Jun 07 16:37:53 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_motg.c,v 1.1.2.2 2019/11/27 13:46:44 martin Exp $ */
+/* $NetBSD: ti_motg.c,v 1.1.2.3 2020/06/07 16:37:53 martin Exp $ */
/*
* Copyright (c) 2013 Manuel Bouyer. All rights reserved.
*
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_motg.c,v 1.1.2.2 2019/11/27 13:46:44 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_motg.c,v 1.1.2.3 2020/06/07 16:37:53 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -187,8 +187,7 @@
{
struct ti_motg_softc *sc = v;
uint32_t stat, stat0, stat1;
- int rv = 0;
- int i;
+ int rv;
MOTGHIST_FUNC(); MOTGHIST_CALLED();
@@ -198,34 +197,18 @@
stat1 = TIOTG_USBC_READ4(sc, USBCTRL_IRQ_STAT1);
DPRINTF("USB %jd 0x%jx 0x%jx stat %jd",
sc->sc_ctrlport, stat0, stat1, stat);
- /* try to deal with vbus errors */
- if (stat1 & MUSB2_MASK_IVBUSERR ) {
- stat1 &= ~MUSB2_MASK_IVBUSERR;
- for (i = 0; i < 1000; i++) {
- TIOTG_USBC_WRITE4(sc, USBCTRL_IRQ_STAT1,
- MUSB2_MASK_IVBUSERR);
- motg_intr_vbus(&sc->sc_motg, stat & 0x1);
- delay(1000);
- stat = TIOTG_USBC_READ4(sc, USBCTRL_STAT);
- if (stat & 0x1)
- break;
- }
- }
+
if (stat0) {
TIOTG_USBC_WRITE4(sc, USBCTRL_IRQ_STAT0, stat0);
}
if (stat1) {
TIOTG_USBC_WRITE4(sc, USBCTRL_IRQ_STAT1, stat1);
}
- if ((stat & 0x1) == 0) {
- mutex_spin_exit(&sc->sc_motg.sc_intr_lock);
- aprint_error_dev(sc->sc_motg.sc_dev, ": vbus error\n");
- return 1;
+ if (stat1 & USBCTRL_IRQ_STAT1_DRVVBUS) {
+ motg_intr_vbus(&sc->sc_motg, stat & 0x1);
}
- if (stat0 != 0 || stat1 != 0) {
- rv = motg_intr(&sc->sc_motg, ((stat0 >> 16) & 0xffff),
- stat0 & 0xffff, stat1 & 0xff);
- }
+ rv = motg_intr(&sc->sc_motg, ((stat0 >> 16) & 0xffff),
+ stat0 & 0xffff, stat1 & 0xff);
mutex_spin_exit(&sc->sc_motg.sc_intr_lock);
return rv;
}
Home |
Main Index |
Thread Index |
Old Index