diff mbox series

[net] net: dsa: felix: ignore pending status of TAS module when it's disabled

Message ID 20240904102722.45427-1-xiaoliang.yang_1@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: felix: ignore pending status of TAS module when it's disabled | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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 success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: edumazet@google.com
netdev/build_clang success Errors and warnings before: 16 this patch: 16
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 success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-04--15-00 (tests: 718)

Commit Message

Xiaoliang Yang Sept. 4, 2024, 10:27 a.m. UTC
The TAS module could not be configured when it's running in pending
status. We need disable the module and configure it again. However, the
pending status is not cleared after the module disabled. So we don't
need to check the pending status if TAS module is disabled.

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

Comments

Vladimir Oltean Sept. 4, 2024, 10:12 a.m. UTC | #1
Hi Xiaoliang,

On Wed, Sep 04, 2024 at 06:27:22PM +0800, Xiaoliang Yang wrote:
> The TAS module could not be configured when it's running in pending
> status. We need disable the module and configure it again. However, the
> pending status is not cleared after the module disabled. So we don't
> need to check the pending status if TAS module is disabled.
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> ---

Does this fix a functional, user-visible problem? If so, which problem is that?
Could you describe it in the commit message? And maybe add a Fixes: tag
to the patch where the problem was first visible?
Xiaoliang Yang Sept. 6, 2024, 9:14 a.m. UTC | #2
Hi Vladimir,

Yes, it's a user-visible problem. User can't reconfigured Qbv once the TAS is 
in pending status(configured the Qbv basetime as a future time). The driver 
always returns busy. Actually Qbv can be reconfigured after it's disabled. 
I update the commit to descript it and send in a new patch.

Thanks,
Xiaoliang

> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> Sent: Wednesday, September 4, 2024 6:12 PM
> To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> Cc: netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org;
> pabeni@redhat.com; Claudiu Manoil <claudiu.manoil@nxp.com>;
> alexandre.belloni@bootlin.com; UNGLinuxDriver@microchip.com;
> andrew@lunn.ch; f.fainelli@gmail.com; michael@walle.cc;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net] net: dsa: felix: ignore pending status of TAS module
> when it's disabled
> 
> Hi Xiaoliang,
> 
> On Wed, Sep 04, 2024 at 06:27:22PM +0800, Xiaoliang Yang wrote:
> > The TAS module could not be configured when it's running in pending
> > status. We need disable the module and configure it again. However,
> > the pending status is not cleared after the module disabled. So we
> > don't need to check the pending status if TAS module is disabled.
> >
> > Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> > ---
> 
> Does this fix a functional, user-visible problem? If so, which problem is that?
> Could you describe it in the commit message? And maybe add a Fixes: tag to
> the patch where the problem was first visible?
diff mbox series

Patch

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index ba37a566da39..ecfa73725d25 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -1474,10 +1474,13 @@  static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
 	/* Hardware errata -  Admin config could not be overwritten if
 	 * config is pending, need reset the TAS module
 	 */
-	val = ocelot_read(ocelot, QSYS_PARAM_STATUS_REG_8);
-	if (val & QSYS_PARAM_STATUS_REG_8_CONFIG_PENDING) {
-		ret = -EBUSY;
-		goto err_reset_tc;
+	val = ocelot_read_rix(ocelot, QSYS_TAG_CONFIG, port);
+	if (val & QSYS_TAG_CONFIG_ENABLE) {
+		val = ocelot_read(ocelot, QSYS_PARAM_STATUS_REG_8);
+		if (val & QSYS_PARAM_STATUS_REG_8_CONFIG_PENDING) {
+			ret = -EBUSY;
+			goto err_reset_tc;
+		}
 	}
 
 	ocelot_rmw_rix(ocelot,