diff mbox series

[net-next,v9,12/13] net:ethernet:realtek: Update the Makefile and Kconfig in the realtek folder

Message ID 20230928104920.113511-13-justinlai0215@realtek.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add Realtek automotive PCIe driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1340 this patch: 1340
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1363 this patch: 1363
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: 1363 this patch: 1363
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 25 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Justin Lai Sept. 28, 2023, 10:49 a.m. UTC
1. Add the RTASE entry in the Kconfig.
2. Add the CONFIG_RTASE entry in the Makefile.

Signed-off-by: Justin Lai <justinlai0215@realtek.com>
---
 drivers/net/ethernet/realtek/Kconfig  | 17 +++++++++++++++++
 drivers/net/ethernet/realtek/Makefile |  1 +
 2 files changed, 18 insertions(+)

Comments

kernel test robot Sept. 28, 2023, 9 p.m. UTC | #1
Hi Justin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Justin-Lai/net-ethernet-realtek-rtase-Add-pci-table-supported-in-this-module/20230928-185229
base:   net-next/main
patch link:    https://lore.kernel.org/r/20230928104920.113511-13-justinlai0215%40realtek.com
patch subject: [PATCH net-next v9 12/13] net:ethernet:realtek: Update the Makefile and Kconfig in the realtek folder
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230929/202309290449.7BfzQ7jq-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230929/202309290449.7BfzQ7jq-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/202309290449.7BfzQ7jq-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/realtek/rtase/rtase_main.c: In function 'rtase_open':
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:1140:25: warning: 'snprintf' argument 4 may overlap destination object 'dev' [-Wrestrict]
    1140 |                         snprintf(ivec->name, sizeof(ivec->name), "%s_int%i", dev->name, i);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1105:42: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
    1105 | static int rtase_open(struct net_device *dev)
         |                       ~~~~~~~~~~~~~~~~~~~^~~


vim +1140 drivers/net/ethernet/realtek/rtase/rtase_main.c

