From 8e0ff81d6f64554d762a237c75f1673a28480693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Wed, 8 Sep 2010 05:04:48 +0000 Subject: [PATCH] USB AMSv2: only read endpoint interrupt status register once git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28041 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/usb-drv-as3525v2.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c index 5c1a062ede..9741a7b453 100644 --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c @@ -466,9 +466,10 @@ static void handle_ep_int(int ep, bool dir_in) struct usb_endpoint *endpoint = &endpoints[ep][dir_in]; if(dir_in) { - if(DIEPINT(ep) & DIEPINT_ahberr) + unsigned long sts = DIEPINT(ep); + if(sts & DIEPINT_ahberr) panicf("usb-drv: ahb error on EP%d IN", ep); - if(DIEPINT(ep) & DIEPINT_xfercompl) + if(sts & DIEPINT_xfercompl) { if(endpoint->busy) { @@ -487,7 +488,7 @@ static void handle_ep_int(int ep, bool dir_in) wakeup_signal(&endpoint->complete); } } - if(DIEPINT(ep) & DIEPINT_timeout) + if(sts & DIEPINT_timeout) { panicf("usb-drv: timeout on EP%d IN", ep); if(endpoint->busy) @@ -501,13 +502,14 @@ static void handle_ep_int(int ep, bool dir_in) } } /* clear interrupts */ - DIEPINT(ep) = DIEPINT(ep); + DIEPINT(ep) = sts; } else { - if(DOEPINT(ep) & DOEPINT_ahberr) + unsigned long sts = DOEPINT(ep); + if(sts & DOEPINT_ahberr) panicf("usb-drv: ahb error on EP%d OUT", ep); - if(DOEPINT(ep) & DOEPINT_xfercompl) + if(sts & DOEPINT_xfercompl) { logf("usb-drv: xfer complete on EP%d OUT", ep); if(endpoint->busy) @@ -527,7 +529,7 @@ static void handle_ep_int(int ep, bool dir_in) wakeup_signal(&endpoint->complete); } } - if(DOEPINT(ep) & DOEPINT_setup) + if(sts & DOEPINT_setup) { logf("usb-drv: setup on EP%d OUT", ep); if(ep != 0) @@ -553,7 +555,7 @@ static void handle_ep_int(int ep, bool dir_in) } } /* clear interrupts */ - DOEPINT(ep) = DOEPINT(ep); + DOEPINT(ep) = sts; } }