linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c/mpc: Fix ISR return value
@ 2015-01-30 10:24 Amit Tomar
  2015-01-30 11:09 ` Danielle Costantino
       [not found] ` <BL2PR03MB449C87445D2FD1F15E9D33483310-AZ66ij2kwaaRkNCTDI+ukOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Amit Tomar @ 2015-01-30 10:24 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

ISR should not return IRQ_HANDLED for not handling anything. 
This patch fixes the return value of ISR for the same case.


Signed-off-by: Amit Singh Tomar <amit.tomar-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
drivers/i2c/busses/i2c-mpc.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 0edf630..7a3136f 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -95,8 +95,9 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
        i2c->interrupt = readb(i2c->base + MPC_I2C_SR);
        writeb(0, i2c->base + MPC_I2C_SR);
        wake_up(&i2c->queue);
+       return IRQ_HANDLED;
    }
-  return IRQ_HANDLED;
+  return IRQ_NONE;
}

/* Sometimes 9th clock pulse isn't generated, and slave doesn't release
--
1.7.9.5
 

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

* Re: [PATCH] i2c/mpc: Fix ISR return value
  2015-01-30 10:24 [PATCH] i2c/mpc: Fix ISR return value Amit Tomar
@ 2015-01-30 11:09 ` Danielle Costantino
       [not found] ` <BL2PR03MB449C87445D2FD1F15E9D33483310-AZ66ij2kwaaRkNCTDI+ukOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Danielle Costantino @ 2015-01-30 11:09 UTC (permalink / raw)
  To: Amit Tomar; +Cc: linuxppc-dev@lists.ozlabs.org, linux-i2c@vger.kernel.org


[-- Attachment #1.1: Type: text/plain, Size: 1806 bytes --]

I have been using the driver with this modification for the past 6 months
and it has been stable in an industrial environment.I had made a few other
changes that also improve reliability (using ppc in_8 and out_8 and eieio
barriers to ensure in-order execution. This lets you remove the unneeded
double read of the status register. I also added a more robust recovery
function to handle force of bus master-ship, and clearing the arb lost
interrupt that is generated. currently this can cause the isr to trigger
and cause superfluous interrupts. I have not posted this patch because of
the extensive changes,

I will ack this patch.

On Fri, Jan 30, 2015 at 2:24 AM, Amit Tomar <Amit.Tomar@freescale.com>
wrote:

> ISR should not return IRQ_HANDLED for not handling anything.
> This patch fixes the return value of ISR for the same case.
>
>
> Signed-off-by: Amit Singh Tomar <amit.tomar@freescale.com>
> ---
> drivers/i2c/busses/i2c-mpc.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index 0edf630..7a3136f 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -95,8 +95,9 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
>         i2c->interrupt = readb(i2c->base + MPC_I2C_SR);
>         writeb(0, i2c->base + MPC_I2C_SR);
>         wake_up(&i2c->queue);
> +       return IRQ_HANDLED;
>     }
> -  return IRQ_HANDLED;
> +  return IRQ_NONE;
> }
>
> /* Sometimes 9th clock pulse isn't generated, and slave doesn't release
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
- Danielle Costantino

[-- Attachment #1.2: Type: text/html, Size: 2568 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* Re: [PATCH] i2c/mpc: Fix ISR return value
       [not found] ` <BL2PR03MB449C87445D2FD1F15E9D33483310-AZ66ij2kwaaRkNCTDI+ukOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
@ 2015-01-30 11:17   ` Danielle Costantino
       [not found]     ` <CAAVjN7fQ4RLgsk1R_DPrFm21OBWpsBdxMuDyQauiz3pxCgK+Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-02-05 19:36   ` Wolfram Sang
  1 sibling, 1 reply; 6+ messages in thread
From: Danielle Costantino @ 2015-01-30 11:17 UTC (permalink / raw)
  To: linux-i2c

I have been using the driver with this modification for the past 6
months and it has been stable in an industrial environment.I had made
a few other changes that also improve reliability (using ppc in_8 and
out_8 and eieio barriers to ensure in-order execution. This lets you
remove the unneeded double read of the status register. I also added a
more robust recovery function to handle force of bus master-ship, and
clearing the arb lost interrupt that is generated. currently this can
cause the isr to trigger and cause superfluous interrupts. I have not
posted this patch because of the extensive changes,

I will ack this patch.

On Fri, Jan 30, 2015 at 2:24 AM, Amit Tomar <Amit.Tomar-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> ISR should not return IRQ_HANDLED for not handling anything.
> This patch fixes the return value of ISR for the same case.
>
>
> Signed-off-by: Amit Singh Tomar <amit.tomar-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-mpc.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 0edf630..7a3136f 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -95,8 +95,9 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
>         i2c->interrupt = readb(i2c->base + MPC_I2C_SR);
>         writeb(0, i2c->base + MPC_I2C_SR);
>         wake_up(&i2c->queue);
> +       return IRQ_HANDLED;
>     }
> -  return IRQ_HANDLED;
> +  return IRQ_NONE;
> }
>
> /* Sometimes 9th clock pulse isn't generated, and slave doesn't release
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
- Danielle Costantino

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

* Re: [PATCH] i2c/mpc: Fix ISR return value
       [not found] ` <BL2PR03MB449C87445D2FD1F15E9D33483310-AZ66ij2kwaaRkNCTDI+ukOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
  2015-01-30 11:17   ` Danielle Costantino
@ 2015-02-05 19:36   ` Wolfram Sang
  2015-03-27 12:47     ` Amit Tomar
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2015-02-05 19:36 UTC (permalink / raw)
  To: Amit Tomar
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

On Fri, Jan 30, 2015 at 10:24:10AM +0000, Amit Tomar wrote:
> ISR should not return IRQ_HANDLED for not handling anything. 
> This patch fixes the return value of ISR for the same case.
> 
> 
> Signed-off-by: Amit Singh Tomar <amit.tomar-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

I can't apply the patch. There seem to be whitespace problems. Please
fix the patch or your mail sending.


> ---
> drivers/i2c/busses/i2c-mpc.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 0edf630..7a3136f 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -95,8 +95,9 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
>         i2c->interrupt = readb(i2c->base + MPC_I2C_SR);
>         writeb(0, i2c->base + MPC_I2C_SR);
>         wake_up(&i2c->queue);
> +       return IRQ_HANDLED;
>     }
> -  return IRQ_HANDLED;
> +  return IRQ_NONE;
> }
> 
> /* Sometimes 9th clock pulse isn't generated, and slave doesn't release
> --
> 1.7.9.5
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] i2c/mpc: Fix ISR return value
       [not found]     ` <CAAVjN7fQ4RLgsk1R_DPrFm21OBWpsBdxMuDyQauiz3pxCgK+Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-02-05 19:37       ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-02-05 19:37 UTC (permalink / raw)
  To: Danielle Costantino; +Cc: linux-i2c

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

On Fri, Jan 30, 2015 at 03:17:37AM -0800, Danielle Costantino wrote:
> I have been using the driver with this modification for the past 6
> months and it has been stable in an industrial environment.I had made
> a few other changes that also improve reliability (using ppc in_8 and
> out_8 and eieio barriers to ensure in-order execution. This lets you
> remove the unneeded double read of the status register. I also added a
> more robust recovery function to handle force of bus master-ship, and
> clearing the arb lost interrupt that is generated. currently this can
> cause the isr to trigger and cause superfluous interrupts. I have not
> posted this patch because of the extensive changes,
> 
> I will ack this patch.

Thanks for the detailed explanation. If you want to assist me even
further, please use the standard form for an Ack:

Acked-by: <your email>

Then patchwork will automatically collect the ack and I don't have to do
it manually.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH] i2c/mpc: Fix ISR return value
  2015-02-05 19:36   ` Wolfram Sang
@ 2015-03-27 12:47     ` Amit Tomar
  0 siblings, 0 replies; 6+ messages in thread
From: Amit Tomar @ 2015-03-27 12:47 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

 >>I can't apply the patch. There seem to be whitespace problems. Please fix the patch or your mail sending.

Sorry for the Delayed response and It's my Bad as I didn't pass it through checkpatch.

I would send a fresh patch.

Thanks
Amit.
 

> ---
> drivers/i2c/busses/i2c-mpc.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mpc.c 
> b/drivers/i2c/busses/i2c-mpc.c index 0edf630..7a3136f 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -95,8 +95,9 @@ static irqreturn_t mpc_i2c_isr(int irq, void 
> *dev_id)
>         i2c->interrupt = readb(i2c->base + MPC_I2C_SR);
>         writeb(0, i2c->base + MPC_I2C_SR);
>         wake_up(&i2c->queue);
> +       return IRQ_HANDLED;
>     }
> -  return IRQ_HANDLED;
> +  return IRQ_NONE;
> }
> 
> /* Sometimes 9th clock pulse isn't generated, and slave doesn't 
> release
> --
> 1.7.9.5
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" 
> in the body of a message to majordomo@vger.kernel.org More majordomo 
> info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-03-27 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30 10:24 [PATCH] i2c/mpc: Fix ISR return value Amit Tomar
2015-01-30 11:09 ` Danielle Costantino
     [not found] ` <BL2PR03MB449C87445D2FD1F15E9D33483310-AZ66ij2kwaaRkNCTDI+ukOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2015-01-30 11:17   ` Danielle Costantino
     [not found]     ` <CAAVjN7fQ4RLgsk1R_DPrFm21OBWpsBdxMuDyQauiz3pxCgK+Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-05 19:37       ` Wolfram Sang
2015-02-05 19:36   ` Wolfram Sang
2015-03-27 12:47     ` Amit Tomar

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).