From: Felipe Balbi <balbi@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, linux-omap@vger.kernel.org,
Brian Hutchinson <b.hutchman@gmail.com>,
Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts
Date: Tue, 13 Jan 2015 13:36:34 -0600 [thread overview]
Message-ID: <20150113193634.GQ16533@saruman> (raw)
In-Reply-To: <1421177368-19756-2-git-send-email-tony@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 2989 bytes --]
On Tue, Jan 13, 2015 at 11:29:23AM -0800, Tony Lindgren wrote:
> On davinci_emac, we have pulse interrupts. This means that we need to
> clear the EOI bits when disabling interrupts as otherwise the interrupts
> keep happening. And we also need to not clear the EOI bits again when
> enabling the interrupts as otherwise we will get tons of:
>
> unexpected IRQ trap at vector 00
>
> These errors almost certainly mean that the omap-intc.c is signaling
> a spurious interrupt with the reserved irq 127 as we've seen earlier
> on omap3.
>
> Let's fix the issue by clearing the EOI bits when disabling the
> interrupts. Let's also keep the comment for "Rx Threshold and Misc
> interrupts are not enabled" for both enable and disable so people
> are aware of this when potentially adding more support.
>
> Note that eventually we should handle the RX and TX interrupts
> separately like cpsw is now doing. However, so far I have not seen
> any issues with this based on my testing, so it seems to behave a
> little different compared to the cpsw that had a similar issue.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
pretty much the same thing that happens with CPSW, I think that a future
patch might want to change things so that we only write EOI to the IRQ
that actually fires, though.
Reviewed-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index ea71251..383ed52 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -922,6 +922,16 @@ static void emac_int_disable(struct emac_priv *priv)
> if (priv->int_disable)
> priv->int_disable();
>
> + /* NOTE: Rx Threshold and Misc interrupts are not enabled */
> +
> + /* ack rxen only then a new pulse will be generated */
> + emac_write(EMAC_DM646X_MACEOIVECTOR,
> + EMAC_DM646X_MAC_EOI_C0_RXEN);
> +
> + /* ack txen- only then a new pulse will be generated */
> + emac_write(EMAC_DM646X_MACEOIVECTOR,
> + EMAC_DM646X_MAC_EOI_C0_TXEN);
> +
> local_irq_restore(flags);
>
> } else {
> @@ -951,15 +961,6 @@ static void emac_int_enable(struct emac_priv *priv)
> * register */
>
> /* NOTE: Rx Threshold and Misc interrupts are not enabled */
> -
> - /* ack rxen only then a new pulse will be generated */
> - emac_write(EMAC_DM646X_MACEOIVECTOR,
> - EMAC_DM646X_MAC_EOI_C0_RXEN);
> -
> - /* ack txen- only then a new pulse will be generated */
> - emac_write(EMAC_DM646X_MACEOIVECTOR,
> - EMAC_DM646X_MAC_EOI_C0_TXEN);
> -
> } else {
> /* Set DM644x control registers for interrupt control */
> emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1);
> --
> 2.1.4
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>,
<linux-omap@vger.kernel.org>,
Brian Hutchinson <b.hutchman@gmail.com>,
Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts
Date: Tue, 13 Jan 2015 13:36:34 -0600 [thread overview]
Message-ID: <20150113193634.GQ16533@saruman> (raw)
In-Reply-To: <1421177368-19756-2-git-send-email-tony@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 2989 bytes --]
On Tue, Jan 13, 2015 at 11:29:23AM -0800, Tony Lindgren wrote:
> On davinci_emac, we have pulse interrupts. This means that we need to
> clear the EOI bits when disabling interrupts as otherwise the interrupts
> keep happening. And we also need to not clear the EOI bits again when
> enabling the interrupts as otherwise we will get tons of:
>
> unexpected IRQ trap at vector 00
>
> These errors almost certainly mean that the omap-intc.c is signaling
> a spurious interrupt with the reserved irq 127 as we've seen earlier
> on omap3.
>
> Let's fix the issue by clearing the EOI bits when disabling the
> interrupts. Let's also keep the comment for "Rx Threshold and Misc
> interrupts are not enabled" for both enable and disable so people
> are aware of this when potentially adding more support.
>
> Note that eventually we should handle the RX and TX interrupts
> separately like cpsw is now doing. However, so far I have not seen
> any issues with this based on my testing, so it seems to behave a
> little different compared to the cpsw that had a similar issue.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
pretty much the same thing that happens with CPSW, I think that a future
patch might want to change things so that we only write EOI to the IRQ
that actually fires, though.
Reviewed-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index ea71251..383ed52 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -922,6 +922,16 @@ static void emac_int_disable(struct emac_priv *priv)
> if (priv->int_disable)
> priv->int_disable();
>
> + /* NOTE: Rx Threshold and Misc interrupts are not enabled */
> +
> + /* ack rxen only then a new pulse will be generated */
> + emac_write(EMAC_DM646X_MACEOIVECTOR,
> + EMAC_DM646X_MAC_EOI_C0_RXEN);
> +
> + /* ack txen- only then a new pulse will be generated */
> + emac_write(EMAC_DM646X_MACEOIVECTOR,
> + EMAC_DM646X_MAC_EOI_C0_TXEN);
> +
> local_irq_restore(flags);
>
> } else {
> @@ -951,15 +961,6 @@ static void emac_int_enable(struct emac_priv *priv)
> * register */
>
> /* NOTE: Rx Threshold and Misc interrupts are not enabled */
> -
> - /* ack rxen only then a new pulse will be generated */
> - emac_write(EMAC_DM646X_MACEOIVECTOR,
> - EMAC_DM646X_MAC_EOI_C0_RXEN);
> -
> - /* ack txen- only then a new pulse will be generated */
> - emac_write(EMAC_DM646X_MACEOIVECTOR,
> - EMAC_DM646X_MAC_EOI_C0_TXEN);
> -
> } else {
> /* Set DM644x control registers for interrupt control */
> emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1);
> --
> 2.1.4
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-13 19:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 19:29 [PATCH 0/6] Fixes for davinci_emac Tony Lindgren
2015-01-13 19:29 ` [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts Tony Lindgren
2015-01-13 19:36 ` Felipe Balbi [this message]
2015-01-13 19:36 ` Felipe Balbi
2015-01-13 19:45 ` Tony Lindgren
2015-01-13 19:29 ` [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac Tony Lindgren
2015-01-13 19:51 ` Felipe Balbi
2015-01-13 19:51 ` Felipe Balbi
2015-01-13 20:54 ` Tony Lindgren
2015-01-13 21:03 ` Felipe Balbi
2015-01-13 21:03 ` Felipe Balbi
2015-01-13 23:42 ` Mark A. Greer
2015-01-13 19:29 ` [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency Tony Lindgren
2015-01-13 19:48 ` Tom Lendacky
2015-01-13 19:48 ` Tom Lendacky
2015-01-13 19:50 ` Felipe Balbi
2015-01-13 19:50 ` Felipe Balbi
2015-01-13 20:15 ` Tony Lindgren
2015-01-13 19:54 ` Tony Lindgren
2015-01-13 21:05 ` David Miller
2015-01-14 19:10 ` Tony Lindgren
2015-01-13 19:29 ` [PATCH 4/6] net: davinci_emac: Fix incomplete code for getting the phy from device tree Tony Lindgren
2015-01-13 19:29 ` [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space Tony Lindgren
2015-01-13 19:54 ` Felipe Balbi
2015-01-13 19:54 ` Felipe Balbi
2015-01-13 19:59 ` Tony Lindgren
2015-01-13 20:21 ` Felipe Balbi
2015-01-13 20:21 ` Felipe Balbi
2015-01-13 19:29 ` [PATCH 6/6] net: davinci_emac: Add support for emac on dm816x Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2015-01-15 22:45 [PATCHv2 0/6] Fixes for davinci_emac Tony Lindgren
2015-01-15 22:45 ` [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150113193634.GQ16533@saruman \
--to=balbi@ti.com \
--cc=b.hutchman@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.