linuxppc-dev.lists.ozlabs.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
  2015-02-05 19:36 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Amit Tomar @ 2015-01-30 10:24 UTC (permalink / raw)
  To: linux-i2c@vger.kernel.org; +Cc: linuxppc-dev@lists.ozlabs.org

ISR should not return IRQ_HANDLED for not handling anything.=20
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 |=A0=A0=A0 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c in=
dex 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)
=A0=A0=A0=A0=A0=A0=A0 i2c->interrupt =3D readb(i2c->base + MPC_I2C_SR);
=A0=A0=A0=A0=A0=A0=A0 writeb(0, i2c->base + MPC_I2C_SR);
=A0=A0=A0=A0=A0=A0=A0 wake_up(&i2c->queue);
+=A0=A0 =A0=A0  return IRQ_HANDLED;
=A0=A0=A0 }
-=A0 return IRQ_HANDLED;
+ =A0return IRQ_NONE;
}

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

^ permalink raw reply	[flat|nested] 4+ 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
  2015-02-05 19:36 ` Wolfram Sang
  1 sibling, 0 replies; 4+ 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: 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 #2: Type: text/html, Size: 2568 bytes --]

^ permalink raw reply	[flat|nested] 4+ 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
@ 2015-02-05 19:36 ` Wolfram Sang
  2015-03-27 12:47   ` Amit Tomar
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2015-02-05 19:36 UTC (permalink / raw)
  To: Amit Tomar; +Cc: linuxppc-dev@lists.ozlabs.org, linux-i2c@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1305 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@freescale.com>

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@vger.kernel.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] 4+ 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; 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CoMKgwqAgd3JpdGViKDAsIGkyYy0+YmFzZSArIE1QQ19JMkNfU1Ip
Ow0KPiDCoMKgwqDCoMKgwqDCoCB3YWtlX3VwKCZpMmMtPnF1ZXVlKTsNCj4gK8KgwqAgwqDCoCAg
cmV0dXJuIElSUV9IQU5ETEVEOw0KPiDCoMKgwqAgfQ0KPiAtwqAgcmV0dXJuIElSUV9IQU5ETEVE
Ow0KPiArIMKgcmV0dXJuIElSUV9OT05FOw0KPiB9DQo+IA0KPiAvKiBTb21ldGltZXMgOXRoIGNs
b2NrIHB1bHNlIGlzbid0IGdlbmVyYXRlZCwgYW5kIHNsYXZlIGRvZXNuJ3QgDQo+IHJlbGVhc2UN
Cj4gLS0NCj4gMS43LjkuNQ0KPiAgDQo+IC0tDQo+IFRvIHVuc3Vic2NyaWJlIGZyb20gdGhpcyBs
aXN0OiBzZW5kIHRoZSBsaW5lICJ1bnN1YnNjcmliZSBsaW51eC1pMmMiIA0KPiBpbiB0aGUgYm9k
eSBvZiBhIG1lc3NhZ2UgdG8gbWFqb3Jkb21vQHZnZXIua2VybmVsLm9yZyBNb3JlIG1ham9yZG9t
byANCj4gaW5mbyBhdCAgaHR0cDovL3ZnZXIua2VybmVsLm9yZy9tYWpvcmRvbW8taW5mby5odG1s
DQo=

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

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

Thread overview: 4+ 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
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).