Re: [PATCH AUTOSEL 4.14 09/20] media: netup_unidvb: fix irq init by register it at the end of probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux