linux-2.6-microblaze.git
3 years agortlwifi: rtl8192ee: use true,false for bool variable large_cfo_hit
Jason Yan [Sat, 19 Sep 2020 07:44:12 +0000 (15:44 +0800)]
rtlwifi: rtl8192ee: use true,false for bool variable large_cfo_hit

This addresses the following coccinelle warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:721:27-47:
WARNING: Comparison of 0/1 to bool variable
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:722:3-23: WARNING:
Assignment of 0/1 to bool variable
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:725:2-22: WARNING:
Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200919074412.3459163-1-yanaijie@huawei.com
3 years agortlwifi: Use ffs in <foo>_phy_calculate_bit_shift
Joe Perches [Sat, 19 Sep 2020 06:37:47 +0000 (23:37 -0700)]
rtlwifi: Use ffs in <foo>_phy_calculate_bit_shift

Remove the loop and use the generic ffs instead.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/e2ab424d24b74901bc0c39f0c60f75e871adf2ba.camel@perches.com
3 years agomt7601u: Convert to DEFINE_SHOW_ATTRIBUTE
Qinglang Miao [Sat, 19 Sep 2020 02:48:38 +0000 (10:48 +0800)]
mt7601u: Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200919024838.14172-1-miaoqinglang@huawei.com
3 years agowlcore: Remove unused function no_write_handler()
YueHaibing [Fri, 18 Sep 2020 13:13:05 +0000 (21:13 +0800)]
wlcore: Remove unused function no_write_handler()

There is no caller in tree, so can remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918131305.20976-1-yuehaibing@huawei.com
3 years agortlwifi: rtl8723be: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:25:05 +0000 (18:25 +0800)]
rtlwifi: rtl8723be: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c:861:6-35: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-10-zhengbin13@huawei.com
3 years agortlwifi: rtl8192de: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:25:04 +0000 (18:25 +0800)]
rtlwifi: rtl8192de: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:566:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:572:13-19: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:581:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:587:13-19: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-9-zhengbin13@huawei.com
3 years agortlwifi: rtl8192ce: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:25:03 +0000 (18:25 +0800)]
rtlwifi: rtl8192ce: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c:616:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c:621:13-19: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c:626:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c:631:13-19: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-8-zhengbin13@huawei.com
3 years agortlwifi: rtl8192cu: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:25:02 +0000 (18:25 +0800)]
rtlwifi: rtl8192cu: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:831:14-49: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-7-zhengbin13@huawei.com
3 years agortlwifi: rtl8821ae: fix comparison to bool warning in phy.c
Zheng Bin [Fri, 18 Sep 2020 10:25:01 +0000 (18:25 +0800)]
rtlwifi: rtl8821ae: fix comparison to bool warning in phy.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:1816:5-13: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:1825:5-13: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:1839:5-13: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-6-zhengbin13@huawei.com
3 years agortlwifi: rtl8821ae: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:25:00 +0000 (18:25 +0800)]
rtlwifi: rtl8821ae: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:1897:5-13: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-5-zhengbin13@huawei.com
3 years agortlwifi: rtl8192cu: fix comparison to bool warning in mac.c
Zheng Bin [Fri, 18 Sep 2020 10:24:59 +0000 (18:24 +0800)]
rtlwifi: rtl8192cu: fix comparison to bool warning in mac.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:161:14-17: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:168:13-16: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:179:14-17: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:186:13-16: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-4-zhengbin13@huawei.com
3 years agortlwifi: rtl8192c: fix comparison to bool warning in phy_common.c
Zheng Bin [Fri, 18 Sep 2020 10:24:58 +0000 (18:24 +0800)]
rtlwifi: rtl8192c: fix comparison to bool warning in phy_common.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c:1106:14-18: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-3-zhengbin13@huawei.com
3 years agortlwifi: rtl8192ee: fix comparison to bool warning in hw.c
Zheng Bin [Fri, 18 Sep 2020 10:24:57 +0000 (18:24 +0800)]
rtlwifi: rtl8192ee: fix comparison to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c:797:6-33: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918102505.16036-2-zhengbin13@huawei.com
3 years agonet: wilc1000: clean up resource in error path of init mon interface
Huang Guobin [Thu, 17 Sep 2020 12:30:19 +0000 (08:30 -0400)]
net: wilc1000: clean up resource in error path of init mon interface

The wilc_wfi_init_mon_int() forgets to clean up resource when
register_netdevice() failed. Add the missed call to fix it.
And the return value of netdev_priv can't be NULL, so remove
the unnecessary error handling.

Fixes: 588713006ea4 ("staging: wilc1000: avoid the use of 'wilc_wfi_mon' static variable")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Huang Guobin <huangguobin4@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200917123019.206382-1-huangguobin4@huawei.com
3 years agossb: Remove meaningless jump label to simplify the code
Jing Xiangfeng [Tue, 15 Sep 2020 02:03:30 +0000 (10:03 +0800)]
ssb: Remove meaningless jump label to simplify the code

The out jump label has nothing to do. So remove it to simplify the code.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200915020330.96067-1-jingxiangfeng@huawei.com
3 years agortlwifi: rtl8723ae: fix comparison pointer to bool warning in phy.c
Zheng Bin [Thu, 10 Sep 2020 14:16:42 +0000 (22:16 +0800)]
rtlwifi: rtl8723ae: fix comparison pointer to bool warning in phy.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c:191:5-13: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c:205:5-13: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c:211:5-13: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c:625:5-30: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910141642.127006-4-zhengbin13@huawei.com
3 years agortlwifi: rtl8723ae: fix comparison pointer to bool warning in trx.c
Zheng Bin [Thu, 10 Sep 2020 14:16:41 +0000 (22:16 +0800)]
rtlwifi: rtl8723ae: fix comparison pointer to bool warning in trx.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c:592:5-9: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c:633:5-9: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910141642.127006-3-zhengbin13@huawei.com
3 years agortlwifi: rtl8723ae: fix comparison pointer to bool warning in rf.c
Zheng Bin [Thu, 10 Sep 2020 14:16:40 +0000 (22:16 +0800)]
rtlwifi: rtl8723ae: fix comparison pointer to bool warning in rf.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c:52:5-22: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c:482:6-14: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910141642.127006-2-zhengbin13@huawei.com
3 years agortlwifi: rtl8188ee: fix comparison pointer to bool warning in hw.c
Zheng Bin [Thu, 10 Sep 2020 13:59:17 +0000 (21:59 +0800)]
rtlwifi: rtl8188ee: fix comparison pointer to bool warning in hw.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:777:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:782:13-19: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:787:14-20: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:792:13-19: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:871:6-33: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:1070:5-13: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910135917.143723-4-zhengbin13@huawei.com
3 years agortlwifi: rtl8188ee: fix comparison pointer to bool warning in trx.c
Zheng Bin [Thu, 10 Sep 2020 13:59:16 +0000 (21:59 +0800)]
rtlwifi: rtl8188ee: fix comparison pointer to bool warning in trx.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c:735:5-9: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c:776:5-9: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910135917.143723-3-zhengbin13@huawei.com
3 years agortlwifi: rtl8188ee: fix comparison pointer to bool warning in phy.c
Zheng Bin [Thu, 10 Sep 2020 13:59:15 +0000 (21:59 +0800)]
rtlwifi: rtl8188ee: fix comparison pointer to bool warning in phy.c

Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c:1584:14-18: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910135917.143723-2-zhengbin13@huawei.com
3 years agoqtnfmac: Remove unused macro QTNF_DMP_MAX_LEN
YueHaibing [Wed, 9 Sep 2020 13:59:51 +0000 (21:59 +0800)]
qtnfmac: Remove unused macro QTNF_DMP_MAX_LEN

