media: Bulk remove BUG_ON(in_interrupt())
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Oct 2020 14:26:17 +0000 (16:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:10 +0000 (10:31 +0100)
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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/common/saa7146/saa7146_fops.c
drivers/media/pci/bt8xx/bttv-risc.c
drivers/media/pci/cx23885/cx23885-core.c
drivers/media/pci/cx25821/cx25821-core.c
drivers/media/platform/fsl-viu.c
drivers/media/usb/tm6000/tm6000-video.c
drivers/media/usb/zr364xx/zr364xx.c

index d6531874faa650f0e8367ac8d37e0490e299b7db..e936c56b0378833804575d8f06db6f77f4521574 100644 (file)
@@ -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);
index 4af72826b006ce07e99a539c7348b5a1270dd025..32fa4a7fe76f7468be0f7a072664a5d2cc814bc9 100644 (file)
@@ -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);
index 4b0c53f61fb7cd78eb79c7bd2da9f30ea7de43b0..16eb4ab0e73eeff50f65adf048dc6bb9259be739 100644 (file)
@@ -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);
 }
 
index 55018d9e439fb775ec00fecdc7e83df9c9f2089e..6f8ffab8840f418332930266ea8214e60eef0467 100644 (file)
@@ -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,
index 4f2a0f992905b4b34c1e33d8ebf147f7a412173d..ff625301e7776e6644e8542bce4faacdaf6099be 100644 (file)
@@ -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)
index 2df736c029d6e65bdfeb89faf5a29a36f7edb090..3f650ede0c3dc50a3bd2970998759a677cbe6ea3 100644 (file)
@@ -693,8 +693,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.
index d65d3c2a034ed81feb7a07e7af28281f923a26b2..1e1c6b4d1874bf1358fc6a00fa60a649b425f9d3 100644 (file)
@@ -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;
 }