* [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Tony Lindgren @ 2015-01-13 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-1-git-send-email-tony@atomide.com>
We only use clk_get() to get the frequency, the rest is done by
the runtime PM calls. Let's free the clock too.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index deb43b3..e9efc74 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
return -EBUSY;
}
emac_bus_frequency = clk_get_rate(emac_clk);
+ clk_put(emac_clk);
/* TODO: Probe PHY here if possible */
--
2.1.4
^ permalink raw reply related
* [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
From: Tony Lindgren @ 2015-01-13 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-1-git-send-email-tony@atomide.com>
Some devices like dm816x have the MDIO registers within the first EMAC
instance address space. Let's fix the issue by allowing to pass an
optional second IO range for the EMAC control register area.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 4c8d82c..0342273 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
static int davinci_emac_probe(struct platform_device *pdev)
{
int rc = 0;
- struct resource *res;
+ struct resource *res, *res_ctrl;
struct net_device *ndev;
struct emac_priv *priv;
unsigned long hw_ram_addr;
@@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device *pdev)
rc = PTR_ERR(priv->remap_addr);
goto no_pdata;
}
+
+ res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ if (res_ctrl) {
+ priv->ctrl_base =
+ devm_ioremap_resource(&pdev->dev, res_ctrl);
+ if (IS_ERR(priv->ctrl_base))
+ goto no_pdata;
+ } else {
+ priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset;
+ }
+
priv->emac_base = priv->remap_addr + pdata->ctrl_reg_offset;
ndev->base_addr = (unsigned long)priv->remap_addr;
- priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset;
-
hw_ram_addr = pdata->hw_ram_addr;
if (!hw_ram_addr)
hw_ram_addr = (u32 __force)res->start + pdata->ctrl_ram_offset;
--
2.1.4
^ permalink raw reply related
* [PATCH 6/6] net: davinci_emac: Add support for emac on dm816x
From: Tony Lindgren @ 2015-01-13 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-1-git-send-email-tony@atomide.com>
On dm816x we have two emac controllers with separate memory
areas.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
Documentation/devicetree/bindings/net/davinci_emac.txt | 3 ++-
drivers/net/ethernet/ti/davinci_emac.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/davinci_emac.txt b/Documentation/devicetree/bindings/net/davinci_emac.txt
index 0328088..24c5cda 100644
--- a/Documentation/devicetree/bindings/net/davinci_emac.txt
+++ b/Documentation/devicetree/bindings/net/davinci_emac.txt
@@ -4,7 +4,8 @@ This file provides information, what the device node
for the davinci_emac interface contains.
Required properties:
-- compatible: "ti,davinci-dm6467-emac" or "ti,am3517-emac"
+- compatible: "ti,davinci-dm6467-emac", "ti,am3517-emac" or
+ "ti,dm816-emac"
- reg: Offset and length of the register set for the device
- ti,davinci-ctrl-reg-offset: offset to control register
- ti,davinci-ctrl-mod-reg-offset: offset to control module register
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 0342273..5caee66 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -2101,9 +2101,14 @@ static const struct emac_platform_data am3517_emac_data = {
.hw_ram_addr = 0x01e20000,
};
+static const struct emac_platform_data dm816_emac_data = {
+ .version = EMAC_VERSION_2,
+};
+
static const struct of_device_id davinci_emac_of_match[] = {
{.compatible = "ti,davinci-dm6467-emac", },
{.compatible = "ti,am3517-emac", .data = &am3517_emac_data, },
+ {.compatible = "ti,dm816-emac", .data = &dm816_emac_data, },
{},
};
MODULE_DEVICE_TABLE(of, davinci_emac_of_match);
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 1/1 net-next] openvswitch: Remove unnecessary version.h inclusion
From: David Miller @ 2015-01-13 19:31 UTC (permalink / raw)
To: s.syam; +Cc: netdev, dev, pshelar, syamsidhardh
In-Reply-To: <1421075975-27483-1-git-send-email-s.syam@samsung.com>
From: Syam Sidhardhan <s.syam@samsung.com>
Date: Mon, 12 Jan 2015 20:49:35 +0530
> version.h inclusion is not necessary as detected by versioncheck.
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> Acked-by: Pravin B Shelar <pshelar@nicira.com>
> ---
> No code changes. Add net-next prefix flag for net-next tree.
Applied, thanks.
^ permalink raw reply
* [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts
From: Tony Lindgren @ 2015-01-13 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-1-git-send-email-tony@atomide.com>
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>
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
^ permalink raw reply related
* [PATCH 4/6] net: davinci_emac: Fix incomplete code for getting the phy from device tree
From: Tony Lindgren @ 2015-01-13 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-1-git-send-email-tony@atomide.com>
Looks like the phy_id is never set up beyond getting the phandle.
Note that we can remove the ifdef for phy_node as there is a stub
for of_phy_connec() if CONFIG_OF is not set.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index e9efc74..4c8d82c 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -62,6 +62,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
+#include <linux/of_mdio.h>
#include <linux/of_irq.h>
#include <linux/of_net.h>
@@ -343,9 +344,7 @@ struct emac_priv {
u32 multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS];
u32 rx_addr_type;
const char *phy_id;
-#ifdef CONFIG_OF
struct device_node *phy_node;
-#endif
struct phy_device *phydev;
spinlock_t lock;
/*platform specific members*/
@@ -1597,8 +1596,20 @@ static int emac_dev_open(struct net_device *ndev)
cpdma_ctlr_start(priv->dma);
priv->phydev = NULL;
+
+ if (priv->phy_node) {
+ priv->phydev = of_phy_connect(ndev, priv->phy_node,
+ &emac_adjust_link, 0, 0);
+ if (!priv->phydev) {
+ dev_err(emac_dev, "could not connect to phy %s\n",
+ priv->phy_node->full_name);
+ ret = -ENODEV;
+ goto err;
+ }
+ }
+
/* use the first phy on the bus if pdata did not give us a phy id */
- if (!priv->phy_id) {
+ if (!priv->phydev && !priv->phy_id) {
struct device *phy;
phy = bus_find_device(&mdio_bus_type, NULL, NULL,
@@ -1607,7 +1618,7 @@ static int emac_dev_open(struct net_device *ndev)
priv->phy_id = dev_name(phy);
}
- if (priv->phy_id && *priv->phy_id) {
+ if (!priv->phydev && priv->phy_id && *priv->phy_id) {
priv->phydev = phy_connect(ndev, priv->phy_id,
&emac_adjust_link,
PHY_INTERFACE_MODE_MII);
@@ -1628,7 +1639,9 @@ static int emac_dev_open(struct net_device *ndev)
"(mii_bus:phy_addr=%s, id=%x)\n",
priv->phydev->drv->name, dev_name(&priv->phydev->dev),
priv->phydev->phy_id);
- } else {
+ }
+
+ if (!priv->phydev) {
/* No PHY , fix the link, speed and duplex settings */
dev_notice(emac_dev, "no phy, defaulting to 100/full\n");
priv->link = 1;
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts
From: Felipe Balbi @ 2015-01-13 19:36 UTC (permalink / raw)
To: Tony Lindgren
Cc: David Miller, netdev, linux-omap, Brian Hutchinson, Felipe Balbi
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 --]
^ permalink raw reply
* Re: [patch net-next v2] tc: add BPF based action
From: David Miller @ 2015-01-13 19:36 UTC (permalink / raw)
To: jiri; +Cc: netdev, jhs, dborkman, ast, hannes
In-Reply-To: <1421078978-10904-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 12 Jan 2015 17:09:38 +0100
> + bpf_len = nla_get_u16(tb[TCA_ACT_BPF_OPS_LEN]);
> + if (bpf_len > BPF_MAXINSNS || bpf_len == 0)
> + return -EINVAL;
> +
> + bpf_size = bpf_len * sizeof(*bpf_ops);
When I see variables named 'len' and 'size', I expect them to be
in unit bytes.
I think it's clearer to call bpf_len something like "bpf_num_insns",
or "bpf_num_ops", or something like that.
Also, is the OPS_LEN attribute really necessary? Can't you just
figure this out using nla_len() on the OPS attribute? Or is that not
always accurate due to alignment?
^ permalink raw reply
* RE: [PATCH] i40e: don't enable and init FCOE by default when do PF reset
From: Dev, Vasu @ 2015-01-13 19:38 UTC (permalink / raw)
To: Ethan Zhao
Cc: Ronciak, John, Ethan Zhao, Kirsher, Jeffrey T, Brandeburg, Jesse,
Allan, Bruce W, Wyborny, Carolyn, Skidmore, Donald C,
Rose, Gregory V, Vick, Matthew, Williams, Mitch A, Parikh, Neerav,
Linux NICS, e1000-devel@lists.sourceforge.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
brian.maly@oracle.com
In-Reply-To: <CABawtvN_afL4B=fwtRJF_YJpe7tv6yf-OHJipWkGd-AiAjtckg@mail.gmail.com>
> -----Original Message-----
> >> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> >> > b/drivers/net/ethernet/intel/i40e/i40e_main.c
> >> > index a5f2660..a2572cc 100644
> >> > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> >> > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> >> > @@ -6180,9 +6180,12 @@ static void i40e_reset_and_rebuild(struct
> >> > i40e_pf *pf, bool reinit)
> >> > }
> >> > #endif /* CONFIG_I40E_DCB */
> >> > #ifdef I40E_FCOE
> >> > - ret = i40e_init_pf_fcoe(pf);
> >> > - if (ret)
> >> > - dev_info(&pf->pdev->dev, "init_pf_fcoe failed: %d\n", ret);
> >> > + if (pf->flags & I40E_FLAG_FCOE_ENABLED) {
> >> > + ret = i40e_init_pf_fcoe(pf);
> >
> > Calling i40e_init_pf_fcoe() here conflicts with its
> I40E_FLAG_FCOE_ENABLED pre-condition since I40E_FLAG_FCOE_ENABLED is
> set by very same i40e_init_pf_fcoe(), in turn i40e_init_pf_fcoe() will never get
> called.
>
> I don't think so, here ,i40e_reset_and_rebuild() is not the only and the first
> place that i40e_init_pf_fcoe() is called, see i40e_probe(), that is the first
> chance.
>
> i40e_probe()
> -->i40e_sw_init()
> -->i40e_init_pf_fcoe()
>
> And the I40E_FLAG_FCOE_ENABLED is possible be set by
> i40e_fcoe_enable() or i40e_fcoe_disable() interface before the reset action is
> to be done.
>
It is set by i40e_init_pf_fcoe() and you are right that the modified call flow by your patch won't impact setting of I40E_FLAG_FCOE_ENABLED anyway which could have prevented calling i40e_init_pf_fcoe() as I described above, so this is not an issue with the patch.
> BTW, the reason I post this patch is that we hit a bug, after setup vlan, the PF
> is enabled to FCOE.
>
Then that BUG would still remain un-fixed and calling i40e_init_pf_fcoe() under I40E_FLAG_FCOE_ENABLED flag really won't affect call flow to fix anything. I mean I40E_FLAG_FCOE_ENABLED condition will be true with "pf->hw.func_caps.fcoe == true" and otherwise calling i40e_init_pf_fcoe() simply returns back early on after checking "pf->hw.func_caps.fcoe == false", so how that bug is fixed here by added I40E_FLAG_FCOE_ENABLED condition ? What is the bug ?
> >
> > Jeff Kirsher should be getting out a patch queued by me which adds
> I40E_FCoE Kbuild option, in that FCoE is disabled by default and user could
> enable FCoE only if needed, that patch would do same of skipping
> i40e_init_pf_fcoe() whether FCoE capability in device enabled or not in
> default config.
> >
>
> The following patch will not fix the above issue -- configuration of PF will be
> changed via reset.
> How about the FCOE is configured and disabled by i40e_fcoe_disable() ,
> then reset happens ?
>
May be but if the BUG is due to FCoE being enabled then having it disabled in config will avoid the bug for non FCoE config option and once bug is understood then that has to be fixed for FCoE enabled config also as I asked above.
Thanks Ethan for detailed response.
Vasu
> > From patchwork Wed Oct 2 23:26:08 2013
> > Content-Type: text/plain; charset="utf-8"
> > MIME-Version: 1.0
> > Content-Transfer-Encoding: 7bit
> > Subject: [net] i40e: adds FCoE configure option
> > Date: Thu, 03 Oct 2013 07:26:08 -0000
> > From: Vasu Dev <vasu.dev@intel.com>
> > X-Patchwork-Id: 11797
> >
> > Adds FCoE config option I40E_FCOE, so that FCoE can be enabled as
> > needed but otherwise have it disabled by default.
> >
> > This also eliminate multiple FCoE config checks, instead now just one
> > config check for CONFIG_I40E_FCOE.
> >
> > The I40E FCoE was added with 3.17 kernel and therefore this patch
> > shall be applied to stable 3.17 kernel also.
> >
> > CC: <stable@vger.kernel.org>
> > Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> > Tested-by: Jim Young <jamesx.m.young@intel.com>
> >
> > ---
> > drivers/net/ethernet/intel/Kconfig | 11 +++++++++++
> > drivers/net/ethernet/intel/i40e/Makefile | 2 +-
> > drivers/net/ethernet/intel/i40e/i40e_osdep.h | 4 ++--
> > 3 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/Kconfig
> > b/drivers/net/ethernet/intel/Kconfig
> > index 5b8300a..4d61ef5 100644
> > --- a/drivers/net/ethernet/intel/Kconfig
> > +++ b/drivers/net/ethernet/intel/Kconfig
> > @@ -281,6 +281,17 @@ config I40E_DCB
> >
> > If unsure, say N.
> >
> > +config I40E_FCOE
> > + bool "Fibre Channel over Ethernet (FCoE)"
> > + default n
> > + depends on I40E && DCB && FCOE
> > + ---help---
> > + Say Y here if you want to use Fibre Channel over Ethernet (FCoE)
> > + in the driver. This will create new netdev for exclusive FCoE
> > + use with XL710 FCoE offloads enabled.
> > +
> > + If unsure, say N.
> > +
> > config I40EVF
> > tristate "Intel(R) XL710 X710 Virtual Function Ethernet support"
> > depends on PCI_MSI
> > diff --git a/drivers/net/ethernet/intel/i40e/Makefile
> > b/drivers/net/ethernet/intel/i40e/Makefile
> > index 4b94ddb..c405819 100644
> > --- a/drivers/net/ethernet/intel/i40e/Makefile
> > +++ b/drivers/net/ethernet/intel/i40e/Makefile
> > @@ -44,4 +44,4 @@ i40e-objs := i40e_main.o \
> > i40e_virtchnl_pf.o
> >
> > i40e-$(CONFIG_I40E_DCB) += i40e_dcb.o i40e_dcb_nl.o
> > -i40e-$(CONFIG_FCOE:m=y) += i40e_fcoe.o
> > +i40e-$(CONFIG_I40E_FCOE) += i40e_fcoe.o
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> > b/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> > index 045b5c4..ad802dd 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_osdep.h
> > @@ -78,7 +78,7 @@ do { \
> > } while (0)
> >
> > typedef enum i40e_status_code i40e_status; -#if defined(CONFIG_FCOE)
> > || defined(CONFIG_FCOE_MODULE)
> > +#ifdef CONFIG_I40E_FCOE
> > #define I40E_FCOE
> > -#endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */
> > +#endif
> > #endif /* _I40E_OSDEP_H_ */
> >
> >> > + if (ret)
> >> > + dev_info(&pf->pdev->dev,
> >> > + "init_pf_fcoe failed: %d\n", ret);
> >> > + }
> >> >
> >> > #endif
> >> > /* do basic switch setup */
> >> > --
> >> > 1.8.3.1
> >
>
> Thanks,
> Ethan
^ permalink raw reply
* [patch-net-next 1/3] net: ethernet: cpsw: unroll IRQ request loop
From: Felipe Balbi @ 2015-01-13 19:44 UTC (permalink / raw)
To: davem
Cc: Tony Lindgren, Linux OMAP Mailing List, mugunthanvnm, netdev,
Felipe Balbi
This patch is in preparation for a nicer IRQ
handling scheme where we use different IRQ
handlers for each IRQ line (as it should be).
Later, we will also drop IRQs offset 0 and 3
because they are always disabled in this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 62 ++++++++++++++++++++++++++++++++----------
1 file changed, 47 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index e61ee8351272..6e04128b9543 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2156,7 +2156,8 @@ static int cpsw_probe(struct platform_device *pdev)
void __iomem *ss_regs;
struct resource *res, *ss_res;
u32 slave_offset, sliver_offset, slave_size;
- int ret = 0, i, k = 0;
+ int ret = 0, i;
+ int irq;
ndev = alloc_etherdev(sizeof(struct cpsw_priv));
if (!ndev) {
@@ -2345,24 +2346,55 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
- while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
- if (k >= ARRAY_SIZE(priv->irqs_table)) {
- ret = -EINVAL;
- goto clean_ale_ret;
- }
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ goto clean_ale_ret;
- ret = devm_request_irq(&pdev->dev, res->start, cpsw_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
+ priv->irqs_table[0] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
- priv->irqs_table[k] = res->start;
- k++;
+ irq = platform_get_irq(pdev, 1);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[1] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
+
+ irq = platform_get_irq(pdev, 2);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[2] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
+
+ irq = platform_get_irq(pdev, 3);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[3] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
}
- priv->num_irqs = k;
+ priv->num_irqs = 4;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
--
2.2.0
^ permalink raw reply related
* [patch-net-next 3/3] net: ethernet: cpsw: don't requests IRQs we don't use
From: Felipe Balbi @ 2015-01-13 19:44 UTC (permalink / raw)
To: davem
Cc: Tony Lindgren, Linux OMAP Mailing List, mugunthanvnm, netdev,
Felipe Balbi
In-Reply-To: <1421178288-7393-1-git-send-email-balbi@ti.com>
CPSW never uses RX_THRESHOLD or MISC interrupts. In
fact, they are always kept masked in their appropriate
IRQ Enable register.
Instead of allocating an IRQ that never fires, it's best
to remove that code altogether and let future patches
implement it if anybody needs those.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 55 ++++++++++++------------------------------
1 file changed, 15 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c9081bdbbcbc..fd0acd9b41ae 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,16 +754,6 @@ requeue:
dev_kfree_skb_any(new_skb);
}
-static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
-{
- struct cpsw_priv *priv = dev_id;
- int value = irq - priv->irqs_table[0];
-
- cpdma_ctlr_eoi(priv->dma, value);
-
- return IRQ_HANDLED;
-}
-
static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
{
struct cpsw_priv *priv = dev_id;
@@ -1635,8 +1625,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
- cpsw_rx_interrupt(priv->irq[1], priv);
- cpsw_tx_interrupt(priv->irq[2], priv);
+ cpsw_rx_interrupt(priv->irq[0], priv);
+ cpsw_tx_interrupt(priv->irq[1], priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
}
@@ -2358,30 +2348,27 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_dma_ret;
}
- ndev->irq = platform_get_irq(pdev, 0);
+ ndev->irq = platform_get_irq(pdev, 1);
if (ndev->irq < 0) {
dev_err(priv->dev, "error getting irq resource\n");
ret = -ENOENT;
goto clean_ale_ret;
}
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- goto clean_ale_ret;
-
- priv->irqs_table[0] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
+ /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
+ * MISC IRQs which are always kept disabled with this driver so
+ * we will not request them.
+ *
+ * If anyone wants to implement support for those, make sure to
+ * first request and append them to irqs_table array.
+ */
+ /* RX IRQ */
irq = platform_get_irq(pdev, 1);
if (irq < 0)
goto clean_ale_ret;
- priv->irqs_table[1] = irq;
+ priv->irqs_table[0] = irq;
ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
@@ -2389,31 +2376,19 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
+ /* TX IRQ */
irq = platform_get_irq(pdev, 2);
if (irq < 0)
goto clean_ale_ret;
- priv->irqs_table[2] = irq;
+ priv->irqs_table[1] = irq;
ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
goto clean_ale_ret;
}
-
- irq = platform_get_irq(pdev, 3);
- if (irq < 0)
- goto clean_ale_ret;
-
- priv->irqs_table[3] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
-
- priv->num_irqs = 4;
+ priv->num_irqs = 2;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
--
2.2.0
^ permalink raw reply related
* [patch-net-next 2/3] net: ethernet: cpsw: split out IRQ handler
From: Felipe Balbi @ 2015-01-13 19:44 UTC (permalink / raw)
To: davem
Cc: Tony Lindgren, Linux OMAP Mailing List, mugunthanvnm, netdev,
Felipe Balbi
In-Reply-To: <1421178288-7393-1-git-send-email-balbi@ti.com>
Now we can introduce dedicated IRQ handlers
for each of the IRQ events. This helps with
cleaning up a little bit of the clutter in
cpsw_interrupt() while also making sure that
TX IRQs will try to handle TX buffers while
RX IRQs will try to handle RX buffers.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 6e04128b9543..c9081bdbbcbc 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,18 +754,36 @@ requeue:
dev_kfree_skb_any(new_skb);
}
-static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
+static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
{
struct cpsw_priv *priv = dev_id;
int value = irq - priv->irqs_table[0];
- /* NOTICE: Ending IRQ here. The trick with the 'value' variable above
- * is to make sure we will always write the correct value to the EOI
- * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
- * for TX Interrupt and 3 for MISC Interrupt.
- */
cpdma_ctlr_eoi(priv->dma, value);
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
+{
+ struct cpsw_priv *priv = dev_id;
+
+ cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
+ cpdma_chan_process(priv->txch, 128);
+
+ priv = cpsw_get_slave_priv(priv, 1);
+ if (priv)
+ cpdma_chan_process(priv->txch, 128);
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
+{
+ struct cpsw_priv *priv = dev_id;
+
+ cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
+
cpsw_intr_disable(priv);
if (priv->irq_enabled == true) {
cpsw_disable_irq(priv);
@@ -1617,7 +1635,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
- cpsw_interrupt(ndev->irq, priv);
+ cpsw_rx_interrupt(priv->irq[1], priv);
+ cpsw_tx_interrupt(priv->irq[2], priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
}
@@ -2351,7 +2370,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[0] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2363,7 +2382,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[1] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2375,7 +2394,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[2] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2387,7 +2406,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[3] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
--
2.2.0
^ permalink raw reply related
* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Tom Lendacky @ 2015-01-13 19:48 UTC (permalink / raw)
To: Tony Lindgren, David Miller
Cc: netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-4-git-send-email-tony@atomide.com>
On 01/13/2015 01:29 PM, Tony Lindgren wrote:
> We only use clk_get() to get the frequency, the rest is done by
> the runtime PM calls. Let's free the clock too.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index deb43b3..e9efc74 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> return -EBUSY;
> }
> emac_bus_frequency = clk_get_rate(emac_clk);
> + clk_put(emac_clk);
The devm_clk_get call is used to get the clock so either a devm_clk_put
needs to be used here or just let the devm_ call do its thing and
automatically do the put when the module is unloaded.
Thanks,
Tom
>
> /* TODO: Probe PHY here if possible */
>
>
^ permalink raw reply
* Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts
From: Tony Lindgren @ 2015-01-13 19:45 UTC (permalink / raw)
To: Felipe Balbi; +Cc: David Miller, netdev, linux-omap, Brian Hutchinson
In-Reply-To: <20150113193634.GQ16533@saruman>
* Felipe Balbi <balbi@ti.com> [150113 11:40]:
> On Tue, Jan 13, 2015 at 11:29:23AM -0800, Tony Lindgren wrote:
> >
> > 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.
>
> 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.
Yeah I agree that's totally the way to go for the future. I've tried to
expose that issue here with nuttcp but so far no luck.
Regards,
Tony
^ permalink raw reply
* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Felipe Balbi @ 2015-01-13 19:50 UTC (permalink / raw)
To: Tom Lendacky
Cc: Tony Lindgren, David Miller, netdev, linux-omap, Brian Hutchinson,
Felipe Balbi
In-Reply-To: <54B57688.6000908@amd.com>
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
On Tue, Jan 13, 2015 at 01:48:24PM -0600, Tom Lendacky wrote:
> On 01/13/2015 01:29 PM, Tony Lindgren wrote:
> >We only use clk_get() to get the frequency, the rest is done by
> >the runtime PM calls. Let's free the clock too.
> >
> >Cc: Brian Hutchinson <b.hutchman@gmail.com>
> >Cc: Felipe Balbi <balbi@ti.com>
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> >---
> > drivers/net/ethernet/ti/davinci_emac.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> >index deb43b3..e9efc74 100644
> >--- a/drivers/net/ethernet/ti/davinci_emac.c
> >+++ b/drivers/net/ethernet/ti/davinci_emac.c
> >@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> > return -EBUSY;
> > }
> > emac_bus_frequency = clk_get_rate(emac_clk);
> >+ clk_put(emac_clk);
>
> The devm_clk_get call is used to get the clock so either a devm_clk_put
> needs to be used here or just let the devm_ call do its thing and
> automatically do the put when the module is unloaded.
instead, if you really don't need the clock for anything other than
getting its rate, why don't you just remove devm_ prefix from clk_get()?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac
From: Felipe Balbi @ 2015-01-13 19:51 UTC (permalink / raw)
To: Tony Lindgren
Cc: David Miller, netdev, linux-omap, Brian Hutchinson, Felipe Balbi,
Mark A. Greer
In-Reply-To: <1421177368-19756-3-git-send-email-tony@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]
On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
> Commit 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support")
> added support for runtime PM, but it causes issues on omap3 related devices
> that actually gate the clocks:
>
> Unhandled fault: external abort on non-linefetch (0x1008)
> ...
> [<c04160f0>] (emac_dev_getnetstats) from [<c04d6a3c>] (dev_get_stats+0x78/0xc8)
> [<c04d6a3c>] (dev_get_stats) from [<c04e9ccc>] (rtnl_fill_ifinfo+0x3b8/0x938)
> [<c04e9ccc>] (rtnl_fill_ifinfo) from [<c04eade4>] (rtmsg_ifinfo+0x68/0xd8)
> [<c04eade4>] (rtmsg_ifinfo) from [<c04dd35c>] (register_netdevice+0x3a0/0x4ec)
> [<c04dd35c>] (register_netdevice) from [<c04dd4bc>] (register_netdev+0x14/0x24)
> [<c04dd4bc>] (register_netdev) from [<c041755c>] (davinci_emac_probe+0x408/0x5c8)
> [<c041755c>] (davinci_emac_probe) from [<c0396d78>] (platform_drv_probe+0x48/0xa4)
>
> Let's fix it by moving the pm_runtime_get() call earlier, and also
> add it to the emac_dev_getnetstats(). Also note that we want to use
> pm_rutime_get_sync() as we don't want to have deferred_resume happen.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Mark A. Greer <mgreer@animalcreek.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index 383ed52..deb43b3 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
> int i = 0;
> struct emac_priv *priv = netdev_priv(ndev);
>
> - pm_runtime_get(&priv->pdev->dev);
> + pm_runtime_get_sync(&priv->pdev->dev);
gotta check return value on all pm_runtime_get_sync() calls. IIRC,
there's a coccinelle script for checking and patching this.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
From: Felipe Balbi @ 2015-01-13 19:54 UTC (permalink / raw)
To: Tony Lindgren
Cc: David Miller, netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <1421177368-19756-6-git-send-email-tony@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]
On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
> Some devices like dm816x have the MDIO registers within the first EMAC
> instance address space. Let's fix the issue by allowing to pass an
> optional second IO range for the EMAC control register area.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index 4c8d82c..0342273 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
> static int davinci_emac_probe(struct platform_device *pdev)
> {
> int rc = 0;
> - struct resource *res;
> + struct resource *res, *res_ctrl;
> struct net_device *ndev;
> struct emac_priv *priv;
> unsigned long hw_ram_addr;
> @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device *pdev)
> rc = PTR_ERR(priv->remap_addr);
> goto no_pdata;
> }
> +
> + res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (res_ctrl) {
devm_ioremap_resource() will check for res_ctrl being a valid pointer,
perhaps below would be slightly better ?
res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->ctrl_base = devm_ioremap_resource(&pdev->dev, res_ctrl);
if (IS_ERR(priv->ctrl_base))
priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset;
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Tony Lindgren @ 2015-01-13 19:54 UTC (permalink / raw)
To: Tom Lendacky
Cc: David Miller, netdev, linux-omap, Brian Hutchinson, Felipe Balbi
In-Reply-To: <54B57688.6000908@amd.com>
* Tom Lendacky <thomas.lendacky@amd.com> [150113 11:51]:
> On 01/13/2015 01:29 PM, Tony Lindgren wrote:
> >We only use clk_get() to get the frequency, the rest is done by
> >the runtime PM calls. Let's free the clock too.
> >
> >Cc: Brian Hutchinson <b.hutchman@gmail.com>
> >Cc: Felipe Balbi <balbi@ti.com>
> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> >---
> > drivers/net/ethernet/ti/davinci_emac.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> >index deb43b3..e9efc74 100644
> >--- a/drivers/net/ethernet/ti/davinci_emac.c
> >+++ b/drivers/net/ethernet/ti/davinci_emac.c
> >@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> > return -EBUSY;
> > }
> > emac_bus_frequency = clk_get_rate(emac_clk);
> >+ clk_put(emac_clk);
>
> The devm_clk_get call is used to get the clock so either a devm_clk_put
> needs to be used here or just let the devm_ call do its thing and
> automatically do the put when the module is unloaded.
Thanks good catch, updated patch below.
Runtime PM is really managing the clocks here and the driver
just checks the rate so let's devm_clk_put() it here.
Regards,
Tony.
8< ---------------------
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 22 Dec 2014 08:19:06 -0800
Subject: [PATCH] net: davinci_emac: Free clock after checking the frequency
We only use clk_get() to get the frequency, the rest is done by
the runtime PM calls. Let's free the clock too.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
return -EBUSY;
}
emac_bus_frequency = clk_get_rate(emac_clk);
+ devm_clk_put(&pdev->dev, emac_clk);
/* TODO: Probe PHY here if possible */
^ permalink raw reply
* [net-next v2 02/15] i40evf: remove redundant code
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
These functions are redundant and duplicate functionality found in
i40evf_free_all_[tx|rx]_resources.
Change-ID: Ia199908926d7a1a4b8247f75f89b5da24c9b149c
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 27 -------------------------
1 file changed, 27 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index cabaf59..ee0db59 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -947,30 +947,6 @@ static int i40evf_up_complete(struct i40evf_adapter *adapter)
}
/**
- * i40evf_clean_all_rx_rings - Free Rx Buffers for all queues
- * @adapter: board private structure
- **/
-static void i40evf_clean_all_rx_rings(struct i40evf_adapter *adapter)
-{
- int i;
-
- for (i = 0; i < adapter->num_active_queues; i++)
- i40evf_clean_rx_ring(adapter->rx_rings[i]);
-}
-
-/**
- * i40evf_clean_all_tx_rings - Free Tx Buffers for all queues
- * @adapter: board private structure
- **/
-static void i40evf_clean_all_tx_rings(struct i40evf_adapter *adapter)
-{
- int i;
-
- for (i = 0; i < adapter->num_active_queues; i++)
- i40evf_clean_tx_ring(adapter->tx_rings[i]);
-}
-
-/**
* i40e_down - Shutdown the connection processing
* @adapter: board private structure
**/
@@ -1008,9 +984,6 @@ void i40evf_down(struct i40evf_adapter *adapter)
i40evf_napi_disable_all(adapter);
netif_carrier_off(netdev);
-
- i40evf_clean_all_tx_rings(adapter);
- i40evf_clean_all_rx_rings(adapter);
}
/**
--
1.9.3
^ permalink raw reply related
* [net-next v2 01/15] i40e: disable IOV before freeing resources
From: Jeff Kirsher @ 2015-01-13 19:57 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
If VF drivers are loaded in the host OS, the call to pci_disable_sriov()
will cause these drivers' remove routines to be called. If the PF driver
has already freed VF resources before this happens, then the VF remove
routine can't properly communicate with the PF driver causing all sorts
of mayhem and error messages and hurt feelings.
To fix this, we move the call to pci_disable_sriov() up to the top of
the function and let it complete before freeing any VF resources.
Change-ID: I397c3997a00f6408e32b7735273911e499600236
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 5bae895..044019b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -791,10 +791,18 @@ void i40e_free_vfs(struct i40e_pf *pf)
if (!pf->vf)
return;
+ /* Disable IOV before freeing resources. This lets any VF drivers
+ * running in the host get themselves cleaned up before we yank
+ * the carpet out from underneath their feet.
+ */
+ if (!pci_vfs_assigned(pf->pdev))
+ pci_disable_sriov(pf->pdev);
+
+ msleep(20); /* let any messages in transit get finished up */
+
/* Disable interrupt 0 so we don't try to handle the VFLR. */
i40e_irq_dynamic_disable_icr0(pf);
- mdelay(10); /* let any messages in transit get finished up */
/* free up vf resources */
tmp = pf->num_alloc_vfs;
pf->num_alloc_vfs = 0;
@@ -813,7 +821,6 @@ void i40e_free_vfs(struct i40e_pf *pf)
* before this function ever gets called.
*/
if (!pci_vfs_assigned(pf->pdev)) {
- pci_disable_sriov(pf->pdev);
/* Acknowledge VFLR for all VFS. Without this, VFs will fail to
* work correctly when SR-IOV gets re-enabled.
*/
--
1.9.3
^ permalink raw reply related
* [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates 2015-01-13
From: Jeff Kirsher @ 2015-01-13 19:57 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to i40e and i40evf.
Mitch provides a fix for i40e to move the call to pci_disable_sriov() so
that it is called earlier to ensure that the PF driver won't free VF
resources before the VF remove routine can complete. Also cleans up
redundant and duplicate code in the i40evf. Refactors the i40evf
shutdown code and let the watchdog take care of shutting things down.
Fix a possible memory leak, if we are using VLANs and the communication
with the PF fail during shutdown. On some versions of the firmware, the
VF admin send queue may become stalled. In this case, the easiest
solution is to place another descriptor on the queue and the firmware
will then process both requests.
Greg adds a warning when the NPAR enabled partitions detected a link speed
less than 10 Gpbs.
Vasu removes redundant VN2VN MAC address which were already added by
the FCoE stack.
Shannon adds code to find how many partitions there are per port and
what is the current partition_id when in NPAR mode. In multifunction
mode, make sure we only allow SR/IOV on the master PF of a port and
only allow partition 1 to set WoL, speed and flow control.
Kamil adds code to read the PBA block from shadow RAM and returns
the part number in a string format.
Catherine provides a fix to check if link state and link speed has
changed before exiting link event
v2: remove un-needed {} in patch #3 of the series based on feedback from
Sergei Shtylyov
The following are changes since commit 52e3ad9f011fe72620b2f7050227cd48fd295ad5:
Merge branch 'rhashtable-next'
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Catherine Sullivan (1):
i40e: Don't exit link event early if link speed has changed
Greg Rose (1):
i40e: Add warning for NPAR partitions with link speed less than 10Gbps
Kamil Krawczyk (1):
i40e: Adding function for reading PBA String
Mitch A Williams (8):
i40e: disable IOV before freeing resources
i40evf: remove redundant code
i40evf: Remove some scary log messages
i40evf: refactor shutdown code
i40evf: remove leftover VLAN filters
i40evf: don't fire traffic IRQs when the interface is down
i40evf: enable interrupt 0 appropriately
i40evf: kick a stalled admin queue
Shannon Nelson (3):
i40e/i40evf: find partition_id in npar mode
i40e: limit WoL and link settings to partition 1
i40e: limit sriov to partition 1 of NPAR configurations
Vasu Dev (1):
i40e: remove VN2VN related mac filters
drivers/net/ethernet/intel/i40e/i40e_common.c | 125 +++++++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 43 ++++++-
drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 2 -
drivers/net/ethernet/intel/i40e/i40e_main.c | 15 ++-
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 5 +
drivers/net/ethernet/intel/i40e/i40e_type.h | 9 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 +-
drivers/net/ethernet/intel/i40evf/i40e_type.h | 7 +-
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 97 ++++++++--------
.../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 6 +-
10 files changed, 257 insertions(+), 63 deletions(-)
--
1.9.3
^ permalink raw reply
* [net-next v2 05/15] i40evf: remove leftover VLAN filters
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
If we're using VLANs and communications with the PF fail during
shutdown, we will leak memory because not all of the VLAN filters will
be removed. To eliminate this possibility, go through the list again
right before the module is removed and delete any leftover entries.
Change-ID: Id3b5315c47ca0a61ae123a96ff345d010bc41aed
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d339256..994ae4e 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2462,6 +2462,10 @@ static void i40evf_remove(struct pci_dev *pdev)
list_del(&f->list);
kfree(f);
}
+ list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) {
+ list_del(&f->list);
+ kfree(f);
+ }
free_netdev(netdev);
--
1.9.3
^ permalink raw reply related
* [net-next v2 03/15] i40evf: Remove some scary log messages
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
These messages may be triggered during normal init of the driver if the
PF or FW take a long time to respond. There's nothing really wrong, so
don't freak people out logging messages.
If the communication channel really is dead, then we'll retry a few
times and give up. This will log a different more scary message that
should cause consternation. This allows the user to more easily detect a
genuine failure.
v2: remove un-needed {} based on feedback from Sergei Shtylyov
Change-ID: I6e2b758d4234a3a09c1015c82c8f2442a697cbdb
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 7 +------
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 3 ---
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index ee0db59..6c73acf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2026,12 +2026,8 @@ static void i40evf_init_task(struct work_struct *work)
/* aq msg sent, awaiting reply */
err = i40evf_verify_api_ver(adapter);
if (err) {
- dev_info(&pdev->dev, "Unable to verify API version (%d), retrying\n",
- err);
- if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) {
- dev_info(&pdev->dev, "Resending request\n");
+ if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK)
err = i40evf_send_api_ver(adapter);
- }
goto err;
}
err = i40evf_send_vf_config_msg(adapter);
@@ -2054,7 +2050,6 @@ static void i40evf_init_task(struct work_struct *work)
}
err = i40evf_get_vf_config(adapter);
if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) {
- dev_info(&pdev->dev, "Resending VF config request\n");
err = i40evf_send_vf_config_msg(adapter);
goto err;
}
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 5fde5a7..3aeb633 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -715,9 +715,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
}
return;
}
- if (v_opcode != adapter->current_op)
- dev_info(&adapter->pdev->dev, "Pending op is %d, received %d\n",
- adapter->current_op, v_opcode);
if (v_retval) {
dev_err(&adapter->pdev->dev, "%s: PF returned error %d to our request %d\n",
__func__, v_retval, v_opcode);
--
1.9.3
^ permalink raw reply related
* [net-next v2 04/15] i40evf: refactor shutdown code
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
If the VF driver is running in the host, the shutdown code is completely
broken. We cannot wait in our down routine for the PF to respond to our
requests, as its admin queue task will never run while we hold the lock.
Instead, we schedule operations, then let the watchdog take care of
shutting things down. If the driver is being removed, then wait in the
remove routine until the watchdog is done before continuing.
Change-ID: I93a58d17389e8d6b58f21e430b56ed7b4590b2c5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 29 ++++++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 6c73acf..d339256 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -958,6 +958,12 @@ void i40evf_down(struct i40evf_adapter *adapter)
if (adapter->state == __I40EVF_DOWN)
return;
+ while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
+ &adapter->crit_section))
+ usleep_range(500, 1000);
+
+ i40evf_irq_disable(adapter);
+
/* remove all MAC filters */
list_for_each_entry(f, &adapter->mac_filter_list, list) {
f->remove = true;
@@ -968,22 +974,27 @@ void i40evf_down(struct i40evf_adapter *adapter)
}
if (!(adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED) &&
adapter->state != __I40EVF_RESETTING) {
- adapter->aq_required |= I40EVF_FLAG_AQ_DEL_MAC_FILTER;
+ /* cancel any current operation */
+ adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
+ adapter->aq_pending = 0;
+ /* Schedule operations to close down the HW. Don't wait
+ * here for this to complete. The watchdog is still running
+ * and it will take care of this.
+ */
+ adapter->aq_required = I40EVF_FLAG_AQ_DEL_MAC_FILTER;
adapter->aq_required |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER;
- /* disable receives */
adapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_QUEUES;
- mod_timer_pending(&adapter->watchdog_timer, jiffies + 1);
- msleep(20);
}
netif_tx_disable(netdev);
netif_tx_stop_all_queues(netdev);
- i40evf_irq_disable(adapter);
-
i40evf_napi_disable_all(adapter);
+ msleep(20);
+
netif_carrier_off(netdev);
+ clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
}
/**
@@ -2408,6 +2419,7 @@ static void i40evf_remove(struct pci_dev *pdev)
struct i40evf_adapter *adapter = netdev_priv(netdev);
struct i40evf_mac_filter *f, *ftmp;
struct i40e_hw *hw = &adapter->hw;
+ int count = 50;
cancel_delayed_work_sync(&adapter->init_task);
cancel_work_sync(&adapter->reset_task);
@@ -2416,6 +2428,11 @@ static void i40evf_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
adapter->netdev_registered = false;
}
+ while (count-- && adapter->aq_required)
+ msleep(50);
+
+ if (count < 0)
+ dev_err(&pdev->dev, "Timed out waiting for PF driver.\n");
adapter->state = __I40EVF_REMOVE;
if (adapter->msix_entries) {
--
1.9.3
^ permalink raw reply related
* [net-next v2 07/15] i40evf: enable interrupt 0 appropriately
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
Don't enable vector 0 in the ISR, just schedule the adminq task and let
it enable the vector. This prevents the task from being called
reentrantly. Make sure that the vector is enabled on all exit paths of
the adminq task, including error exits.
Change-ID: I53f3d14f91ed7a9e90291ea41c681122a5eca5b5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index c960ef5..e2311af 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -313,10 +313,6 @@ static irqreturn_t i40evf_msix_aq(int irq, void *data)
val = val | I40E_PFINT_DYN_CTL0_CLEARPBA_MASK;
wr32(hw, I40E_VFINT_DYN_CTL01, val);
- /* re-enable interrupt causes */
- wr32(hw, I40E_VFINT_ICR0_ENA1, ena_mask);
- wr32(hw, I40E_VFINT_DYN_CTL01, I40E_VFINT_DYN_CTL01_INTENA_MASK);
-
/* schedule work on the private workqueue */
schedule_work(&adapter->adminq_task);
@@ -1620,12 +1616,12 @@ static void i40evf_adminq_task(struct work_struct *work)
u16 pending;
if (adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED)
- return;
+ goto out;
event.buf_len = I40EVF_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
if (!event.msg_buf)
- return;
+ goto out;
v_msg = (struct i40e_virtchnl_msg *)&event.desc;
do {
@@ -1675,10 +1671,10 @@ static void i40evf_adminq_task(struct work_struct *work)
if (oldval != val)
wr32(hw, hw->aq.asq.len, val);
+ kfree(event.msg_buf);
+out:
/* re-enable Admin queue interrupt cause */
i40evf_misc_irq_enable(adapter);
-
- kfree(event.msg_buf);
}
/**
--
1.9.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox