summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-08-19 05:19:10 +0200
committercinap_lenrek <cinap_lenrek@localhost>2011-08-19 05:19:10 +0200
commit79a044e38e5a9bca0ae3c7692f568162670dcdd3 (patch)
tree932c6a4645eae106b1f3c49fb14f1ddbee2ca91c
parent0c1284f602699f3e2e9d6f6136452cc92fea7e27 (diff)
downloadplan9front-79a044e38e5a9bca0ae3c7692f568162670dcdd3.tar.xz
usb: fix potential uninterruptable calls
-rw-r--r--sys/src/9/pc/usbohci.c12
-rw-r--r--sys/src/9/pc/usbuhci.c14
-rw-r--r--sys/src/9/port/usbehci.c16
3 files changed, 21 insertions, 21 deletions
diff --git a/sys/src/9/pc/usbohci.c b/sys/src/9/pc/usbohci.c
index 003a5e7ee..f3d0e0068 100644
--- a/sys/src/9/pc/usbohci.c
+++ b/sys/src/9/pc/usbohci.c
@@ -1474,7 +1474,7 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
print("\t%s\n", buf);
}
if(mustlock){
- qlock(io);
+ eqlock(io);
if(waserror()){
qunlock(io);
nexterror();
@@ -1614,7 +1614,7 @@ epread(Ep *ep, void *a, long count)
switch(ep->ttype){
case Tctl:
cio = ep->aux;
- qlock(cio);
+ eqlock(cio);
if(waserror()){
qunlock(cio);
nexterror();
@@ -1687,7 +1687,7 @@ epctlio(Ep *ep, Ctlio *cio, void *a, long count)
cio, ep->dev->nb, ep->nb, count);
if(count < Rsetuplen)
error("short usb command");
- qlock(cio);
+ eqlock(cio);
free(cio->data);
cio->data = nil;
cio->ndata = 0;
@@ -1795,7 +1795,7 @@ episowrite(Ep *ep, void *a, long count)
iso->delay = (ep->sampledelay*ep->samplesz + ep->maxpkt-1) / ep->maxpkt;
iso->debug = ep->debug;
- qlock(iso);
+ eqlock(iso);
if(waserror()){
qunlock(iso);
nexterror();
@@ -2186,7 +2186,7 @@ portreset(Hci *hp, int port, int on)
return 0;
ctlr = hp->aux;
- qlock(&ctlr->resetl);
+ eqlock(&ctlr->resetl);
if(waserror()){
qunlock(&ctlr->resetl);
nexterror();
@@ -2218,7 +2218,7 @@ portenable(Hci *hp, int port, int on)
ctlr = hp->aux;
dprint("ohci: %#p port %d enable=%d\n", ctlr->ohci, port, on);
- qlock(&ctlr->resetl);
+ eqlock(&ctlr->resetl);
if(waserror()){
qunlock(&ctlr->resetl);
nexterror();
diff --git a/sys/src/9/pc/usbuhci.c b/sys/src/9/pc/usbuhci.c
index d5a107a68..3b3af719f 100644
--- a/sys/src/9/pc/usbuhci.c
+++ b/sys/src/9/pc/usbuhci.c
@@ -1031,7 +1031,7 @@ episowrite(Ep *ep, Isoio *iso, void *a, long count)
diprint("uhci: episowrite: %#p ep%d.%d\n", iso, ep->dev->nb, ep->nb);
ctlr = ep->hp->aux;
- qlock(iso);
+ eqlock(iso);
if(waserror()){
qunlock(iso);
nexterror();
@@ -1104,7 +1104,7 @@ episoread(Ep *ep, Isoio *iso, void *a, int count)
b = a;
ctlr = ep->hp->aux;
- qlock(iso);
+ eqlock(iso);
if(waserror()){
qunlock(iso);
nexterror();
@@ -1303,7 +1303,7 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
print("uchi epio: user data: %s\n", buf);
}
if(mustlock){
- qlock(io);
+ eqlock(io);
if(waserror()){
qunlock(io);
nexterror();
@@ -1442,7 +1442,7 @@ epread(Ep *ep, void *a, long count)
switch(ep->ttype){
case Tctl:
cio = ep->aux;
- qlock(cio);
+ eqlock(cio);
if(waserror()){
qunlock(cio);
nexterror();
@@ -1515,7 +1515,7 @@ epctlio(Ep *ep, Ctlio *cio, void *a, long count)
cio, ep->dev->nb, ep->nb, count);
if(count < Rsetuplen)
error("short usb comand");
- qlock(cio);
+ eqlock(cio);
free(cio->data);
cio->data = nil;
cio->ndata = 0;
@@ -2001,7 +2001,7 @@ portenable(Hci *hp, int port, int on)
ctlr = hp->aux;
dprint("uhci: %#x port %d enable=%d\n", ctlr->port, port, on);
ioport = PORT(port-1);
- qlock(&ctlr->portlck);
+ eqlock(&ctlr->portlck);
if(waserror()){
qunlock(&ctlr->portlck);
nexterror();
@@ -2058,7 +2058,7 @@ portstatus(Hci *hp, int port)
ctlr = hp->aux;
ioport = PORT(port-1);
- qlock(&ctlr->portlck);
+ eqlock(&ctlr->portlck);
if(waserror()){
iunlock(ctlr);
qunlock(&ctlr->portlck);
diff --git a/sys/src/9/port/usbehci.c b/sys/src/9/port/usbehci.c
index 56aae9371..1f0b77488 100644
--- a/sys/src/9/port/usbehci.c
+++ b/sys/src/9/port/usbehci.c
@@ -1611,7 +1611,7 @@ portenable(Hci *hp, int port, int on)
ctlr = hp->aux;
opio = ctlr->opio;
s = opio->portsc[port-1];
- qlock(&ctlr->portlck);
+ eqlock(&ctlr->portlck);
if(waserror()){
qunlock(&ctlr->portlck);
nexterror();
@@ -1672,7 +1672,7 @@ portreset(Hci *hp, int port, int on)
ctlr = hp->aux;
opio = ctlr->opio;
- qlock(&ctlr->portlck);
+ eqlock(&ctlr->portlck);
if(waserror()){
iunlock(ctlr);
qunlock(&ctlr->portlck);
@@ -1717,7 +1717,7 @@ portstatus(Hci *hp, int port)
ctlr = hp->aux;
opio = ctlr->opio;
- qlock(&ctlr->portlck);
+ eqlock(&ctlr->portlck);
if(waserror()){
iunlock(ctlr);
qunlock(&ctlr->portlck);
@@ -1936,7 +1936,7 @@ episoread(Ep *ep, Isoio *iso, void *a, long count)
b = a;
ctlr = ep->hp->aux;
- qlock(iso);
+ eqlock(iso);
if(waserror()){
qunlock(iso);
nexterror();
@@ -2039,7 +2039,7 @@ episowrite(Ep *ep, Isoio *iso, void *a, long count)
diprint("ehci: episowrite: %#p ep%d.%d\n", iso, ep->dev->nb, ep->nb);
ctlr = ep->hp->aux;
- qlock(iso);
+ eqlock(iso);
if(waserror()){
qunlock(iso);
nexterror();
@@ -2333,7 +2333,7 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
print("echi epio: user data: %s\n", buf);
}
if(mustlock){
- qlock(io);
+ eqlock(io);
if(waserror()){
qunlock(io);
nexterror();
@@ -2459,7 +2459,7 @@ epread(Ep *ep, void *a, long count)
switch(ep->ttype){
case Tctl:
cio = ep->aux;
- qlock(cio);
+ eqlock(cio);
if(waserror()){
qunlock(cio);
nexterror();
@@ -2530,7 +2530,7 @@ epctlio(Ep *ep, Ctlio *cio, void *a, long count)
cio, ep->dev->nb, ep->nb, count);
if(count < Rsetuplen)
error("short usb comand");
- qlock(cio);
+ eqlock(cio);
free(cio->data);
cio->data = nil;
cio->ndata = 0;