aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/usb/siano
diff options
context:
space:
mode:
authorTomoki Sekiyama <tomoki.sekiyama@gmail.com>2018-03-03 13:20:56 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-06 12:46:15 -0500
commit564246fd3ff41afd3234c18ae28bc4ad9d815f79 (patch)
tree7fc6c410d790ccec8d1e0d29462d27c2ff714207 /drivers/media/usb/siano
parentmedia: doc: poll: fix links to dual-ioctl sections (diff)
downloadwireguard-linux-564246fd3ff41afd3234c18ae28bc4ad9d815f79.tar.xz
wireguard-linux-564246fd3ff41afd3234c18ae28bc4ad9d815f79.zip
media: siano: Fix coherent memory allocation failure on arm64
On some architectures such as arm64, siano chip based TV-tuner USB devices are not recognized correctly due to coherent memory allocation failure with the following error: [ 663.556135] usbcore: deregistering interface driver smsusb [ 683.624809] smsusb:smsusb_probe: board id=18, interface number 0 [ 683.633530] smsusb:smsusb_init_device: smscore_register_device(...) failed, rc -12 [ 683.641501] smsusb:smsusb_probe: Device initialized with return code -12 [ 683.652978] smsusb: probe of 1-1:1.0 failed with error -12 This is caused by dma_alloc_coherent(NULL, ...) returning NULL in smscoreapi.c. To fix this error, allocate the buffer memory for the USB devices via kmalloc() and let the USB core do the DMA mapping and free. Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/siano')
-rw-r--r--drivers/media/usb/siano/smsusb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index f13e4b01b5a5..6d436e9e454f 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -179,8 +179,7 @@ static int smsusb_submit_urb(struct smsusb_device_t *dev,
smsusb_onresponse,
surb
);
- surb->urb.transfer_dma = surb->cb->phys;
- surb->urb.transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+ surb->urb.transfer_flags |= URB_FREE_BUFFER;
return usb_submit_urb(&surb->urb, GFP_ATOMIC);
}
@@ -446,6 +445,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
dev->in_ep, dev->out_ep);
params.device = &dev->udev->dev;
+ params.usb_device = dev->udev;
params.buffer_size = dev->buffer_size;
params.num_buffers = MAX_BUFFERS;
params.sendrequest_handler = smsusb_sendrequest;