linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next] net: dsa: felix: convert TAS link speed based on phylink speed
@ 2020-09-22 10:43 Xiaoliang Yang
  2020-09-22 11:36 ` Vladimir Oltean
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoliang Yang @ 2020-09-22 10:43 UTC (permalink / raw)
  To: xiaoliang.yang_1, davem, netdev, linux-kernel, allan.nielsen,
	joergen.andreasen, UNGLinuxDriver, alexandru.marginean, po.liu,
	claudiu.manoil, vladimir.oltean, leoyang.li

state->speed holds a value of 10, 100, 1000 or 2500, but
QSYS_TAG_CONFIG_LINK_SPEED expects a value of 0, 1, 2, 3. So convert the
speed to a proper value.

Fixes: de143c0e274b ("net: dsa: felix: Configure Time-Aware Scheduler via
taprio offload")

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 79ddc4ba27a3..f584eababd0a 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -973,8 +973,28 @@ static void vsc9959_mdio_bus_free(struct ocelot *ocelot)
 static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
 				    u32 speed)
 {
+	u8 tas_speed;
+
+	switch (speed) {
+	case SPEED_10:
+		tas_speed = OCELOT_SPEED_10;
+		break;
+	case SPEED_100:
+		tas_speed = OCELOT_SPEED_100;
+		break;
+	case SPEED_1000:
+		tas_speed = OCELOT_SPEED_1000;
+		break;
+	case SPEED_2500:
+		tas_speed = OCELOT_SPEED_2500;
+		break;
+	default:
+		tas_speed = OCELOT_SPEED_1000;
+		break;
+	}
+
 	ocelot_rmw_rix(ocelot,
-		       QSYS_TAG_CONFIG_LINK_SPEED(speed),
+		       QSYS_TAG_CONFIG_LINK_SPEED(tas_speed),
 		       QSYS_TAG_CONFIG_LINK_SPEED_M,
 		       QSYS_TAG_CONFIG, port);
 }
-- 
2.17.1


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

* Re: [net-next] net: dsa: felix: convert TAS link speed based on phylink speed
  2020-09-22 10:43 [net-next] net: dsa: felix: convert TAS link speed based on phylink speed Xiaoliang Yang
@ 2020-09-22 11:36 ` Vladimir Oltean
  2020-09-24  2:10   ` Xiaoliang Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Oltean @ 2020-09-22 11:36 UTC (permalink / raw)
  To: Xiaoliang Yang
  Cc: davem, netdev, linux-kernel, allan.nielsen, joergen.andreasen,
	UNGLinuxDriver, Alexandru Marginean, Po Liu, Claudiu Manoil,
	Leo Li

Hi Xiaoliang,

On Tue, Sep 22, 2020 at 06:43:02PM +0800, Xiaoliang Yang wrote:
> state->speed holds a value of 10, 100, 1000 or 2500, but
> QSYS_TAG_CONFIG_LINK_SPEED expects a value of 0, 1, 2, 3. So convert the
> speed to a proper value.
> 
> Fixes: de143c0e274b ("net: dsa: felix: Configure Time-Aware Scheduler via
> taprio offload")
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

But next time keep in mind the following:

- The Fixes: tag should never wrap on multiple lines, even if it exceeds
  80 characters.
- Patches that fix a problem in net-next only should go to David's
  net-next tree. Patches that fix a problem on Linus Torvalds' tree
  should go to David's "net" tree. This one should go to "net", not to
  "net-next".
- All tags (Fixes, Signed-off-by, etc) should be grouped together with
  no empty lines between them.

Actually due to the first issue I mentioned, could you please resend
this?

Thanks,
-Vladimir

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

* RE: [net-next] net: dsa: felix: convert TAS link speed based on phylink speed
  2020-09-22 11:36 ` Vladimir Oltean
@ 2020-09-24  2:10   ` Xiaoliang Yang
  2020-09-24 12:30     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoliang Yang @ 2020-09-24  2:10 UTC (permalink / raw)
  To: Vladimir Oltean, davem
  Cc: netdev, linux-kernel, allan.nielsen, joergen.andreasen,
	UNGLinuxDriver, Alexandru Marginean, Po Liu, Claudiu Manoil,
	Leo Li


On Tue, Sep 22, 2020 at 19:37, Vladimir Oltean wrote:
> 
> Hi Xiaoliang,
> 
> On Tue, Sep 22, 2020 at 06:43:02PM +0800, Xiaoliang Yang wrote:
> > state->speed holds a value of 10, 100, 1000 or 2500, but
> > QSYS_TAG_CONFIG_LINK_SPEED expects a value of 0, 1, 2, 3. So convert
> > the speed to a proper value.
> >
> > Fixes: de143c0e274b ("net: dsa: felix: Configure Time-Aware Scheduler
> > via taprio offload")
> >
> > Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> > ---
> 
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> But next time keep in mind the following:
> 
> - The Fixes: tag should never wrap on multiple lines, even if it exceeds
>   80 characters.
> - Patches that fix a problem in net-next only should go to David's
>   net-next tree. Patches that fix a problem on Linus Torvalds' tree
>   should go to David's "net" tree. This one should go to "net", not to
>   "net-next".
> - All tags (Fixes, Signed-off-by, etc) should be grouped together with
>   no empty lines between them.
> 
> Actually due to the first issue I mentioned, could you please resend this?
> 
> Thanks,
> -Vladimir

I modify the commit and resend this patch to "net tree", please reject this one.

Thanks,
Xiaoliang Yang

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

* Re: [net-next] net: dsa: felix: convert TAS link speed based on phylink speed
  2020-09-24  2:10   ` Xiaoliang Yang
@ 2020-09-24 12:30     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-09-24 12:30 UTC (permalink / raw)
  To: Xiaoliang Yang
  Cc: Vladimir Oltean, davem, netdev, linux-kernel, allan.nielsen,
	joergen.andreasen, UNGLinuxDriver, Alexandru Marginean, Po Liu,
	Claudiu Manoil, Leo Li

> I modify the commit and resend this patch to "net tree", please reject this one.

Hi Xiaoliang Yang

You dropped "PATCH" from the subject. Please also include a version
number, so it is possible to identify which is the last version:

[PATCH net v2] net: dsa: felix: convert TAS link speed based on phylink speed

https://www.kernel.org/doc/html/latest/process/submitting-patches.html
https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html

It is a good idea to spend a few minutes every day just reading
patches and review comments to get an idea how the process works.

	Andrew


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

end of thread, other threads:[~2020-09-24 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 10:43 [net-next] net: dsa: felix: convert TAS link speed based on phylink speed Xiaoliang Yang
2020-09-22 11:36 ` Vladimir Oltean
2020-09-24  2:10   ` Xiaoliang Yang
2020-09-24 12:30     ` Andrew Lunn

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