linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] [media] ite-cir: postpone ISR registration
@ 2012-04-18 20:54 Luis Henriques
  2012-04-19 15:08 ` Luis Henriques
  2012-04-19 20:44 ` Jarod Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Luis Henriques @ 2012-04-18 20:54 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Jarod Wilson, linux-media, linux-kernel

An early registration of an ISR was causing a crash to several users (for
example here: http://bugs.launchpad.net/bugs/972723  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 682009d..98d8ccf 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1521,10 +1521,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;
@@ -1600,6 +1596,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


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

* Re: [PATCH 1/1] [media] ite-cir: postpone ISR registration
  2012-04-18 20:54 [PATCH 1/1] [media] ite-cir: postpone ISR registration Luis Henriques
@ 2012-04-19 15:08 ` Luis Henriques
  2012-04-19 20:44 ` Jarod Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Luis Henriques @ 2012-04-19 15:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Jarod Wilson, linux-media, linux-kernel, stable

On Wed, Apr 18, 2012 at 09:54:07PM +0100, Luis Henriques wrote:
> An early registration of an ISR was causing a crash to several users (for
> example here: http://bugs.launchpad.net/bugs/972723  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 682009d..98d8ccf 100644
> --- a/drivers/media/rc/ite-cir.c
> +++ b/drivers/media/rc/ite-cir.c
> @@ -1521,10 +1521,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;
> @@ -1600,6 +1596,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

I completely forgot to add:

Cc: <stable@vger.kernel.org>

to my email.

Cheers,
--
Luis

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

* Re: [PATCH 1/1] [media] ite-cir: postpone ISR registration
  2012-04-18 20:54 [PATCH 1/1] [media] ite-cir: postpone ISR registration Luis Henriques
  2012-04-19 15:08 ` Luis Henriques
@ 2012-04-19 20:44 ` Jarod Wilson
  2012-04-19 21:32   ` Luis Henriques
  1 sibling, 1 reply; 4+ messages in thread
From: Jarod Wilson @ 2012-04-19 20:44 UTC (permalink / raw)
  To: Luis Henriques; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

On Wed, Apr 18, 2012 at 09:54:07PM +0100, Luis Henriques wrote:
> An early registration of an ISR was causing a crash to several users (for
> example here: http://bugs.launchpad.net/bugs/972723  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.

Ugh. Looks like we actually have a similar problem with multiple lpc super
i/o based CIR drivers. I'd probably move both the irq and io region
requests in ite-cir, fintek-cir, nuvoton-cir, ene_ir and winbond-cir. If
I'm thinking clearly, I've actually seen a very similar report for one of
the other CIR drivers recently. Good catch. But yeah, lets do the same for
all the drivers, and move request_region as well.

-- 
Jarod Wilson
jarod@redhat.com


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

* Re: [PATCH 1/1] [media] ite-cir: postpone ISR registration
  2012-04-19 20:44 ` Jarod Wilson
@ 2012-04-19 21:32   ` Luis Henriques
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Henriques @ 2012-04-19 21:32 UTC (permalink / raw)
  To: Jarod Wilson; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

On Thu, Apr 19, 2012 at 04:44:44PM -0400, Jarod Wilson wrote:
> On Wed, Apr 18, 2012 at 09:54:07PM +0100, Luis Henriques wrote:
> > An early registration of an ISR was causing a crash to several users (for
> > example here: http://bugs.launchpad.net/bugs/972723  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.
> 
> Ugh. Looks like we actually have a similar problem with multiple lpc super
> i/o based CIR drivers. I'd probably move both the irq and io region
> requests in ite-cir, fintek-cir, nuvoton-cir, ene_ir and winbond-cir. If
> I'm thinking clearly, I've actually seen a very similar report for one of
> the other CIR drivers recently. Good catch. But yeah, lets do the same for
> all the drivers, and move request_region as well.

Yeah, I've realised the other drivers had the same issue.  ite-cir was
just for one that bit us first.

Anyway, I'll be sending in a minute another patch with your comments.

Cheers,
--
Luis

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

end of thread, other threads:[~2012-04-19 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 20:54 [PATCH 1/1] [media] ite-cir: postpone ISR registration Luis Henriques
2012-04-19 15:08 ` Luis Henriques
2012-04-19 20:44 ` Jarod Wilson
2012-04-19 21:32   ` Luis Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).