There is no caller in tree, so remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200909135951.4028-1-yuehaibing@huawei.com
3 years agortw88: rtw8822c: eliminate code duplication, use native swap() function
Ivan Safonov [Sun, 13 Sep 2020 16:59:59 +0000 (19:59 +0300)]
rtw88: rtw8822c: eliminate code duplication, use native swap() function

swap_u32() duplicate native swap(), so replace swap_u32() with swap().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200913165958.419744-1-insafonov@gmail.com
3 years agowlcore: Remove unused macro WL1271_SUSPEND_SLEEP
YueHaibing [Wed, 9 Sep 2020 13:59:05 +0000 (21:59 +0800)]
wlcore: Remove unused macro WL1271_SUSPEND_SLEEP

commit 45aa7f071b06 ("wlcore: Use generic runtime pm calls for wowlan elp configuration")
left behind this, remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200909135905.35728-1-yuehaibing@huawei.com
3 years agobrcmsmac: main: Eliminate empty brcms_c_down_del_timer()
Jason Yan [Thu, 10 Sep 2020 14:04:46 +0000 (22:04 +0800)]
brcmsmac: main: Eliminate empty brcms_c_down_del_timer()

This function does nothing so remove it. This addresses the following
coccicheck warning:

drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c:5103:6-15:
Unneeded variable: "callbacks". Return "0" on line 5105

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910140446.1168049-1-yanaijie@huawei.com
Link: https://lore.kernel.org/r/20200910140455.1168174-1-yanaijie@huawei.com
3 years agobrcmsmac: phy_lcn: Remove unused variable 'lcnphy_rx_iqcomp_table_rev0'
Lee Jones [Thu, 10 Sep 2020 06:54:31 +0000 (07:54 +0100)]
brcmsmac: phy_lcn: Remove unused variable 'lcnphy_rx_iqcomp_table_rev0'

