RE: [PATCH net-next 4/6] r8152: support new chips

2021-04-20 Thread Hayes Wang
Jakub Kicinski > Sent: Saturday, April 17, 2021 5:50 AM > > + switch (tp->version) { > > + case RTL_VER_10: > > + data = ocp_reg_read(tp, 0xad40); > > + data &= ~0x3ff; > > + data |= BIT(7) | BIT(2); > > + ocp_reg_write(tp, 0xad40, data); > > + > > +

[PATCH net-next 4/6] r8152: support new chips

2021-04-16 Thread Hayes Wang
Support RTL8153C, RTL8153D, RTL8156A, and RTL8156B. The RTL8156A and RTL8156B are the 2.5G ethernet. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2634 +++ 1 file changed, 2359 insertions(+), 275 deletions(-) diff --git a/drivers/net/usb/r8152.c b

[PATCH net-next 5/6] r8152: support PHY firmware for RTL8156 series

2021-04-16 Thread Hayes Wang
Support new firmware type and method for RTL8156 series. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 563 +++- 1 file changed, 561 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 72b8ef0ad5a1

[PATCH net-next 2/6] r8152: adjust rtl8152_check_firmware function

2021-04-16 Thread Hayes Wang
Use bits operations to record and check the firmware. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 51 +++-- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 10db48f4ed77

[PATCH net-next 6/6] r8152: search the configuration of vendor mode

2021-04-16 Thread Hayes Wang
The vendor mode is not always at config #1, so it is necessary to set the correct configuration number. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 39 +++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/r8152.c b

[PATCH net-next 1/6] r8152: set inter fram gap time depending on speed

2021-04-16 Thread Hayes Wang
effectively, because the transfer would be completed fastly. Therefore, use the maximum value to improve the effect of the aggregation. However, you may not feel the improvement for fast CPUs, because they compensate for the effect of the aggregation. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c

[PATCH net-next 3/6] r8152: add help function to change mtu

2021-04-16 Thread Hayes Wang
The different chips may have different requests when changing mtu. Therefore, add a new help function of rtl_ops to change mtu. Besides, reset the tx/rx after changing mtu. Additionally, add mtu_to_size() and size_to_mtu() macros to simplify the code. Signed-off-by: Hayes Wang --- drivers/net

[PATCH net-next 0/6] r8152: support new chips

2021-04-16 Thread Hayes Wang
Support new RTL8153 and RTL8156 series. Hayes Wang (6): r8152: set inter fram gap time depending on speed r8152: adjust rtl8152_check_firmware function r8152: add help function to change mtu r8152: support new chips r8152: support PHY firmware for RTL8156 series r8152: search

[PATCH net] r8152: limit the RX buffer size of RTL8153A for USB 2.0

2021-03-19 Thread Hayes Wang
by: Robert Davies Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 90f1c0200042..20fb5638ac65 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c

[PATCH net] r8169: fix r8168fp_adjust_ocp_cmd function

2021-03-05 Thread Hayes Wang
The (0xBAF7 & 0x00FFF000) << 6 should be (0xf70 << 18). Fixes: 561535b0f239 ("r8169: fix OCP access on RTL8117") Signed-off-by: Hayes Wang --- drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[PATCH net] Revert "r8152: adjust the settings about MAC clock speed down for RTL8153"

2021-03-03 Thread Hayes Wang
-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 35 ++- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index b246817f3405..90f1c0200042 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb

RE: [PATCH net] r8152: move r8153_mac_clk_spd

2021-02-21 Thread Hayes Wang
Jakub Kicinski > Sent: Saturday, February 20, 2021 2:23 AM [...] > Any word on what user-visible misbehavior this causes? I think it influences the power saving for suspending. I am checking it with our engineers. > Can you provide a Fixes tag? Yes. I will add it when I updating this patch.

[PATCH net] r8152: move r8153_mac_clk_spd

2021-02-19 Thread Hayes Wang
-by: Hayes Wang --- drivers/net/usb/r8152.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 67cd6986634f..ec29878db566 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -4678,7 +4678,6 @@ static void

[PATCH net-next 0/4] r8152: minor adjustments

2021-02-19 Thread Hayes Wang
These patches are used to adjust the code. Hayes Wang (4): r8152: enable U1/U2 for USB_SPEED_SUPER r8152: check if the pointer of the function exists r8152: replace netif_err with dev_err r8152: spilt rtl_set_eee_plus and r8153b_green_en drivers/net/usb/r8152.c | 67

[PATCH net-next 4/4] r8152: spilt rtl_set_eee_plus and r8153b_green_en

2021-02-19 Thread Hayes Wang
Add rtl_eee_plus_en() and rtl_green_en(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 43 ++--- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 82a129264e31..b246817f3405

[PATCH net-next 3/4] r8152: replace netif_err with dev_err

2021-02-19 Thread Hayes Wang
Some messages are before calling register_netdev(), so replace netif_err() with dev_err(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index baa63ea2590a

[PATCH net-next 2/4] r8152: check if the pointer of the function exists

2021-02-19 Thread Hayes Wang
Return error code if autosuspend_en, eee_get, or eee_set don't exist. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 4bfee289aa6f..baa63ea2590a 100644 --- a/drivers

[PATCH net-next 1/4] r8152: enable U1/U2 for USB_SPEED_SUPER

2021-02-19 Thread Hayes Wang
U1/U2 shoued be enabled for USB 3.0 or later. The USB 2.0 doesn't support it. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2d7cc63bef89..4bfee289aa6f

[PATCH net-next 1/2] r8152: replace several functions about phy patch request

2021-02-03 Thread Hayes Wang
. When the PHY is resumed from the state of power cut, the PHY is at a safe mode and the OCP_PHY_PATCH_STAT wouldn't be updated. For this situation, it is safe to set patch request command without waiting OCP_PHY_PATCH_STAT. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 84

[PATCH net-next 2/2] r8152: adjust the flow of power cut for RTL8153B

2021-02-03 Thread Hayes Wang
(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 68 - 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e792c1c69f14..d0048ebc114a 100644 --- a/drivers/net/usb/r8152.c +++ b

[PATCH net-next 0/2] r8152: adjust flow for power cut

2021-02-03 Thread Hayes Wang
The two patches are used to adjust the flow about resuming from the state of power cut. For the purpose, some functions have to be updated first. Hayes Wang (2): r8152: replace several functions about phy patch request r8152: adjust the flow of power cut for RTL8153B drivers/net/usb/r8152.c

RE: [PATCH net] net: usb: cdc_ncm: don't spew notifications

2021-01-19 Thread Hayes Wang
t; [786139.761108] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink > 2500 mbit/s uplink > ... > > Chrome OS cannot support RTL8156 until this is fixed. > > Signed-off-by: Grant Grundler Reviewed-by: Hayes Wang Best Regards, Hayes

RE: [PATCH 3/3] net: usb: cdc_ncm: don't spew notifications

2021-01-18 Thread Hayes Wang
gt; connected > > [786139.697100] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink > 2500 mbit/s uplink > > [786139.729094] cdc_ncm 2-1:2.0 enx002427880815: network connection: > connected > > [786139.761108] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink > 2500 mbit/s uplink > > ... > > > > Chrome OS cannot support RTL8156 until this is fixed. > > > > Signed-off-by: Grant Grundler Reviewed-by: Hayes Wang Best Regards, Hayes

[PATCH net-next v2] r8153_ecm: avoid to be prior to r8152 driver

2020-11-17 Thread Hayes Wang
Avoid r8153_ecm is compiled as built-in, if r8152 driver is compiled as modules. Otherwise, the r8153_ecm would be used, even though the device is supported by r8152 driver. Fixes: c1aedf015ebd ("net/usb/r8153_ecm: support ECM mode for RTL8153") Reported-by: Marek Szyprowski Signed-off

RE: [PATCH net-next] r8153_ecm: avoid to be prior to r8152 driver

2020-11-17 Thread Hayes Wang
Jakub Kicinski > Sent: Wednesday, November 18, 2020 12:12 AM [...] > Something like this? > > config USB_RTL8153_ECM > tristate > select MII > select USB_NET_CDCETHER > depends on USB_RTL8152 || USB_RTL8152=n > help > > > > select clauses will pull

RE: [PATCH net-next] r8153_ecm: avoid to be prior to r8152 driver

2020-11-16 Thread Hayes Wang
Jakub Kicinski > Sent: Tuesday, November 17, 2020 1:03 AM [...] > > Yes, this fixes this issue, although I would prefer a separate Kconfig > > entry for r8153_ecm with proper dependencies instead of this ifdefs in > > Makefile. > > Agreed, this is what dependency resolution is for. > > Let's

[PATCH net-next] r8153_ecm: avoid to be prior to r8152 driver

2020-11-15 Thread Hayes Wang
Avoid r8153_ecm is compiled as built-in, if r8152 driver is compiled as modules. Otherwise, the r8153_ecm would be used, even though the device is supported by r8152 driver. Fixes: c1aedf015ebd ("net/usb/r8153_ecm: support ECM mode for RTL8153") Reported-by: Marek Szyprowski Signed-off

[PATCH net-next v2 RESEND] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-11-03 Thread Hayes Wang
, the r8152 is used for the device with vendor mode. Otherwise, the r8153_ecm is used for the device with ECM mode. Signed-off-by: Hayes Wang --- drivers/net/usb/Makefile| 2 +- drivers/net/usb/r8152.c | 30 +-- drivers/net/usb/r8153_ecm.c | 162 include

RE: [PATCH net-next v2] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-11-03 Thread Hayes Wang
Jakub Kicinski > Sent: Wednesday, November 4, 2020 12:16 AM [...] > > So no, please do not create such a common file, it is not needed or a > > good idea. > > I wouldn't go that far, PCI subsystem just doesn't want everyone to add > IDs to the shared file unless there is a reason. > > *Do

RE: [PATCH net-next v2] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-11-03 Thread Hayes Wang
Greg Kroah-Hartman > Sent: Tuesday, November 3, 2020 5:33 PM [...] > There is a reason, it's a nightmare to maintain and handle merges for, > just don't do it. > > Read the comments at the top of the pci_ids.h file if you are curious > why we don't even do this for PCI device ids anymore for the

[PATCH net-next v3 1/2] include/linux/usb: new header file for the vendor ID of USB devices

2020-11-03 Thread Hayes Wang
Add a new header file usb_vendor_id.h to consolidate the definitions of the vendor ID of USB devices which may be used by cdc_ether and r8152 driver. Signed-off-by: Hayes Wang --- drivers/net/usb/cdc_ether.c | 139 +- drivers/net/usb/r8152.c | 48

[PATCH net-next v3 0/2] drivers/net/usb: support ECM mode for RTL8153

2020-11-03 Thread Hayes Wang
v3: Move original patch to #2. And add a new patch #1 to consolidate vendor ID of USB devices. v2: Add include/linux/usb/r8152.h to avoid the warning about no previous prototype for rtl8152_get_version. Hayes Wang (2): include/linux/usb: new header file for the vendor ID of USB devices net

[PATCH net-next v3 2/2] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-11-03 Thread Hayes Wang
, the r8152 is used for the device with vendor mode. Otherwise, the r8153_ecm is used for the device with ECM mode. Signed-off-by: Hayes Wang --- drivers/net/usb/Makefile| 2 +- drivers/net/usb/r8152.c | 22 + drivers/net/usb/r8153_ecm.c | 162 include

RE: [PATCH net-next v2] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-11-01 Thread Hayes Wang
Jakub Kicinski [...] > Can you describe the use case in more detail? > > AFAICT r8152 defines a match for the exact same device. > Does it not mean that which driver is used will be somewhat random > if both are built? I export rtl_get_version() from r8152. It would return none zero value if

[PATCH net-next v2] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-10-29 Thread Hayes Wang
Support ECM mode based on cdc_ether with relative mii functions, when CONFIG_USB_RTL8152 is not set, or the device is not supported by r8152 driver. Signed-off-by: Hayes Wang --- v2: Add include/linux/usb/r8152.h to avoid the warning about no previous prototype for rtl8152_get_version. drivers

[PATCH] net/usb/r8153_ecm: support ECM mode for RTL8153

2020-10-29 Thread Hayes Wang
Support ECM mode based on cdc_ether with relative mii functions, when CONFIG_USB_RTL8152 is not set, or the device is not supported by r8152 driver. Signed-off-by: Hayes Wang --- drivers/net/usb/Makefile| 2 +- drivers/net/usb/r8152.c | 5 +- drivers/net/usb/r8153_ecm.c | 174

RE: [PATCH net-next] r8152: support request_firmware for RTL8153

2019-10-23 Thread Hayes Wang
Marek Szyprowski [mailto:m.szyprow...@samsung.com] > Sent: Wednesday, October 23, 2019 6:23 PM [...] > >> This patch (which landed in linux-next last days) causes a following > >> kernel oops on the ARM 32bit Exynos5422 SoC based Odroid XU4 board: > > Please try the following patch. > > Yes, this

RE: [PATCH net-next] r8152: support request_firmware for RTL8153

2019-10-23 Thread Hayes Wang
Marek Szyprowski [mailto:m.szyprow...@samsung.com] > Sent: Wednesday, October 23, 2019 5:17 PM > Subject: Re: [PATCH net-next] r8152: support request_firmware for RTL8153 > > Hi Hayes, > > On 16.10.2019 05:02, Hayes Wang wrote: > > This patch supports loading addition

RE: [PATCH net-next 4/4] r8152: support firmware of PHY NC for RTL8153A

2019-10-21 Thread Hayes Wang
Jakub Kicinski [mailto:jakub.kicin...@netronome.com] > Sent: Tuesday, October 22, 2019 11:36 AM > To: Hayes Wang > Cc: net...@vger.kernel.org; nic_swsd; linux-kernel@vger.kernel.org; > pmal...@chromium.org; grund...@chromium.org > Subject: Re: [PATCH net-next 4/4] r8152: support fir

[PATCH net-next 1/4] r8152: rename fw_type_1 with fw_mac

2019-10-20 Thread Hayes Wang
The struct fw_type_1 is used by MAC only, so rename it to a meaningful one. Besides, adjust two messages. Replace "load xxx fail" with "check xxx fail" Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 82 - 1 file changed,

[PATCH net-next 0/4] r8152: PHY firmware

2019-10-20 Thread Hayes Wang
Support loading the firmware of the PHY with the type of RTL_FW_PHY_NC. Hayes Wang (4): r8152: rename fw_type_1 with fw_mac r8152: add checking fw_offset field of struct fw_mac r8152: move r8153_patch_request forward r8152: support firmware of PHY NC for RTL8153A drivers/net/usb/r8152.c

[PATCH net-next 3/4] r8152: move r8153_patch_request forward

2019-10-20 Thread Hayes Wang
Move r8153_patch_request() forward for later patch. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 54 - 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 090ddd5fb973

[PATCH net-next 4/4] r8152: support firmware of PHY NC for RTL8153A

2019-10-20 Thread Hayes Wang
are used to lock/unlock the PHY, and set/clear the patch key from the firmware file. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 284 +++- 1 file changed, 282 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c

[PATCH net-next 2/4] r8152: add checking fw_offset field of struct fw_mac

2019-10-20 Thread Hayes Wang
Make sure @fw_offset field of struct fw_mac is more than the size of struct fw_mac. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 55a7674a0c06

[PATCH net-next] r8152: support request_firmware for RTL8153

2019-10-15 Thread Hayes Wang
compatible or hardware issues. For example, the device couldn't be found after rebooting several times. The supported chips are RTL_VER_04 (rtl8153a-2.fw) RTL_VER_05 (rtl8153a-3.fw) RTL_VER_06 (rtl8153a-4.fw) RTL_VER_09 (rtl8153b-2.fw) Signed-off-by: Hayes Wang

[PATCH net-next v2] r8152: adjust the settings of ups flags

2019-09-04 Thread Hayes Wang
the feature of UPS. Then, some functions could be combined. Signed-off-by: Hayes Wang --- v2: Fix the conflicts after commit 771efeda3936 ("r8152: modify rtl8152_set_speed function") is applied. --- drivers/net/usb/r8152.c | 208 +++- 1 file changed, 120

[PATCH net-next] r8152: adjust the settings of ups flags

2019-09-04 Thread Hayes Wang
the feature of UPS. Then, some functions could be combined. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 215 +++- 1 file changed, 125 insertions(+), 90 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 778d27d1fb15

RE: [PATCH net-next] r8152: modify rtl8152_set_speed function

2019-09-03 Thread Hayes Wang
Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Tuesday, September 03, 2019 3:13 PM [...] > > Some of our chips support the feature of UPS. When satisfying certain > > condition, the hw would recover the settings of speed. Therefore, I have > > to record the settings of the speed, and set

RE: [PATCH net-next] r8152: modify rtl8152_set_speed function

2019-09-03 Thread Hayes Wang
Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Tuesday, September 03, 2019 2:45 PM [...] > > Besides, I have a question. I think I don't need rtl8152_set_speed() > > if I implement phylib. However, I need to record some information > > according to the settings of speed. For now, I do it in

RE: [PATCH net-next] r8152: modify rtl8152_set_speed function

2019-09-03 Thread Hayes Wang
Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Tuesday, September 03, 2019 2:14 PM [...] > >> Seeing all this code it might be a good idea to switch this driver > >> to phylib, similar to what I did with r8169 some time ago. > > > > It is too complex to be completed for me at the moment. >

RE: [PATCH net-next] r8152: modify rtl8152_set_speed function

2019-09-02 Thread Hayes Wang
Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Tuesday, September 03, 2019 2:37 AM [...] > Seeing all this code it might be a good idea to switch this driver > to phylib, similar to what I did with r8169 some time ago. It is too complex to be completed for me at the moment. If this patch

[PATCH net-next] r8152: modify rtl8152_set_speed function

2019-09-02 Thread Hayes Wang
First, for AUTONEG_DISABLE, we only need to modify MII_BMCR. Second, add advertising parameter for rtl8152_set_speed(). Add RTL_ADVERTISED_xxx for advertising parameter of rtl8152_set_speed(). Then, the advertising settings from ethtool could be saved. Signed-off-by: Hayes Wang --- drivers/net

RE: [PATCH net-next] r8152: fix accessing skb after napi_gro_receive

2019-09-01 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Friday, August 30, 2019 12:32 AM > To: Hayes Wang; net...@vger.kernel.org > Cc: nic_swsd; linux-kernel@vger.kernel.org > Subject: Re: [PATCH net-next] r8152: fix accessing skb after napi_gro_receive > > On 8/19/19 5:15 AM

RE: [PATCH net v4 0/2] r8152: fix side effect

2019-08-28 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Thursday, August 29, 2019 7:18 AM [...] > > v4: > > Add Fixes tag for both patch #1 and #2. > > I applied v3, sorry. > > I think it is OK as I will backport things to v5.2 -stable anyways. Thanks. Best Regards, Hayes

[PATCH net v4 1/2] Revert "r8152: napi hangup fix after disconnect"

2019-08-28 Thread Hayes Wang
ngup fix after disconnect"), first. And submit another patch to fix it. Fixes: ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/n

[PATCH net v4 2/2] r8152: remove calling netif_napi_del

2019-08-28 Thread Hayes Wang
Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Fixes: ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2 -- 1 file changed, 2 deletions(-)

[PATCH net v4 0/2] r8152: fix side effect

2019-08-28 Thread Hayes Wang
if_napi_del. However, the commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") let the check useless. Therefore, I revert commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect") first, and add another patch to fix it. Hayes Wang (2): Revert

[PATCH net v3 2/2] r8152: remove calling netif_napi_del

2019-08-27 Thread Hayes Wang
Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ad3abe26b51b..04137ac373b0

[PATCH net v3 1/2] Revert "r8152: napi hangup fix after disconnect"

2019-08-27 Thread Hayes Wang
ngup fix after disconnect"), first. And submit another patch to fix it. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index eee0f5007ee3..ad3abe26b51b 100644 --- a

[PATCH net v3 0/2] r8152: fix side effect

2019-08-27 Thread Hayes Wang
ec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection") let the check useless. Therefore, I revert commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect") first, and add another patch to fix it. Hayes Wang (2): Revert "r8152: napi hangup fix after disco

RE: [PATCH net v2 1/2] Revert "r8152: napi hangup fix after disconnect"

2019-08-26 Thread Hayes Wang
Jiri Slaby [mailto:jsl...@suse.cz] > Sent: Monday, August 26, 2019 4:55 PM [...] > Could you clarify *why* it conflicts? And how is the problem fixed by > 0ee1f473496 avoided now? In rtl8152_disconnect(), the flow would be as following. static void rtl8152_disconnect(struct usb_interface *intf)

[PATCH net v2 1/2] Revert "r8152: napi hangup fix after disconnect"

2019-08-26 Thread Hayes Wang
This reverts commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5. This conflicts with commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection"). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH net v2 2/2] r8152: remove calling netif_napi_del

2019-08-26 Thread Hayes Wang
Remove unnecessary use of netif_napi_del. This also avoids to call napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ad3abe26b51b..04137ac373b0

[PATCH net v2 0/2] r8152: fix side effect

2019-08-26 Thread Hayes Wang
real disconnection") let the check useless. Therefore, I revert commit 0ee1f4734967 ("r8152: napi hangup fix after disconnect") first, and add another patch to fix it. Hayes Wang (2): Revert "r8152: napi hangup fix after disconnect" r8152: remove calling netif_napi_del

RE: [PATCH net-next v4 0/2] r8152: save EEE

2019-08-25 Thread Hayes Wang
Andrew Lunn [mailto:and...@lunn.ch] > Sent: Friday, August 23, 2019 10:37 PM [...] > Hi Hayes > > That was 3 revisions of the patches in less than 30 minutes. Slow > down, take your time, review your work yourself before posting it, > etc. > > Aim for no more than one revision, posted to the

[PATCH net 1/2] Revert "r8152: napi hangup fix after disconnect"

2019-08-23 Thread Hayes Wang
This reverts commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5. This conflicts with commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG only for real disconnection"). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH net 0/2] r8152: fix side effect

2019-08-23 Thread Hayes Wang
734967 ("r8152: napi hangup fix after disconnect") first, and add another patch to fix it. Hayes Wang (2): Revert "r8152: napi hangup fix after disconnect" r8152: avoid using napi_disable after netif_napi_del. drivers/net/usb/r8152.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.21.0

[PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del.

2019-08-23 Thread Hayes Wang
Exchange netif_napi_del() and unregister_netdev() in rtl8152_disconnect() to avoid using napi_disable() after netif_napi_del(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net-next v4 2/2] r8152: add a helper function about setting EEE

2019-08-23 Thread Hayes Wang
Add a helper function "rtl_eee_enable" for setting EEE. Besides, I move r8153_eee_en() and r8153b_eee_en(). And, I remove r8152b_enable_eee(), r8153_set_eee(), and r8153b_set_eee(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 168 ++

[PATCH net-next v4 0/2] r8152: save EEE

2019-08-23 Thread Hayes Wang
necessary to enable EEE. Add the patch #2 for the helper function. v1: Saving the settings of EEE to avoid they become the default settings after reset_resume(). Hayes Wang (2): r8152: saving the settings of EEE r8152: add a helper function about setting EEE drivers/net/usb/r81

[PATCH net-next v4 1/2] r8152: saving the settings of EEE

2019-08-23 Thread Hayes Wang
Saving the settings of EEE to avoid they become the default settings after reset_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 80 + 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next v3 2/2] r8152: add a helper function about setting EEE

2019-08-23 Thread Hayes Wang
Add a helper funtion "rtl_eee_enable" for setting EEE. Besides, I move r8153_eee_en() and r8153b_eee_en(). And, I remove r8152b_enable_eee(), r8153_set_eee(), and r8153b_set_eee(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 166 +++---

[PATCH net-next v3 1/2] r8152: saving the settings of EEE

2019-08-23 Thread Hayes Wang
Saving the settings of EEE to avoid they become the default settings after reset_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 80 + 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next v3 0/2] r8152: save EEE

2019-08-23 Thread Hayes Wang
of EEE to avoid they become the default settings after reset_resume(). Hayes Wang (2): r8152: saving the settings of EEE r8152: add a helper function about setting EEE drivers/net/usb/r8152.c | 182 +--- 1 file changed, 95 insertions(+), 87 deletions

[PATCH net-next v2 2/2] r8152: add a helper function about setting EEE

2019-08-23 Thread Hayes Wang
Add a helper funtcion "rtl_eee_enable" for setting EEE. Besides, I move r8153_eee_en() and r8153b_eee_en(). And, I remove r8152b_enable_eee(), r8153_set_eee(), and r8153b_set_eee(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 166 +++---

[PATCH net-next v2 1/2] r8152: saving the settings of EEE

2019-08-23 Thread Hayes Wang
Saving the settings of EEE to avoid they become the default settings after reset_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 80 + 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next v2 0/2] Save EEE

2019-08-23 Thread Hayes Wang
(). Hayes Wang (2): r8152: saving the settings of EEE r8152: add a helper function about setting EEE drivers/net/usb/r8152.c | 182 +--- 1 file changed, 95 insertions(+), 87 deletions(-) -- 2.21.0

[PATCH net-next] r8152: saving the settings of EEE

2019-08-22 Thread Hayes Wang
Saving the settings of EEE to avoid they become the default settings after reset_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 86 +++-- 1 file changed, 56 insertions(+), 30 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next v2] r8152: divide the tx and rx bottom functions

2019-08-19 Thread Hayes Wang
33/933. Signed-off-by: Hayes Wang --- v2: add the performance number in the commit message. --- drivers/net/usb/r8152.c | 39 ++- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 40d18e

[PATCH net-next] r8152: fix accessing skb after napi_gro_receive

2019-08-18 Thread Hayes Wang
Fix accessing skb after napi_gro_receive which is caused by commit 47922fcde536 ("r8152: support skb_add_rx_frag"). Fixes: 47922fcde536 ("r8152: support skb_add_rx_frag") Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 del

RE: [PATCH net-next] r8152: divide the tx and rx bottom functions

2019-08-16 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Friday, August 16, 2019 5:27 PM [...] > Maybe you would avoid messing with a tasklet (we really try to get rid > of tasklets in general) using two NAPI, one for TX, one for RX. > > Some drivers already use two NAPI, it is fine. > > This might

RE: [PATCH net-next] r8152: divide the tx and rx bottom functions

2019-08-16 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Friday, August 16, 2019 4:20 PM [...] > Which callback ? The USB device has two endpoints for Tx and Rx. If I submit tx or rx URB to the USB host controller, the relative callback functions would be called, when they are finished. For rx, it is

RE: [PATCH net-next] r8152: divide the tx and rx bottom functions

2019-08-16 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Friday, August 16, 2019 2:40 PM [...] > tasklet and NAPI are scheduled on the same core (the current > cpu calling napi_schedule() or tasklet_schedule()) > > I would rather not add this dubious tasklet, and instead try to understand > what is

RE: [PATCH net-next] r8152: divide the tx and rx bottom functions

2019-08-15 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Friday, August 16, 2019 4:59 AM [...] > Theoretically, yes. > > But do you have actual performance numbers showing this to be worth > the change? > > Always provide performance numbers with changes that are supposed to > improve performance. On

[PATCH net-next] r8152: divide the tx and rx bottom functions

2019-08-14 Thread Hayes Wang
Move the tx bottom function from NAPI to a new tasklet. Then, for multi-cores, the bottom functions of tx and rx may be run at same time with different cores. This is used to improve performance. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 39

[PATCH net] r8152: set RTL8152_UNPLUG only for real disconnection

2019-07-04 Thread Hayes Wang
at incorrect state. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e887ac86fbef..39e0768d734d 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers

[PATCH net] r8152: move calling r8153b_rx_agg_chg_indicate()

2019-07-03 Thread Hayes Wang
to let the setting work. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 101d1325f3f1..e887ac86fbef 100644 --- a/drivers/net/usb

[PATCH net] r8152: fix the setting of detecting the linking change for runtime suspend

2019-07-01 Thread Hayes Wang
1. Rename r8153b_queue_wake() to r8153_queue_wake(). 2. Correct the setting. The enable bit should be 0xd38c bit 0. Besides, the 0xd38a bit 0 and 0xd398 bit 8 have to be cleared for both enabled and disabled. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 38

RE: skb_to_sgvec() causes sg_pcopy_to_buffer() wrong

2019-06-21 Thread Hayes Wang
> Use skb_to_sgvec() to set scatter list, and sometime we would get a > sg->offset which is more than PAGE_SIZE. Call sg_pcopy_to_buffer() > with this scatter list would get wrong data. > > In sg_miter_get_next_page(), you would get wrong miter->__remaining, > when the sg->offset is more than

skb_to_sgvec() casuses sg_pcopy_to_buffer() wrong

2019-06-20 Thread Hayes Wang
Use skb_to_sgvec() to set scatter list, and sometime we would get a sg->offset which is more than PAGE_SIZE. Call sg_pcopy_to_buffer() with this scatter list would get wrong data. In sg_miter_get_next_page(), you would get wrong miter->__remaining, when the sg->offset is more than PAGE_SIZE.

RE: r8152: data corruption in various scenarios

2019-01-06 Thread Hayes Wang
Monday, January 07, 2019 5:17 AM [...] >> This is probably an xHC bug. A similar issue is fixed by commit 9da5a1092b13 >> ("xhci: Bad Ethernet performance plugged in ASM1042A host”). >> >>> I just got that exact message above, with the r8152 in my 1-day old WD15 >>> dock, >>> with the TB16

[PATCH net 0/2] r8152: fix rx issues

2018-02-02 Thread Hayes Wang
The two patched are used to fix rx issues. Hayes Wang (2): r8152: fix wrong checksum status for received IPv4 packets r8152: set rx mode early when linking on drivers/net/usb/r8152.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.13.6

[PATCH net 0/2] r8152: fix rx issues

2018-02-02 Thread Hayes Wang
The two patched are used to fix rx issues. Hayes Wang (2): r8152: fix wrong checksum status for received IPv4 packets r8152: set rx mode early when linking on drivers/net/usb/r8152.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.13.6

[PATCH net 2/2] r8152: set rx mode early when linking on

2018-02-02 Thread Hayes Wang
. Then, the packets of response would be missed. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 756de9ea8d2e..958b2e8b90f6 100644 --- a/d

[PATCH net 1/2] r8152: fix wrong checksum status for received IPv4 packets

2018-02-02 Thread Hayes Wang
-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0657203ffb91..756de9ea8d2e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r

[PATCH net 2/2] r8152: set rx mode early when linking on

2018-02-02 Thread Hayes Wang
. Then, the packets of response would be missed. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 756de9ea8d2e..958b2e8b90f6 100644 --- a/drivers/net/usb/r8152.c +++ b

[PATCH net 1/2] r8152: fix wrong checksum status for received IPv4 packets

2018-02-02 Thread Hayes Wang
-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0657203ffb91..756de9ea8d2e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1848,11 +1848,9

RE: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-17 Thread Hayes Wang
[...] > > r8153 on Dell TB15/16 dock corrupts rx packets. > > > > This change is suggested by Realtek. They guess that the XHCI > > controller doesn't have enough buffer, and their guesswork is correct, > > once the RX aggregation gets disabled, the issue is gone. > > > > ASMedia is currently

RE: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-17 Thread Hayes Wang
[...] > > r8153 on Dell TB15/16 dock corrupts rx packets. > > > > This change is suggested by Realtek. They guess that the XHCI > > controller doesn't have enough buffer, and their guesswork is correct, > > once the RX aggregation gets disabled, the issue is gone. > > > > ASMedia is currently

[PATCH net-next] r8152: correct the definition

2017-06-20 Thread Hayes Wang
Replace VLAN_HLEN and CRC_SIZE with ETH_FCS_LEN. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8bc4573..6

  1   2   3   4   5   6   7   8   9   10   >