35c3134a765bbcb Justin Lai 2023-09-28  1104  
1f431ee317f33f8 Justin Lai 2023-09-28  1105  static int rtase_open(struct net_device *dev)
1f431ee317f33f8 Justin Lai 2023-09-28  1106  {
1f431ee317f33f8 Justin Lai 2023-09-28  1107  	struct rtase_private *tp = netdev_priv(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1108  	struct rtase_int_vector *ivec = &tp->int_vector[0];
1f431ee317f33f8 Justin Lai 2023-09-28  1109  	const struct pci_dev *pdev = tp->pdev;
1f431ee317f33f8 Justin Lai 2023-09-28  1110  	int ret;
1f431ee317f33f8 Justin Lai 2023-09-28  1111  	u16 i;
1f431ee317f33f8 Justin Lai 2023-09-28  1112  
1f431ee317f33f8 Justin Lai 2023-09-28  1113  	rtase_set_rxbufsize(tp, dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1114  
1f431ee317f33f8 Justin Lai 2023-09-28  1115  	ret = rtase_alloc_desc(tp);
1f431ee317f33f8 Justin Lai 2023-09-28  1116  	if (ret)
1f431ee317f33f8 Justin Lai 2023-09-28  1117  		goto err_free_all_allocated_mem;
1f431ee317f33f8 Justin Lai 2023-09-28  1118  
1f431ee317f33f8 Justin Lai 2023-09-28  1119  	ret = rtase_init_ring(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1120  	if (ret)
1f431ee317f33f8 Justin Lai 2023-09-28  1121  		goto err_free_all_allocated_mem;
1f431ee317f33f8 Justin Lai 2023-09-28  1122  
1f431ee317f33f8 Justin Lai 2023-09-28  1123  	INIT_DELAYED_WORK(&tp->task, NULL);
1f431ee317f33f8 Justin Lai 2023-09-28  1124  
1f431ee317f33f8 Justin Lai 2023-09-28  1125  	rtase_hw_config(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1126  
1f431ee317f33f8 Justin Lai 2023-09-28  1127  	if (tp->sw_flag & SWF_MSIX_ENABLED) {
1f431ee317f33f8 Justin Lai 2023-09-28  1128  		ret = request_irq(ivec->irq, rtase_interrupt, 0,
1f431ee317f33f8 Justin Lai 2023-09-28  1129  				  dev->name, ivec);
1f431ee317f33f8 Justin Lai 2023-09-28  1130  
1f431ee317f33f8 Justin Lai 2023-09-28  1131  		/* request other interrupts to handle multiqueue */
1f431ee317f33f8 Justin Lai 2023-09-28  1132  		for (i = 1; i < tp->int_nums; i++) {
1f431ee317f33f8 Justin Lai 2023-09-28  1133  			if (ret)
1f431ee317f33f8 Justin Lai 2023-09-28  1134  				continue;
1f431ee317f33f8 Justin Lai 2023-09-28  1135  
1f431ee317f33f8 Justin Lai 2023-09-28  1136  			ivec = &tp->int_vector[i];
1f431ee317f33f8 Justin Lai 2023-09-28  1137  			if (ivec->status != 1)
1f431ee317f33f8 Justin Lai 2023-09-28  1138  				continue;
1f431ee317f33f8 Justin Lai 2023-09-28  1139  
1f431ee317f33f8 Justin Lai 2023-09-28 @1140  			snprintf(ivec->name, sizeof(ivec->name), "%s_int%i", dev->name, i);
1f431ee317f33f8 Justin Lai 2023-09-28  1141  			ret = request_irq(ivec->irq, rtase_q_interrupt, 0,
1f431ee317f33f8 Justin Lai 2023-09-28  1142  					  ivec->name, ivec);
1f431ee317f33f8 Justin Lai 2023-09-28  1143  		}
1f431ee317f33f8 Justin Lai 2023-09-28  1144  	} else if (tp->sw_flag & SWF_MSI_ENABLED) {
1f431ee317f33f8 Justin Lai 2023-09-28  1145  		ret = request_irq(pdev->irq, rtase_interrupt, 0, dev->name,
1f431ee317f33f8 Justin Lai 2023-09-28  1146  				  ivec);
1f431ee317f33f8 Justin Lai 2023-09-28  1147  	} else {
1f431ee317f33f8 Justin Lai 2023-09-28  1148  		ret = request_irq(pdev->irq, rtase_interrupt, IRQF_SHARED,
1f431ee317f33f8 Justin Lai 2023-09-28  1149  				  dev->name, ivec);
1f431ee317f33f8 Justin Lai 2023-09-28  1150  	}
1f431ee317f33f8 Justin Lai 2023-09-28  1151  
1f431ee317f33f8 Justin Lai 2023-09-28  1152  	if (ret != 0) {
1f431ee317f33f8 Justin Lai 2023-09-28  1153  		netdev_err(dev, "can't request MSIX interrupt. Error: %d", ret);
1f431ee317f33f8 Justin Lai 2023-09-28  1154  		goto err_free_all_allocated_mem;
1f431ee317f33f8 Justin Lai 2023-09-28  1155  	}
1f431ee317f33f8 Justin Lai 2023-09-28  1156  
1f431ee317f33f8 Justin Lai 2023-09-28  1157  	rtase_hw_start(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1158  
1f431ee317f33f8 Justin Lai 2023-09-28  1159  	netif_carrier_on(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1160  	netif_wake_queue(dev);
1f431ee317f33f8 Justin Lai 2023-09-28  1161  	netdev_info(dev, "link up\n");
1f431ee317f33f8 Justin Lai 2023-09-28  1162  
1f431ee317f33f8 Justin Lai 2023-09-28  1163  	goto out;
1f431ee317f33f8 Justin Lai 2023-09-28  1164  
1f431ee317f33f8 Justin Lai 2023-09-28  1165  err_free_all_allocated_mem:
1f431ee317f33f8 Justin Lai 2023-09-28  1166  	rtase_free_desc(tp);
1f431ee317f33f8 Justin Lai 2023-09-28  1167  
1f431ee317f33f8 Justin Lai 2023-09-28  1168  out:
1f431ee317f33f8 Justin Lai 2023-09-28  1169  	return ret;
1f431ee317f33f8 Justin Lai 2023-09-28  1170  }
1f431ee317f33f8 Justin Lai 2023-09-28  1171
kernel test robot Oct. 4, 2023, 11:47 p.m. UTC | #2
Hi Justin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Justin-Lai/net-ethernet-realtek-rtase-Add-pci-table-supported-in-this-module/20230928-185229
base:   net-next/main
patch link:    https://lore.kernel.org/r/20230928104920.113511-13-justinlai0215%40realtek.com
patch subject: [PATCH net-next v9 12/13] net:ethernet:realtek: Update the Makefile and Kconfig in the realtek folder
config: i386-randconfig-061-20231005 (https://download.01.org/0day-ci/archive/20231005/202310050703.fr8Txbrs-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231005/202310050703.fr8Txbrs-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/202310050703.fr8Txbrs-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:203:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le64 [usertype] addr @@     got long long @@
   drivers/net/ethernet/realtek/rtase/rtase_main.c:203:20: sparse:     expected restricted __le64 [usertype] addr
   drivers/net/ethernet/realtek/rtase/rtase_main.c:203:20: sparse:     got long long
   drivers/net/ethernet/realtek/rtase/rtase_main.c:362:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le64 [usertype] addr @@     got long long @@
   drivers/net/ethernet/realtek/rtase/rtase_main.c:362:29: sparse:     expected restricted __le64 [usertype] addr
   drivers/net/ethernet/realtek/rtase/rtase_main.c:362:29: sparse:     got long long
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:686:37: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:687:37: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:692:19: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:694:37: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:708:27: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:710:27: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:727:35: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:729:35: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:732:35: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:734:35: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1580:19: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1584:37: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1614:29: sparse: sparse: cast to restricted __le64
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:1614:29: sparse: sparse: cast from restricted __le32
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1615:36: sparse: sparse: cast to restricted __le64
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:1615:36: sparse: sparse: cast from restricted __le16
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1616:35: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/realtek/rtase/rtase_main.c:1616:35: sparse: sparse: cast from restricted __le16

vim +203 drivers/net/ethernet/realtek/rtase/rtase_main.c

1f431ee317f33f Justin Lai 2023-09-28  195  
29576bc3be86aa Justin Lai 2023-09-28  196  static void rtase_unmap_tx_skb(struct pci_dev *pdev, u32 len,
29576bc3be86aa Justin Lai 2023-09-28  197  			       struct tx_desc *desc)
29576bc3be86aa Justin Lai 2023-09-28  198  {
29576bc3be86aa Justin Lai 2023-09-28  199  	dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
29576bc3be86aa Justin Lai 2023-09-28  200  			 DMA_TO_DEVICE);
29576bc3be86aa Justin Lai 2023-09-28  201  	desc->opts1 = cpu_to_le32(RTK_OPTS1_DEBUG_VALUE);
29576bc3be86aa Justin Lai 2023-09-28  202  	desc->opts2 = 0x00;
29576bc3be86aa Justin Lai 2023-09-28 @203  	desc->addr = RTK_MAGIC_NUMBER;
29576bc3be86aa Justin Lai 2023-09-28  204  }
29576bc3be86aa Justin Lai 2023-09-28  205
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/Kconfig b/drivers/net/ethernet/realtek/Kconfig
index 93d9df55b361..57ef924deebd 100644
--- a/drivers/net/ethernet/realtek/Kconfig
+++ b/drivers/net/ethernet/realtek/Kconfig
@@ -113,4 +113,21 @@  config R8169
 	  To compile this driver as a module, choose M here: the module
 	  will be called r8169.  This is recommended.
 
+config RTASE
+	tristate "Realtek Automotive Switch 9054/9068/9072/9075/9068/9071 PCIe Interface support"
+	depends on PCI
+	select CRC32
+	help
+	  Say Y here if you have a Realtek Ethernet adapter belonging to
+	  the following families:
+	  RTL9054 5GBit Ethernet
+	  RTL9068 5GBit Ethernet
+	  RTL9072 5GBit Ethernet
+	  RTL9075 5GBit Ethernet
+	  RTL9068 5GBit Ethernet
+	  RTL9071 5GBit Ethernet
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called rtase. This is recommended.
+
 endif # NET_VENDOR_REALTEK
diff --git a/drivers/net/ethernet/realtek/Makefile b/drivers/net/ethernet/realtek/Makefile
index 2e1d78b106b0..0c1c16f63e9a 100644
--- a/drivers/net/ethernet/realtek/Makefile
+++ b/drivers/net/ethernet/realtek/Makefile
@@ -8,3 +8,4 @@  obj-$(CONFIG_8139TOO) += 8139too.o
 obj-$(CONFIG_ATP) += atp.o
 r8169-objs += r8169_main.o r8169_firmware.o r8169_phy_config.o
 obj-$(CONFIG_R8169) += r8169.o
+obj-$(CONFIG_RTASE) += rtase/