linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net] ravb: Remove clear unhandled interrupt
@ 2015-12-13 15:12 Yoshihiro Kaneko
  2015-12-13 16:25 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-13 15:12 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Sergei Shtylyov, Simon Horman, Magnus Damm,
	linux-sh

From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>

AVB-DMAC Receive FIFO Warning interrupt is not enabled, so it is not
necessary to disable the interrupt in ndo_close().
On the other hand, this patch disables the interrupt in ndo_open() to
prevent the possibility that the interrupt is issued by the state that
a boot loader left.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on the master branch of David Miller's networking
tree.

v2 [Yoshihiro Kaneko]
* compile tested only
* As suggested by Sergei Shtylyov
  - clear RIC1 in ndo_open() to disable the interrupt regardless of
    a left state from a bootloader.


 drivers/net/ethernet/renesas/ravb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index b69e0c2..5e34a88 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1228,6 +1228,9 @@ static int ravb_open(struct net_device *ndev)
 		goto out_free_irq2;
 	ravb_emac_init(ndev);
 
+	/* Disable unhandled interrupt */
+	ravb_write(ndev, 0, RIC1);
+
 	/* Initialise PTP Clock driver */
 	ravb_ptp_init(ndev, priv->pdev);
 
@@ -1471,7 +1474,6 @@ static int ravb_close(struct net_device *ndev)
 
 	/* Disable interrupts by clearing the interrupt masks. */
 	ravb_write(ndev, 0, RIC0);
-	ravb_write(ndev, 0, RIC1);
 	ravb_write(ndev, 0, RIC2);
 	ravb_write(ndev, 0, TIC);
 
-- 
1.9.1


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

* Re: [PATCH v2 net] ravb: Remove clear unhandled interrupt
  2015-12-13 15:12 [PATCH v2 net] ravb: Remove clear unhandled interrupt Yoshihiro Kaneko
@ 2015-12-13 16:25 ` Sergei Shtylyov
  2015-12-14 16:30   ` Yoshihiro Kaneko
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2015-12-13 16:25 UTC (permalink / raw)
  To: Yoshihiro Kaneko, netdev
  Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

Hello.

On 12/13/2015 06:12 PM, Yoshihiro Kaneko wrote:

    The subject doesn't seem to reflect what the patch is doing.

> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>
> AVB-DMAC Receive FIFO Warning interrupt is not enabled, so it is not
> necessary to disable the interrupt in ndo_close().
> On the other hand, this patch disables the interrupt in ndo_open() to
> prevent the possibility that the interrupt is issued by the state that
> a boot loader left.
>
> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on the master branch of David Miller's networking
> tree.
>
> v2 [Yoshihiro Kaneko]
> * compile tested only
> * As suggested by Sergei Shtylyov
>    - clear RIC1 in ndo_open() to disable the interrupt regardless of
>      a left state from a bootloader.
>
>
>   drivers/net/ethernet/renesas/ravb_main.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index b69e0c2..5e34a88 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1228,6 +1228,9 @@ static int ravb_open(struct net_device *ndev)
>   		goto out_free_irq2;
>   	ravb_emac_init(ndev);
>
> +	/* Disable unhandled interrupt */
> +	ravb_write(ndev, 0, RIC1);
> +

    Oh, I thought the interrupt masks are programmed here but they are set in 
ravb_dmac_init() that this function calls. Please do it there instead (where 
it was originally done).

[...]

MBR, Sergei


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

* Re: [PATCH v2 net] ravb: Remove clear unhandled interrupt
  2015-12-13 16:25 ` Sergei Shtylyov
@ 2015-12-14 16:30   ` Yoshihiro Kaneko
  0 siblings, 0 replies; 3+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-14 16:30 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: netdev, David S. Miller, Simon Horman, Magnus Damm, Linux-sh list

Hi,

2015-12-14 1:25 GMT+09:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
> On 12/13/2015 06:12 PM, Yoshihiro Kaneko wrote:
>
>    The subject doesn't seem to reflect what the patch is doing.
>
>
>> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>>
>> AVB-DMAC Receive FIFO Warning interrupt is not enabled, so it is not
>> necessary to disable the interrupt in ndo_close().
>> On the other hand, this patch disables the interrupt in ndo_open() to
>> prevent the possibility that the interrupt is issued by the state that
>> a boot loader left.
>>
>> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on the master branch of David Miller's networking
>> tree.
>>
>> v2 [Yoshihiro Kaneko]
>> * compile tested only
>> * As suggested by Sergei Shtylyov
>>    - clear RIC1 in ndo_open() to disable the interrupt regardless of
>>      a left state from a bootloader.
>>
>>
>>   drivers/net/ethernet/renesas/ravb_main.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>> b/drivers/net/ethernet/renesas/ravb_main.c
>> index b69e0c2..5e34a88 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -1228,6 +1228,9 @@ static int ravb_open(struct net_device *ndev)
>>                 goto out_free_irq2;
>>         ravb_emac_init(ndev);
>>
>> +       /* Disable unhandled interrupt */
>> +       ravb_write(ndev, 0, RIC1);
>> +
>
>
>    Oh, I thought the interrupt masks are programmed here but they are set in
> ravb_dmac_init() that this function calls. Please do it there instead (where
> it was originally done).

done.

>
> [...]
>
> MBR, Sergei
>

Thanks,
kaneko

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

end of thread, other threads:[~2015-12-14 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13 15:12 [PATCH v2 net] ravb: Remove clear unhandled interrupt Yoshihiro Kaneko
2015-12-13 16:25 ` Sergei Shtylyov
2015-12-14 16:30   ` Yoshihiro Kaneko

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