diff mbox series

[v3,net,1/2] net: stmmac: add new mode parameter for fix_mac_speed

Message ID 20230731161929.2341584-2-shenwei.wang@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series update stmmac fix_mac_speed | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 1355 this patch: 47
netdev/cc_maintainers warning 4 maintainers not CCed: samin.guo@starfivetech.com linux-arm-msm@vger.kernel.org kernel@esmil.dk linux-sunxi@lists.linux.dev
netdev/build_clang fail Errors and warnings before: 1351 this patch: 20
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 1378 this patch: 47
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 111 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Shenwei Wang July 31, 2023, 4:19 p.m. UTC
A mode parameter has been added to the callback function of fix_mac_speed
to indicate the physical layer type.

The mode can be one the following:
	MLO_AN_PHY	- Conventional PHY
	MLO_AN_FIXED	- Fixed-link mode
	MLO_AN_INBAND	- In-band protocol

Also use short version of 'uint' to replace the 'unsigned int' in the
function definitions.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c         | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c  | 4 ++--
 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c     | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c          | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c     | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c    | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c    | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c       | 2 +-
 include/linux/stmmac.h                                  | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

Comments

Marc Kleine-Budde Aug. 1, 2023, 6:37 a.m. UTC | #1
On 31.07.2023 11:19:28, Shenwei Wang wrote:
> A mode parameter has been added to the callback function of fix_mac_speed
> to indicate the physical layer type.
> 
> The mode can be one the following:
> 	MLO_AN_PHY	- Conventional PHY
> 	MLO_AN_FIXED	- Fixed-link mode
> 	MLO_AN_INBAND	- In-band protocol
> 
> Also use short version of 'uint' to replace the 'unsigned int' in the
> function definitions.

There are not many users of 'uint' in the kernel and it's not used in
the stmmac driver so far. From my point of view I would not introduce
it and stick to the standard 'unsigned int'.

