diff mbox series

[net,v3,4/4] rtase: Add defines for hardware version id

Message ID 20241118040828.454861-5-justinlai0215@realtek.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Correcting switch hardware versions and reported speeds | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
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 success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
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: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 37 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

Commit Message

Justin Lai Nov. 18, 2024, 4:08 a.m. UTC
Add defines for hardware version id.

Signed-off-by: Justin Lai <justinlai0215@realtek.com>
---
 drivers/net/ethernet/realtek/rtase/rtase.h      |  5 ++++-
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

Comments

Michal Kubiak Nov. 18, 2024, 11:15 a.m. UTC | #1
On Mon, Nov 18, 2024 at 12:08:28PM +0800, Justin Lai wrote:
> Add defines for hardware version id.
> 
> Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> ---
>  drivers/net/ethernet/realtek/rtase/rtase.h      |  5 ++++-
>  drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------
>  2 files changed, 10 insertions(+), 7 deletions(-)
> 

The patch is addressed to the "net" tree, but "Fixes" tag is missing.
Also, the patch does not look like a bugfix it's rather an improvement
of coding style with no functional changes. That's why I doubt it should go
to the "net" tree.

Thanks,
Michal
Justin Lai Nov. 19, 2024, 7:22 a.m. UTC | #2
> 
> On Mon, Nov 18, 2024 at 12:08:28PM +0800, Justin Lai wrote:
> > Add defines for hardware version id.
> >
> > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> > ---
> >  drivers/net/ethernet/realtek/rtase/rtase.h      |  5 ++++-
> >  drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------
> >  2 files changed, 10 insertions(+), 7 deletions(-)
> >
> 
> The patch is addressed to the "net" tree, but "Fixes" tag is missing.
> Also, the patch does not look like a bugfix it's rather an improvement of coding
> style with no functional changes. That's why I doubt it should go to the "net"
> tree.
> 
> Thanks,
> Michal

Hi Michal,

This patch introduces multiple defines for hardware version IDs, rather
than addressing any issues related to the function logic, which is why it
does not include a "Fixes:" tag. The reason for isolating this change in a
separate patch is to maintain a "single patch, single purpose" approach.
Additionally, these defines will be used in other patches within the same
patch set, which is why they are included in this patch set as a whole.

Justin
Michal Kubiak Nov. 19, 2024, 11:28 a.m. UTC | #3
On Tue, Nov 19, 2024 at 07:22:46AM +0000, Justin Lai wrote:
> > 
> > On Mon, Nov 18, 2024 at 12:08:28PM +0800, Justin Lai wrote:
> > > Add defines for hardware version id.
> > >
> > > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> > > ---
> > >  drivers/net/ethernet/realtek/rtase/rtase.h      |  5 ++++-
> > >  drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------
> > >  2 files changed, 10 insertions(+), 7 deletions(-)
> > >
> > 
> > The patch is addressed to the "net" tree, but "Fixes" tag is missing.
> > Also, the patch does not look like a bugfix it's rather an improvement of coding
> > style with no functional changes. That's why I doubt it should go to the "net"
> > tree.
> > 
> > Thanks,
> > Michal
> 
> Hi Michal,
> 
> This patch introduces multiple defines for hardware version IDs, rather
> than addressing any issues related to the function logic, which is why it
> does not include a "Fixes:" tag. The reason for isolating this change in a
> separate patch is to maintain a "single patch, single purpose" approach.
> Additionally, these defines will be used in other patches within the same
> patch set, which is why they are included in this patch set as a whole.
> 
> Justin
> 

Hi Justin,

I understand the purpose of the patch, however the patch is addressed
to the "net" tree. Each patch sent to "net" tree should have "Fixes" tag,
because that tree is for fixes only.
You may consider sending the patch to the "net-next", (which is closed
now because of the merge window).

Thanks,
Michal
Justin Lai Nov. 20, 2024, 6:40 a.m. UTC | #4
> 
> On Tue, Nov 19, 2024 at 07:22:46AM +0000, Justin Lai wrote:
> > >
> > > On Mon, Nov 18, 2024 at 12:08:28PM +0800, Justin Lai wrote:
> > > > Add defines for hardware version id.
> > > >
> > > > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> > > > ---
> > > >  drivers/net/ethernet/realtek/rtase/rtase.h      |  5 ++++-
> > > >  drivers/net/ethernet/realtek/rtase/rtase_main.c | 12 ++++++------
> > > >  2 files changed, 10 insertions(+), 7 deletions(-)
> > > >
> > >
> > > The patch is addressed to the "net" tree, but "Fixes" tag is missing.
> > > Also, the patch does not look like a bugfix it's rather an
> > > improvement of coding style with no functional changes. That's why I doubt
> it should go to the "net"
> > > tree.
> > >
> > > Thanks,
> > > Michal
> >
> > Hi Michal,
> >
> > This patch introduces multiple defines for hardware version IDs,
> > rather than addressing any issues related to the function logic, which
> > is why it does not include a "Fixes:" tag. The reason for isolating
> > this change in a separate patch is to maintain a "single patch, single
> purpose" approach.
> > Additionally, these defines will be used in other patches within the
> > same patch set, which is why they are included in this patch set as a whole.
> >
> > Justin
> >
> 
> Hi Justin,
> 
> I understand the purpose of the patch, however the patch is addressed to the
> "net" tree. Each patch sent to "net" tree should have "Fixes" tag, because that
> tree is for fixes only.
> You may consider sending the patch to the "net-next", (which is closed now
> because of the merge window).
> 
> Thanks,
> Michal

Hi Michal,

Thank you for your suggestion. Upon further consideration, I agree
that the addition of the hardware version ID definitions should have been
implemented directly when fixing the related issue. I will make the
necessary changes accordingly.

Justin
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h
index 547c71937b01..4a4434869b10 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase.h
+++ b/drivers/net/ethernet/realtek/rtase/rtase.h
@@ -9,7 +9,10 @@ 
 #ifndef RTASE_H
 #define RTASE_H
 
-#define RTASE_HW_VER_MASK 0x7C800000
+#define RTASE_HW_VER_MASK     0x7C800000
+#define RTASE_HW_VER_906X_7XA 0x00800000
+#define RTASE_HW_VER_906X_7XC 0x04000000
+#define RTASE_HW_VER_907XD_V1 0x04800000
 
 #define RTASE_RX_DMA_BURST_256       4
 #define RTASE_TX_DMA_BURST_UNLIMITED 7
diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
index 26331a2b7b2d..1bfe5ef40c52 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -1720,11 +1720,11 @@  static int rtase_get_settings(struct net_device *dev,
 						supported);
 
 	switch (tp->hw_ver) {
-	case 0x00800000:
-	case 0x04000000:
+	case RTASE_HW_VER_906X_7XA:
+	case RTASE_HW_VER_906X_7XC:
 		cmd->base.speed = SPEED_5000;
 		break;
-	case 0x04800000:
+	case RTASE_HW_VER_907XD_V1:
 		cmd->base.speed = SPEED_10000;
 		break;
 	}
@@ -1990,9 +1990,9 @@  static int rtase_check_mac_version_valid(struct rtase_private *tp)
 	tp->hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK;
 
 	switch (tp->hw_ver) {
-	case 0x00800000:
-	case 0x04000000:
-	case 0x04800000:
+	case RTASE_HW_VER_906X_7XA:
+	case RTASE_HW_VER_906X_7XC:
+	case RTASE_HW_VER_907XD_V1:
 		ret = 0;
 		break;
 	}