linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
@ 2014-06-20  2:01 Zhao Qiang
  2014-06-20  2:01 ` [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb Zhao Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Zhao Qiang @ 2014-06-20  2:01 UTC (permalink / raw)
  To: linuxppc-dev, linux-can, wg, mkl, B07421; +Cc: Zhao Qiang

when flexcan is not physically linked, command 'cantest' will
trigger an err_irq, add err_irq handler for it.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
Changes for v2:
	- use a space instead of tab
	- use flexcan_poll_state instead of print

 drivers/net/can/flexcan.c | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index f425ec2..7432ba4 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -208,6 +208,7 @@ struct flexcan_priv {
 	void __iomem *base;
 	u32 reg_esr;
 	u32 reg_ctrl_default;
+	unsigned int err_irq;
 
 	struct clk *clk_ipg;
 	struct clk *clk_per;
@@ -744,6 +745,23 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t flexcan_err_irq(int irq, void *dev_id)
+{
+	struct net_device *dev = dev_id;
+	struct flexcan_priv *priv = netdev_priv(dev);
+	struct flexcan_regs __iomem *regs = priv->base;
+	u32 reg_ctrl, reg_esr;
+
+	reg_esr = flexcan_read(&regs->esr);
+	reg_ctrl = flexcan_read(&regs->ctrl);
+	if (reg_esr & FLEXCAN_ESR_TX_WRN) {
+		flexcan_write(reg_esr & ~FLEXCAN_ESR_TX_WRN, &regs->esr);
+		flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK, &regs->ctrl);
+		flexcan_poll_state(dev, reg_esr);
+	}
+	return IRQ_HANDLED;
+}
+
 static void flexcan_set_bittiming(struct net_device *dev)
 {
 	const struct flexcan_priv *priv = netdev_priv(dev);
@@ -944,6 +962,12 @@ static int flexcan_open(struct net_device *dev)
 	if (err)
 		goto out_close;
 
+	if (priv->err_irq)
+		err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
+				  dev->name, dev);
+	if (err)
+		goto out_close;
+
 	/* start chip and queuing */
 	err = flexcan_chip_start(dev);
 	if (err)
@@ -1099,7 +1123,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	struct resource *mem;
 	struct clk *clk_ipg = NULL, *clk_per = NULL;
 	void __iomem *base;
-	int err, irq;
+	int err, irq, err_irq;
 	u32 clock_freq = 0;
 
 	if (pdev->dev.of_node)
@@ -1126,6 +1150,10 @@ static int flexcan_probe(struct platform_device *pdev)
 	if (irq <= 0)
 		return -ENODEV;
 
+	err_irq = platform_get_irq(pdev, 1);
+	if (err_irq <= 0)
+		err_irq = 0;
+
 	base = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
@@ -1149,6 +1177,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	dev->flags |= IFF_ECHO;
 
 	priv = netdev_priv(dev);
+	priv->err_irq = err_irq;
 	priv->can.clock.freq = clock_freq;
 	priv->can.bittiming_const = &flexcan_bittiming_const;
 	priv->can.do_set_mode = flexcan_set_mode;
-- 
1.8.5

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

* [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb
  2014-06-20  2:01 [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Zhao Qiang
@ 2014-06-20  2:01 ` Zhao Qiang
  2014-06-20  8:52   ` Marc Kleine-Budde
  2014-06-20 16:19 ` [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Scott Wood
  2014-06-21 19:38 ` Marc Kleine-Budde
  2 siblings, 1 reply; 9+ messages in thread
From: Zhao Qiang @ 2014-06-20  2:01 UTC (permalink / raw)
  To: linuxppc-dev, linux-can, wg, mkl, B07421; +Cc: Zhao Qiang

add err interrupt for p1010rdb into dts.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
Changes for v2:
	- add binding documentation update

 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 7 +++++--
 arch/powerpc/boot/dts/fsl/p1010si-post.dtsi               | 6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
index 56d6cc3..81929e5 100644
--- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
+++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
@@ -10,7 +10,9 @@ Required properties:
   - fsl,p1010-flexcan
 
 - reg : Offset and length of the register set for this device
-- interrupts : Interrupt tuple for this device
+- interrupts : Interrupt tuple for this device.
+	The first interrupt is for FlexCAN(Message Buffer and Wake Up)
+	The second is for error(Shared with IFC, PEX1 and some other device)
 
 Optional properties:
 
@@ -23,7 +25,8 @@ Example:
 	can@1c000 {
 		compatible = "fsl,p1010-flexcan";
 		reg = <0x1c000 0x1000>;
-		interrupts = <48 0x2>;
+		interrupts = <48 0x2 0 0
+			      16 0x2 0 0>;
 		interrupt-parent = <&mpic>;
 		clock-frequency = <200000000>; // filled in by bootloader
 	};
diff --git a/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi
index af12ead..47125a6 100644
--- a/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1010si-post.dtsi
@@ -136,13 +136,15 @@
 	can0: can@1c000 {
 		compatible = "fsl,p1010-flexcan";
 		reg = <0x1c000 0x1000>;
-		interrupts = <48 0x2 0 0>;
+		interrupts = <48 0x2 0 0
+			      16 0x2 0 0>;
 	};
 
 	can1: can@1d000 {
 		compatible = "fsl,p1010-flexcan";
 		reg = <0x1d000 0x1000>;
-		interrupts = <61 0x2 0 0>;
+		interrupts = <61 0x2 0 0
+			      16 0x2 0 0>;
 	};
 
 	L2: l2-cache-controller@20000 {
-- 
1.8.5

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

* Re: [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb
  2014-06-20  2:01 ` [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb Zhao Qiang
@ 2014-06-20  8:52   ` Marc Kleine-Budde
  2014-06-20 16:16     ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Marc Kleine-Budde @ 2014-06-20  8:52 UTC (permalink / raw)
  To: Zhao Qiang, linuxppc-dev, linux-can, wg, B07421

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

On 06/20/2014 04:01 AM, Zhao Qiang wrote:
> add err interrupt for p1010rdb into dts.
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- add binding documentation update
> 
>  Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 7 +++++--
>  arch/powerpc/boot/dts/fsl/p1010si-post.dtsi               | 6 ++++--
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> index 56d6cc3..81929e5 100644
> --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> @@ -10,7 +10,9 @@ Required properties:
>    - fsl,p1010-flexcan
>  
>  - reg : Offset and length of the register set for this device
> -- interrupts : Interrupt tuple for this device
> +- interrupts : Interrupt tuple for this device.
> +	The first interrupt is for FlexCAN(Message Buffer and Wake Up)
> +	The second is for error(Shared with IFC, PEX1 and some other device)

The second interrupt is optional, at least on ARM we don't need it,
please reflect this in the documentation update.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

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

* Re: [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb
  2014-06-20  8:52   ` Marc Kleine-Budde
@ 2014-06-20 16:16     ` Scott Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Scott Wood @ 2014-06-20 16:16 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Zhao Qiang, B07421, linuxppc-dev, wg, linux-can

On Fri, 2014-06-20 at 10:52 +0200, Marc Kleine-Budde wrote:
> On 06/20/2014 04:01 AM, Zhao Qiang wrote:
> > add err interrupt for p1010rdb into dts.
> > 
> > Signed-off-by: Zhao Qiang <B45475@freescale.com>
> > ---
> > Changes for v2:
> > 	- add binding documentation update
> > 
> >  Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 7 +++++--
> >  arch/powerpc/boot/dts/fsl/p1010si-post.dtsi               | 6 ++++--
> >  2 files changed, 9 insertions(+), 4 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > index 56d6cc3..81929e5 100644
> > --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> > @@ -10,7 +10,9 @@ Required properties:
> >    - fsl,p1010-flexcan
> >  
> >  - reg : Offset and length of the register set for this device
> > -- interrupts : Interrupt tuple for this device
> > +- interrupts : Interrupt tuple for this device.
> > +	The first interrupt is for FlexCAN(Message Buffer and Wake Up)
> > +	The second is for error(Shared with IFC, PEX1 and some other device)
> 
> The second interrupt is optional, at least on ARM we don't need it,
> please reflect this in the documentation update.

The binding also shouldn't specify that the interrupt is shared, much
less with specific things.  It's not relevant, and may not be
universally true.

-Scott

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

* Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
  2014-06-20  2:01 [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Zhao Qiang
  2014-06-20  2:01 ` [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb Zhao Qiang
@ 2014-06-20 16:19 ` Scott Wood
  2014-06-23  6:20   ` qiang.zhao
  2014-06-21 19:38 ` Marc Kleine-Budde
  2 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2014-06-20 16:19 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: B07421, mkl, linuxppc-dev, wg, linux-can

On Fri, 2014-06-20 at 10:01 +0800, Zhao Qiang wrote:
> when flexcan is not physically linked, command 'cantest' will
> trigger an err_irq, add err_irq handler for it.
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- use a space instead of tab
> 	- use flexcan_poll_state instead of print
> 
>  drivers/net/can/flexcan.c | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index f425ec2..7432ba4 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -208,6 +208,7 @@ struct flexcan_priv {
>  	void __iomem *base;
>  	u32 reg_esr;
>  	u32 reg_ctrl_default;
> +	unsigned int err_irq;

Why unsigned?

> +static irqreturn_t flexcan_err_irq(int irq, void *dev_id)
> +{
> +	struct net_device *dev = dev_id;
> +	struct flexcan_priv *priv = netdev_priv(dev);
> +	struct flexcan_regs __iomem *regs = priv->base;
> +	u32 reg_ctrl, reg_esr;
> +
> +	reg_esr = flexcan_read(&regs->esr);
> +	reg_ctrl = flexcan_read(&regs->ctrl);
> +	if (reg_esr & FLEXCAN_ESR_TX_WRN) {
> +		flexcan_write(reg_esr & ~FLEXCAN_ESR_TX_WRN, &regs->esr);
> +		flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK, &regs->ctrl);
> +		flexcan_poll_state(dev, reg_esr);
> +	}
> +	return IRQ_HANDLED;
> +}

You should only return IRQ_HANDLED if there was something to handle.

> @@ -944,6 +962,12 @@ static int flexcan_open(struct net_device *dev)
>  	if (err)
>  		goto out_close;
>  
> +	if (priv->err_irq)
> +		err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
> +				  dev->name, dev);
> +	if (err)
> +		goto out_close;

Is this really a fatal error?  And why do you check err outside the "if
(priv->err_irq)" block?  What if some previous code left err non-zero
(either now or after some future code change)?

> @@ -1126,6 +1150,10 @@ static int flexcan_probe(struct platform_device *pdev)
>  	if (irq <= 0)
>  		return -ENODEV;
>  
> +	err_irq = platform_get_irq(pdev, 1);
> +	if (err_irq <= 0)
> +		err_irq = 0;
> +

Why is this <= 0 check needed?

-Scott

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

* Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
  2014-06-20  2:01 [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Zhao Qiang
  2014-06-20  2:01 ` [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb Zhao Qiang
  2014-06-20 16:19 ` [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Scott Wood
@ 2014-06-21 19:38 ` Marc Kleine-Budde
  2 siblings, 0 replies; 9+ messages in thread
From: Marc Kleine-Budde @ 2014-06-21 19:38 UTC (permalink / raw)
  To: Zhao Qiang, linuxppc-dev, linux-can, wg, B07421

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

On 06/20/2014 04:01 AM, Zhao Qiang wrote:
> when flexcan is not physically linked, command 'cantest' will
> trigger an err_irq, add err_irq handler for it.
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- use a space instead of tab
> 	- use flexcan_poll_state instead of print
> 
>  drivers/net/can/flexcan.c | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index f425ec2..7432ba4 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -208,6 +208,7 @@ struct flexcan_priv {
>  	void __iomem *base;
>  	u32 reg_esr;
>  	u32 reg_ctrl_default;
> +	unsigned int err_irq;
>  
>  	struct clk *clk_ipg;
>  	struct clk *clk_per;
> @@ -744,6 +745,23 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> +static irqreturn_t flexcan_err_irq(int irq, void *dev_id)
> +{
> +	struct net_device *dev = dev_id;
> +	struct flexcan_priv *priv = netdev_priv(dev);
> +	struct flexcan_regs __iomem *regs = priv->base;
> +	u32 reg_ctrl, reg_esr;
> +
> +	reg_esr = flexcan_read(&regs->esr);
> +	reg_ctrl = flexcan_read(&regs->ctrl);
> +	if (reg_esr & FLEXCAN_ESR_TX_WRN) {

When is the err_irq triggered?

> +		flexcan_write(reg_esr & ~FLEXCAN_ESR_TX_WRN, &regs->esr);
> +		flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK, &regs->ctrl);
> +		flexcan_poll_state(dev, reg_esr);

poll_state() is does not work, if called from an IRQ
handler.....Depending when err_irq is triggered, is it worth to just
call the normal interrupt handler?

> +	}
> +	return IRQ_HANDLED;

Please return IRQ_HANDLED, only if there really was an interrupt.

> +}
> +
>  static void flexcan_set_bittiming(struct net_device *dev)
>  {
>  	const struct flexcan_priv *priv = netdev_priv(dev);
> @@ -944,6 +962,12 @@ static int flexcan_open(struct net_device *dev)
>  	if (err)
>  		goto out_close;
>  
> +	if (priv->err_irq)
> +		err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
> +				  dev->name, dev);
> +	if (err)
> +		goto out_close;

In case of an error, you don't free() dev->irq.

> +
>  	/* start chip and queuing */
>  	err = flexcan_chip_start(dev);
>  	if (err)
> @@ -1099,7 +1123,7 @@ static int flexcan_probe(struct platform_device *pdev)
>  	struct resource *mem;
>  	struct clk *clk_ipg = NULL, *clk_per = NULL;
>  	void __iomem *base;
> -	int err, irq;
> +	int err, irq, err_irq;
>  	u32 clock_freq = 0;
>  
>  	if (pdev->dev.of_node)
> @@ -1126,6 +1150,10 @@ static int flexcan_probe(struct platform_device *pdev)
>  	if (irq <= 0)
>  		return -ENODEV;
>  
> +	err_irq = platform_get_irq(pdev, 1);
> +	if (err_irq <= 0)
> +		err_irq = 0;
> +
>  	base = devm_ioremap_resource(&pdev->dev, mem);
>  	if (IS_ERR(base))
>  		return PTR_ERR(base);
> @@ -1149,6 +1177,7 @@ static int flexcan_probe(struct platform_device *pdev)
>  	dev->flags |= IFF_ECHO;
>  
>  	priv = netdev_priv(dev);
> +	priv->err_irq = err_irq;
>  	priv->can.clock.freq = clock_freq;
>  	priv->can.bittiming_const = &flexcan_bittiming_const;
>  	priv->can.do_set_mode = flexcan_set_mode;
> 

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

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

* RE: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
  2014-06-20 16:19 ` [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Scott Wood
@ 2014-06-23  6:20   ` qiang.zhao
  2014-06-24 17:34     ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: qiang.zhao @ 2014-06-23  6:20 UTC (permalink / raw)
  To: Scott Wood; +Cc: mkl, linuxppc-dev, wg, linux-can

T24gU2F0LCAyMDE0LTA2LTIxIGF0IDEyOjE5LCBXb29kIFNjb3R0IHdyb3RlOg0KDQo+IC0tLS0t
T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1dHVyZSBjb2Rl
IGNoYW5nZSk/DQo+IA0KPiA+IEBAIC0xMTI2LDYgKzExNTAsMTAgQEAgc3RhdGljIGludCBmbGV4
Y2FuX3Byb2JlKHN0cnVjdCBwbGF0Zm9ybV9kZXZpY2UNCj4gKnBkZXYpDQo+ID4gIAlpZiAoaXJx
IDw9IDApDQo+ID4gIAkJcmV0dXJuIC1FTk9ERVY7DQo+ID4NCj4gPiArCWVycl9pcnEgPSBwbGF0
Zm9ybV9nZXRfaXJxKHBkZXYsIDEpOw0KPiA+ICsJaWYgKGVycl9pcnEgPD0gMCkNCj4gPiArCQll
cnJfaXJxID0gMDsNCj4gPiArDQo+IA0KPiBXaHkgaXMgdGhpcyA8PSAwIGNoZWNrIG5lZWRlZD8N
Cg0KSW50ZXJydXB0WzFdIGlzIG9wdGlvbmFsLiBJZiB0aGVyZSBpcyBub3QgaW50ZXJydXB0WzFd
IGluIGR0YiwgZXJyX2lycSB3aWxsIGJlIDw9MC4NCg0KPiANCj4gLVNjb3R0DQo+IA0KDQo=

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

* Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
  2014-06-23  6:20   ` qiang.zhao
@ 2014-06-24 17:34     ` Scott Wood
  2014-06-25  2:04       ` qiang.zhao
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2014-06-24 17:34 UTC (permalink / raw)
  To: Zhao Qiang-B45475; +Cc: mkl, linuxppc-dev, wg, linux-can

On Mon, 2014-06-23 at 01:20 -0500, Zhao Qiang-B45475 wrote:
> On Sat, 2014-06-21 at 12:19, Wood Scott wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Saturday, June 21, 2014 12:19 AM
> > To: Zhao Qiang-B45475
> > Cc: linuxppc-dev@lists.ozlabs.org; linux-can@vger.kernel.org;
> > wg@grandegger.com; mkl@pengutronix.de; Wood Scott-B07421
> > Subject: Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
> > 
> > On Fri, 2014-06-20 at 10:01 +0800, Zhao Qiang wrote:
> > > when flexcan is not physically linked, command 'cantest' will trigger
> > > an err_irq, add err_irq handler for it.
> > >
> > > Signed-off-by: Zhao Qiang <B45475@freescale.com>
> > > ---
> > > Changes for v2:
> > > 	- use a space instead of tab
> > > 	- use flexcan_poll_state instead of print
> > >
> > >  drivers/net/can/flexcan.c | 31 ++++++++++++++++++++++++++++++-
> > >  1 file changed, 30 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> > > index f425ec2..7432ba4 100644
> > > --- a/drivers/net/can/flexcan.c
> > > +++ b/drivers/net/can/flexcan.c
> > > @@ -208,6 +208,7 @@ struct flexcan_priv {
> > >  	void __iomem *base;
> > >  	u32 reg_esr;
> > >  	u32 reg_ctrl_default;
> > > +	unsigned int err_irq;
> > 
> > Why unsigned?
> Err_irq is from 0.

So?  irqs are plain "int" almost everywhere in the kernel.

-Scott

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

* RE: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan
  2014-06-24 17:34     ` Scott Wood
@ 2014-06-25  2:04       ` qiang.zhao
  0 siblings, 0 replies; 9+ messages in thread
From: qiang.zhao @ 2014-06-25  2:04 UTC (permalink / raw)
  To: Scott Wood; +Cc: mkl, linuxppc-dev, wg, linux-can

=0A=
________________________________________=0A=
From: Wood Scott-B07421=0A=
Sent: Wednesday, June 25, 2014 1:34 AM=0A=
To: Zhao Qiang-B45475=0A=
Cc: linuxppc-dev@lists.ozlabs.org; linux-can@vger.kernel.org; wg@grandegger=
.com; mkl@pengutronix.de=0A=
Subject: Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan=0A=
=0A=
On Mon, 2014-06-23 at 01:20 -0500, Zhao Qiang-B45475 wrote:=0A=
> On Sat, 2014-06-21 at 12:19, Wood Scott wrote:=0A=
>=0A=
> > -----Original Message-----=0A=
> > From: Wood Scott-B07421=0A=
> > Sent: Saturday, June 21, 2014 12:19 AM=0A=
> > To: Zhao Qiang-B45475=0A=
> > Cc: linuxppc-dev@lists.ozlabs.org; linux-can@vger.kernel.org;=0A=
> > wg@grandegger.com; mkl@pengutronix.de; Wood Scott-B07421=0A=
> > Subject: Re: [PATCH v2 1/2] flexcan: add err_irq handler for flexcan=0A=
> >=0A=
> > On Fri, 2014-06-20 at 10:01 +0800, Zhao Qiang wrote:=0A=
> > > when flexcan is not physically linked, command 'cantest' will trigger=
=0A=
> > > an err_irq, add err_irq handler for it.=0A=
> > >=0A=
> > > Signed-off-by: Zhao Qiang <B45475@freescale.com>=0A=
> > > ---=0A=
> > > Changes for v2:=0A=
> > >   - use a space instead of tab=0A=
> > >   - use flexcan_poll_state instead of print=0A=
> > >=0A=
> > >  drivers/net/can/flexcan.c | 31 ++++++++++++++++++++++++++++++-=0A=
> > >  1 file changed, 30 insertions(+), 1 deletion(-)=0A=
> > >=0A=
> > > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c=0A=
> > > index f425ec2..7432ba4 100644=0A=
> > > --- a/drivers/net/can/flexcan.c=0A=
> > > +++ b/drivers/net/can/flexcan.c=0A=
> > > @@ -208,6 +208,7 @@ struct flexcan_priv {=0A=
> > >   void __iomem *base;=0A=
> > >   u32 reg_esr;=0A=
> > >   u32 reg_ctrl_default;=0A=
> > > + unsigned int err_irq;=0A=
> >=0A=
> > Why unsigned?=0A=
> Err_irq is from 0.=0A=
=0A=
So?  irqs are plain "int" almost everywhere in the kernel.=0A=
=0A=
OK, I will change it.=0A=
=0A=
-Zhao =0A=
=0A=

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

end of thread, other threads:[~2014-06-25  2:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20  2:01 [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Zhao Qiang
2014-06-20  2:01 ` [PATCH v2 2/2] flexcan: add err interrupt for p1010rdb Zhao Qiang
2014-06-20  8:52   ` Marc Kleine-Budde
2014-06-20 16:16     ` Scott Wood
2014-06-20 16:19 ` [PATCH v2 1/2] flexcan: add err_irq handler for flexcan Scott Wood
2014-06-23  6:20   ` qiang.zhao
2014-06-24 17:34     ` Scott Wood
2014-06-25  2:04       ` qiang.zhao
2014-06-21 19:38 ` Marc Kleine-Budde

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