Just my 2 cent,
Marc
kernel test robot Aug. 1, 2023, 10:52 a.m. UTC | #2
Hi Shenwei,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenwei-Wang/net-stmmac-add-new-mode-parameter-for-fix_mac_speed/20230801-002328
base:   net/main
patch link:    https://lore.kernel.org/r/20230731161929.2341584-2-shenwei.wang%40nxp.com
patch subject: [PATCH v3 net 1/2] net: stmmac: add new mode parameter for fix_mac_speed
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20230801/202308011831.Ndat5994-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230801/202308011831.Ndat5994-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308011831.Ndat5994-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c: In function 'sti_dwmac_probe':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:296:33: error: assignment to 'void (*)(void *, uint,  uint)' {aka 'void (*)(void *, unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(void *, unsigned int)' [-Werror=incompatible-pointer-types]
     296 |         plat_dat->fix_mac_speed = data->fix_retime_src;
         |                                 ^
   cc1: some warnings being treated as errors


vim +296 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c

d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  258  
8387ee21f972de Joachim Eastwood    2015-07-29  259  static int sti_dwmac_probe(struct platform_device *pdev)
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  260  {
8387ee21f972de Joachim Eastwood    2015-07-29  261  	struct plat_stmmacenet_data *plat_dat;
07ca3749cec2b8 Joachim Eastwood    2015-07-29  262  	const struct sti_dwmac_of_data *data;
8387ee21f972de Joachim Eastwood    2015-07-29  263  	struct stmmac_resources stmmac_res;
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  264  	struct sti_dwmac *dwmac;
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  265  	int ret;
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  266  
149adedd7696cb Joachim Eastwood    2015-07-29  267  	data = of_device_get_match_data(&pdev->dev);
149adedd7696cb Joachim Eastwood    2015-07-29  268  	if (!data) {
149adedd7696cb Joachim Eastwood    2015-07-29  269  		dev_err(&pdev->dev, "No OF match data provided\n");
149adedd7696cb Joachim Eastwood    2015-07-29  270  		return -EINVAL;
149adedd7696cb Joachim Eastwood    2015-07-29  271  	}
149adedd7696cb Joachim Eastwood    2015-07-29  272  
8387ee21f972de Joachim Eastwood    2015-07-29  273  	ret = stmmac_get_platform_resources(pdev, &stmmac_res);
8387ee21f972de Joachim Eastwood    2015-07-29  274  	if (ret)
8387ee21f972de Joachim Eastwood    2015-07-29  275  		return ret;
8387ee21f972de Joachim Eastwood    2015-07-29  276  
83216e3988cd19 Michael Walle       2021-04-12  277  	plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
8387ee21f972de Joachim Eastwood    2015-07-29  278  	if (IS_ERR(plat_dat))
8387ee21f972de Joachim Eastwood    2015-07-29  279  		return PTR_ERR(plat_dat);
8387ee21f972de Joachim Eastwood    2015-07-29  280  
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  281  	dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
d2ed0a7755fe14 Johan Hovold        2016-11-30  282  	if (!dwmac) {
d2ed0a7755fe14 Johan Hovold        2016-11-30  283  		ret = -ENOMEM;
d2ed0a7755fe14 Johan Hovold        2016-11-30  284  		goto err_remove_config_dt;
d2ed0a7755fe14 Johan Hovold        2016-11-30  285  	}
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  286  
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  287  	ret = sti_dwmac_parse_data(dwmac, pdev);
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  288  	if (ret) {
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  289  		dev_err(&pdev->dev, "Unable to parse OF data\n");
d2ed0a7755fe14 Johan Hovold        2016-11-30  290  		goto err_remove_config_dt;
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  291  	}
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  292  
16b1adbb16c8a5 Joachim Eastwood    2015-07-29  293  	dwmac->fix_retime_src = data->fix_retime_src;
16b1adbb16c8a5 Joachim Eastwood    2015-07-29  294  
8387ee21f972de Joachim Eastwood    2015-07-29  295  	plat_dat->bsp_priv = dwmac;
16b1adbb16c8a5 Joachim Eastwood    2015-07-29 @296  	plat_dat->fix_mac_speed = data->fix_retime_src;
8387ee21f972de Joachim Eastwood    2015-07-29  297  
b89cbfb01a2855 Joachim Eastwood    2016-11-04  298  	ret = clk_prepare_enable(dwmac->clk);
8387ee21f972de Joachim Eastwood    2015-07-29  299  	if (ret)
d2ed0a7755fe14 Johan Hovold        2016-11-30  300  		goto err_remove_config_dt;
8387ee21f972de Joachim Eastwood    2015-07-29  301  
0eebedc2fd284e Joachim Eastwood    2016-11-04  302  	ret = sti_dwmac_set_mode(dwmac);
b89cbfb01a2855 Joachim Eastwood    2016-11-04  303  	if (ret)
b89cbfb01a2855 Joachim Eastwood    2016-11-04  304  		goto disable_clk;
b89cbfb01a2855 Joachim Eastwood    2016-11-04  305  
b89cbfb01a2855 Joachim Eastwood    2016-11-04  306  	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
b89cbfb01a2855 Joachim Eastwood    2016-11-04  307  	if (ret)
b89cbfb01a2855 Joachim Eastwood    2016-11-04  308  		goto disable_clk;
b89cbfb01a2855 Joachim Eastwood    2016-11-04  309  
b89cbfb01a2855 Joachim Eastwood    2016-11-04  310  	return 0;
b89cbfb01a2855 Joachim Eastwood    2016-11-04  311  
b89cbfb01a2855 Joachim Eastwood    2016-11-04  312  disable_clk:
b89cbfb01a2855 Joachim Eastwood    2016-11-04  313  	clk_disable_unprepare(dwmac->clk);
d2ed0a7755fe14 Johan Hovold        2016-11-30  314  err_remove_config_dt:
d2ed0a7755fe14 Johan Hovold        2016-11-30  315  	stmmac_remove_config_dt(pdev, plat_dat);
0a9e22715ee384 Johan Hovold        2016-11-30  316  
b89cbfb01a2855 Joachim Eastwood    2016-11-04  317  	return ret;
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  318  }
d15891ca1fdd7f Srinivas Kandagatla 2014-02-11  319
Shenwei Wang Aug. 1, 2023, 6:43 p.m. UTC | #3
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: Tuesday, August 1, 2023 1:37 AM
> To: Shenwei Wang <shenwei.wang@nxp.com>
> Cc: Russell King <linux@armlinux.org.uk>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Maxime
> Coquelin <mcoquelin.stm32@gmail.com>; Shawn Guo <shawnguo@kernel.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Neil Armstrong
> <neil.armstrong@linaro.org>; Kevin Hilman <khilman@baylibre.com>; Vinod
> Koul <vkoul@kernel.org>; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; Jose
> Abreu <joabreu@synopsys.com>; imx@lists.linux.dev; Simon Horman
> <simon.horman@corigine.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Giuseppe Cavallaro
> <peppe.cavallaro@st.com>; Nobuhiro Iwamatsu
> <nobuhiro1.iwamatsu@toshiba.co.jp>; Fabio Estevam <festevam@gmail.com>;
> linux-stm32@st-md-mailman.stormreply.com; Jerome Brunet
> <jbrunet@baylibre.com>; Bartosz Golaszewski
> <bartosz.golaszewski@linaro.org>; Wong Vee Khee <veekhee@apple.com>; dl-
> linux-imx <linux-imx@nxp.com>; Andrew Halaney <ahalaney@redhat.com>;
> Bhupesh Sharma <bhupesh.sharma@linaro.org>; Martin Blumenstingl
> <martin.blumenstingl@googlemail.com>; Revanth Kumar Uppala
> <ruppala@nvidia.com>; Jochen Henneberg <jh@henneberg-systemdesign.com>;
> linux-amlogic@lists.infradead.org; linux-arm-kernel@lists.infradead.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Pengutronix Kernel
> Team <kernel@pengutronix.de>
> Subject: [EXT] Re: [PATCH v3 net 1/2] net: stmmac: add new mode parameter
> for fix_mac_speed
> 
> On 31.07.2023 11:19:28, Shenwei Wang wrote:
> > A mode parameter has been added to the callback function of
> > fix_mac_speed to indicate the physical layer type.
> >
> > The mode can be one the following:
> > 	MLO_AN_PHY	- Conventional PHY
> > 	MLO_AN_FIXED	- Fixed-link mode
> > 	MLO_AN_INBAND	- In-band protocol
> >
> > Also use short version of 'uint' to replace the 'unsigned int' in the
> > function definitions.
> 
> There are not many users of 'uint' in the kernel and it's not used in the stmmac
> driver so far. From my point of view I would not introduce it and stick to the
> standard 'unsigned int'.
> 

Using 'uint' makes the code look cleaner because adding one extra parameter may cause some function 
declarations to span multiple lines.  This change keeps function declarations compact on a single line.

Thanks,
Shenwei

> Just my 2 cent,
> Marc
> 
> --
> Pengutronix e.K.                 | Marc Kleine-Budde          |
> Embedded Linux                   | https://www.pengutronix.de |
> Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
Jakub Kicinski Aug. 1, 2023, 7:58 p.m. UTC | #4
On Tue, 1 Aug 2023 18:43:52 +0000 Shenwei Wang wrote:
> Subject: RE: [EXT] Re: [PATCH v3 net 1/2] net: stmmac: add new mode parameter  for fix_mac_speed

Looks like new platform enablement, the correct tree to target this 
at is net-next (i.e. [PATCH net-next]).

> > -----Original Message-----
> > From: Marc Kleine-Budde <mkl@pengutronix.de>
> > Sent: Tuesday, August 1, 2023 1:37 AM
> > To: Shenwei Wang <shenwei.wang@nxp.com>
> > Cc: Russell King <linux@armlinux.org.uk>; David S. Miller
> > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> > Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Maxime
> > Coquelin <mcoquelin.stm32@gmail.com>; Shawn Guo <shawnguo@kernel.org>;
> > Sascha Hauer <s.hauer@pengutronix.de>; Neil Armstrong
> > <neil.armstrong@linaro.org>; Kevin Hilman <khilman@baylibre.com>; Vinod
> > Koul <vkoul@kernel.org>; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec
> > <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; Jose
> > Abreu <joabreu@synopsys.com>; imx@lists.linux.dev; Simon Horman
> > <simon.horman@corigine.com>; Alexandre Torgue
> > <alexandre.torgue@foss.st.com>; Giuseppe Cavallaro
> > <peppe.cavallaro@st.com>; Nobuhiro Iwamatsu
> > <nobuhiro1.iwamatsu@toshiba.co.jp>; Fabio Estevam <festevam@gmail.com>;
> > linux-stm32@st-md-mailman.stormreply.com; Jerome Brunet
> > <jbrunet@baylibre.com>; Bartosz Golaszewski
> > <bartosz.golaszewski@linaro.org>; Wong Vee Khee <veekhee@apple.com>; dl-
> > linux-imx <linux-imx@nxp.com>; Andrew Halaney <ahalaney@redhat.com>;
> > Bhupesh Sharma <bhupesh.sharma@linaro.org>; Martin Blumenstingl
> > <martin.blumenstingl@googlemail.com>; Revanth Kumar Uppala
> > <ruppala@nvidia.com>; Jochen Henneberg <jh@henneberg-systemdesign.com>;
> > linux-amlogic@lists.infradead.org; linux-arm-kernel@lists.infradead.org;
> > netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Pengutronix Kernel
> > Team <kernel@pengutronix.de>
> > Subject: [EXT] Re: [PATCH v3 net 1/2] net: stmmac: add new mode parameter
> > for fix_mac_speed

Why is this quote included? Please get a sane email client.

> > On 31.07.2023 11:19:28, Shenwei Wang wrote:  
> > > A mode parameter has been added to the callback function of
> > > fix_mac_speed to indicate the physical layer type.
> > >
> > > The mode can be one the following:
> > > 	MLO_AN_PHY	- Conventional PHY
> > > 	MLO_AN_FIXED	- Fixed-link mode
> > > 	MLO_AN_INBAND	- In-band protocol
> > >
> > > Also use short version of 'uint' to replace the 'unsigned int' in the
> > > function definitions.  
> > 
> > There are not many users of 'uint' in the kernel and it's not used in the stmmac
> > driver so far. From my point of view I would not introduce it and stick to the
> > standard 'unsigned int'.
> 
> Using 'uint' makes the code look cleaner because adding one extra
> parameter may cause some function declarations to span multiple
> lines.  This change keeps function declarations compact on a single
> line.

Marc is right. Just do it.
Shenwei Wang Aug. 2, 2023, 7:33 p.m. UTC | #5
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Tuesday, August 1, 2023 2:58 PM
> To: Shenwei Wang <shenwei.wang@nxp.com>
> > > Subject: [EXT] Re: [PATCH v3 net 1/2] net: stmmac: add new mode
> > > parameter for fix_mac_speed
> 
> Why is this quote included? Please get a sane email client.
> 

I have no idea. We are using Office Outlook.

Regards,
Shenwei

> > > On 31.07.2023 11:19:28, Shenwei Wang wrote:
> > > > A mode parameter has been added to the callback function of
> > > > fix_mac_speed to indicate the physical layer type.
> > > >
> > > > The mode can be one the following:
> > > >   MLO_AN_PHY      - Conventional PHY
> > > >   MLO_AN_FIXED    - Fixed-link mode
> > > >   MLO_AN_INBAND   - In-band protocol
> > > >
> > > > Also use short version of 'uint' to replace the 'unsigned int' in
> > > > the function definitions.
> > >
> > > There are not many users of 'uint' in the kernel and it's not used
> > > in the stmmac driver so far. From my point of view I would not
> > > introduce it and stick to the standard 'unsigned int'.
> >
> > Using 'uint' makes the code look cleaner because adding one extra
> > parameter may cause some function declarations to span multiple lines.
> > This change keeps function declarations compact on a single line.
> 
> Marc is right. Just do it.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
index b5efd9c2eac7..7e45cfa9fc2c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
@@ -178,7 +178,7 @@  static void dwc_qos_remove(struct platform_device *pdev)
 #define AUTO_CAL_STATUS 0x880c
 #define  AUTO_CAL_STATUS_ACTIVE BIT(31)
 
-static void tegra_eqos_fix_speed(void *priv, unsigned int speed)
+static void tegra_eqos_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct tegra_eqos *eqos = priv;
 	unsigned long rate = 125000000;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index b9378a63f0e8..53ee5a42c071 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -178,7 +178,7 @@  static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
 	/* nothing to do now */
 }
 
-static void imx_dwmac_fix_speed(void *priv, unsigned int speed)
+static void imx_dwmac_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct plat_stmmacenet_data *plat_dat;
 	struct imx_priv_data *dwmac = priv;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
index a5e639ab0b9e..1f2eabfe79ca 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
@@ -22,13 +22,13 @@  struct intel_dwmac {
 };
 
 struct intel_dwmac_data {
-	void (*fix_mac_speed)(void *priv, unsigned int speed);
+	void (*fix_mac_speed)(void *priv, uint speed, uint mode);
 	unsigned long ptp_ref_clk_rate;
 	unsigned long tx_clk_rate;
 	bool tx_clk_en;
 };
 
-static void kmb_eth_fix_mac_speed(void *priv, unsigned int speed)
+static void kmb_eth_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct intel_dwmac *dwmac = priv;
 	unsigned long rate;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
index e39406df8516..8070352844e3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
@@ -257,7 +257,7 @@  static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
 	return PTR_ERR_OR_ZERO(gmac->qsgmii_csr);
 }
 
-static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed)
+static void ipq806x_gmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct ipq806x_gmac *gmac = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
index 7aa5e6bc04eb..612551c09ad9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
@@ -22,7 +22,7 @@  struct meson_dwmac {
 	void __iomem	*reg;
 };
 
-static void meson6_dwmac_fix_mac_speed(void *priv, unsigned int speed)
+static void meson6_dwmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct meson_dwmac *dwmac = priv;
 	unsigned int val;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 735525ba8b93..c32549d2fc5a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -631,7 +631,7 @@  static int ethqos_configure(struct qcom_ethqos *ethqos)
 	return ethqos->configure_func(ethqos);
 }
 
-static void ethqos_fix_mac_speed(void *priv, unsigned int speed)
+static void ethqos_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct qcom_ethqos *ethqos = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index d81591b470a2..2fb24c7e1b44 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1785,7 +1785,7 @@  static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 	gmac_clk_enable(gmac, false);
 }
 
-static void rk_fix_speed(void *priv, unsigned int speed)
+static void rk_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct rk_priv_data *bsp_priv = priv;
 	struct device *dev = &bsp_priv->pdev->dev;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 6267bcb60206..ef3be5a3e7b5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -61,7 +61,7 @@  struct socfpga_dwmac {
 	struct mdio_device *pcs_mdiodev;
 };
 
-static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
+static void socfpga_dwmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv;
 	void __iomem *splitter_base = dwmac->splitter_base;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
index d3a39d2fb3a9..66e434cd7124 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
@@ -22,7 +22,7 @@  struct starfive_dwmac {
 	struct clk *clk_tx;
 };
 
-static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed)
+static void starfive_dwmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct starfive_dwmac *dwmac = priv;
 	unsigned long rate;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
index 50963e91c347..4bbc9d6888f1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -72,7 +72,7 @@  static void sun7i_gmac_exit(struct platform_device *pdev, void *priv)
 		regulator_disable(gmac->regulator);
 }
 
-static void sun7i_fix_speed(void *priv, unsigned int speed)
+static void sun7i_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct sunxi_priv_data *gmac = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
index acbb284be174..5c50cebe9a17 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
@@ -53,7 +53,7 @@  struct visconti_eth {
 	spinlock_t lock; /* lock to protect register update */
 };
 
-static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
+static void visconti_eth_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct visconti_eth *dwmac = priv;
 	struct net_device *netdev = dev_get_drvdata(dwmac->dev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e1f1c034d325..1c26d60886be 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1060,7 +1060,7 @@  static void stmmac_mac_link_up(struct phylink_config *config,
 	priv->speed = speed;
 
 	if (priv->plat->fix_mac_speed)
-		priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed);
+		priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed, mode);
 
 	if (!duplex)
 		ctrl &= ~priv->hw->link.duplex;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index ef67dba775d0..7d5e178574be 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -253,7 +253,7 @@  struct plat_stmmacenet_data {
 	u8 tx_sched_algorithm;
 	struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
 	struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES];
-	void (*fix_mac_speed)(void *priv, unsigned int speed);
+	void (*fix_mac_speed)(void *priv, uint speed, uint mode);
 	int (*fix_soc_reset)(void *priv, void __iomem *ioaddr);
 	int (*serdes_powerup)(struct net_device *ndev, void *priv);
 	void (*serdes_powerdown)(struct net_device *ndev, void *priv);