Commit 872d65f6 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'fix/misc' into for-linus

parents d336905e b68b58fd
...@@ -863,7 +863,6 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci) ...@@ -863,7 +863,6 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci)
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
int ret; int ret;
writel(0, aaci->base + AC97_POWERDOWN);
/* /*
* Assert AACIRESET for 2us * Assert AACIRESET for 2us
*/ */
...@@ -1047,7 +1046,11 @@ static int __devinit aaci_probe(struct amba_device *dev, struct amba_id *id) ...@@ -1047,7 +1046,11 @@ static int __devinit aaci_probe(struct amba_device *dev, struct amba_id *id)
writel(0x1fff, aaci->base + AACI_INTCLR); writel(0x1fff, aaci->base + AACI_INTCLR);
writel(aaci->maincr, aaci->base + AACI_MAINCR); writel(aaci->maincr, aaci->base + AACI_MAINCR);
/*
* Fix: ac97 read back fail errors by reading
* from any arbitrary aaci register.
*/
readl(aaci->base + AACI_CSCH1);
ret = aaci_probe_ac97(aaci); ret = aaci_probe_ac97(aaci);
if (ret) if (ret)
goto out; goto out;
......
...@@ -986,6 +986,8 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream) ...@@ -986,6 +986,8 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream)
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
long timeout = msecs_to_jiffies(50); long timeout = msecs_to_jiffies(50);
if (ep->umidi->disconnected)
return;
/* /*
* The substream buffer is empty, but some data might still be in the * The substream buffer is empty, but some data might still be in the
* currently active URBs, so we have to wait for those to complete. * currently active URBs, so we have to wait for those to complete.
...@@ -1123,14 +1125,21 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi, ...@@ -1123,14 +1125,21 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
* Frees an output endpoint. * Frees an output endpoint.
* May be called when ep hasn't been initialized completely. * May be called when ep hasn't been initialized completely.
*/ */
static void snd_usbmidi_out_endpoint_delete(struct snd_usb_midi_out_endpoint* ep) static void snd_usbmidi_out_endpoint_clear(struct snd_usb_midi_out_endpoint *ep)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < OUTPUT_URBS; ++i) for (i = 0; i < OUTPUT_URBS; ++i)
if (ep->urbs[i].urb) if (ep->urbs[i].urb) {
free_urb_and_buffer(ep->umidi, ep->urbs[i].urb, free_urb_and_buffer(ep->umidi, ep->urbs[i].urb,
ep->max_transfer); ep->max_transfer);
ep->urbs[i].urb = NULL;
}
}
static void snd_usbmidi_out_endpoint_delete(struct snd_usb_midi_out_endpoint *ep)
{
snd_usbmidi_out_endpoint_clear(ep);
kfree(ep); kfree(ep);
} }
...@@ -1262,15 +1271,18 @@ void snd_usbmidi_disconnect(struct list_head* p) ...@@ -1262,15 +1271,18 @@ void snd_usbmidi_disconnect(struct list_head* p)
usb_kill_urb(ep->out->urbs[j].urb); usb_kill_urb(ep->out->urbs[j].urb);
if (umidi->usb_protocol_ops->finish_out_endpoint) if (umidi->usb_protocol_ops->finish_out_endpoint)
umidi->usb_protocol_ops->finish_out_endpoint(ep->out); umidi->usb_protocol_ops->finish_out_endpoint(ep->out);
ep->out->active_urbs = 0;
if (ep->out->drain_urbs) {
ep->out->drain_urbs = 0;
wake_up(&ep->out->drain_wait);
}
} }
if (ep->in) if (ep->in)
for (j = 0; j < INPUT_URBS; ++j) for (j = 0; j < INPUT_URBS; ++j)
usb_kill_urb(ep->in->urbs[j]); usb_kill_urb(ep->in->urbs[j]);
/* free endpoints here; later call can result in Oops */ /* free endpoints here; later call can result in Oops */
if (ep->out) { if (ep->out)
snd_usbmidi_out_endpoint_delete(ep->out); snd_usbmidi_out_endpoint_clear(ep->out);
ep->out = NULL;
}
if (ep->in) { if (ep->in) {
snd_usbmidi_in_endpoint_delete(ep->in); snd_usbmidi_in_endpoint_delete(ep->in);
ep->in = NULL; ep->in = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment