linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/16] net: stmmac: misc fix
@ 2017-02-08  8:31 Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX Corentin Labbe
                   ` (15 more replies)
  0 siblings, 16 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

Hello

I am currently working on dwmac-sun8i glue driver for Allwinner H3/A83T/A64.
This serie is the result of all minor problem found in the stmmac driver.

All patch are tested on cubieboard2 via dwmac-sunxi and on pine64/orangepis via dwmac-sun8i.

Regards

Changes since v1:
- Removed netdev_dbg() in "net: stmmac: print phy information"
- Removed patch "net: stmmac: Implement NAPI for TX", it will be reworked
- Changed error message in "Correct the error message about invalid speed"
- Added some acked-by

Corentin Labbe (16):
  net: stmmac: fix the typo on MAC_RNABLE_RX
  net: stmmac: Remove the bus_setup function pointer
  net: stmmac: fix some typos in comments
  net: stmmac: remove freesoftware address
  net: stmmac: remplace asm/io.h by linux/io.h
  net: stmmac: fix some code style problem
  net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout
  net: stmmac: Use readl_poll_timeout
  net: stmmac: replace ENOSYS by EINVAL
  net: stmmac: Correct the error message about invalid speed
  net: stmmac: Rewrite two test against NULL value
  net: stmmac: rename rx_crc to rx_crc_errors
  net: stmmac: print phy information
  net: stmmac: remove dead code in stmmac_tx_clean
  net: stmmac: remove unused variable in sysfs_display_ring
  net: stmmac: replace unsigned by u32

 drivers/net/ethernet/stmicro/stmmac/chain_mode.c   |  4 --
 drivers/net/ethernet/stmicro/stmmac/common.h       |  8 +---
 drivers/net/ethernet/stmicro/stmmac/descs.h        |  4 --
 drivers/net/ethernet/stmicro/stmmac/descs_com.h    |  4 --
 drivers/net/ethernet/stmicro/stmmac/dwmac100.h     |  4 --
 drivers/net/ethernet/stmicro/stmmac/dwmac1000.h    |  4 --
 .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |  4 --
 .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |  4 --
 .../net/ethernet/stmicro/stmmac/dwmac100_core.c    |  4 --
 drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |  4 --
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |  2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h    |  4 --
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c    | 28 +++++-------
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |  6 +--
 drivers/net/ethernet/stmicro/stmmac/mmc.h          |  4 --
 drivers/net/ethernet/stmicro/stmmac/mmc_core.c     |  4 --
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |  6 +--
 drivers/net/ethernet/stmicro/stmmac/ring_mode.c    |  4 --
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |  4 --
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  6 +--
 .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c  |  4 --
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 49 ++++++--------------
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c  | 52 ++++++++--------------
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c   |  4 --
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  6 +--
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c   |  4 --
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h   |  4 --
 include/linux/stmmac.h                             |  1 -
 28 files changed, 51 insertions(+), 185 deletions(-)

-- 
2.10.2

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

* [PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer Corentin Labbe
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

the define MAC_RNABLE_RX have a typo, rename it to MAC_ENABLE_RX

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/common.h    | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 75e2666..262a1c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -343,7 +343,7 @@ struct dma_features {
 /* Common MAC defines */
 #define MAC_CTRL_REG		0x00000000	/* MAC Control */
 #define MAC_ENABLE_TX		0x00000008	/* Transmitter Enable */
-#define MAC_RNABLE_RX		0x00000004	/* Receiver Enable */
+#define MAC_ENABLE_RX		0x00000004	/* Receiver Enable */
 
 /* Default LPI timers */
 #define STMMAC_DEFAULT_LIT_LS	0x3E8
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
index 84e3e84..a414bde 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
@@ -261,9 +261,9 @@ void stmmac_set_mac(void __iomem *ioaddr, bool enable)
 	u32 value = readl(ioaddr + MAC_CTRL_REG);
 
 	if (enable)
-		value |= MAC_RNABLE_RX | MAC_ENABLE_TX;
+		value |= MAC_ENABLE_RX | MAC_ENABLE_TX;
 	else
-		value &= ~(MAC_ENABLE_TX | MAC_RNABLE_RX);
+		value &= ~(MAC_ENABLE_TX | MAC_ENABLE_RX);
 
 	writel(value, ioaddr + MAC_CTRL_REG);
 }
-- 
2.10.2

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

* [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 13:17   ` Giuseppe CAVALLARO
  2017-02-08  8:31 ` [PATCH v2 03/16] net: stmmac: fix some typos in comments Corentin Labbe
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The bus_setup function pointer is not used at all, this patch remove it.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ----
 include/linux/stmmac.h                            | 1 -
 2 files changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index bd83bf9..1ef60282 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1682,10 +1682,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
 	/* Copy the MAC addr into the HW  */
 	priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
 
-	/* If required, perform hw setup of the bus. */
-	if (priv->plat->bus_setup)
-		priv->plat->bus_setup(priv->ioaddr);
-
 	/* PS and related bits will be programmed according to the speed */
 	if (priv->hw->pcs) {
 		int speed = priv->plat->mac_port_sel_speed;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index d76033d6..fc273e9 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -134,7 +134,6 @@ struct plat_stmmacenet_data {
 	int tx_fifo_size;
 	int rx_fifo_size;
 	void (*fix_mac_speed)(void *priv, unsigned int speed);
-	void (*bus_setup)(void __iomem *ioaddr);
 	int (*init)(struct platform_device *pdev, void *priv);
 	void (*exit)(struct platform_device *pdev, void *priv);
 	void *bsp_priv;
-- 
2.10.2

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

* [PATCH v2 03/16] net: stmmac: fix some typos in comments
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 04/16] net: stmmac: remove freesoftware address Corentin Labbe
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

This patch fix some typos in comments.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c   |  6 +++---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 16 ++++++++--------
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
index a414bde..3b1570d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
@@ -102,7 +102,7 @@ static void show_tx_process_state(unsigned int status)
 		pr_debug("- TX (Stopped): Reset or Stop command\n");
 		break;
 	case 1:
-		pr_debug("- TX (Running):Fetching the Tx desc\n");
+		pr_debug("- TX (Running): Fetching the Tx desc\n");
 		break;
 	case 2:
 		pr_debug("- TX (Running): Waiting for end of tx\n");
@@ -136,7 +136,7 @@ static void show_rx_process_state(unsigned int status)
 		pr_debug("- RX (Running): Fetching the Rx desc\n");
 		break;
 	case 2:
-		pr_debug("- RX (Running):Checking for end of pkt\n");
+		pr_debug("- RX (Running): Checking for end of pkt\n");
 		break;
 	case 3:
 		pr_debug("- RX (Running): Waiting for Rx pkt\n");
@@ -246,7 +246,7 @@ void stmmac_set_mac_addr(void __iomem *ioaddr, u8 addr[6],
 	unsigned long data;
 
 	data = (addr[5] << 8) | addr[4];
-	/* For MAC Addr registers se have to set the Address Enable (AE)
+	/* For MAC Addr registers we have to set the Address Enable (AE)
 	 * bit that has no effect on the High Reg 0 where the bit 31 (MO)
 	 * is RO.
 	 */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1ef60282..0636858 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -216,7 +216,7 @@ static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv)
 /**
  * stmmac_hw_fix_mac_speed - callback for speed selection
  * @priv: driver private structure
- * Description: on some platforms (e.g. ST), some HW system configuraton
+ * Description: on some platforms (e.g. ST), some HW system configuration
  * registers have to be set according to the link speed negotiated.
  */
 static inline void stmmac_hw_fix_mac_speed(struct stmmac_priv *priv)
@@ -416,7 +416,7 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p,
 /**
  *  stmmac_hwtstamp_ioctl - control hardware timestamping.
  *  @dev: device pointer.
- *  @ifr: An IOCTL specefic structure, that can contain a pointer to
+ *  @ifr: An IOCTL specific structure, that can contain a pointer to
  *  a proprietary structure used to pass information to the driver.
  *  Description:
  *  This function configures the MAC to enable/disable both outgoing(TX)
@@ -1003,7 +1003,7 @@ static void stmmac_free_rx_buffers(struct stmmac_priv *priv, int i)
  * @dev: net device structure
  * @flags: gfp flag.
  * Description: this function initializes the DMA RX/TX descriptors
- * and allocates the socket buffers. It suppors the chained and ring
+ * and allocates the socket buffers. It supports the chained and ring
  * modes.
  */
 static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
@@ -2532,7 +2532,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit)
 		if (unlikely(status == discard_frame)) {
 			priv->dev->stats.rx_errors++;
 			if (priv->hwts_rx_en && !priv->extend_desc) {
-				/* DESC2 & DESC3 will be overwitten by device
+				/* DESC2 & DESC3 will be overwritten by device
 				 * with timestamp value, hence reinitialize
 				 * them in stmmac_rx_refill() function so that
 				 * device can reuse it.
@@ -2555,7 +2555,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit)
 
 			frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
 
-			/*  If frame length is greather than skb buffer size
+			/*  If frame length is greater than skb buffer size
 			 *  (preallocated during init) then the packet is
 			 *  ignored
 			 */
@@ -2761,7 +2761,7 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev,
 	/* Some GMAC devices have a bugged Jumbo frame support that
 	 * needs to have the Tx COE disabled for oversized frames
 	 * (due to limited buffer sizes). In this case we disable
-	 * the TX csum insertionin the TDES and not use SF.
+	 * the TX csum insertion in the TDES and not use SF.
 	 */
 	if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
 		features &= ~NETIF_F_CSUM_MASK;
@@ -2988,7 +2988,7 @@ static int stmmac_sysfs_dma_cap_read(struct seq_file *seq, void *v)
 		   (priv->dma_cap.hash_filter) ? "Y" : "N");
 	seq_printf(seq, "\tMultiple MAC address registers: %s\n",
 		   (priv->dma_cap.multi_addr) ? "Y" : "N");
-	seq_printf(seq, "\tPCS (TBI/SGMII/RTBI PHY interfatces): %s\n",
+	seq_printf(seq, "\tPCS (TBI/SGMII/RTBI PHY interfaces): %s\n",
 		   (priv->dma_cap.pcs) ? "Y" : "N");
 	seq_printf(seq, "\tSMA (MDIO) Interface: %s\n",
 		   (priv->dma_cap.sma_mdio) ? "Y" : "N");
@@ -3485,7 +3485,7 @@ int stmmac_resume(struct device *dev)
 		priv->irq_wake = 0;
 	} else {
 		pinctrl_pm_select_default_state(priv->device);
-		/* enable the clk prevously disabled */
+		/* enable the clk previously disabled */
 		clk_enable(priv->plat->stmmac_clk);
 		clk_enable(priv->plat->pclk);
 		/* reset the phy so that it's ready */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index b0344c2..a1a469e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -198,7 +198,7 @@ int stmmac_mdio_reset(struct mii_bus *bus)
 
 	/* This is a workaround for problems with the STE101P PHY.
 	 * It doesn't complete its reset until at least one clock cycle
-	 * on MDC, so perform a dummy mdio read. To be upadted for GMAC4
+	 * on MDC, so perform a dummy mdio read. To be updated for GMAC4
 	 * if needed.
 	 */
 	if (!priv->plat->has_gmac4)
-- 
2.10.2

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

* [PATCH v2 04/16] net: stmmac: remove freesoftware address
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (2 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 03/16] net: stmmac: fix some typos in comments Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 13:17   ` Giuseppe CAVALLARO
  2017-02-08  8:31 ` [PATCH v2 05/16] net: stmmac: remplace asm/io.h by linux/io.h Corentin Labbe
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

This patch fix the checkpatch warning about free software address.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/chain_mode.c      | 4 ----
 drivers/net/ethernet/stmicro/stmmac/common.h          | 4 ----
 drivers/net/ethernet/stmicro/stmmac/descs.h           | 4 ----
 drivers/net/ethernet/stmicro/stmmac/descs_com.h       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac100.h        | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac1000.h       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c  | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c   | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c   | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c    | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c        | 4 ----
 drivers/net/ethernet/stmicro/stmmac/mmc.h             | 4 ----
 drivers/net/ethernet/stmicro/stmmac/mmc_core.c        | 4 ----
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/ring_mode.c       | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac.h          | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c  | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c     | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c      | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c      | 4 ----
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h      | 4 ----
 26 files changed, 104 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
index 026e8e9..01a8c02 100644
--- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
@@ -16,10 +16,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 262a1c4..24929bf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h
index faeeef7..0c2432b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/descs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/descs.h
@@ -11,10 +11,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs_com.h b/drivers/net/ethernet/stmicro/stmmac/descs_com.h
index 1d181e2..ca9d7e4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h
+++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h
@@ -17,10 +17,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
index 1657acf..e149848 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
index 52b9407..c02d366 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
@@ -10,10 +10,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index a26715b..91c8926 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -16,10 +16,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
index 612d3aa..fbaec0f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
@@ -16,10 +16,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
index 9dd2987..8ab5189 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
@@ -18,10 +18,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
index e5664da..d40e91e8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
@@ -18,10 +18,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
index 726d9d9..56e485f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
index 3b1570d..e4cda39 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
@@ -10,10 +10,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index f0d8632..8427643 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/stmicro/stmmac/mmc.h
index 38a1a56..c037326 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc.h
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
index ce9aa79..e9b04c2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index fd78406..5a0d4b0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
index 9983ce9..452f256 100644
--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
@@ -16,10 +16,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index bf8a83e..cd8fb61 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -10,10 +10,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 322e5c6..9083d9a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index 10d6059..721b616 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0636858..a13fcc4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -13,10 +13,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index a1a469e..738d5c7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -13,10 +13,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 3da4737..5c9e4622 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 4963ccd..320f46e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 3eb281d..d71bd80 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
index c06938c..48fb72f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
@@ -12,10 +12,6 @@
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
 
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
 
-- 
2.10.2

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

* [PATCH v2 05/16] net: stmmac: remplace asm/io.h by linux/io.h
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (3 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 04/16] net: stmmac: remove freesoftware address Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 06/16] net: stmmac: fix some code style problem Corentin Labbe
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

This patch fix the checkpatch warning about asm/io.h.
Sorting all includes in the process.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 738d5c7..3fdc6ec 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -20,13 +20,13 @@
   Maintainer: Giuseppe Cavallaro <peppe.cavallaro@st.com>
 *******************************************************************************/
 
+#include <linux/io.h>
 #include <linux/mii.h>
-#include <linux/phy.h>
-#include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_mdio.h>
-#include <asm/io.h>
+#include <linux/phy.h>
+#include <linux/slab.h>
 
 #include "stmmac.h"
 
-- 
2.10.2

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

* [PATCH v2 06/16] net: stmmac: fix some code style problem
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (4 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 05/16] net: stmmac: remplace asm/io.h by linux/io.h Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 10:41   ` Joe Perches
  2017-02-08 11:57   ` Sergei Shtylyov
  2017-02-08  8:31 ` [PATCH v2 07/16] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout Corentin Labbe
                   ` (9 subsequent siblings)
  15 siblings, 2 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

Checkpatch complains about some code style problem on stmmac_mdio.c.
This patch fix them.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 3fdc6ec..c24bef2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -152,9 +152,9 @@ int stmmac_mdio_reset(struct mii_bus *bus)
 
 #ifdef CONFIG_OF
 	if (priv->device->of_node) {
-
 		if (data->reset_gpio < 0) {
 			struct device_node *np = priv->device->of_node;
+
 			if (!np)
 				return 0;
 
@@ -221,7 +221,7 @@ int stmmac_mdio_register(struct net_device *ndev)
 		return 0;
 
 	new_bus = mdiobus_alloc();
-	if (new_bus == NULL)
+	if (!new_bus)
 		return -ENOMEM;
 
 	if (mdio_bus_data->irqs)
@@ -258,6 +258,7 @@ int stmmac_mdio_register(struct net_device *ndev)
 	found = 0;
 	for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
 		struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
+
 		if (phydev) {
 			int act = 0;
 			char irq_num[4];
@@ -267,7 +268,7 @@ int stmmac_mdio_register(struct net_device *ndev)
 			 * If an IRQ was provided to be assigned after
 			 * the bus probe, do it here.
 			 */
-			if ((mdio_bus_data->irqs == NULL) &&
+			if ((!mdio_bus_data->irqs) &&
 			    (mdio_bus_data->probed_phy_irq > 0)) {
 				new_bus->irq[addr] =
 					mdio_bus_data->probed_phy_irq;
-- 
2.10.2

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

* [PATCH v2 07/16] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (5 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 06/16] net: stmmac: fix some code style problem Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout Corentin Labbe
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The stmmac_mdio_busy_wait() function do the same job than
readl_poll_timeout().
So is is better to replace it.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 33 ++++++++---------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index c24bef2..d9893cf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -21,6 +21,7 @@
 *******************************************************************************/
 
 #include <linux/io.h>
+#include <linux/iopoll.h>
 #include <linux/mii.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
@@ -38,22 +39,6 @@
 #define MII_GMAC4_WRITE			(1 << MII_GMAC4_GOC_SHIFT)
 #define MII_GMAC4_READ			(3 << MII_GMAC4_GOC_SHIFT)
 
-static int stmmac_mdio_busy_wait(void __iomem *ioaddr, unsigned int mii_addr)
-{
-	unsigned long curr;
-	unsigned long finish = jiffies + 3 * HZ;
-
-	do {
-		curr = jiffies;
-		if (readl(ioaddr + mii_addr) & MII_BUSY)
-			cpu_relax();
-		else
-			return 0;
-	} while (!time_after_eq(curr, finish));
-
-	return -EBUSY;
-}
-
 /**
  * stmmac_mdio_read
  * @bus: points to the mii_bus structure
@@ -70,7 +55,7 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
 	struct stmmac_priv *priv = netdev_priv(ndev);
 	unsigned int mii_address = priv->hw->mii.addr;
 	unsigned int mii_data = priv->hw->mii.data;
-
+	u32 v;
 	int data;
 	u32 value = MII_BUSY;
 
@@ -82,12 +67,14 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
 	if (priv->plat->has_gmac4)
 		value |= MII_GMAC4_READ;
 
-	if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
+	if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY),
+			       100, 10000))
 		return -EBUSY;
 
 	writel(value, priv->ioaddr + mii_address);
 
-	if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
+	if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY),
+			       100, 10000))
 		return -EBUSY;
 
 	/* Read the data from the MII data register */
@@ -111,7 +98,7 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
 	struct stmmac_priv *priv = netdev_priv(ndev);
 	unsigned int mii_address = priv->hw->mii.addr;
 	unsigned int mii_data = priv->hw->mii.data;
-
+	u32 v;
 	u32 value = MII_BUSY;
 
 	value |= (phyaddr << priv->hw->mii.addr_shift)
@@ -126,7 +113,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
 		value |= MII_WRITE;
 
 	/* Wait until any existing MII operation is complete */
-	if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
+	if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY),
+			       100, 10000))
 		return -EBUSY;
 
 	/* Set the MII address register to write */
@@ -134,7 +122,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
 	writel(value, priv->ioaddr + mii_address);
 
 	/* Wait until any existing MII operation is complete */
-	return stmmac_mdio_busy_wait(priv->ioaddr, mii_address);
+	return readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY),
+				  100, 10000);
 }
 
 /**
-- 
2.10.2

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

* [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (6 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 07/16] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 13:18   ` Giuseppe CAVALLARO
  2017-02-08  8:31 ` [PATCH v2 09/16] net: stmmac: replace ENOSYS by EINVAL Corentin Labbe
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The dwmac_dma_reset function use an open coded of readl_poll_timeout().
Replace the open coded handling with the proper function.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
index e4cda39..e60bfca 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
@@ -17,6 +17,7 @@
 *******************************************************************************/
 
 #include <linux/io.h>
+#include <linux/iopoll.h>
 #include "common.h"
 #include "dwmac_dma.h"
 
@@ -25,19 +26,16 @@
 int dwmac_dma_reset(void __iomem *ioaddr)
 {
 	u32 value = readl(ioaddr + DMA_BUS_MODE);
-	int limit;
+	int err;
 
 	/* DMA SW reset */
 	value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
-	limit = 10;
-	while (limit--) {
-		if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
-			break;
-		mdelay(10);
-	}
 
-	if (limit < 0)
+	err = readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
+				 !(value & DMA_BUS_MODE_SFT_RESET),
+				 100000, 10000);
+	if (err)
 		return -EBUSY;
 
 	return 0;
-- 
2.10.2

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

* [PATCH v2 09/16] net: stmmac: replace ENOSYS by EINVAL
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (7 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed Corentin Labbe
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

As said by checkpatch ENOSYS means 'invalid syscall nr' and nothing
else.
This patch replace ENOSYS by the more appropriate value EINVAL.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 320f46e..433a842 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -411,7 +411,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
 struct plat_stmmacenet_data *
 stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
 {
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-EINVAL);
 }
 
 void stmmac_remove_config_dt(struct platform_device *pdev,
-- 
2.10.2

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

* [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (8 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 09/16] net: stmmac: replace ENOSYS by EINVAL Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 13:18   ` Giuseppe CAVALLARO
  2017-02-08  8:31 ` [PATCH v2 11/16] net: stmmac: Rewrite two test against NULL value Corentin Labbe
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The message about invalid speed does not state 1000 as a valid speed.
It is much simpler to said that the speed is invalid.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a13fcc4..ed81375 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -738,8 +738,7 @@ static void stmmac_adjust_link(struct net_device *dev)
 				break;
 			default:
 				netif_warn(priv, link, priv->dev,
-					   "Speed (%d) not 10/100\n",
-					   phydev->speed);
+					   "broken speed: %d\n", phydev->speed);
 				break;
 			}
 
-- 
2.10.2

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

* [PATCH v2 11/16] net: stmmac: Rewrite two test against NULL value
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (9 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 12/16] net: stmmac: rename rx_crc to rx_crc_errors Corentin Labbe
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

This patch rewrite two test against NULL value with correct style.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ed81375..cc88bdb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -689,7 +689,7 @@ static void stmmac_adjust_link(struct net_device *dev)
 	int new_state = 0;
 	unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
 
-	if (phydev == NULL)
+	if (!phydev)
 		return;
 
 	spin_lock_irqsave(&priv->lock, flags);
@@ -1131,7 +1131,7 @@ static void dma_free_tx_skbufs(struct stmmac_priv *priv)
 						 DMA_TO_DEVICE);
 		}
 
-		if (priv->tx_skbuff[i] != NULL) {
+		if (priv->tx_skbuff[i]) {
 			dev_kfree_skb_any(priv->tx_skbuff[i]);
 			priv->tx_skbuff[i] = NULL;
 			priv->tx_skbuff_dma[i].buf = 0;
-- 
2.10.2

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

* [PATCH v2 12/16] net: stmmac: rename rx_crc to rx_crc_errors
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (10 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 11/16] net: stmmac: Rewrite two test against NULL value Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 13/16] net: stmmac: print phy information Corentin Labbe
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The ethtool stat counter rx_crc from stmmac is mis-named, the name
seems to speak about the number of RX CRC done, but in fact it is about
errors.

This patch rename it to rx_crc_errors, just like the same ifconfig
counter.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/common.h         | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c   | 2 +-
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c      | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 24929bf..144fe84 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -67,7 +67,7 @@ struct stmmac_extra_stats {
 	unsigned long overflow_error;
 	unsigned long ipc_csum_error;
 	unsigned long rx_collision;
-	unsigned long rx_crc;
+	unsigned long rx_crc_errors;
 	unsigned long dribbling_bit;
 	unsigned long rx_length;
 	unsigned long rx_mii;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index 8816515..843ec69 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -103,7 +103,7 @@ static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x,
 			x->rx_mii++;
 
 		if (unlikely(rdes3 & RDES3_CRC_ERROR)) {
-			x->rx_crc++;
+			x->rx_crc_errors++;
 			stats->rx_crc_errors++;
 		}
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index 8427643..323b59e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -221,7 +221,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
 			x->rx_mii++;
 
 		if (unlikely(rdes0 & RDES0_CRC_ERROR)) {
-			x->rx_crc++;
+			x->rx_crc_errors++;
 			stats->rx_crc_errors++;
 		}
 		ret = discard_frame;
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index 5a0d4b0..efb818e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -111,7 +111,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
 			stats->collisions++;
 		}
 		if (unlikely(rdes0 & RDES0_CRC_ERROR)) {
-			x->rx_crc++;
+			x->rx_crc_errors++;
 			stats->rx_crc_errors++;
 		}
 		ret = discard_frame;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 9083d9a..aab895d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -61,7 +61,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
 	STMMAC_STAT(overflow_error),
 	STMMAC_STAT(ipc_csum_error),
 	STMMAC_STAT(rx_collision),
-	STMMAC_STAT(rx_crc),
+	STMMAC_STAT(rx_crc_errors),
 	STMMAC_STAT(dribbling_bit),
 	STMMAC_STAT(rx_length),
 	STMMAC_STAT(rx_mii),
-- 
2.10.2

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

* [PATCH v2 13/16] net: stmmac: print phy information
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (11 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 12/16] net: stmmac: rename rx_crc to rx_crc_errors Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08 13:18   ` Giuseppe CAVALLARO
  2017-02-08  8:31 ` [PATCH v2 14/16] net: stmmac: remove dead code in stmmac_tx_clean Corentin Labbe
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

When a PHY is found, printing which one was found (and which type/model) is
a good information to know.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cc88bdb..9805aa8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -870,9 +870,7 @@ static int stmmac_init_phy(struct net_device *dev)
 	if (phydev->is_pseudo_fixed_link)
 		phydev->irq = PHY_POLL;
 
-	netdev_dbg(priv->dev, "%s: attached to PHY (UID 0x%x) Link = %d\n",
-		   __func__, phydev->phy_id, phydev->link);
-
+	phy_attached_info(phydev);
 	return 0;
 }
 
-- 
2.10.2

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

* [PATCH v2 14/16] net: stmmac: remove dead code in stmmac_tx_clean
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (12 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 13/16] net: stmmac: print phy information Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 15/16] net: stmmac: remove unused variable in sysfs_display_ring Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 16/16] net: stmmac: replace unsigned by u32 Corentin Labbe
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

Since commit cf32deec16e4 ("stmmac: add tx_skbuff_dma to save descriptors used by PTP"),
the struct dma_desc *p in stmmac_tx_clean was not used at all.

This patch remove this dead code.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9805aa8..c5dc3f9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1109,13 +1109,6 @@ static void dma_free_tx_skbufs(struct stmmac_priv *priv)
 	int i;
 
 	for (i = 0; i < DMA_TX_SIZE; i++) {
-		struct dma_desc *p;
-
-		if (priv->extend_desc)
-			p = &((priv->dma_etx + i)->basic);
-		else
-			p = priv->dma_tx + i;
-
 		if (priv->tx_skbuff_dma[i].buf) {
 			if (priv->tx_skbuff_dma[i].map_as_page)
 				dma_unmap_page(priv->device,
-- 
2.10.2

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

* [PATCH v2 15/16] net: stmmac: remove unused variable in sysfs_display_ring
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (13 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 14/16] net: stmmac: remove dead code in stmmac_tx_clean Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  2017-02-08  8:31 ` [PATCH v2 16/16] net: stmmac: replace unsigned by u32 Corentin Labbe
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

The u64 x variable in sysfs_display_ring is unused.
This patch remove it.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c5dc3f9..d1b2e1e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2893,9 +2893,7 @@ static void sysfs_display_ring(void *head, int size, int extend_desc,
 	struct dma_desc *p = (struct dma_desc *)head;
 
 	for (i = 0; i < size; i++) {
-		u64 x;
 		if (extend_desc) {
-			x = *(u64 *) ep;
 			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
 				   i, (unsigned int)virt_to_phys(ep),
 				   le32_to_cpu(ep->basic.des0),
@@ -2904,7 +2902,6 @@ static void sysfs_display_ring(void *head, int size, int extend_desc,
 				   le32_to_cpu(ep->basic.des3));
 			ep++;
 		} else {
-			x = *(u64 *) p;
 			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
 				   i, (unsigned int)virt_to_phys(ep),
 				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
-- 
2.10.2

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

* [PATCH v2 16/16] net: stmmac: replace unsigned by u32
  2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
                   ` (14 preceding siblings ...)
  2017-02-08  8:31 ` [PATCH v2 15/16] net: stmmac: remove unused variable in sysfs_display_ring Corentin Labbe
@ 2017-02-08  8:31 ` Corentin Labbe
  15 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08  8:31 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel, Corentin Labbe

checkpatch complains about two unsigned without type after.
Since the value return is u32, it is simpler to replace it by u32 instead
of "unsigned int"

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d1b2e1e..7251871 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -187,7 +187,7 @@ static void print_pkt(unsigned char *buf, int len)
 
 static inline u32 stmmac_tx_avail(struct stmmac_priv *priv)
 {
-	unsigned avail;
+	u32 avail;
 
 	if (priv->dirty_tx > priv->cur_tx)
 		avail = priv->dirty_tx - priv->cur_tx - 1;
@@ -199,7 +199,7 @@ static inline u32 stmmac_tx_avail(struct stmmac_priv *priv)
 
 static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv)
 {
-	unsigned dirty;
+	u32 dirty;
 
 	if (priv->dirty_rx <= priv->cur_rx)
 		dirty = priv->cur_rx - priv->dirty_rx;
-- 
2.10.2

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

* Re: [PATCH v2 06/16] net: stmmac: fix some code style problem
  2017-02-08  8:31 ` [PATCH v2 06/16] net: stmmac: fix some code style problem Corentin Labbe
@ 2017-02-08 10:41   ` Joe Perches
  2017-02-08 15:06     ` Corentin Labbe
  2017-02-08 11:57   ` Sergei Shtylyov
  1 sibling, 1 reply; 25+ messages in thread
From: Joe Perches @ 2017-02-08 10:41 UTC (permalink / raw)
  To: Corentin Labbe, peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel

On Wed, 2017-02-08 at 09:31 +0100, Corentin Labbe wrote:
> Checkpatch complains about some code style problem on stmmac_mdio.c.
> This patch fix them.
[]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
[]
> @@ -258,6 +258,7 @@ int stmmac_mdio_register(struct net_device *ndev)
>  	found = 0;
>  	for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
>  		struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
> +
>  		if (phydev) {
>  			int act = 0;
>  			char irq_num[4];

Maybe use
		if (!phydev)
			continue;
to reduce indentation

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

* Re: [PATCH v2 06/16] net: stmmac: fix some code style problem
  2017-02-08  8:31 ` [PATCH v2 06/16] net: stmmac: fix some code style problem Corentin Labbe
  2017-02-08 10:41   ` Joe Perches
@ 2017-02-08 11:57   ` Sergei Shtylyov
  1 sibling, 0 replies; 25+ messages in thread
From: Sergei Shtylyov @ 2017-02-08 11:57 UTC (permalink / raw)
  To: Corentin Labbe, peppe.cavallaro, alexandre.torgue, netdev; +Cc: linux-kernel

Hello!

On 2/8/2017 11:31 AM, Corentin Labbe wrote:

> Checkpatch complains about some code style problem on stmmac_mdio.c.
> This patch fix them.

    Fixes.

> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index 3fdc6ec..c24bef2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
[...]
> @@ -267,7 +268,7 @@ int stmmac_mdio_register(struct net_device *ndev)
>  			 * If an IRQ was provided to be assigned after
>  			 * the bus probe, do it here.
>  			 */
> -			if ((mdio_bus_data->irqs == NULL) &&
> +			if ((!mdio_bus_data->irqs) &&

    Innermost parens not needed (and weren't needed before).

>  			    (mdio_bus_data->probed_phy_irq > 0)) {
>  				new_bus->irq[addr] =
>  					mdio_bus_data->probed_phy_irq;

MBR, Sergei

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

* Re: [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer
  2017-02-08  8:31 ` [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer Corentin Labbe
@ 2017-02-08 13:17   ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 25+ messages in thread
From: Giuseppe CAVALLARO @ 2017-02-08 13:17 UTC (permalink / raw)
  To: Corentin Labbe, alexandre.torgue, netdev; +Cc: linux-kernel

On 2/8/2017 9:31 AM, Corentin Labbe wrote:
> The bus_setup function pointer is not used at all, this patch remove it.
>
                                     no longer used...


> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

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

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ----
>  include/linux/stmmac.h                            | 1 -
>  2 files changed, 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index bd83bf9..1ef60282 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1682,10 +1682,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
>  	/* Copy the MAC addr into the HW  */
>  	priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
>
> -	/* If required, perform hw setup of the bus. */
> -	if (priv->plat->bus_setup)
> -		priv->plat->bus_setup(priv->ioaddr);
> -
>  	/* PS and related bits will be programmed according to the speed */
>  	if (priv->hw->pcs) {
>  		int speed = priv->plat->mac_port_sel_speed;
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index d76033d6..fc273e9 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -134,7 +134,6 @@ struct plat_stmmacenet_data {
>  	int tx_fifo_size;
>  	int rx_fifo_size;
>  	void (*fix_mac_speed)(void *priv, unsigned int speed);
> -	void (*bus_setup)(void __iomem *ioaddr);
>  	int (*init)(struct platform_device *pdev, void *priv);
>  	void (*exit)(struct platform_device *pdev, void *priv);
>  	void *bsp_priv;
>

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

* Re: [PATCH v2 04/16] net: stmmac: remove freesoftware address
  2017-02-08  8:31 ` [PATCH v2 04/16] net: stmmac: remove freesoftware address Corentin Labbe
@ 2017-02-08 13:17   ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 25+ messages in thread
From: Giuseppe CAVALLARO @ 2017-02-08 13:17 UTC (permalink / raw)
  To: Corentin Labbe, alexandre.torgue, netdev; +Cc: linux-kernel

On 2/8/2017 9:31 AM, Corentin Labbe wrote:
> This patch fix the checkpatch warning about free software address.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

just wonder if this should be sent separately for net-next instead of

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

> ---
>  drivers/net/ethernet/stmicro/stmmac/chain_mode.c      | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/common.h          | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/descs.h           | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/descs_com.h       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac100.h        | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac1000.h       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c  | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c   | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c   | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c    | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/enh_desc.c        | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/mmc.h             | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/mmc_core.c        | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/norm_desc.c       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/ring_mode.c       | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac.h          | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c  | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c     | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c      | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c      | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h      | 4 ----
>  26 files changed, 104 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> index 026e8e9..01a8c02 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> @@ -16,10 +16,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
> index 262a1c4..24929bf 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/common.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h
> index faeeef7..0c2432b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/descs.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/descs.h
> @@ -11,10 +11,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/descs_com.h b/drivers/net/ethernet/stmicro/stmmac/descs_com.h
> index 1d181e2..ca9d7e4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h
> @@ -17,10 +17,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
> index 1657acf..e149848 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
> index 52b9407..c02d366 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
> @@ -10,10 +10,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> index a26715b..91c8926 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> @@ -16,10 +16,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> index 612d3aa..fbaec0f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> @@ -16,10 +16,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
> index 9dd2987..8ab5189 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
> @@ -18,10 +18,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> index e5664da..d40e91e8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> @@ -18,10 +18,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
> index 726d9d9..56e485f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> index 3b1570d..e4cda39 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> @@ -10,10 +10,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
> index f0d8632..8427643 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/stmicro/stmmac/mmc.h
> index 38a1a56..c037326 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/mmc.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
> index ce9aa79..e9b04c2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> index fd78406..5a0d4b0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> index 9983ce9..452f256 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> @@ -16,10 +16,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index bf8a83e..cd8fb61 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -10,10 +10,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 322e5c6..9083d9a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
> index 10d6059..721b616 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 0636858..a13fcc4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -13,10 +13,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index a1a469e..738d5c7 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> @@ -13,10 +13,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index 3da4737..5c9e4622 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 4963ccd..320f46e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> index 3eb281d..d71bd80 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> index c06938c..48fb72f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
> @@ -12,10 +12,6 @@
>    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>    more details.
>
> -  You should have received a copy of the GNU General Public License along with
> -  this program; if not, write to the Free Software Foundation, Inc.,
> -  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> -
>    The full GNU General Public License is included in this distribution in
>    the file called "COPYING".
>
>

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

* Re: [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout
  2017-02-08  8:31 ` [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout Corentin Labbe
@ 2017-02-08 13:18   ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 25+ messages in thread
From: Giuseppe CAVALLARO @ 2017-02-08 13:18 UTC (permalink / raw)
  To: Corentin Labbe, alexandre.torgue, netdev; +Cc: linux-kernel

On 2/8/2017 9:31 AM, Corentin Labbe wrote:
> The dwmac_dma_reset function use an open coded of readl_poll_timeout().
> Replace the open coded handling with the proper function.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> index e4cda39..e60bfca 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> @@ -17,6 +17,7 @@
>  *******************************************************************************/
>
>  #include <linux/io.h>
> +#include <linux/iopoll.h>
>  #include "common.h"
>  #include "dwmac_dma.h"
>
> @@ -25,19 +26,16 @@
>  int dwmac_dma_reset(void __iomem *ioaddr)
>  {
>  	u32 value = readl(ioaddr + DMA_BUS_MODE);
> -	int limit;
> +	int err;
>
>  	/* DMA SW reset */
>  	value |= DMA_BUS_MODE_SFT_RESET;
>  	writel(value, ioaddr + DMA_BUS_MODE);
> -	limit = 10;
> -	while (limit--) {
> -		if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
> -			break;
> -		mdelay(10);
> -	}
>
> -	if (limit < 0)
> +	err = readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
> +				 !(value & DMA_BUS_MODE_SFT_RESET),
> +				 100000, 10000);
> +	if (err)
>  		return -EBUSY;
>
>  	return 0;
>

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

* Re: [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed
  2017-02-08  8:31 ` [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed Corentin Labbe
@ 2017-02-08 13:18   ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 25+ messages in thread
From: Giuseppe CAVALLARO @ 2017-02-08 13:18 UTC (permalink / raw)
  To: Corentin Labbe, alexandre.torgue, netdev; +Cc: linux-kernel

On 2/8/2017 9:31 AM, Corentin Labbe wrote:
> The message about invalid speed does not state 1000 as a valid speed.
> It is much simpler to said that the speed is invalid.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

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

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index a13fcc4..ed81375 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -738,8 +738,7 @@ static void stmmac_adjust_link(struct net_device *dev)
>  				break;
>  			default:
>  				netif_warn(priv, link, priv->dev,
> -					   "Speed (%d) not 10/100\n",
> -					   phydev->speed);
> +					   "broken speed: %d\n", phydev->speed);
>  				break;
>  			}
>
>

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

* Re: [PATCH v2 13/16] net: stmmac: print phy information
  2017-02-08  8:31 ` [PATCH v2 13/16] net: stmmac: print phy information Corentin Labbe
@ 2017-02-08 13:18   ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 25+ messages in thread
From: Giuseppe CAVALLARO @ 2017-02-08 13:18 UTC (permalink / raw)
  To: Corentin Labbe, alexandre.torgue, netdev; +Cc: linux-kernel

On 2/8/2017 9:31 AM, Corentin Labbe wrote:
> When a PHY is found, printing which one was found (and which type/model) is
> a good information to know.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

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

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index cc88bdb..9805aa8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -870,9 +870,7 @@ static int stmmac_init_phy(struct net_device *dev)
>  	if (phydev->is_pseudo_fixed_link)
>  		phydev->irq = PHY_POLL;
>
> -	netdev_dbg(priv->dev, "%s: attached to PHY (UID 0x%x) Link = %d\n",
> -		   __func__, phydev->phy_id, phydev->link);
> -
> +	phy_attached_info(phydev);
>  	return 0;
>  }
>
>

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

* Re: [PATCH v2 06/16] net: stmmac: fix some code style problem
  2017-02-08 10:41   ` Joe Perches
@ 2017-02-08 15:06     ` Corentin Labbe
  0 siblings, 0 replies; 25+ messages in thread
From: Corentin Labbe @ 2017-02-08 15:06 UTC (permalink / raw)
  To: Joe Perches; +Cc: peppe.cavallaro, alexandre.torgue, netdev, linux-kernel

On Wed, Feb 08, 2017 at 02:41:58AM -0800, Joe Perches wrote:
> On Wed, 2017-02-08 at 09:31 +0100, Corentin Labbe wrote:
> > Checkpatch complains about some code style problem on stmmac_mdio.c.
> > This patch fix them.
> []
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> []
> > @@ -258,6 +258,7 @@ int stmmac_mdio_register(struct net_device *ndev)
> >  	found = 0;
> >  	for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
> >  		struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
> > +
> >  		if (phydev) {
> >  			int act = 0;
> >  			char irq_num[4];
> 
> Maybe use
> 		if (!phydev)
> 			continue;
> to reduce indentation

Thanks I will do it in a subsequent patch

Regards
Corentin Labbe

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

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

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08  8:31 [PATCH v2 00/16] net: stmmac: misc fix Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer Corentin Labbe
2017-02-08 13:17   ` Giuseppe CAVALLARO
2017-02-08  8:31 ` [PATCH v2 03/16] net: stmmac: fix some typos in comments Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 04/16] net: stmmac: remove freesoftware address Corentin Labbe
2017-02-08 13:17   ` Giuseppe CAVALLARO
2017-02-08  8:31 ` [PATCH v2 05/16] net: stmmac: remplace asm/io.h by linux/io.h Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 06/16] net: stmmac: fix some code style problem Corentin Labbe
2017-02-08 10:41   ` Joe Perches
2017-02-08 15:06     ` Corentin Labbe
2017-02-08 11:57   ` Sergei Shtylyov
2017-02-08  8:31 ` [PATCH v2 07/16] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 08/16] net: stmmac: Use readl_poll_timeout Corentin Labbe
2017-02-08 13:18   ` Giuseppe CAVALLARO
2017-02-08  8:31 ` [PATCH v2 09/16] net: stmmac: replace ENOSYS by EINVAL Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed Corentin Labbe
2017-02-08 13:18   ` Giuseppe CAVALLARO
2017-02-08  8:31 ` [PATCH v2 11/16] net: stmmac: Rewrite two test against NULL value Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 12/16] net: stmmac: rename rx_crc to rx_crc_errors Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 13/16] net: stmmac: print phy information Corentin Labbe
2017-02-08 13:18   ` Giuseppe CAVALLARO
2017-02-08  8:31 ` [PATCH v2 14/16] net: stmmac: remove dead code in stmmac_tx_clean Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 15/16] net: stmmac: remove unused variable in sysfs_display_ring Corentin Labbe
2017-02-08  8:31 ` [PATCH v2 16/16] net: stmmac: replace unsigned by u32 Corentin Labbe

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