staging: most: hdm-usb: make use of is_channel_healthy flag
This patch makes the write completion handler use the is_channel_healthy flag to prevent the hdm from scheduling a second clear_halt workqueue in case an endpoint reported a STALL condition. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
654f7ec4b3
commit
879c93fefd
|
@ -418,6 +418,7 @@ static void hdm_write_completion(struct urb *urb)
|
||||||
case -EPIPE:
|
case -EPIPE:
|
||||||
dev_warn(dev, "Broken OUT pipe detected\n");
|
dev_warn(dev, "Broken OUT pipe detected\n");
|
||||||
most_stop_enqueue(&mdev->iface, channel);
|
most_stop_enqueue(&mdev->iface, channel);
|
||||||
|
mdev->is_channel_healthy[channel] = false;
|
||||||
mbo->status = MBO_E_INVAL;
|
mbo->status = MBO_E_INVAL;
|
||||||
mdev->clear_work[channel].pipe = urb->pipe;
|
mdev->clear_work[channel].pipe = urb->pipe;
|
||||||
schedule_work(&mdev->clear_work[channel].ws);
|
schedule_work(&mdev->clear_work[channel].ws);
|
||||||
|
@ -582,6 +583,7 @@ static void hdm_read_completion(struct urb *urb)
|
||||||
case -EPIPE:
|
case -EPIPE:
|
||||||
dev_warn(dev, "Broken IN pipe detected\n");
|
dev_warn(dev, "Broken IN pipe detected\n");
|
||||||
most_stop_enqueue(&mdev->iface, channel);
|
most_stop_enqueue(&mdev->iface, channel);
|
||||||
|
mdev->is_channel_healthy[channel] = false;
|
||||||
mbo->status = MBO_E_INVAL;
|
mbo->status = MBO_E_INVAL;
|
||||||
mdev->clear_work[channel].pipe = urb->pipe;
|
mdev->clear_work[channel].pipe = urb->pipe;
|
||||||
schedule_work(&mdev->clear_work[channel].ws);
|
schedule_work(&mdev->clear_work[channel].ws);
|
||||||
|
@ -938,6 +940,7 @@ static void wq_clear_halt(struct work_struct *wq_obj)
|
||||||
if (usb_clear_halt(mdev->usb_device, pipe))
|
if (usb_clear_halt(mdev->usb_device, pipe))
|
||||||
dev_warn(&mdev->usb_device->dev, "Failed to reset endpoint.\n");
|
dev_warn(&mdev->usb_device->dev, "Failed to reset endpoint.\n");
|
||||||
|
|
||||||
|
mdev->is_channel_healthy[channel] = true;
|
||||||
most_resume_enqueue(&mdev->iface, channel);
|
most_resume_enqueue(&mdev->iface, channel);
|
||||||
mutex_unlock(&mdev->io_mutex);
|
mutex_unlock(&mdev->io_mutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue