audio/hda: ignore replies with invalid codec number
parent
2f1a0685ea
commit
b3ad2a853a
|
@ -441,7 +441,7 @@ hdacmd(Ctlr *ctlr, uint request, uint reply[2])
|
||||||
if(csr16(ctlr, Rirbwp) != re){
|
if(csr16(ctlr, Rirbwp) != re){
|
||||||
re = (re + 1) % ctlr->rirbsize;
|
re = (re + 1) % ctlr->rirbsize;
|
||||||
memmove(reply, &ctlr->rirb[re*2], 8);
|
memmove(reply, &ctlr->rirb[re*2], 8);
|
||||||
return 8;
|
return 1;
|
||||||
}
|
}
|
||||||
microdelay(1);
|
microdelay(1);
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,9 @@ cmderr(Id id, uint verb, uint par, uint *ret)
|
||||||
q |= (verb << 8) | par;
|
q |= (verb << 8) | par;
|
||||||
else
|
else
|
||||||
q |= (verb << 16) | par;
|
q |= (verb << 16) | par;
|
||||||
if(hdacmd(id.ctlr, q, w) != 8)
|
if(hdacmd(id.ctlr, q, w) != 1)
|
||||||
|
return -1;
|
||||||
|
if(w[1] != id.codec)
|
||||||
return -1;
|
return -1;
|
||||||
*ret = w[0];
|
*ret = w[0];
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1299,7 +1301,7 @@ hdacmdwrite(Chan *, void *a, long n, vlong)
|
||||||
lp = a;
|
lp = a;
|
||||||
qlock(ctlr);
|
qlock(ctlr);
|
||||||
for(i=0; i<n/4; i++){
|
for(i=0; i<n/4; i++){
|
||||||
if(hdacmd(ctlr, lp[i], w) < 0){
|
if(hdacmd(ctlr, lp[i], w) <= 0){
|
||||||
w[0] = 0;
|
w[0] = 0;
|
||||||
w[1] = ~0;
|
w[1] = ~0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue