diff mbox

[1/1] UBUNTU: SAUCE: ite-cir: postpone ISR registration

Message ID 1334845344-18613-2-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques April 19, 2012, 2:22 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/984387

An early registration of an ISR was causing a crash to several users.  The
reason was that IRQs were being triggered before the driver initialisation
was completed.

This patch fixes this by moving the invocation to request_irq() to a later
stage on the driver probe function.

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/rc/ite-cir.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Seth Forshee April 19, 2012, 3:01 p.m. UTC | #1
On Thu, Apr 19, 2012 at 03:22:24PM +0100, Luis Henriques wrote:
> BugLink: http://bugs.launchpad.net/bugs/984387
> 
> An early registration of an ISR was causing a crash to several users.  The
> reason was that IRQs were being triggered before the driver initialisation
> was completed.
> 
> This patch fixes this by moving the invocation to request_irq() to a later
> stage on the driver probe function.
> 
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  drivers/media/rc/ite-cir.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
> index ecd3d02..c8c775a 100644
> --- a/drivers/media/rc/ite-cir.c
> +++ b/drivers/media/rc/ite-cir.c
> @@ -1525,10 +1525,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
>  				dev_desc->io_region_size, ITE_DRIVER_NAME))
>  		goto failure;
>  
> -	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
> -			ITE_DRIVER_NAME, (void *)itdev))
> -		goto failure;
> -
>  	/* set driver data into the pnp device */
>  	pnp_set_drvdata(pdev, itdev);
>  	itdev->pdev = pdev;
> @@ -1604,6 +1600,10 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
>  	rdev->driver_name = ITE_DRIVER_NAME;
>  	rdev->map_name = RC_MAP_RC6_MCE;
>  
> +	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
> +			ITE_DRIVER_NAME, (void *)itdev))
> +		goto failure;
> +
>  	ret = rc_register_device(rdev);
>  	if (ret)
>  		goto failure;
> -- 
> 1.7.9.5
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox

Patch

diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index ecd3d02..c8c775a 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1525,10 +1525,6 @@  static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 				dev_desc->io_region_size, ITE_DRIVER_NAME))
 		goto failure;
 
-	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
-			ITE_DRIVER_NAME, (void *)itdev))
-		goto failure;
-
 	/* set driver data into the pnp device */
 	pnp_set_drvdata(pdev, itdev);
 	itdev->pdev = pdev;
@@ -1604,6 +1600,10 @@  static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 	rdev->driver_name = ITE_DRIVER_NAME;
 	rdev->map_name = RC_MAP_RC6_MCE;
 
+	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
+			ITE_DRIVER_NAME, (void *)itdev))
+		goto failure;
+
 	ret = rc_register_device(rdev);
 	if (ret)
 		goto failure;