Commit ec7e0a18 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: hdm-usb: reduce context of list_del mutex

This patch reduces context of the list_del mutex for the function
hdm_enqueue().
Signed-off-by: default avatarAndrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 99d75346
...@@ -663,15 +663,11 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -663,15 +663,11 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
init_completion(&anchor->urb_compl); init_completion(&anchor->urb_compl);
mbo->priv = anchor; mbo->priv = anchor;
spin_lock_irqsave(&mdev->anchor_list_lock[channel], flags);
list_add_tail(&anchor->list, &mdev->anchor_list[channel]);
spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags);
if ((mdev->padding_active[channel]) && if ((mdev->padding_active[channel]) &&
(conf->direction & MOST_CH_TX)) (conf->direction & MOST_CH_TX))
if (hdm_add_padding(mdev, channel, mbo)) { if (hdm_add_padding(mdev, channel, mbo)) {
retval = -EIO; retval = -EIO;
goto _error_1; goto _error;
} }
urb->transfer_dma = mbo->bus_address; urb->transfer_dma = mbo->bus_address;
...@@ -699,6 +695,10 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -699,6 +695,10 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
} }
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
spin_lock_irqsave(&mdev->anchor_list_lock[channel], flags);
list_add_tail(&anchor->list, &mdev->anchor_list[channel]);
spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags);
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(dev, "URB submit failed with error %d.\n", retval); dev_err(dev, "URB submit failed with error %d.\n", retval);
......
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