Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [patch 0/4] media: Cleanup in_interrupt() usage
@ 2020-10-13 14:26 Thomas Gleixner
  2020-10-13 14:26 ` [patch 1/4] media: Bulk remove BUG_ON(in_interrupt()) Thomas Gleixner
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-13 14:26 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Hans Verkuil, Laurent Pinchart,
	Mauro Carvalho Chehab, linux-media, linux-usb, Hans Verkuil

Folks,

in the discussion about preempt count consistency accross kernel
configurations:

 https://lore.kernel.org/r/20200914204209.256266093@linutronix.de/

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(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 1/4] media: Bulk remove BUG_ON(in_interrupt())
  2020-10-13 14:26 [patch 0/4] media: Cleanup in_interrupt() usage Thomas Gleixner
@ 2020-10-13 14:26 ` Thomas Gleixner
  2020-10-13 14:26 ` [patch 2/4] media: omap3isp: Remove misleading comment Thomas Gleixner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-13 14:26 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Hans Verkuil, Laurent Pinchart,
	Mauro Carvalho Chehab, linux-media, linux-usb, Hans Verkuil

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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Cc: linux-usb@vger.kernel.org

diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c
index d6531874faa6..e936c56b0378 100644
--- a/drivers/media/common/saa7146/saa7146_fops.c
+++ b/drivers/media/common/saa7146/saa7146_fops.c
@@ -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);
diff --git a/drivers/media/pci/bt8xx/bttv-risc.c b/drivers/media/pci/bt8xx/bttv-risc.c
index 4af72826b006..32fa4a7fe76f 100644
--- a/drivers/media/pci/bt8xx/bttv-risc.c
+++ b/drivers/media/pci/bt8xx/bttv-risc.c
@@ -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);
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c
index 4b0c53f61fb7..16eb4ab0e73e 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -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);
 }
 
diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c
index 55018d9e439f..6f8ffab8840f 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -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,
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index 84633a3b8475..e0c51cd779b8 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -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)
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index bfba06ea60e9..9b44462c5332 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -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.
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c
index 8c670934d920..83221c0b6e6d 100644
--- a/drivers/media/usb/zr364xx/zr364xx.c
+++ b/drivers/media/usb/zr364xx/zr364xx.c
@@ -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;
 }


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 2/4] media: omap3isp: Remove misleading comment
  2020-10-13 14:26 [patch 0/4] media: Cleanup in_interrupt() usage Thomas Gleixner
  2020-10-13 14:26 ` [patch 1/4] media: Bulk remove BUG_ON(in_interrupt()) Thomas Gleixner
@ 2020-10-13 14:26 ` Thomas Gleixner
  2020-10-13 18:20   ` Laurent Pinchart
  2020-10-13 14:26 ` [patch 3/4] media: au0828: Consolidate dmesg output Thomas Gleixner
  2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
  3 siblings, 1 reply; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-13 14:26 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Mauro Carvalho Chehab, Laurent Pinchart,
	linux-media, Hans Verkuil, linux-usb, Hans Verkuil

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 <tglx@linutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org

---
 drivers/media/platform/omap3isp/ispccdc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -299,11 +299,10 @@ static int ccdc_lsc_busy(struct isp_ccdc
 			     ISPCCDC_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)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 3/4] media: au0828: Consolidate dmesg output
  2020-10-13 14:26 [patch 0/4] media: Cleanup in_interrupt() usage Thomas Gleixner
  2020-10-13 14:26 ` [patch 1/4] media: Bulk remove BUG_ON(in_interrupt()) Thomas Gleixner
  2020-10-13 14:26 ` [patch 2/4] media: omap3isp: Remove misleading comment Thomas Gleixner
@ 2020-10-13 14:26 ` Thomas Gleixner
  2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
  3 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-13 14:26 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Hans Verkuil, Mauro Carvalho Chehab, linux-media,
	Hans Verkuil, Laurent Pinchart, linux-usb

The 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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org

---
 drivers/media/usb/au0828/au0828-video.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -231,6 +231,7 @@ static int au0828_init_isoc(struct au082
 	for (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;
 		}


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 4/4] media: cx231xx: Consolidate dmesg output
  2020-10-13 14:26 [patch 0/4] media: Cleanup in_interrupt() usage Thomas Gleixner
                   ` (2 preceding siblings ...)
  2020-10-13 14:26 ` [patch 3/4] media: au0828: Consolidate dmesg output Thomas Gleixner
@ 2020-10-13 14:26 ` Thomas Gleixner
  2020-10-14 14:36   ` kernel test robot
                     ` (2 more replies)
  3 siblings, 3 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-13 14:26 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Mauro Carvalho Chehab, Hans Verkuil, linux-media,
	Hans Verkuil, Laurent Pinchart, linux-usb

The 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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org

---
 drivers/media/usb/cx231xx/cx231xx-core.c |   10 ++++------
 drivers/media/usb/cx231xx/cx231xx-vbi.c  |    3 +--
 2 files changed, 5 insertions(+), 8 deletions(-)

--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -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;
 		}
--- a/drivers/media/usb/cx231xx/cx231xx-vbi.c
+++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c
@@ -409,8 +409,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx
 		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" : "");
+				sb_size, i);
 			cx231xx_uninit_vbi_isoc(dev);
 			return -ENOMEM;
 		}


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 2/4] media: omap3isp: Remove misleading comment
  2020-10-13 14:26 ` [patch 2/4] media: omap3isp: Remove misleading comment Thomas Gleixner
@ 2020-10-13 18:20   ` Laurent Pinchart
  0 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2020-10-13 18:20 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Peter Zijlstra, Mauro Carvalho Chehab, linux-media,
	Hans Verkuil, linux-usb, Hans Verkuil

Hi Thomas,

Thank you for the patch.

On Tue, Oct 13, 2020 at 04:26:18PM +0200, Thomas Gleixner wrote:
> 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 <tglx@linutronix.de>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: linux-media@vger.kernel.org

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/omap3isp/ispccdc.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> --- a/drivers/media/platform/omap3isp/ispccdc.c
> +++ b/drivers/media/platform/omap3isp/ispccdc.c
> @@ -299,11 +299,10 @@ static int ccdc_lsc_busy(struct isp_ccdc
>  			     ISPCCDC_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)
> 

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 4/4] media: cx231xx: Consolidate dmesg output
  2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
@ 2020-10-14 14:36   ` kernel test robot
  2020-10-14 15:21     ` Thomas Gleixner
  2020-10-14 15:38   ` [patch V2 " Thomas Gleixner
  2020-10-17  2:56   ` [patch " kernel test robot
  2 siblings, 1 reply; 10+ messages in thread
From: kernel test robot @ 2020-10-14 14:36 UTC (permalink / raw)
  To: Thomas Gleixner, LKML
  Cc: kbuild-all, Peter Zijlstra, Mauro Carvalho Chehab, linux-media,
	Hans Verkuil, Laurent Pinchart, linux-usb


[-- Attachment #1: Type: text/plain, Size: 16009 bytes --]

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
Reported-by: kernel test robot <lkp@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28405 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 4/4] media: cx231xx: Consolidate dmesg output
  2020-10-14 14:36   ` kernel test robot
@ 2020-10-14 15:21     ` Thomas Gleixner
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-14 15:21 UTC (permalink / raw)
  To: kernel test robot, LKML
  Cc: kbuild-all, Peter Zijlstra, Mauro Carvalho Chehab, linux-media,
	Hans Verkuil, Laurent Pinchart, linux-usb

On Wed, Oct 14 2020 at 22:36, kernel test robot wrote:
>    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",

Duh.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch V2 4/4] media: cx231xx: Consolidate dmesg output
  2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
  2020-10-14 14:36   ` kernel test robot
@ 2020-10-14 15:38   ` Thomas Gleixner
  2020-10-17  2:56   ` [patch " kernel test robot
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2020-10-14 15:38 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Mauro Carvalho Chehab, Hans Verkuil, linux-media,
	Hans Verkuil, Laurent Pinchart, linux-usb

The 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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org
---
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(-)

--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -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;
 		}
--- a/drivers/media/usb/cx231xx/cx231xx-vbi.c
+++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c
@@ -408,9 +408,8 @@ int cx231xx_init_vbi_isoc(struct cx231xx
 		    kzalloc(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;
 		}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 4/4] media: cx231xx: Consolidate dmesg output
  2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
  2020-10-14 14:36   ` kernel test robot
  2020-10-14 15:38   ` [patch V2 " Thomas Gleixner
@ 2020-10-17  2:56   ` kernel test robot
  2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-10-17  2:56 UTC (permalink / raw)
  To: Thomas Gleixner, LKML
  Cc: kbuild-all, clang-built-linux, Peter Zijlstra,
	Mauro Carvalho Chehab, linux-media, Hans Verkuil,
	Laurent Pinchart, linux-usb


[-- Attachment #1: Type: text/plain, Size: 15410 bytes --]

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
Reported-by: kernel test robot <lkp@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40065 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 14:26 [patch 0/4] media: Cleanup in_interrupt() usage Thomas Gleixner
2020-10-13 14:26 ` [patch 1/4] media: Bulk remove BUG_ON(in_interrupt()) Thomas Gleixner
2020-10-13 14:26 ` [patch 2/4] media: omap3isp: Remove misleading comment Thomas Gleixner
2020-10-13 18:20   ` Laurent Pinchart
2020-10-13 14:26 ` [patch 3/4] media: au0828: Consolidate dmesg output Thomas Gleixner
2020-10-13 14:26 ` [patch 4/4] media: cx231xx: " Thomas Gleixner
2020-10-14 14:36   ` kernel test robot
2020-10-14 15:21     ` Thomas Gleixner
2020-10-14 15:38   ` [patch V2 " Thomas Gleixner
2020-10-17  2:56   ` [patch " kernel test robot

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git