media: Cleanup in_interrupt() usage
cover media: Cleanup in_interrupt() usage
Folks,
in the discussion about preempt count consistency accross kernel configurations:
https://lore.kernel.org/r/[email protected]/
it was concluded that the usage of in_interrupt() and related context checks should be removed from non-core code.
The media subsystem has a few instances of in_interrupt() usage:
1) BUG_ON(in_interrupt()
BUG_ON() is considered the last resort and the usage there is clearly not in that category. It could be replaced by a lockdep_assert_preemption_enabled(), but all these usage sites invoke core functionality which will catch incorrect context already. So adding more there is not really useful
2) Comments and printk()'s
The comment is misleading and the checks in the printk()'s are pointless as the code can never be called from in_interrupt() as it contains GFP_KERNEL allocations.
I'm collecting related cleanups all over the tree, but feel free to route them through the media tree as they have no dependencies. Let me know which route you prefer.
Thanks,
tglx
--- common/saa7146/saa7146_fops.c | 2 -- pci/bt8xx/bttv-risc.c | 1 - pci/cx23885/cx23885-core.c | 1 - pci/cx25821/cx25821-core.c | 1 - platform/fsl-viu.c | 2 -- platform/omap3isp/ispccdc.c | 5 ++--- usb/au0828/au0828-video.c | 5 ++--- usb/cx231xx/cx231xx-core.c | 10 ++++------ usb/cx231xx/cx231xx-vbi.c | 3 +-- usb/tm6000/tm6000-video.c | 2 -- usb/zr364xx/zr364xx.c | 2 -- 11 files changed, 9 insertions(+), 25 deletions(-)
PATCH 1/4 media: Bulk remove BUG_ON(in_interrupt())
None of these BUG_ON()'s is justified. BUG_ON() should only be used when there is really no way to survive.
If at all these could be replaced by lockdep_assert_preemption_enabled() to cover all invalid caller context and not just those covered by in_interrupt().
But all functions which are invoked from those places contain already debug mechanisms to catch wrong context, so having these extra checks is not having any advantage.
drivers/media/common/saa7146/saa7146_fops.c +0 -2
@@ -55,8 +55,6 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q,struct videobuf_dmabuf *dma=videobuf_to_dma (&buf->vb);DEB_EE ("dev:%p, buf:%p\n" , dev, buf); -BUG_ON (in_interrupt ()); -videobuf_waiton (q, &buf->vb,0 ,0 );videobuf_dma_unmap (q->dev, dma);videobuf_dma_free (dma);
drivers/media/pci/bt8xx/bttv-risc.c +0 -1
@@ -572,7 +572,6 @@ bttv_dma_free(struct videobuf_queue *q,struct bttv *btv, struct bttv_buffer *buf {struct videobuf_dmabuf *dma=videobuf_to_dma (&buf->vb); -BUG_ON (in_interrupt ());videobuf_waiton (q, &buf->vb,0 ,0 );videobuf_dma_unmap (q->dev, dma);videobuf_dma_free (dma);
drivers/media/pci/cx23885/cx23885-core.c +0 -1
@@ -1322,7 +1322,6 @@ void cx23885_free_buffer(struct cx23885_dev *dev, struct cx23885_buffer *buf) {struct cx23885_riscmem *risc = &buf->risc; -BUG_ON (in_interrupt ());pci_free_consistent (dev->pci, risc->size, risc->cpu, risc->dma); }
drivers/media/pci/cx25821/cx25821-core.c +0 -1
@@ -1198,7 +1198,6 @@ EXPORT_SYMBOL(cx25821_risc_databuffer_audio);void cx25821_free_buffer (struct cx25821_dev *dev,struct cx25821_buffer *buf) { -BUG_ON (in_interrupt ());if (WARN_ON (buf->risc.size ==0 ))return ; pci_free_consistent(dev->pci,
drivers/media/platform/fsl-viu.c +0 -2
@@ -381,8 +381,6 @@ static void free_buffer(struct videobuf_queue *vq, struct viu_buf *buf)struct videobuf_buffer *vb = &buf->vb;void *vaddr =NULL ; -BUG_ON (in_interrupt ()); -videobuf_waiton (vq, &buf->vb,0 ,0 );if (vq->int_ops && vq->int_ops->vaddr)
drivers/media/usb/tm6000/tm6000-video.c +0 -2
@@ -692,8 +692,6 @@ static void free_buffer(struct videobuf_queue *vq, struct tm6000_buffer *buf)struct tm6000_core *dev = fh->dev;unsigned long flags; -BUG_ON (in_interrupt ()); -/* We used to wait for the buffer to finish here, but this didn't work because, as we were keeping the state as VIDEOBUF_QUEUED, videobuf_queue_cancel marked it as finished for us.
drivers/media/usb/zr364xx/zr364xx.c +0 -2
@@ -357,8 +357,6 @@ static void free_buffer(struct videobuf_queue *vq, struct zr364xx_buffer *buf) {_DBG ("%s\n" , __func__); -BUG_ON (in_interrupt ()); -videobuf_vmalloc_free (&buf->vb); buf->vb.state =VIDEOBUF_NEEDS_INIT ; }
PATCH 2/4 media: omap3isp: Remove misleading comment
In reply to Thomas Gleixnerin_interrupt() covers hard and soft interrupt servicing and bottom half disabled contexts, which is semantically ill defined.
The comment for __ccdc_lsc_configure() "Context: in_interrupt()" is therefore as useful as "Context: unknown'. Remove it.
--- drivers/media/platform/omap3isp/ispccdc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/platform/omap3isp/ispccdc.c +2 -3
@@ -299,11 +299,10 @@ static int ccdc_lsc_busy(struct isp_ccdcISPCCDC_LSC_BUSY ; } -/* __ccdc_lsc_configure - Apply a new configuration to the LSC engine +/* +* __ccdc_lsc_configure - Apply a new configuration to the LSC engine * @ccdc: Pointer to ISP CCDC device * @req: New configuration request -* -* context: in_interrupt() */ static int __ccdc_lsc_configure (struct isp_ccdc_device *ccdc,struct ispccdc_lsc_config_req *req)
Re: [patch 2/4] media: omap3isp: Remove misleading comment
Hi Thomas,
Thank you for the patch.
Quoted 10 lines · Thomas Gleixner
in_interrupt()covers hard and soft interrupt servicing and bottom half disabled contexts, which is semantically ill defined.The comment for
__ccdc_lsc_configure()"Context:in_interrupt()" is therefore as useful as "Context: unknown'. Remove it.Signed-off-by Thomas Gleixner <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Laurent Pinchart <[email protected]>
Quoted 21 lines
--- drivers/media/platform/omap3isp/ispccdc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/media/platform/omap3isp/ispccdc.c +2
-3@@ -299,11 +299,10 @@ static int ccdc_lsc_busy(struct isp_ccdcISPCCDC_LSC_BUSY ; } -/* __ccdc_lsc_configure - Apply a new configuration to the LSC engine +/* +* __ccdc_lsc_configure - Apply a new configuration to the LSC engine * @ccdc: Pointer to ISP CCDC device * @req: New configuration request -* -* context: in_interrupt() */ static int __ccdc_lsc_configure (struct isp_ccdc_device *ccdc,struct ispccdc_lsc_config_req *req)
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 3/4 media: au0828: Consolidate dmesg output
In reply to Thomas GleixnerThe memory allocations in au0828_init_isoc() happen all in task context with GFP_KERNEL. Therefore a printk() trying to deduce whether this is called from task or interrupt context is pretty useless.
Convert it to au0828_isocdbg() as the other one in that function and for completeness sake add one for the URB allocation as well.
--- drivers/media/usb/au0828/au0828-video.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/usb/au0828/au0828-video.c +2 -3
@@ -231,6 +231,7 @@ static int au0828_init_isoc(struct au082for (i =0 ; i < dev->isoc_ctl.num_bufs; i++) { urb =usb_alloc_urb (max_packets,GFP_KERNEL );if (!urb) { +au0828_isocdbg ("cannot allocate URB\n" );au0828_uninit_isoc (dev);return -ENOMEM ; }
@@ -239,9 +240,7 @@ static int au0828_init_isoc(struct au082 dev->isoc_ctl.transfer_buffer[i] =usb_alloc_coherent (dev->usbdev, sb_size,GFP_KERNEL , &urb->transfer_dma);if (!dev->isoc_ctl.transfer_buffer[i]) { -printk ("unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +au0828_isocdbg ("cannot allocate transfer buffer\n" );au0828_uninit_isoc (dev);return -ENOMEM ; }
PATCH 4/4 media: cx231xx: Consolidate dmesg output
In reply to Thomas GleixnerThe memory allocations in cx231xx_init_*() happen all in task context with GFP_KERNEL. Therefore a dev_err() trying to deduce whether this is called from task or interrupt context is pretty useless.
Remove these historical leftovers.
--- drivers/media/usb/cx231xx/cx231xx-core.c | 10 ++++------ drivers/media/usb/cx231xx/cx231xx-vbi.c | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/media/usb/cx231xx/cx231xx-core.c +4 -6
@@ -1061,9 +1061,8 @@ int cx231xx_init_isoc(struct cx231xx *de &urb->transfer_dma);if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {dev_err (dev->dev, -"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +"unable to allocate %i bytes for transfer buffer %i\n" , + sb_size, i);cx231xx_uninit_isoc (dev);return -ENOMEM ; }
@@ -1197,9 +1196,8 @@ int cx231xx_init_bulk(struct cx231xx *de &urb->transfer_dma);if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {dev_err (dev->dev, -"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +"unable to allocate %i bytes for transfer buffer %i\n" , + sb_size, i);cx231xx_uninit_bulk (dev);return -ENOMEM ; }
drivers/media/usb/cx231xx/cx231xx-vbi.c +1 -2
@@ -409,8 +409,7 @@ int cx231xx_init_vbi_isoc(struct cx231xxif (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {dev_err (dev->dev,"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); + sb_size, i);cx231xx_uninit_vbi_isoc (dev);return -ENOMEM ; }
kernel test robot
build botRe: [patch 4/4] media: cx231xx: Consolidate dmesg output
I love your patch! Perhaps something to improve:
Hi Thomas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on linus/master linux/master v5.9 next-20201013] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/media-Cleanup-in_interrupt-usage/20201013-224011 base: git://linuxtv.org/media_tree.git master config: microblaze-randconfig-r004-20201014 (attached as .config) compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/703daca167ddea5ab71b9547b549c1c1499f2bf4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Gleixner/media-Cleanup-in_interrupt-usage/20201013-224011 git checkout 703daca167ddea5ab71b9547b549c1c1499f2bf4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/media/usb/cx231xx/cx231xx.h:16,
from drivers/media/usb/cx231xx/cx231xx-vbi.c:10:
drivers/media/usb/cx231xx/cx231xx-vbi.c: In function 'cx231xx_init_vbi_isoc':
>> drivers/media/usb/cx231xx/cx231xx-vbi.c:411:5: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
411 | "unable to allocate %i bytes for transfer buffer %i%s\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/media/usb/cx231xx/cx231xx-vbi.c:410:4: note: in expansion of macro 'dev_err'
410 | dev_err(dev->dev,
| ^~~~~~~
drivers/media/usb/cx231xx/cx231xx-vbi.c:411:57: note: format string is defined here
411 | "unable to allocate %i bytes for transfer buffer %i%s\n",
| ~^
| |
| char *vim +411 drivers/media/usb/cx231xx/cx231xx-vbi.c
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 336
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 337 /*
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 338 * Allocate URBs and start IRQ
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 339 */
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 340 int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 341 int num_bufs, int max_pkt_size,
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 342 int (*bulk_copy) (struct cx231xx *dev,
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 343 struct urb *urb))
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 344 {
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 345 struct cx231xx_dmaqueue *dma_q = &dev->vbi_mode.vidq;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 346 int i;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 347 int sb_size, pipe;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 348 struct urb *urb;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 349 int rc;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 350
336fea922936c11 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 351 dev_dbg(dev->dev, "called cx231xx_vbi_isoc\n");
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 352
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 353 /* De-allocates all pending stuff */
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 354 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 355
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 356 /* clear if any halt */
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 357 usb_clear_halt(dev->udev,
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 358 usb_rcvbulkpipe(dev->udev,
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 359 dev->vbi_mode.end_point_addr));
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 360
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 361 dev->vbi_mode.bulk_ctl.bulk_copy = bulk_copy;
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 362 dev->vbi_mode.bulk_ctl.num_bufs = num_bufs;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 363 dma_q->pos = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 364 dma_q->is_partial_line = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 365 dma_q->last_sav = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 366 dma_q->current_field = -1;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 367 dma_q->bytes_left_in_line = dev->width << 1;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 368 dma_q->lines_per_field = ((dev->norm & V4L2_STD_625_50) ?
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 369 PAL_VBI_LINES : NTSC_VBI_LINES);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 370 dma_q->lines_completed = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 371 for (i = 0; i < 8; i++)
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 372 dma_q->partial_buf[i] = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 373
6396bb221514d28 drivers/media/usb/cx231xx/cx231xx-vbi.c Kees Cook 2018-06-12 374 dev->vbi_mode.bulk_ctl.urb = kcalloc(num_bufs, sizeof(void *),
cde4362f0244a70 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 375 GFP_KERNEL);
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 376 if (!dev->vbi_mode.bulk_ctl.urb) {
336fea922936c11 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 377 dev_err(dev->dev,
b7085c08647598a drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 378 "cannot alloc memory for usb buffers\n");
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 379 return -ENOMEM;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 380 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 381
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 382 dev->vbi_mode.bulk_ctl.transfer_buffer =
6396bb221514d28 drivers/media/usb/cx231xx/cx231xx-vbi.c Kees Cook 2018-06-12 383 kcalloc(num_bufs, sizeof(void *), GFP_KERNEL);
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 384 if (!dev->vbi_mode.bulk_ctl.transfer_buffer) {
336fea922936c11 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 385 dev_err(dev->dev,
b7085c08647598a drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 386 "cannot allocate memory for usbtransfer\n");
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 387 kfree(dev->vbi_mode.bulk_ctl.urb);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 388 return -ENOMEM;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 389 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 390
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 391 dev->vbi_mode.bulk_ctl.max_pkt_size = max_pkt_size;
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 392 dev->vbi_mode.bulk_ctl.buf = NULL;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 393
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 394 sb_size = max_packets * dev->vbi_mode.bulk_ctl.max_pkt_size;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 395
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 396 /* allocate urbs and transfer buffers */
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 397 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 398
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 399 urb = usb_alloc_urb(0, GFP_KERNEL);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 400 if (!urb) {
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 401 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 402 return -ENOMEM;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 403 }
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 404 dev->vbi_mode.bulk_ctl.urb[i] = urb;
cd5534be6bc681d drivers/media/video/cx231xx/cx231xx-vbi.c David Dillow 2012-06-18 405 urb->transfer_flags = 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 406
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 407 dev->vbi_mode.bulk_ctl.transfer_buffer[i] =
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 408 kzalloc(sb_size, GFP_KERNEL);
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 409 if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {
336fea922936c11 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 410 dev_err(dev->dev,
b7085c08647598a drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 @411 "unable to allocate %i bytes for transfer buffer %i%s\n",
703daca167ddea5 drivers/media/usb/cx231xx/cx231xx-vbi.c Thomas Gleixner 2020-10-13 412 sb_size, i);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 413 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 414 return -ENOMEM;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 415 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 416
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 417 pipe = usb_rcvbulkpipe(dev->udev, dev->vbi_mode.end_point_addr);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 418 usb_fill_bulk_urb(urb, dev->udev, pipe,
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 419 dev->vbi_mode.bulk_ctl.transfer_buffer[i],
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 420 sb_size, cx231xx_irq_vbi_callback, dma_q);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 421 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 422
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 423 init_waitqueue_head(&dma_q->wq);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 424
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 425 /* submit urbs and enables IRQ */
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 426 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
64fbf4445526068 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 427 rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 428 if (rc) {
336fea922936c11 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 429 dev_err(dev->dev,
b7085c08647598a drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 430 "submit of urb %i failed (error=%i)\n", i, rc);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 431 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 432 return rc;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 433 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 434 }
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 435
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 436 cx231xx_capture_start(dev, 1, Vbi);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 437
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 438 return 0;
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 439 }
84b5dbf39ed2f51 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 440 EXPORT_SYMBOL_GPL(cx231xx_init_vbi_isoc);
e0d3bafd02586cf drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 441 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [patch 4/4] media: cx231xx: Consolidate dmesg output
Quoted 3 lines · kernel test robot
drivers/media/usb/cx231xx/cx231xx-vbi.c: In function 'cx231xx_init_vbi_isoc':Quoted 1 line
Quoted 1 line
drivers/media/usb/cx231xx/cx231xx-vbi.c:411:5: warning: format '%s' expects a matching 'char *' argument [-Wformat=]411 | "unable to allocate %i bytes for transfer buffer %i%s\n",
Duh.
PATCH v2 4/4 media: cx231xx: Consolidate dmesg output
In reply to Thomas GleixnerThe memory allocations in cx231xx_init_*() happen all in task context with GFP_KERNEL. Therefore a dev_err() trying to deduce whether this is called from task or interrupt context is pretty useless.
Remove these historical leftovers.
---
V2: Removed the extra format specifier (0day)
--- drivers/media/usb/cx231xx/cx231xx-core.c | 10 ++++------ drivers/media/usb/cx231xx/cx231xx-vbi.c | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-)
drivers/media/usb/cx231xx/cx231xx-core.c +4 -6
@@ -1065,9 +1065,8 @@ int cx231xx_init_isoc(struct cx231xx *de &urb->transfer_dma);if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {dev_err (dev->dev, -"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +"unable to allocate %i bytes for transfer buffer %i\n" , + sb_size, i);cx231xx_uninit_isoc (dev);return -ENOMEM ; }
@@ -1201,9 +1200,8 @@ int cx231xx_init_bulk(struct cx231xx *de &urb->transfer_dma);if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {dev_err (dev->dev, -"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +"unable to allocate %i bytes for transfer buffer %i\n" , + sb_size, i);cx231xx_uninit_bulk (dev);return -ENOMEM ; }
drivers/media/usb/cx231xx/cx231xx-vbi.c +2 -3
@@ -408,9 +408,8 @@ int cx231xx_init_vbi_isoc(struct cx231xxkzalloc (sb_size,GFP_KERNEL );if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {dev_err (dev->dev, -"unable to allocate %i bytes for transfer buffer %i%s\n" , - sb_size, i, -in_interrupt () ?" while in int" :"" ); +"unable to allocate %i bytes for transfer buffer %i\n" , + sb_size, i);cx231xx_uninit_vbi_isoc (dev);return -ENOMEM ; }
kernel test robot
build botRe: [patch 4/4] media: cx231xx: Consolidate dmesg output
In reply to Thomas GleixnerI love your patch! Perhaps something to improve:
Hi Thomas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on linus/master linux/master v5.9 next-20201016] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/media-Cleanup-in_interrupt-usage/20201013-224011 base: git://linuxtv.org/media_tree.git master config: x86_64-randconfig-a016-20201017 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project efd02c1548ee458d59063f6393e94e972b5c3d50)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/703daca167ddea5ab71b9547b549c1c1499f2bf4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Gleixner/media-Cleanup-in_interrupt-usage/20201013-224011 git checkout 703daca167ddea5ab71b9547b549c1c1499f2bf4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/media/usb/cx231xx/cx231xx-vbi.c:411:57: warning: more '%' conversions than data arguments [-Wformat-insufficient-args]
"unable to allocate %i bytes for transfer buffer %i%s\n",
~^
include/linux/dev_printk.h:104:24: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~
include/linux/dev_printk.h:19:22: note: expanded from macro 'dev_fmt'
#define dev_fmt(fmt) fmt
^~~1 warning generated.
vim +411 drivers/media/usb/cx231xx/cx231xx-vbi.c
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 336
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 337 /*
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 338 * Allocate URBs and start IRQ
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 339 */
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 340 int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 341 int num_bufs, int max_pkt_size,
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 342 int (*bulk_copy) (struct cx231xx *dev,
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 343 struct urb *urb))
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 344 {
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 345 struct cx231xx_dmaqueue *dma_q = &dev->vbi_mode.vidq;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 346 int i;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 347 int sb_size, pipe;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 348 struct urb *urb;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 349 int rc;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 350
336fea922936c1 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 351 dev_dbg(dev->dev, "called cx231xx_vbi_isoc\n");
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 352
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 353 /* De-allocates all pending stuff */
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 354 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 355
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 356 /* clear if any halt */
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 357 usb_clear_halt(dev->udev,
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 358 usb_rcvbulkpipe(dev->udev,
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 359 dev->vbi_mode.end_point_addr));
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 360
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 361 dev->vbi_mode.bulk_ctl.bulk_copy = bulk_copy;
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 362 dev->vbi_mode.bulk_ctl.num_bufs = num_bufs;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 363 dma_q->pos = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 364 dma_q->is_partial_line = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 365 dma_q->last_sav = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 366 dma_q->current_field = -1;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 367 dma_q->bytes_left_in_line = dev->width << 1;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 368 dma_q->lines_per_field = ((dev->norm & V4L2_STD_625_50) ?
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 369 PAL_VBI_LINES : NTSC_VBI_LINES);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 370 dma_q->lines_completed = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 371 for (i = 0; i < 8; i++)
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 372 dma_q->partial_buf[i] = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 373
6396bb221514d2 drivers/media/usb/cx231xx/cx231xx-vbi.c Kees Cook 2018-06-12 374 dev->vbi_mode.bulk_ctl.urb = kcalloc(num_bufs, sizeof(void *),
cde4362f0244a7 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 375 GFP_KERNEL);
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 376 if (!dev->vbi_mode.bulk_ctl.urb) {
336fea922936c1 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 377 dev_err(dev->dev,
b7085c08647598 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 378 "cannot alloc memory for usb buffers\n");
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 379 return -ENOMEM;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 380 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 381
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 382 dev->vbi_mode.bulk_ctl.transfer_buffer =
6396bb221514d2 drivers/media/usb/cx231xx/cx231xx-vbi.c Kees Cook 2018-06-12 383 kcalloc(num_bufs, sizeof(void *), GFP_KERNEL);
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 384 if (!dev->vbi_mode.bulk_ctl.transfer_buffer) {
336fea922936c1 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 385 dev_err(dev->dev,
b7085c08647598 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 386 "cannot allocate memory for usbtransfer\n");
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 387 kfree(dev->vbi_mode.bulk_ctl.urb);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 388 return -ENOMEM;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 389 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 390
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 391 dev->vbi_mode.bulk_ctl.max_pkt_size = max_pkt_size;
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 392 dev->vbi_mode.bulk_ctl.buf = NULL;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 393
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 394 sb_size = max_packets * dev->vbi_mode.bulk_ctl.max_pkt_size;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 395
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 396 /* allocate urbs and transfer buffers */
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 397 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 398
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 399 urb = usb_alloc_urb(0, GFP_KERNEL);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 400 if (!urb) {
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 401 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 402 return -ENOMEM;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 403 }
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 404 dev->vbi_mode.bulk_ctl.urb[i] = urb;
cd5534be6bc681 drivers/media/video/cx231xx/cx231xx-vbi.c David Dillow 2012-06-18 405 urb->transfer_flags = 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 406
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 407 dev->vbi_mode.bulk_ctl.transfer_buffer[i] =
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 408 kzalloc(sb_size, GFP_KERNEL);
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 409 if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {
336fea922936c1 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 410 dev_err(dev->dev,
b7085c08647598 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 @411 "unable to allocate %i bytes for transfer buffer %i%s\n",
703daca167ddea drivers/media/usb/cx231xx/cx231xx-vbi.c Thomas Gleixner 2020-10-13 412 sb_size, i);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 413 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 414 return -ENOMEM;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 415 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 416
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 417 pipe = usb_rcvbulkpipe(dev->udev, dev->vbi_mode.end_point_addr);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 418 usb_fill_bulk_urb(urb, dev->udev, pipe,
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 419 dev->vbi_mode.bulk_ctl.transfer_buffer[i],
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 420 sb_size, cx231xx_irq_vbi_callback, dma_q);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 421 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 422
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 423 init_waitqueue_head(&dma_q->wq);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 424
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 425 /* submit urbs and enables IRQ */
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 426 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
64fbf444552606 drivers/media/video/cx231xx/cx231xx-vbi.c Palash Bandyopadhyay 2010-07-06 427 rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 428 if (rc) {
336fea922936c1 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-03 429 dev_err(dev->dev,
b7085c08647598 drivers/media/usb/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2014-11-02 430 "submit of urb %i failed (error=%i)\n", i, rc);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 431 cx231xx_uninit_vbi_isoc(dev);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 432 return rc;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 433 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 434 }
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 435
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 436 cx231xx_capture_start(dev, 1, Vbi);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 437
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 438 return 0;
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 439 }
84b5dbf39ed2f5 drivers/media/video/cx231xx/cx231xx-vbi.c Mauro Carvalho Chehab 2009-03-03 440 EXPORT_SYMBOL_GPL(cx231xx_init_vbi_isoc);
e0d3bafd02586c drivers/media/video/cx231xx/cx231xx-vbi.c Sri Deevi 2009-03-03 441 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org