aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2012-01-26 10:04:11 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-26 14:04:29 -0500
commit8791d63af0cf113725ae4cb8cba9492814c59a93 (patch)
tree122d61acd7256de93ffa1baf284936ef8d86e12d
parentc79eba92406acc4898adcd1689fc21a6aa91ed0b (diff)
[media] imon: don't wedge hardware after early callbacks
This patch is just a minor update to one titled "imon: Input from ffdc device type ignored" from Corinna Vinschen. An earlier patch to prevent an oops when we got early callbacks also has the nasty side-effect of wedging imon hardware, as we don't acknowledge the urb. Rework the check slightly here to bypass processing the packet, as the driver isn't yet fully initialized, but still acknowlege the urb and submit a new rx_urb. Do this for both interfaces -- irrelevant for ffdc hardware, but relevant for newer hardware, though newer hardware doesn't spew the constant stream of data as soon as the hardware is initialized like the older ffdc devices, so they'd be less likely to trigger this anyway... Tested with both an ffdc device and an 0042 device. Reported-by: Corinna Vinschen <vinschen@redhat.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> CC: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/rc/imon.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 6ed96465137a..3f175ebe2766 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -47,7 +47,7 @@
47#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" 47#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
48#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" 48#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
49#define MOD_NAME "imon" 49#define MOD_NAME "imon"
50#define MOD_VERSION "0.9.3" 50#define MOD_VERSION "0.9.4"
51 51
52#define DISPLAY_MINOR_BASE 144 52#define DISPLAY_MINOR_BASE 144
53#define DEVICE_NAME "lcd%d" 53#define DEVICE_NAME "lcd%d"
@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb)
1658 return; 1658 return;
1659 1659
1660 ictx = (struct imon_context *)urb->context; 1660 ictx = (struct imon_context *)urb->context;
1661 if (!ictx || !ictx->dev_present_intf0) 1661 if (!ictx)
1662 return; 1662 return;
1663 1663
1664 /*
1665 * if we get a callback before we're done configuring the hardware, we
1666 * can't yet process the data, as there's nowhere to send it, but we
1667 * still need to submit a new rx URB to avoid wedging the hardware
1668 */
1669 if (!ictx->dev_present_intf0)
1670 goto out;
1671
1664 switch (urb->status) { 1672 switch (urb->status) {
1665 case -ENOENT: /* usbcore unlink successful! */ 1673 case -ENOENT: /* usbcore unlink successful! */
1666 return; 1674 return;
@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
1678 break; 1686 break;
1679 } 1687 }
1680 1688
1689out:
1681 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); 1690 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
1682} 1691}
1683 1692
@@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb)
1690 return; 1699 return;
1691 1700
1692 ictx = (struct imon_context *)urb->context; 1701 ictx = (struct imon_context *)urb->context;
1693 if (!ictx || !ictx->dev_present_intf1) 1702 if (!ictx)
1694 return; 1703 return;
1695 1704
1705 /*
1706 * if we get a callback before we're done configuring the hardware, we
1707 * can't yet process the data, as there's nowhere to send it, but we
1708 * still need to submit a new rx URB to avoid wedging the hardware
1709 */
1710 if (!ictx->dev_present_intf1)
1711 goto out;
1712
1696 switch (urb->status) { 1713 switch (urb->status) {
1697 case -ENOENT: /* usbcore unlink successful! */ 1714 case -ENOENT: /* usbcore unlink successful! */
1698 return; 1715 return;
@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
1710 break; 1727 break;
1711 } 1728 }
1712 1729
1730out:
1713 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); 1731 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
1714} 1732}
1715 1733
@@ -2242,7 +2260,7 @@ find_endpoint_failed:
2242 mutex_unlock(&ictx->lock); 2260 mutex_unlock(&ictx->lock);
2243 usb_free_urb(rx_urb); 2261 usb_free_urb(rx_urb);
2244rx_urb_alloc_failed: 2262rx_urb_alloc_failed:
2245 dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret); 2263 dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);
2246 2264
2247 return NULL; 2265 return NULL;
2248} 2266}