[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZIy1+CA55P2YC4xA@duo.ucw.cz>
Date: Fri, 16 Jun 2023 21:20:24 +0200
From: Pavel Machek <pavel@....cz>
To: Sasha Levin <sashal@...nel.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Wei Chen <harperchen1110@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, serjk@...up.ru,
aospan@...up.ru, linux-media@...r.kernel.org
Subject: Re: [PATCH AUTOSEL 4.14 09/20] media: netup_unidvb: fix irq init by
register it at the end of probe
Hi!
> [ Upstream commit e6ad6233592593079db5c8fa592c298e51bc1356 ]
>
> IRQ handler netup_spi_interrupt() takes spinlock spi->lock. The lock
> is initialized in netup_spi_init(). However, irq handler is registered
> before initializing the lock.
>
> Spinlock dma->lock and i2c->lock suffer from the same problem.
>
> Fix this by registering the irq at the end of probe.
Are you sure you got the error handling right? AFAICT
netup_unidvb_dma_fini(ndev, 0/1); is needed here.
Best regards,
Pavel
> +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> @@ -943,6 +938,14 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
> dev_err(&pci_dev->dev, "netup_unidvb: DMA setup failed\n");
> goto dma_setup_err;
> }
> +
> + if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
> + "netup_unidvb", pci_dev) < 0) {
> + dev_err(&pci_dev->dev,
> + "%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
> + goto dma_setup_err;
> + }
> +
> dev_info(&pci_dev->dev,
> "netup_unidvb: device has been initialized\n");
> return 0;
> @@ -961,8 +964,6 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
> dma_free_coherent(&pci_dev->dev, ndev->dma_size,
> ndev->dma_virt, ndev->dma_phys);
> dma_alloc_err:
> - free_irq(pci_dev->irq, pci_dev);
> -irq_request_err:
> iounmap(ndev->lmmio1);
> pci_bar1_error:
> iounmap(ndev->lmmio0);
--
People of Russia, stop Putin before his war on Ukraine escalates.
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists