netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2
@ 2017-05-08 14:14 Andy Shevchenko
  2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Andy Shevchenko @ 2017-05-08 14:14 UTC (permalink / raw)
  To: Joao Pinto, Jan Kiszka, netdev, Giuseppe CAVALLARO, David S. Miller
  Cc: Andy Shevchenko

Due to misconfiguration of PCI driver for Intel Quark the user will get
a kernel crash:

# udhcpc -i eth0
udhcpc: started, v1.26.2
stmmaceth 0000:00:14.6 eth0: device MAC address 98:4f:ee:05:ac:47
Generic PHY stmmac-a6:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-a6:01, irq=-1)
stmmaceth 0000:00:14.6 eth0: IEEE 1588-2008 Advanced Timestamp supported
stmmaceth 0000:00:14.6 eth0: registered PTP clock
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

udhcpc: sending discover

stmmaceth 0000:00:14.6 eth0: Link is Up - 100Mbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: stmmac_xmit+0xf1/0x1080

Fix this by adding necessary settings.

P.S. I split fix to three patches according to what each of them adds.

Andy Shevchenko (4):
  stmmac: pci: set default number of rx and tx queues
  stmmac: pci: TX and RX queue priority configuration
  stmmac: pci: RX queue routing configuration
  stmmac: pci: split out common_default_data() helper

 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 41 +++++++++++-------------
 1 file changed, 18 insertions(+), 23 deletions(-)

-- 
2.11.0

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

* [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
@ 2017-05-08 14:14 ` Andy Shevchenko
  2017-05-08 14:18   ` Joao Pinto
  2017-05-08 14:22   ` Giuseppe CAVALLARO
  2017-05-08 14:14 ` [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration Andy Shevchenko
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2017-05-08 14:14 UTC (permalink / raw)
  To: Joao Pinto, Jan Kiszka, netdev, Giuseppe CAVALLARO, David S. Miller
  Cc: Andy Shevchenko

The commit 26d6851fd24e

	("net: stmmac: set default number of rx and tx queues in stmmac_pci")

missed Intel Quark configuration. Append it here.

Fixes: 26d6851fd24e ("net: stmmac: set default number of rx and tx queues in stmmac_pci")
Cc: Joao Pinto <Joao.Pinto@synopsys.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 39be96779145..ae3e836f9bb6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -145,6 +145,10 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
 	/* Set the maxmtu to a default of JUMBO_LEN */
 	plat->maxmtu = JUMBO_LEN;
 
+	/* Set default number of RX and TX queues to use */
+	plat->tx_queues_to_use = 1;
+	plat->rx_queues_to_use = 1;
+
 	return 0;
 }
 
-- 
2.11.0

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

* [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
  2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
@ 2017-05-08 14:14 ` Andy Shevchenko
  2017-05-08 14:18   ` Joao Pinto
  2017-05-08 14:14 ` [PATCH v1 3/4] stmmac: pci: RX queue routing configuration Andy Shevchenko
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2017-05-08 14:14 UTC (permalink / raw)
  To: Joao Pinto, Jan Kiszka, netdev, Giuseppe CAVALLARO, David S. Miller
  Cc: Andy Shevchenko

The commit a8f5102af2a7

	("net: stmmac: TX and RX queue priority configuration")

missed Intel Quark configuration. Append it here.

Fixes: a8f5102af2a7 ("net: stmmac: TX and RX queue priority configuration")
Cc: Joao Pinto <Joao.Pinto@synopsys.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index ae3e836f9bb6..c015a715a8ac 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -149,6 +149,10 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
 	plat->tx_queues_to_use = 1;
 	plat->rx_queues_to_use = 1;
 
+	/* Disable Priority config by default */
+	plat->tx_queues_cfg[0].use_prio = false;
+	plat->rx_queues_cfg[0].use_prio = false;
+
 	return 0;
 }
 
-- 
2.11.0

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

* [PATCH v1 3/4] stmmac: pci: RX queue routing configuration
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
  2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
  2017-05-08 14:14 ` [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration Andy Shevchenko
@ 2017-05-08 14:14 ` Andy Shevchenko
  2017-05-08 14:18   ` Joao Pinto
  2017-05-08 14:14 ` [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper Andy Shevchenko
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2017-05-08 14:14 UTC (permalink / raw)
  To: Joao Pinto, Jan Kiszka, netdev, Giuseppe CAVALLARO, David S. Miller
  Cc: Andy Shevchenko

The commit abe80fdc6ee6

    ("net: stmmac: RX queue routing configuration")

missed Intel Quark configuration. Append it here.

Fixes: abe80fdc6ee6 ("net: stmmac: RX queue routing configuration")
Cc: Joao Pinto <Joao.Pinto@synopsys.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index c015a715a8ac..2456e0a945ef 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -153,6 +153,9 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
 	plat->tx_queues_cfg[0].use_prio = false;
 	plat->rx_queues_cfg[0].use_prio = false;
 
+	/* Disable RX queues routing by default */
+	plat->rx_queues_cfg[0].pkt_route = 0x0;
+
 	return 0;
 }
 
-- 
2.11.0

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

* [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
                   ` (2 preceding siblings ...)
  2017-05-08 14:14 ` [PATCH v1 3/4] stmmac: pci: RX queue routing configuration Andy Shevchenko
@ 2017-05-08 14:14 ` Andy Shevchenko
  2017-05-08 14:19   ` Joao Pinto
  2017-05-08 17:34 ` [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Jan Kiszka
  2017-05-08 19:15 ` David Miller
  5 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2017-05-08 14:14 UTC (permalink / raw)
  To: Joao Pinto, Jan Kiszka, netdev, Giuseppe CAVALLARO, David S. Miller
  Cc: Andy Shevchenko

New helper is added in order to prevent misconfiguration happened
for one of the platforms when configuration data is expanded.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 52 ++++++++----------------
 1 file changed, 18 insertions(+), 34 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 2456e0a945ef..22f910795be4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -70,11 +70,8 @@ static int stmmac_pci_find_phy_addr(struct stmmac_pci_info *info)
 	return -ENODEV;
 }
 
-static void stmmac_default_data(struct plat_stmmacenet_data *plat)
+static void common_default_data(struct plat_stmmacenet_data *plat)
 {
-	plat->bus_id = 1;
-	plat->phy_addr = 0;
-	plat->interface = PHY_INTERFACE_MODE_GMII;
 	plat->clk_csr = 2;	/* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
 	plat->has_gmac = 1;
 	plat->force_sf_dma_mode = 1;
@@ -82,10 +79,6 @@ static void stmmac_default_data(struct plat_stmmacenet_data *plat)
 	plat->mdio_bus_data->phy_reset = NULL;
 	plat->mdio_bus_data->phy_mask = 0;
 
-	plat->dma_cfg->pbl = 32;
-	plat->dma_cfg->pblx8 = true;
-	/* TODO: AXI */
-
 	/* Set default value for multicast hash bins */
 	plat->multicast_filter_bins = HASH_TABLE_SIZE;
 
@@ -107,12 +100,29 @@ static void stmmac_default_data(struct plat_stmmacenet_data *plat)
 	plat->rx_queues_cfg[0].pkt_route = 0x0;
 }
 
+static void stmmac_default_data(struct plat_stmmacenet_data *plat)
+{
+	/* Set common default data first */
+	common_default_data(plat);
+
+	plat->bus_id = 1;
+	plat->phy_addr = 0;
+	plat->interface = PHY_INTERFACE_MODE_GMII;
+
+	plat->dma_cfg->pbl = 32;
+	plat->dma_cfg->pblx8 = true;
+	/* TODO: AXI */
+}
+
 static int quark_default_data(struct plat_stmmacenet_data *plat,
 			      struct stmmac_pci_info *info)
 {
 	struct pci_dev *pdev = info->pdev;
 	int ret;
 
+	/* Set common default data first */
+	common_default_data(plat);
+
 	/*
 	 * Refuse to load the driver and register net device if MAC controller
 	 * does not connect to any PHY interface.
@@ -124,38 +134,12 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
 	plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
 	plat->phy_addr = ret;
 	plat->interface = PHY_INTERFACE_MODE_RMII;
-	plat->clk_csr = 2;
-	plat->has_gmac = 1;
-	plat->force_sf_dma_mode = 1;
-
-	plat->mdio_bus_data->phy_reset = NULL;
-	plat->mdio_bus_data->phy_mask = 0;
 
 	plat->dma_cfg->pbl = 16;
 	plat->dma_cfg->pblx8 = true;
 	plat->dma_cfg->fixed_burst = 1;
 	/* AXI (TODO) */
 
-	/* Set default value for multicast hash bins */
-	plat->multicast_filter_bins = HASH_TABLE_SIZE;
-
-	/* Set default value for unicast filter entries */
-	plat->unicast_filter_entries = 1;
-
-	/* Set the maxmtu to a default of JUMBO_LEN */
-	plat->maxmtu = JUMBO_LEN;
-
-	/* Set default number of RX and TX queues to use */
-	plat->tx_queues_to_use = 1;
-	plat->rx_queues_to_use = 1;
-
-	/* Disable Priority config by default */
-	plat->tx_queues_cfg[0].use_prio = false;
-	plat->rx_queues_cfg[0].use_prio = false;
-
-	/* Disable RX queues routing by default */
-	plat->rx_queues_cfg[0].pkt_route = 0x0;
-
 	return 0;
 }
 
-- 
2.11.0

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

* Re: [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues
  2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
@ 2017-05-08 14:18   ` Joao Pinto
  2017-05-08 14:22   ` Giuseppe CAVALLARO
  1 sibling, 0 replies; 12+ messages in thread
From: Joao Pinto @ 2017-05-08 14:18 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, Jan Kiszka, netdev,
	Giuseppe CAVALLARO, David S. Miller

Às 3:14 PM de 5/8/2017, Andy Shevchenko escreveu:
> The commit 26d6851fd24e
> 
> 	("net: stmmac: set default number of rx and tx queues in stmmac_pci")
> 
> missed Intel Quark configuration. Append it here.
> 
> Fixes: 26d6851fd24e ("net: stmmac: set default number of rx and tx queues in stmmac_pci")
> Cc: Joao Pinto <Joao.Pinto@synopsys.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index 39be96779145..ae3e836f9bb6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -145,6 +145,10 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
>  	/* Set the maxmtu to a default of JUMBO_LEN */
>  	plat->maxmtu = JUMBO_LEN;
>  
> +	/* Set default number of RX and TX queues to use */
> +	plat->tx_queues_to_use = 1;
> +	plat->rx_queues_to_use = 1;
> +
>  	return 0;
>  }
>  
> 

Acked-by: Joao Pinto <jpinto@synopsys.com>

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

* Re: [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration
  2017-05-08 14:14 ` [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration Andy Shevchenko
@ 2017-05-08 14:18   ` Joao Pinto
  0 siblings, 0 replies; 12+ messages in thread
From: Joao Pinto @ 2017-05-08 14:18 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, Jan Kiszka, netdev,
	Giuseppe CAVALLARO, David S. Miller

Às 3:14 PM de 5/8/2017, Andy Shevchenko escreveu:
> The commit a8f5102af2a7
> 
> 	("net: stmmac: TX and RX queue priority configuration")
> 
> missed Intel Quark configuration. Append it here.
> 
> Fixes: a8f5102af2a7 ("net: stmmac: TX and RX queue priority configuration")
> Cc: Joao Pinto <Joao.Pinto@synopsys.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index ae3e836f9bb6..c015a715a8ac 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -149,6 +149,10 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
>  	plat->tx_queues_to_use = 1;
>  	plat->rx_queues_to_use = 1;
>  
> +	/* Disable Priority config by default */
> +	plat->tx_queues_cfg[0].use_prio = false;
> +	plat->rx_queues_cfg[0].use_prio = false;
> +
>  	return 0;
>  }
>  
> 

Acked-by: Joao Pinto <jpinto@synopsys.com>

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

* Re: [PATCH v1 3/4] stmmac: pci: RX queue routing configuration
  2017-05-08 14:14 ` [PATCH v1 3/4] stmmac: pci: RX queue routing configuration Andy Shevchenko
@ 2017-05-08 14:18   ` Joao Pinto
  0 siblings, 0 replies; 12+ messages in thread
From: Joao Pinto @ 2017-05-08 14:18 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, Jan Kiszka, netdev,
	Giuseppe CAVALLARO, David S. Miller

Às 3:14 PM de 5/8/2017, Andy Shevchenko escreveu:
> The commit abe80fdc6ee6
> 
>     ("net: stmmac: RX queue routing configuration")
> 
> missed Intel Quark configuration. Append it here.
> 
> Fixes: abe80fdc6ee6 ("net: stmmac: RX queue routing configuration")
> Cc: Joao Pinto <Joao.Pinto@synopsys.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index c015a715a8ac..2456e0a945ef 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -153,6 +153,9 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
>  	plat->tx_queues_cfg[0].use_prio = false;
>  	plat->rx_queues_cfg[0].use_prio = false;
>  
> +	/* Disable RX queues routing by default */
> +	plat->rx_queues_cfg[0].pkt_route = 0x0;
> +
>  	return 0;
>  }
>  
> 

Acked-by: Joao Pinto <jpinto@synopsys.com>

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

* Re: [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper
  2017-05-08 14:14 ` [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper Andy Shevchenko
@ 2017-05-08 14:19   ` Joao Pinto
  0 siblings, 0 replies; 12+ messages in thread
From: Joao Pinto @ 2017-05-08 14:19 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, Jan Kiszka, netdev,
	Giuseppe CAVALLARO, David S. Miller

Às 3:14 PM de 5/8/2017, Andy Shevchenko escreveu:
> New helper is added in order to prevent misconfiguration happened
> for one of the platforms when configuration data is expanded.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 52 ++++++++----------------
>  1 file changed, 18 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index 2456e0a945ef..22f910795be4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -70,11 +70,8 @@ static int stmmac_pci_find_phy_addr(struct stmmac_pci_info *info)
>  	return -ENODEV;
>  }
>  
> -static void stmmac_default_data(struct plat_stmmacenet_data *plat)
> +static void common_default_data(struct plat_stmmacenet_data *plat)
>  {
> -	plat->bus_id = 1;
> -	plat->phy_addr = 0;
> -	plat->interface = PHY_INTERFACE_MODE_GMII;
>  	plat->clk_csr = 2;	/* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
>  	plat->has_gmac = 1;
>  	plat->force_sf_dma_mode = 1;
> @@ -82,10 +79,6 @@ static void stmmac_default_data(struct plat_stmmacenet_data *plat)
>  	plat->mdio_bus_data->phy_reset = NULL;
>  	plat->mdio_bus_data->phy_mask = 0;
>  
> -	plat->dma_cfg->pbl = 32;
> -	plat->dma_cfg->pblx8 = true;
> -	/* TODO: AXI */
> -
>  	/* Set default value for multicast hash bins */
>  	plat->multicast_filter_bins = HASH_TABLE_SIZE;
>  
> @@ -107,12 +100,29 @@ static void stmmac_default_data(struct plat_stmmacenet_data *plat)
>  	plat->rx_queues_cfg[0].pkt_route = 0x0;
>  }
>  
> +static void stmmac_default_data(struct plat_stmmacenet_data *plat)
> +{
> +	/* Set common default data first */
> +	common_default_data(plat);
> +
> +	plat->bus_id = 1;
> +	plat->phy_addr = 0;
> +	plat->interface = PHY_INTERFACE_MODE_GMII;
> +
> +	plat->dma_cfg->pbl = 32;
> +	plat->dma_cfg->pblx8 = true;
> +	/* TODO: AXI */
> +}
> +
>  static int quark_default_data(struct plat_stmmacenet_data *plat,
>  			      struct stmmac_pci_info *info)
>  {
>  	struct pci_dev *pdev = info->pdev;
>  	int ret;
>  
> +	/* Set common default data first */
> +	common_default_data(plat);
> +
>  	/*
>  	 * Refuse to load the driver and register net device if MAC controller
>  	 * does not connect to any PHY interface.
> @@ -124,38 +134,12 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
>  	plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
>  	plat->phy_addr = ret;
>  	plat->interface = PHY_INTERFACE_MODE_RMII;
> -	plat->clk_csr = 2;
> -	plat->has_gmac = 1;
> -	plat->force_sf_dma_mode = 1;
> -
> -	plat->mdio_bus_data->phy_reset = NULL;
> -	plat->mdio_bus_data->phy_mask = 0;
>  
>  	plat->dma_cfg->pbl = 16;
>  	plat->dma_cfg->pblx8 = true;
>  	plat->dma_cfg->fixed_burst = 1;
>  	/* AXI (TODO) */
>  
> -	/* Set default value for multicast hash bins */
> -	plat->multicast_filter_bins = HASH_TABLE_SIZE;
> -
> -	/* Set default value for unicast filter entries */
> -	plat->unicast_filter_entries = 1;
> -
> -	/* Set the maxmtu to a default of JUMBO_LEN */
> -	plat->maxmtu = JUMBO_LEN;
> -
> -	/* Set default number of RX and TX queues to use */
> -	plat->tx_queues_to_use = 1;
> -	plat->rx_queues_to_use = 1;
> -
> -	/* Disable Priority config by default */
> -	plat->tx_queues_cfg[0].use_prio = false;
> -	plat->rx_queues_cfg[0].use_prio = false;
> -
> -	/* Disable RX queues routing by default */
> -	plat->rx_queues_cfg[0].pkt_route = 0x0;
> -
>  	return 0;
>  }
>  
> 

Makes sense!

Acked-by: Joao Pinto <jpinto@synopsys.com>

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

* Re: [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues
  2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
  2017-05-08 14:18   ` Joao Pinto
@ 2017-05-08 14:22   ` Giuseppe CAVALLARO
  1 sibling, 0 replies; 12+ messages in thread
From: Giuseppe CAVALLARO @ 2017-05-08 14:22 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, Jan Kiszka, netdev, David S. Miller

On 5/8/2017 4:14 PM, Andy Shevchenko wrote:
> The commit 26d6851fd24e
>
> 	("net: stmmac: set default number of rx and tx queues in stmmac_pci")
>
> missed Intel Quark configuration. Append it here.
>
> Fixes: 26d6851fd24e ("net: stmmac: set default number of rx and tx queues in stmmac_pci")
> Cc: Joao Pinto <Joao.Pinto@synopsys.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index 39be96779145..ae3e836f9bb6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -145,6 +145,10 @@ static int quark_default_data(struct plat_stmmacenet_data *plat,
>   	/* Set the maxmtu to a default of JUMBO_LEN */
>   	plat->maxmtu = JUMBO_LEN;
>   
> +	/* Set default number of RX and TX queues to use */
> +	plat->tx_queues_to_use = 1;
> +	plat->rx_queues_to_use = 1;
> +
>   	return 0;
>   }
>   

For the Series, please consider my

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>


thx a lot

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

* Re: [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
                   ` (3 preceding siblings ...)
  2017-05-08 14:14 ` [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper Andy Shevchenko
@ 2017-05-08 17:34 ` Jan Kiszka
  2017-05-08 19:15 ` David Miller
  5 siblings, 0 replies; 12+ messages in thread
From: Jan Kiszka @ 2017-05-08 17:34 UTC (permalink / raw)
  To: Andy Shevchenko, Joao Pinto, netdev, Giuseppe CAVALLARO, David S. Miller

On 2017-05-08 16:14, Andy Shevchenko wrote:
> Due to misconfiguration of PCI driver for Intel Quark the user will get
> a kernel crash:
> 
> # udhcpc -i eth0
> udhcpc: started, v1.26.2
> stmmaceth 0000:00:14.6 eth0: device MAC address 98:4f:ee:05:ac:47
> Generic PHY stmmac-a6:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-a6:01, irq=-1)
> stmmaceth 0000:00:14.6 eth0: IEEE 1588-2008 Advanced Timestamp supported
> stmmaceth 0000:00:14.6 eth0: registered PTP clock
> IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
> 
> udhcpc: sending discover
> 
> stmmaceth 0000:00:14.6 eth0: Link is Up - 100Mbps/Full - flow control off
> IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: stmmac_xmit+0xf1/0x1080
> 
> Fix this by adding necessary settings.
> 
> P.S. I split fix to three patches according to what each of them adds.
> 
> Andy Shevchenko (4):
>   stmmac: pci: set default number of rx and tx queues
>   stmmac: pci: TX and RX queue priority configuration
>   stmmac: pci: RX queue routing configuration
>   stmmac: pci: split out common_default_data() helper
> 
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 41 +++++++++++-------------
>  1 file changed, 18 insertions(+), 23 deletions(-)
> 

Tested-by: Jan Kiszka <jan.kiszka@siemens.com>

All fine again, thanks!

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

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

* Re: [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2
  2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
                   ` (4 preceding siblings ...)
  2017-05-08 17:34 ` [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Jan Kiszka
@ 2017-05-08 19:15 ` David Miller
  5 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2017-05-08 19:15 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: Joao.Pinto, jan.kiszka, netdev, peppe.cavallaro

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Mon,  8 May 2017 17:14:18 +0300

> Due to misconfiguration of PCI driver for Intel Quark the user will get
> a kernel crash:
> 
> # udhcpc -i eth0
> udhcpc: started, v1.26.2
> stmmaceth 0000:00:14.6 eth0: device MAC address 98:4f:ee:05:ac:47
> Generic PHY stmmac-a6:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=stmmac-a6:01, irq=-1)
> stmmaceth 0000:00:14.6 eth0: IEEE 1588-2008 Advanced Timestamp supported
> stmmaceth 0000:00:14.6 eth0: registered PTP clock
> IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
> 
> udhcpc: sending discover
> 
> stmmaceth 0000:00:14.6 eth0: Link is Up - 100Mbps/Full - flow control off
> IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: stmmac_xmit+0xf1/0x1080
> 
> Fix this by adding necessary settings.
> 
> P.S. I split fix to three patches according to what each of them adds.

Looks good, series applied, thanks.

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

end of thread, other threads:[~2017-05-08 19:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 14:14 [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Andy Shevchenko
2017-05-08 14:14 ` [PATCH v1 1/4] stmmac: pci: set default number of rx and tx queues Andy Shevchenko
2017-05-08 14:18   ` Joao Pinto
2017-05-08 14:22   ` Giuseppe CAVALLARO
2017-05-08 14:14 ` [PATCH v1 2/4] stmmac: pci: TX and RX queue priority configuration Andy Shevchenko
2017-05-08 14:18   ` Joao Pinto
2017-05-08 14:14 ` [PATCH v1 3/4] stmmac: pci: RX queue routing configuration Andy Shevchenko
2017-05-08 14:18   ` Joao Pinto
2017-05-08 14:14 ` [PATCH v1 4/4] stmmac: pci: split out common_default_data() helper Andy Shevchenko
2017-05-08 14:19   ` Joao Pinto
2017-05-08 17:34 ` [PATCH v1 0/4] stmmac: pci: Fix crash on Intel Galileo Gen2 Jan Kiszka
2017-05-08 19:15 ` David Miller

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