Fixes the following W=1 kernel build warning(s):

 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:361:25: warning: unused variable 'lcnphy_rx_iqcomp_table_rev0' [-Wunused-const-variable]
 struct lcnphy_rx_iqcomp lcnphy_rx_iqcomp_table_rev0[] = {
                         ^
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910065431.657636-30-lee.jones@linaro.org
Link: https://lore.kernel.org/r/20200910140505.1168317-1-yanaijie@huawei.com
Link: https://lore.kernel.org/r/20200910035600.21736-1-yuehaibing@huawei.com
3 years agobrcmsmac: phytbl_lcn: Remove unused array 'dot11lcn_gain_tbl_rev1'
Lee Jones [Thu, 10 Sep 2020 06:54:30 +0000 (07:54 +0100)]
brcmsmac: phytbl_lcn: Remove unused array 'dot11lcn_gain_tbl_rev1'

Fixes the following W=1 kernel build warning(s):

 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phytbl_lcn.c:108:18: warning: unused variable 'dot11lcn_gain_tbl_rev1' [-Wunused-const-variable]
 static const u32 dot11lcn_gain_tbl_rev1[] = {

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910065431.657636-29-lee.jones@linaro.org
3 years agoairo: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Mon, 7 Sep 2020 20:19:42 +0000 (22:19 +0200)]
airo: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'mpi_map_card()' GFP_KERNEL can be used because
this function is called from a probe or a module_init() function and no
spinlock is taken in the between.

The call chains are:
  airo_init_module module_init function in 'airo.c'
or
  airo_probe .probe function in 'airo_cs.c'
    --> airo_config

followed in both cases by:
      --> init_airo_card
        --> _init_airo_card
          --> mpi_map_card

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200907201942.321568-1-christophe.jaillet@wanadoo.fr
3 years agobrcmfmac: support SAE authentication offload in AP mode
Chung-Hsien Hsu [Mon, 17 Aug 2020 07:33:16 +0000 (02:33 -0500)]
brcmfmac: support SAE authentication offload in AP mode

Firmware may have SAE authenticator code built-in. This is detected by
the driver and indicated in the wiphy features flags. User space can use
this flag to determine whether or not to provide the password material
in the nl80211 start AP command to offload the SAE authentication in AP
mode.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200817073316.33402-5-stanley.hsu@cypress.com
3 years agobrcmfmac: support 4-way handshake offloading for WPA/WPA2-PSK in AP mode
Chung-Hsien Hsu [Mon, 17 Aug 2020 07:33:14 +0000 (02:33 -0500)]
brcmfmac: support 4-way handshake offloading for WPA/WPA2-PSK in AP mode

Firmware may have authenticator code built-in. This is detected by the
driver and indicated in the wiphy features flags. User space can use
this flag to determine whether or not to provide the pre-shared key
material in the nl80211 start AP command to offload the 4-way handshake
in AP mode.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200817073316.33402-3-stanley.hsu@cypress.com
3 years agonet: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq
Barry Song [Fri, 11 Sep 2020 01:55:10 +0000 (13:55 +1200)]
net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq

Rather than doing request_irq and then disabling the irq immediately, it
should be safer to use IRQ_NOAUTOEN flag for the irq. It removes any gap
between request_irq() and disable_irq().

Cc: Salil Mehta <salil.mehta@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-ethernet-ti-ale-add-static-configuration'
David S. Miller [Sat, 12 Sep 2020 00:34:40 +0000 (17:34 -0700)]
Merge branch 'net-ethernet-ti-ale-add-static-configuration'

Grygorii Strashko says:

====================
net: ethernet: ti: ale: add static configuration

As existing, as newly introduced CPSW ALE versions have differences in
supported features and ALE table formats. Especially it's actual for the
recent AM65x/J721E/J7200 and future AM64x SoCs, which supports more
features like: auto-aging, classifiers, Link aggregation, additional HW
filtering, etc.

The existing ALE configuration interface is not practical in terms of
adding new features and requires consumers to program a lot static
parameters. And any attempt to add new features will case endless adding
and maintaining different combination of flags and options. Because CPSW
ALE configuration is static and fixed for SoC (or set of SoC), It is
reasonable to add support for static ALE configurations inside ALE module.

This series introduces static ALE configuration table for different ALE
variants and provides option for consumers to select required ALE
configuration by providing ALE const char *dev_id identifier (Patch 2).
And all existing driver have been switched to use new approach (Patches 3-6).

After this ALE HW auto-ageing feature can be enabled for AM65x CPSW ALE
variant (Patch 7).

Finally, Patches 8-9 introduces tables to describe the ALE VLAN entries
fields as the ALE VLAN entries are too much differ between different TI
CPSW ALE versions. So, handling them using flags, defines and get/set
functions are became over-complicated.

Patch 1 - is preparation patch

Changes in v3:
- fixed comment for Patch 2

Changes in v2:
- fixed sparse warnings

v2: https://lore.kernel.org/patchwork/cover/1301684/
v1: https://lore.kernel.org/patchwork/cover/1301048/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: ale: add support for multi port k3 cpsw versions
Grygorii Strashko [Thu, 10 Sep 2020 20:28:07 +0000 (23:28 +0300)]
net: ethernet: ti: ale: add support for multi port k3 cpsw versions

The TI J721E (CPSW9g) ALE version is similar, in general, to Sitara AM3/4/5
CPSW ALE, but has more extended functions and different ALE VLAN entry
format.

This patch adds support for for multi port TI J721E (CPSW9g) ALE variant.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: ale: switch to use tables for vlan entry description
Grygorii Strashko [Thu, 10 Sep 2020 20:28:06 +0000 (23:28 +0300)]
net: ethernet: ti: ale: switch to use tables for vlan entry description

The ALE VLAN entries are too much differ between different TI CPSW ALE
versions. So, handling them using flags, defines and get/set functions
became over-complicated.

This patch introduces tables to describe the ALE VLAN entries fields, which
are different between TI CPSW ALE versions, and new get/set access
functions. It also allows to detect incorrect access to not available ALL
entry fields.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: am65-cpsw: enable hw auto ageing
Grygorii Strashko [Thu, 10 Sep 2020 20:28:05 +0000 (23:28 +0300)]
net: ethernet: ti: am65-cpsw: enable hw auto ageing

The AM65x ALE supports HW auto-ageing which can be enabled by programming
ageing interval in ALE_AGING_TIMER register. For this CPSW fck_clk
frequency has to be know by ALE.

This patch extends cpsw_ale_params with bus_freq field and enables ALE HW
auto ageing for AM65x CPSW2G ALE version.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: ale: make usage of ale dev_id mandatory
Grygorii Strashko [Thu, 10 Sep 2020 20:28:04 +0000 (23:28 +0300)]
net: ethernet: ti: ale: make usage of ale dev_id mandatory

Hence all existing driver updated to use ALE dev_id the usage of ale dev_id
can be made mandatory and cpsw_ale_create() can be updated to use
"features" property from ALE static configuration.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: am65-cpsw: use dev_id for ale configuration
Grygorii Strashko [Thu, 10 Sep 2020 20:28:03 +0000 (23:28 +0300)]
net: ethernet: ti: am65-cpsw: use dev_id for ale configuration

The previous patch has introduced possibility to select CPSW ALE by using
ALE dev_id identifier. Switch TI TI AM65x/J721E CPSW NUSS driver to use
dev_id.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: netcp: ethss: use dev_id for ale configuration
Grygorii Strashko [Thu, 10 Sep 2020 20:28:02 +0000 (23:28 +0300)]
net: netcp: ethss: use dev_id for ale configuration

The previous patch has introduced possibility to select CPSW ALE by using
ALE dev_id identifier. Switch TI Keystone 2 NETCP driver to use dev_id and
perform clean up by removing "ale_entries" configuration code.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: cpsw: use dev_id for ale configuration
Grygorii Strashko [Thu, 10 Sep 2020 20:28:01 +0000 (23:28 +0300)]
net: ethernet: ti: cpsw: use dev_id for ale configuration

The previous patch has introduced possibility to select CPSW ALE by using
ALE dev_id identifier. Switch TI cpsw driver to use dev_id="cpsw" and
perform clean up by removing "ale_entries" configuration code.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: ale: add static configuration
Grygorii Strashko [Thu, 10 Sep 2020 20:28:00 +0000 (23:28 +0300)]
net: ethernet: ti: ale: add static configuration

As existing, as newly introduced CPSW ALE versions have differences in
supported features and ALE table formats. Especially it's actual for the
recent AM65x/J721E/J7200 SoC and feature AM64x, which supports features
like: auto-aging, classifiers, Link aggregation, additional hw filtering,
etc.

Existing ALE configuration interface is not practical in terms of adding
new features and requires consumers to program a lot static parameters. Any
attempt to add new options will case endless adding and maintaining
different combination of flags and options.

Hence CPSW ALE configuration is static and fixed for SoC (or set of SoC) It
is reasonable to add support for static ALE configurations inside ALE
module. This patch adds static ALE configuration table for different ALE
versions and provides option for consumers to select required ALE
configuration by providing ALE const char *dev_id identifier.

This feature is not enabled by default until existing CPSW drivers will be
modified by follow up patches.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: ale: add cpsw_ale_get_num_entries api
Grygorii Strashko [Thu, 10 Sep 2020 20:27:59 +0000 (23:27 +0300)]
net: ethernet: ti: ale: add cpsw_ale_get_num_entries api

Add cpsw_ale_get_num_entries() API to return number of ALE table entries
and update existing drivers to use it.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'DSA-tag_8021q-cleanup'
David S. Miller [Sat, 12 Sep 2020 00:30:43 +0000 (17:30 -0700)]
Merge branch 'DSA-tag_8021q-cleanup'

Vladimir Oltean says:

====================
DSA tag_8021q cleanup

This small series tries to consolidate the VLAN handling in DSA a little
bit. It reworks tag_8021q to be minimally invasive to the dsa_switch_ops
structure. This makes the rest of the code a bit easier to follow.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoRevert "net: dsa: Add more convenient functions for installing port VLANs"
Vladimir Oltean [Thu, 10 Sep 2020 16:48:57 +0000 (19:48 +0300)]
Revert "net: dsa: Add more convenient functions for installing port VLANs"

This reverts commit 314f76d7a68bab0516aa52877944e6aacfa0fc3f.

Citing that commit message, the call graph was:

    dsa_slave_vlan_rx_add_vid   dsa_port_setup_8021q_tagging
                |                        |
                |                        |
                |          +-------------+
                |          |
                v          v
               dsa_port_vid_add      dsa_slave_port_obj_add
                      |                         |
                      +-------+         +-------+
                              |         |
                              v         v
                           dsa_port_vlan_add

Now that tag_8021q has its own ops structure, it no longer relies on
dsa_port_vid_add, and therefore on the dsa_switch_ops to install its
VLANs.

So dsa_port_vid_add now only has one single caller. So we can simplify
the call graph to what it was before, aka:

        dsa_slave_vlan_rx_add_vid     dsa_slave_port_obj_add
                      |                         |
                      +-------+         +-------+
                              |         |
                              v         v
                           dsa_port_vlan_add

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dsa: tag_8021q: add a context structure
Vladimir Oltean [Thu, 10 Sep 2020 16:48:56 +0000 (19:48 +0300)]
net: dsa: tag_8021q: add a context structure

While working on another tag_8021q driver implementation, some things
became apparent:

- It is not mandatory for a DSA driver to offload the tag_8021q VLANs by
  using the VLAN table per se. For example, it can add custom TCAM rules
  that simply encapsulate RX traffic, and redirect & decapsulate rules
  for TX traffic. For such a driver, it makes no sense to receive the
  tag_8021q configuration through the same callback as it receives the
  VLAN configuration from the bridge and the 8021q modules.

- Currently, sja1105 (the only tag_8021q user) sets a
  priv->expect_dsa_8021q variable to distinguish between the bridge
  calling, and tag_8021q calling. That can be improved, to say the
  least.

- The crosschip bridging operations are, in fact, stateful already. The
  list of crosschip_links must be kept by the caller and passed to the
  relevant tag_8021q functions.

So it would be nice if the tag_8021q configuration was more
self-contained. This patch attempts to do that.

Create a struct dsa_8021q_context which encapsulates a struct
dsa_switch, and has 2 function pointers for adding and deleting a VLAN.
These will replace the previous channel to the driver, which was through
the .port_vlan_add and .port_vlan_del callbacks of dsa_switch_ops.

Also put the list of crosschip_links into this dsa_8021q_context.
Drivers that don't support cross-chip bridging can simply omit to
initialize this list, as long as they dont call any cross-chip function.

The sja1105_vlan_add and sja1105_vlan_del functions are refactored into
a smaller sja1105_vlan_add_one, which now has 2 entry points:
- sja1105_vlan_add, from struct dsa_switch_ops
- sja1105_dsa_8021q_vlan_add, from the tag_8021q ops
But even this change is fairly trivial. It just reflects the fact that
for sja1105, the VLANs from these 2 channels end up in the same hardware
table. However that is not necessarily true in the general sense (and
that's the reason for making this change).

The rest of the patch is mostly plain refactoring of "ds" -> "ctx". The
dsa_8021q_context structure needs to be propagated because adding a VLAN
is now done through the ops function pointers inside of it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dsa: tag_8021q: setup tagging via a single function call
Vladimir Oltean [Thu, 10 Sep 2020 16:48:55 +0000 (19:48 +0300)]
net: dsa: tag_8021q: setup tagging via a single function call

There is no point in calling dsa_port_setup_8021q_tagging for each
individual port. Additionally, it will become more difficult to do that
when we'll have a context structure to tag_8021q (next patch). So
refactor this now.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dsa: tag_8021q: include missing refcount.h
Vladimir Oltean [Thu, 10 Sep 2020 16:48:54 +0000 (19:48 +0300)]
net: dsa: tag_8021q: include missing refcount.h

The previous assumption was that the caller would already have this
header file included.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocrypto/chcr: move nic TLS functionality to drivers/net
Rohit Maheshwari [Thu, 10 Sep 2020 14:21:47 +0000 (19:51 +0530)]
crypto/chcr: move nic TLS functionality to drivers/net

This patch moves complete nic tls offload (kTLS) code from crypto
directory to drivers/net/ethernet/chelsio/inline_crypto/ch_ktls
directory. nic TLS is made a separate ULD of cxgb4.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'sfc-encap-offloads-on-EF10'
David S. Miller [Sat, 12 Sep 2020 00:15:22 +0000 (17:15 -0700)]
Merge branch 'sfc-encap-offloads-on-EF10'

Edward Cree says:

====================
sfc: encap offloads on EF10

EF10 NICs from the 8000 series onwards support TX offloads (checksumming,
 TSO) on VXLAN- and NVGRE-encapsulated packets.  This series adds driver
 support for these offloads.

Changes from v1:
 * Fix 'no TXQ of type' error handling in patch #1 (and clear up the
   misleading comment that inspired the wrong version)
 * Add comment in patch #5 explaining what the deal with TSOv3 is
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: advertise encapsulated offloads on EF10
Edward Cree [Fri, 11 Sep 2020 22:40:41 +0000 (23:40 +0100)]
sfc: advertise encapsulated offloads on EF10

Necessitates an .ndo_features_check, as the EF10 datapath has several
 limitations on what it can handle.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: implement encapsulated TSO on EF10
Edward Cree [Fri, 11 Sep 2020 22:40:14 +0000 (23:40 +0100)]
sfc: implement encapsulated TSO on EF10

>From the 8000 series onwards, EF10 NICs with suitable firmware are able
 to perform TSO within VXLAN or NVGRE encapsulation.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: de-indirect TSO handling
Edward Cree [Fri, 11 Sep 2020 22:40:03 +0000 (23:40 +0100)]
sfc: de-indirect TSO handling

Remove the tx_queue->handle_tso function pointer, and just use
 tx_queue->tso_version to decide which function to call, thus removing
 an indirect call from the fast path.
Instead of passing a tso_v2 flag to efx_mcdi_tx_init(), set the desired
 tx_queue->tso_version before calling it.
In efx_mcdi_tx_init(), report back failure to obtain a TSOv2 context by
 setting tx_queue->tso_version to 0, which will cause the TX path to
 use the GSO-based fallback.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: select inner-csum-offload TX queues for skbs that need it
Edward Cree [Fri, 11 Sep 2020 22:39:39 +0000 (23:39 +0100)]
sfc: select inner-csum-offload TX queues for skbs that need it

Won't actually be exercised until we start advertising the corresponding
 offload features.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: create inner-csum queues on EF10 if supported
Edward Cree [Fri, 11 Sep 2020 22:39:28 +0000 (23:39 +0100)]
sfc: create inner-csum queues on EF10 if supported

If the MC reports the VXLAN_NVGRE datapath capability, then these queues
 can be used for checksum offload of encapsulated packets.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: define inner/outer csum offload TXQ types
Edward Cree [Fri, 11 Sep 2020 22:39:14 +0000 (23:39 +0100)]
sfc: define inner/outer csum offload TXQ types

Nothing yet creates inner csum TXQs; just change all references to
 EFX_TXQ_TYPE_OFFLOAD to the new EFX_TXQ_TYPE_OUTER_CSUM.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: decouple TXQ type from label
Edward Cree [Fri, 11 Sep 2020 22:39:02 +0000 (23:39 +0100)]
sfc: decouple TXQ type from label

Make it possible to have an arbitrary mapping from types to labels,
 because when we add inner-csum-offload TXQs there will no longer be a
 convenient nesting hierarchy of NIC types (EF10 will have inner-csum
 TXQs, while Siena will have HIGHPRI).
Correct a misleading comment on efx_hard_start_xmit().

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoocteontx2-af: Constify npc_kpu_profile_{action,cam}
Rikard Falkeborn [Fri, 11 Sep 2020 22:00:15 +0000 (00:00 +0200)]
octeontx2-af: Constify npc_kpu_profile_{action,cam}

These are never modified, so constify them to allow the compiler to
place them in read-only memory. This moves about 25kB to read-only
memory as seen by the output of the size command.

Before:
   text    data     bss     dec     hex filename
 296203   65464    1248  362915   589a3 drivers/net/ethernet/marvell/octeontx2/af/octeontx2_af.ko

After:
   text    data     bss     dec     hex filename
 321003   40664    1248  362915   589a3 drivers/net/ethernet/marvell/octeontx2/af/octeontx2_af.ko

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'sfc-misc-cleanups'
David S. Miller [Fri, 11 Sep 2020 21:55:14 +0000 (14:55 -0700)]
Merge branch 'sfc-misc-cleanups'

Edward Cree says:

====================
sfc: misc cleanups

Clean up a few nits I noticed while working on TXQ stuff.
====================

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: cleanups around efx_alloc_channel
Edward Cree [Fri, 11 Sep 2020 18:45:14 +0000 (19:45 +0100)]
sfc: cleanups around efx_alloc_channel

The old_channel argument is never used, so remove it.
The function is only called from elsewhere in efx_channels.c, so make
 it static and remove the declaration from the header file.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: remove spurious unreachable return statement
Edward Cree [Fri, 11 Sep 2020 18:44:56 +0000 (19:44 +0100)]
sfc: remove spurious unreachable return statement

The statement above it already returns, so there is no way to get here.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: remove duplicate call to efx_init_channels from EF100 probe
Edward Cree [Fri, 11 Sep 2020 18:44:44 +0000 (19:44 +0100)]
sfc: remove duplicate call to efx_init_channels from EF100 probe

efx_init_struct already calls this, we don't need to do it again.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agobridge: mcast: Fix incomplete MDB dump
Ido Schimmel [Fri, 11 Sep 2020 13:24:47 +0000 (16:24 +0300)]
bridge: mcast: Fix incomplete MDB dump

Each MDB entry is encoded in a nested netlink attribute called
'MDBA_MDB_ENTRY'. In turn, this attribute contains another nested
attributed called 'MDBA_MDB_ENTRY_INFO', which encodes a single port
group entry within the MDB entry.

The cited commit added the ability to restart a dump from a specific
port group entry. However, on failure to add a port group entry to the
dump the entire MDB entry (stored in 'nest2') is removed, resulting in
missing port group entries.

Fix this by finalizing the MDB entry with the partial list of already
encoded port group entries.

Fixes: 5205e919c9f0 ("net: bridge: mcast: add support for src list and filter mode dumping")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoipv6: remove redundant assignment to variable err
Colin Ian King [Fri, 11 Sep 2020 10:35:09 +0000 (11:35 +0100)]
ipv6: remove redundant assignment to variable err

The variable err is being initialized with a value that is never read and
it is being updated later with a new value. The initialization is redundant
and can be removed.  Also re-order variable declarations in reverse
Christmas tree ordering.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'ag71xx-add-ethtool-and-flow-control-support'
David S. Miller [Fri, 11 Sep 2020 21:45:55 +0000 (14:45 -0700)]
Merge branch 'ag71xx-add-ethtool-and-flow-control-support'

Oleksij Rempel says:

====================
ag71xx: add ethtool and flow control support

The main target of this patches is to provide flow control support
for ag71xx driver. To be able to validate this functionality, I also
added ethtool support with HW counters. So, this patches was validated
with iperf3 and counters showing Pause frames send or received by this
NIC.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ag71xx: add flow control support
Oleksij Rempel [Fri, 11 Sep 2020 08:25:28 +0000 (10:25 +0200)]
net: ag71xx: add flow control support

Add flow control support. The functionality was tested on AR9331 SoC and
confirmed by iperf3 results and HW counters exported over ethtool.
Following test configurations was used:

iMX6S receiver <--- TL-SG1005D switch <---- AR9331 sender

The switch is supporting symmytric flow control:
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
--->>   Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 4
        Transceiver: external
        Link detected: yes

The iMX6S system was configured to 10Mbit, to let the switch use flow
control:
  - ethtool -s eth0 speed 10

With flow control disabled on AR9331:
  - ethtool -A eth0  rx off tx off
  - iperf3 -u -c 172.17.0.1 -b100M -l1472 -t10

[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  66.2 MBytes  55.5 Mbits/sec  0.000 ms  0/47155 (0%)  sender
[  5]   0.00-10.04  sec  11.5 MBytes  9.57 Mbits/sec  1.309 ms  38986/47146 (83%)  receiver

With flow control enabled on AR9331:
  - ethtool -A eth0  rx on tx on
  - iperf3 -u -c 172.17.0.1 -b100M -l1472 -t10

[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  15.1 MBytes  12.6 Mbits/sec  0.000 ms  0/10727 (0%)  sender
[  5]   0.00-10.05  sec  11.5 MBytes  9.57 Mbits/sec  1.371 ms  2525/10689 (24%)  receiver

Similar results are get in opposite direction by introducing extra CPU
load on AR9331:
  - chrt 40 dd if=/dev/zero of=/dev/null &

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ag71xx: add ethtool support
Oleksij Rempel [Fri, 11 Sep 2020 08:25:27 +0000 (10:25 +0200)]
net: ag71xx: add ethtool support

Add basic ethtool support. The functionality was tested on AR9331 SoC.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodrivers/net/wan/x25_asy: Remove an unused flag "SLF_OUTWAIT"
Xie He [Fri, 11 Sep 2020 06:35:03 +0000 (23:35 -0700)]
drivers/net/wan/x25_asy: Remove an unused flag "SLF_OUTWAIT"

The "SLF_OUTWAIT" flag defined in x25_asy.h is not actually used.
It is only cleared at one place in x25_asy.c but is never read or set.
So we can remove it.

Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: stmmac: set get_rx_header_len() as void for it didn't have any error code to...
Luo Jiaxing [Fri, 11 Sep 2020 03:55:58 +0000 (11:55 +0800)]
net: stmmac: set get_rx_header_len() as void for it didn't have any error code to return

We found the following warning when using W=1 to build kernel:

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3634:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret, coe = priv->hw->rx_csum;

When digging stmmac_get_rx_header_len(), dwmac4_get_rx_header_len() and
dwxgmac2_get_rx_header_len() return 0 only, without any error code to
report. Therefore, it's better to define get_rx_header_len() as void.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'Add-GVE-Features'
David S. Miller [Fri, 11 Sep 2020 21:31:54 +0000 (14:31 -0700)]
Merge branch 'Add-GVE-Features'

David Awogbemila says:

====================
Add GVE Features.

Note: Patch 4 in v3 was dropped.

Patch 4 (patch 5 in v3): Start/stop timer only when report stats is
enabled/disabled.
Patch 7 (patch 8 in v3): Use netdev_info, not dev_info, to log
device link status.
====================

Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Enable Link Speed Reporting in the driver.
David Awogbemila [Fri, 11 Sep 2020 17:38:51 +0000 (10:38 -0700)]
gve: Enable Link Speed Reporting in the driver.

This change allows the driver to report the device link speed
when the ethtool command:
ethtool <nic name>
is run.
Getting the link speed is done via a new admin queue command:
ReportLinkSpeed.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Use link status register to report link status
Patricio Noyola [Fri, 11 Sep 2020 17:38:50 +0000 (10:38 -0700)]
gve: Use link status register to report link status

This makes the driver better aware of the connectivity status of the
device. Based on the device's status register, the driver can call
netif_carrier_{on,off}.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Patricio Noyola <patricion@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Batch AQ commands for creating and destroying queues.
Sagi Shahar [Fri, 11 Sep 2020 17:38:49 +0000 (10:38 -0700)]
gve: Batch AQ commands for creating and destroying queues.

Adds support for batching AQ commands and uses it for creating and
destroying queues.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Sagi Shahar <sagis@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: NIC stats for report-stats and for ethtool
David Awogbemila [Fri, 11 Sep 2020 17:38:48 +0000 (10:38 -0700)]
gve: NIC stats for report-stats and for ethtool

This adds per queue NIC stats to ethtool stats and to report-stats.
These stats are always exposed to guest whether or not the
report-stats flag is turned on.

Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Add Gvnic stats AQ command and ethtool show/set-priv-flags.
Kuo Zhao [Fri, 11 Sep 2020 17:38:47 +0000 (10:38 -0700)]
gve: Add Gvnic stats AQ command and ethtool show/set-priv-flags.

This adds functionality to report driver stats to Hypervisor.
(Users may want to turn this feature off as a matter of privacy
so a "report-stats" flag is added as an ethtool priv option.
It is also disabled by default.)
The hypervisor would trigger a stats report in case "too many"
packets dropped; the stats would be useful in debugging stuck
queues.
A "stats_report_trigger_cnt" stat is added to count the number of times
the hypervisor attempts to trigger stats report.

A timer is also added so that when report-stats is enabled, stat are
updated once every 20 seconds.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Kuo Zhao <kuozhao@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Use dev_info/err instead of netif_info/err.
Catherine Sullivan [Fri, 11 Sep 2020 17:38:46 +0000 (10:38 -0700)]
gve: Use dev_info/err instead of netif_info/err.

Update the driver to use dev_info/err instead of netif_info/err.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Add stats for gve.
Kuo Zhao [Fri, 11 Sep 2020 17:38:45 +0000 (10:38 -0700)]
gve: Add stats for gve.

Sample output of "ethtool -S <interface-name>" with 1 RX queue and 1 TX
queue:
NIC statistics:
     rx_packets: 1039
     tx_packets: 37
     rx_bytes: 822071
     tx_bytes: 4100
     rx_dropped: 0
     tx_dropped: 0
     tx_timeouts: 0
     rx_skb_alloc_fail: 0
     rx_buf_alloc_fail: 0
     rx_desc_err_dropped_pkt: 0
     interface_up_cnt: 1
     interface_down_cnt: 0
     reset_cnt: 0
     page_alloc_fail: 0
     dma_mapping_error: 0
     rx_posted_desc[0]: 1365
     rx_completed_desc[0]: 341
     rx_bytes[0]: 215094
     rx_dropped_pkt[0]: 0
     rx_copybreak_pkt[0]: 3
     rx_copied_pkt[0]: 3
     tx_posted_desc[0]: 6
     tx_completed_desc[0]: 6
     tx_bytes[0]: 420
     tx_wake[0]: 0
     tx_stop[0]: 0
     tx_event_counter[0]: 6
     adminq_prod_cnt: 34
     adminq_cmd_fail: 0
     adminq_timeouts: 0
     adminq_describe_device_cnt: 1
     adminq_cfg_device_resources_cnt: 1
     adminq_register_page_list_cnt: 16
     adminq_unregister_page_list_cnt: 0
     adminq_create_tx_queue_cnt: 8
     adminq_create_rx_queue_cnt: 8
     adminq_destroy_tx_queue_cnt: 0
     adminq_destroy_rx_queue_cnt: 0
     adminq_dcfg_device_resources_cnt: 0
     adminq_set_driver_parameter_cnt: 0

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Kuo Zhao <kuozhao@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Get and set Rx copybreak via ethtool
Kuo Zhao [Fri, 11 Sep 2020 17:38:44 +0000 (10:38 -0700)]
gve: Get and set Rx copybreak via ethtool

This adds support for getting and setting the RX copybreak
value via ethtool.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Kuo Zhao <kuozhao@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge tag 'wireless-drivers-next-2020-09-11' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Fri, 11 Sep 2020 20:32:31 +0000 (13:32 -0700)]
Merge tag 'wireless-drivers-next-2020-09-11' of git://git./linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.10

First set of patches for v5.10. Most noteworthy here is ath11k getting
initial support for QCA6390 and IPQ6018 devices. But most of the
patches are cleanup: W=1 warning fixes, fallthrough keywords, DMA API
changes and tasklet API changes.

Major changes:

ath10k

* support SDIO firmware codedumps

* support station specific TID configurations

ath11k

* add support for IPQ6018

* add support for QCA6390 PCI devices

ath9k

* add support for NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 to improve PTK0
  rekeying

wcn36xx

* add support for TX ack
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Fri, 11 Sep 2020 15:03:00 +0000 (18:03 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for v5.10. Major changes:

ath10k

* support SDIO firmware codedumps

* support station specific TID configurations

ath11k

* add support for IPQ6018

3 years agoath10k: Remove unused macro ATH10K_ROC_TIMEOUT_HZ
YueHaibing [Wed, 9 Sep 2020 13:58:34 +0000 (21:58 +0800)]
ath10k: Remove unused macro ATH10K_ROC_TIMEOUT_HZ

There is no caller in tree, so can remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200909135834.38448-1-yuehaibing@huawei.com
3 years agoath11k: Remove unused inline function htt_htt_stats_debug_dump()
YueHaibing [Wed, 9 Sep 2020 13:45:33 +0000 (21:45 +0800)]
ath11k: Remove unused inline function htt_htt_stats_debug_dump()

There is no caller in tree, so can remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200909134533.19604-1-yuehaibing@huawei.com
3 years agoath11k: fix link error when CONFIG_REMOTEPROC is disabled
Kalle Valo [Thu, 10 Sep 2020 07:20:59 +0000 (07:20 +0000)]
ath11k: fix link error when CONFIG_REMOTEPROC is disabled

If CONFIG_REMOTEPROC was disabled the linking failed with:

ERROR: modpost: "rproc_get_by_phandle" [drivers/net/wireless/ath/ath11k/ath11k.ko] undefined!

Compile tested only.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 1ff8ed786d5d ("ath11k: use remoteproc only with AHB devices")
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/0101017476e38f40-c4168ac4-c00a-4220-a032-fe17e4a157cb-000000@us-west-2.amazonses.com
3 years agoath11k: remove calling ath11k_init_hw_params() second time
Anilkumar Kolli [Tue, 8 Sep 2020 10:01:59 +0000 (10:01 +0000)]
ath11k: remove calling ath11k_init_hw_params() second time

During probe ath11k_init_hw_params() is called from ath11k_core_pre_init()
and is not needed agian in ath11k_core_init().

Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1

Fixes: 1ff8ed786d5d (ath11k: use remoteproc only with AHB devices)
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/010101746d2a40d3-25cd7dbe-c0dd-4fdf-8735-366d7fb40207-000000@us-west-2.amazonses.com
3 years agoath11k: add raw mode and software crypto support
Venkateswara Naralasetty [Tue, 8 Sep 2020 06:32:21 +0000 (06:32 +0000)]
ath11k: add raw mode and software crypto support

Adding raw mode tx/rx support. Also, adding support
for software crypto which depends on raw mode.

To enable raw mode tx/rx:
insmod ath11k.ko frame_mode=0

To enable software crypto:
insmod ath11k.ko crypto_mode=1

These modes could be helpful in debugging crypto related issues.

Tested-on: IPQ8074 WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1

Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/010101746c6a52d9-18302a2c-0d6d-4057-aa4b-95960c809646-000000@us-west-2.amazonses.com
3 years agoath11k: add ipq6018 support
Anilkumar Kolli [Tue, 8 Sep 2020 07:55:36 +0000 (07:55 +0000)]
ath11k: add ipq6018 support

IPQ6018 has one 5G and one 2G radio with 2x2,
shares ipq8074 configurations.

Tested on: IPQ6018 hw1.0 AHB WLAN.HK.2.2-02134-QCAHKSWPL_SILICONZ-1
Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/010101746cb68b63-c2bc31ec-a31e-442e-a572-26f4c045c06b-000000@us-west-2.amazonses.com
3 years agoath11k: move target ce configs to hw_params
Anilkumar Kolli [Tue, 8 Sep 2020 07:55:35 +0000 (07:55 +0000)]
ath11k: move target ce configs to hw_params

Move target CE config and target CE service config to hw_params.
No functional changes.

Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/010101746cb685d9-6bedeccb-29a1-4d32-8664-fcfe7d105f4a-000000@us-west-2.amazonses.com
3 years agodt: bindings: net: update compatible for ath11k
Anilkumar Kolli [Tue, 8 Sep 2020 07:55:31 +0000 (07:55 +0000)]
dt: bindings: net: update compatible for ath11k

Add IPQ6018 wireless driver support,
its based on ath11k driver.

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/010101746cb6751a-ca300933-1174-4534-a01b-b1dbf1c1f305-000000@us-west-2.amazonses.com
3 years agonet: smc91x: Remove set but not used variable 'status' in smc_phy_configure()
Luo Jiaxing [Thu, 10 Sep 2020 13:12:16 +0000 (21:12 +0800)]
net: smc91x: Remove set but not used variable 'status' in smc_phy_configure()

Fixes the following warning when using W=1 to build kernel:

drivers/net/ethernet/smsc/smc91x.c: In function ‘smc_phy_configure’:
drivers/net/ethernet/smsc/smc91x.c:1039:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
  int status;

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'smc-next'
David S. Miller [Thu, 10 Sep 2020 22:24:27 +0000 (15:24 -0700)]
Merge branch 'smc-next'

Karsten Graul says:

====================
net/smc: updates 2020-09-10

Please apply the following patch series for smc to netdev's net-next tree.

This patch series is a mix of various improvements and cleanups.
The patches 1 and 10 improve the handling of large parallel workloads.
Patch 8 corrects a kernel config default for config CCWGROUP on s390.
Patch 9 allows userspace tools to retrieve socket information for more
sockets.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: use separate work queues for different worker types
Karsten Graul [Thu, 10 Sep 2020 16:48:29 +0000 (18:48 +0200)]
net/smc: use separate work queues for different worker types

There are 6 types of workers which exist per smc connection. 3 of them
are used for listen and handshake processing, another 2 are used for
close and abort processing and 1 is the tx worker that moves calls to
sleeping functions into a worker.
To prevent flooding of the system work queue when many connections are
opened or closed at the same time (some pattern uperf implements), move
those workers to one of 3 smc-specific work queues. Two work queues are
module-global and used for handshake and close workers. The third work
queue is defined per link group and used by the tx workers that may
sleep waiting for resources of this link group.
And in smc_llc_enqueue() queue the llc_event_work work to the system
prio work queue because its critical that this work is started fast.

Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: use the retry mechanism for netlink messages
Guvenc Gulce [Thu, 10 Sep 2020 16:48:28 +0000 (18:48 +0200)]
net/smc: use the retry mechanism for netlink messages

When the netlink messages to be sent to the userspace
are too big for a single netlink message, send them in
chunks using the netlink_dump infrastructure. Modify the
smc diag dump code so that it can signal to the netlink_dump
infrastructure that it needs to send more data.

Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agos390/net: add SMC config as one of the defaults of CCWGROUP
Guvenc Gulce [Thu, 10 Sep 2020 16:48:27 +0000 (18:48 +0200)]
s390/net: add SMC config as one of the defaults of CCWGROUP

arch/s390/net/pnet.c uses ccwgroup function dev_is_ccwgroup()
in pnetid_by_dev_port().
For s390 the net/smc code makes use of function pnetid_by_dev_port().
Make sure ccwgroup is built into the kernel, if smc is to be built
into the kernel.

Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: immediate freeing in smc_lgr_cleanup_early()
Ursula Braun [Thu, 10 Sep 2020 16:48:26 +0000 (18:48 +0200)]
net/smc: immediate freeing in smc_lgr_cleanup_early()

smc_lgr_cleanup_early() schedules the free worker with delay. DMB
unregistering occurs in this delayed worker increasing the risk
to reach the SMCD SBA limit without need. Terminate the
linkgroup immediately, since termination means early DMB unregistering.

For SMCD the global smc_server_lgr_pending lock is given up early.
A linkgroup to be given up with smc_lgr_cleanup_early() may already
contain more than one connection. Using __smc_lgr_terminate() in
smc_lgr_cleanup_early() covers this.

And consolidate smc_ism_put_vlan() and smc_put_device() into smc_lgr_free()
only.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: reduce smc_listen_decline() calls
Ursula Braun [Thu, 10 Sep 2020 16:48:25 +0000 (18:48 +0200)]
net/smc: reduce smc_listen_decline() calls

smc_listen_work() contains already an smc_listen_decline() exit.
Use this exit for smc_listen_rdma_finish() problems as well.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: improve server ISM device determination
Ursula Braun [Thu, 10 Sep 2020 16:48:24 +0000 (18:48 +0200)]
net/smc: improve server ISM device determination

Move check whether peer can be reached into smc_pnet_find_ism_by_pnetid().
Thus searching continues for another ism device, if check fails.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: common routine for CLC accept and confirm
Ursula Braun [Thu, 10 Sep 2020 16:48:23 +0000 (18:48 +0200)]
net/smc: common routine for CLC accept and confirm

smc_clc_send_accept() and smc_clc_send_confirm() are quite similar.
Move common code into a separate function smc_clc_send_confirm_accept().
And introduce separate SMCD and SMCR struct definitions for CLC accept
resp. confirm.
No functional change.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: dynamic allocation of CLC proposal buffer
Ursula Braun [Thu, 10 Sep 2020 16:48:22 +0000 (18:48 +0200)]
net/smc: dynamic allocation of CLC proposal buffer

Reduce stack size for smc_listen_work() and smc_clc_send_proposal()
by dynamic allocation of the CLC buffer to be received or sent.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: introduce better field names
Ursula Braun [Thu, 10 Sep 2020 16:48:21 +0000 (18:48 +0200)]
net/smc: introduce better field names

Field names "srv_first_contact" and "cln_first_contact" are misleading,
since they apply to both, server and client. Rename them to
"first_contact_peer" and "first_contact_local".
Rename "ism_gid" by the more precise name "ism_peer_gid".
Rename version constant "SMC_CLC_V1" into "SMC_V1".
No functional change.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/smc: reduce active tcp_listen workers
Ursula Braun [Thu, 10 Sep 2020 16:48:20 +0000 (18:48 +0200)]
net/smc: reduce active tcp_listen workers

SMC starts a separate tcp_listen worker for every SMC socket in
state SMC_LISTEN, and can accept an incoming connection request only,
if this worker is really running and waiting in kernel_accept(). But
the number of running workers is limited.
This patch reworks the listening SMC code and starts a tcp_listen worker
after the SYN-ACK handshake on the internal clc-socket only.

Suggested-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Reviewed-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'nfc-s3fwrn5-Few-cleanups'
David S. Miller [Thu, 10 Sep 2020 22:22:17 +0000 (15:22 -0700)]
Merge branch 'nfc-s3fwrn5-Few-cleanups'

Krzysztof Kozlowski says:

====================
nfc: s3fwrn5: Few cleanups

Changes since v2:
1. Fix dtschema ID after rename (patch 1/8).
2. Apply patch 9/9 (defconfig change).

Changes since v1:
1. Rename dtschema file and add additionalProperties:false, as Rob
   suggested,
2. Add Marek's tested-by,
3. New patches: #4, #5, #6, #7 and #9.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoarm64: dts: exynos: Use newer S3FWRN5 GPIO properties in Exynos5433 TM2
Krzysztof Kozlowski [Thu, 10 Sep 2020 16:12:19 +0000 (18:12 +0200)]
arm64: dts: exynos: Use newer S3FWRN5 GPIO properties in Exynos5433 TM2

Since "s3fwrn5" is not a valid vendor prefix, use new GPIO properties
instead of the deprecated.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>