[PATCH linux-firmware] rtl_nic: add new firmware for RTL8153 and RTL8156 series

2021-04-20 Thread Hayes Wang
1. rtl8153c-1 v1 03/31/21. 2. rtl8156a-2 v1 04/15/21. 3. rtl8156b-2 v1 04/15/21. Signed-off-by: Hayes Wang --- WHENCE| 3 +++ rtl_nic/rtl8153c-1.fw | Bin 0 -> 816 bytes rtl_nic/rtl8156a-2.fw | Bin 0 -> 3816 bytes rtl_nic/rtl8156b-2.fw | Bin 0 -> 5448 bytes 4 file

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 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 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 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 1/6] r8152: set inter fram gap time depending on speed

2021-04-16 Thread Hayes Wang
ation 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/r8

[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 the

[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. Bes

[PATCH net] r8152: move r8153_mac_clk_spd

2021-02-19 Thread Hayes Wang
: 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 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/dr

[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 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..4bfee28

[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 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

[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; 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

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

2021-01-18 Thread Hayes Wang
k connection: > 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 jus

[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

RE: [PATCH net-next 3/5] r8152: add MCU typed read/write functions

2020-11-05 Thread Hayes Wang
Marek Behún > Sent: Friday, November 6, 2020 2:40 PM [...] > Hi Hayes, > > just to be clear: > Are you against defining these functions via macros? > If so, I can simply rewrite this so that it does not use macros... I would like the way which let me find the source of the function easily. I don

RE: [PATCH net-next 3/5] r8152: add MCU typed read/write functions

2020-11-05 Thread Hayes Wang
Vladimir Oltean > Sent: Thursday, November 5, 2020 6:57 PM > On Thu, Nov 05, 2020 at 10:54:18AM +0100, Marek Behún wrote: > > I thought that static inline functions are preferred to macros, since > > compiler warns better if they are used incorrectly... > > Citation needed. Also, how do static in

RE: [PATCH net-next 1/5] r8152: use generic USB macros to define product table

2020-11-03 Thread Hayes Wang
Marek Behún > Sent: Wednesday, November 4, 2020 2:03 PM [...] > BTW Hayes, is it possible for me gaining access to Realtek > documentation for these chips under NDA? For example via my employer, > CZ.NIC? I can't find any such information on Realtek website. I have to ask my boss. Maybe I reply

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

2020-11-03 Thread Hayes Wang
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 1/5] r8152: use generic USB macros to define product table

2020-11-03 Thread Hayes Wang
Marek Behún > Sent: Wednesday, November 4, 2020 3:22 AM > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index b1770489aca5..85dda591c838 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c > @@ -6862,20 +6862,12 @@ static void rtl8152_disconnect(struct > usb_i

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 n

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
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 22/30] net: usb: r8152: Provide missing documentation for some struct members

2020-11-02 Thread Hayes Wang
> 'mode_pre' not described in 'fw_phy_nc' > drivers/net/usb/r8152.c:986: warning: Function parameter or member > 'mode_post' not described in 'fw_phy_nc' > drivers/net/usb/r8152.c:986: warning: Function parameter or member > 'reserved'

RE: [PATCH 27/30] net: usb: r8152: Fix a couple of spelling errors in fw_phy_nc's docs

2020-11-02 Thread Hayes Wang
warning: Function parameter or member > 'mode_post' not described in 'fw_phy_nc' > > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: Hayes Wang > Cc: nic maintainers > Cc: linux-...@vger.kernel.org > Cc: netdev@vger.kernel.org > Signed-off-by: Lee Jones Acked-by: Hayes Wang

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 r81

[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

[PATCH firmware] rtl_nic: add firmware files for RTL8153

2019-10-22 Thread Hayes Wang
This adds the firmware for Realtek RTL8153 Based USB Ethernet Adapters. 1. Fix compatible issue for Asmedia hub. 2. Fix compatible issue for Compal platform. 3. Fix sometimes the device is lost after rebooting. 4. Improve the compatibility for EEE. Signed-off-by: Hayes Wang --- WHENCE

RE: [PATCH net-next] r8152: Add identifier names for function pointers

2019-10-02 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Thursday, October 03, 2019 5:10 AM > To: Hayes Wang > Cc: grund...@chromium.org; netdev@vger.kernel.org; nic_swsd; Prashant > Malani > Subject: [PATCH net-next] r8152: Add identifier names for function pointers > > Check

RE: [PATCH net-next] r8152: Factor out OOB link list waits

2019-10-01 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Tuesday, October 01, 2019 4:36 PM > To: Hayes Wang > Cc: grund...@chromium.org; netdev@vger.kernel.org; nic_swsd; Prashant > Malani > Subject: [PATCH net-next] r8152: Factor out OOB link list waits > > The same f

RE: [PATCH v2] r8152: Use guard clause and fix comment typos

2019-09-24 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Tuesday, September 24, 2019 12:01 PM > To: Hayes Wang > Cc: grund...@chromium.org; netdev@vger.kernel.org; nic_swsd; Prashant > Malani > Subject: [PATCH v2] r8152: Use guard clause and fix comment typos > > Use a guard cla

RE: [PATCH] r8152: Use guard clause and fix comment typos

2019-09-23 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Tuesday, September 24, 2019 6:27 AM > To: Hayes Wang [...] > - do { > + while (1) { > struct tx_agg *agg; > + struct net_device *netdev = tp->netdev; > > if (sk

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

2019-09-04 Thread Hayes Wang
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

RE: Proposal: r8152 firmware patching framework

2019-09-01 Thread Hayes Wang
Prashant Malani > > > > (Adding a few more Realtek folks) > > > > Friendly ping. Any thoughts / feedback, Realtek folks (and others) ? > > > >> On Thu, Aug 29, 2019 at 11:40 AM Prashant Malani > wrote: > >> > >> Hi, > >> > >> The r8152 driver source code distributed by Realtek (on > >> www.realt

RE: [PATCH] r8152: Add rx_buf_sz field to struct r8152

2019-08-27 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Wednesday, August 28, 2019 2:02 AM > To: Hayes Wang; da...@davemloft.net > Cc: grund...@chromium.org; netdev@vger.kernel.org; nic_swsd; Prashant > Malani > Subject: [PATCH] r8152: Add rx_buf_sz field to struct r8152 > >

RE: [PATCH] r8152: Set memory to all 0xFFs on failed reg reads

2019-08-25 Thread Hayes Wang
to all > 0xFFs when usb_control_msg() fails. > > This patch is copied from the r8152 driver (v2.12.0) published by > Realtek (www.realtek.com). > > Signed-off-by: Prashant Malani > --- Acked-by: Hayes Wang Best Regards, Hayes

[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 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 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-next v4 0/2] r8152: save EEE

2019-08-23 Thread Hayes Wang
cessary 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 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 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
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 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 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 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 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

RE: [PATCH net-next] r8169: allocate rx buffers using alloc_pages_node

2019-08-07 Thread Hayes Wang
n avoid some overhead by using > alloc_pages_node directly instead of bothering kmalloc_node. Due to > this change buffers are page-aligned now, therefore the alignment check > can be removed. > > Signed-off-by: Heiner Kallweit Acked-by: Hayes Wang

RE: [PATCH net] r8152: fix typo in register name

2019-07-31 Thread Hayes Wang
> From: Kevin Lo [mailto:ke...@kevlo.org] > Sent: Thursday, August 01, 2019 11:30 AM > To: Hayes Wang > Cc: netdev@vger.kernel.org > Subject: [PATCH net] r8152: fix typo in register name > > It is likely that PAL_BDC_CR should be PLA_BDC_CR. > > Signed-off-by: Kevi

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 "worka

RE: Hangs in r8152 connected to power management in kernels at least up v4.17-rc4

2018-05-16 Thread Hayes Wang
Oliver Neukum [mailto:oneu...@suse.com] > Sent: Wednesday, May 16, 2018 6:10 PM [...] > > Besides, I find a similar issue as following. > > https://www.spinics.net/lists/netdev/msg493512.html > > Well, if we have an imbalance in NAPI it should strike whereever > it is used, not just in suspend().

RE: Hangs in r8152 connected to power management in kernels at least up v4.17-rc4

2018-05-16 Thread Hayes Wang
Oliver Neukum [mailto:oneu...@suse.com] > Sent: Wednesday, May 16, 2018 4:27 PM [...] > > > > Would usb_autopm_get_interface() take a long time? > > The driver would wake the device if it has suspended. > > I have no idea about how usb_autopm_get_interface() works, so I don't know > how to help. >

RE: Hangs in r8152 connected to power management in kernels at least up v4.17-rc4

2018-05-15 Thread Hayes Wang
Oliver Neukum [mailto:oneu...@suse.com] > > Hi, > > I got reports about hangs with this trace: > > May 13 01:36:55 neroon kernel: INFO: task kworker/0:0:4 blocked for more > than 60 seconds. > May 13 01:36:55 neroon kernel: Tainted: G U > 4.17.0-rc4-1.g8257a00-vanilla #1 > May 13 01:36

[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 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

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

2018-02-02 Thread Hayes Wang
, 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

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 worki

RE: [PATCH net-next 3/3] r8169: improve runtime pm in general and suspend unused ports

2018-01-09 Thread Hayes Wang
> Heiner Kallweit [mailto:hkallwe...@gmail.com] > > Sent: Tuesday, January 09, 2018 4:39 AM > [...] > > - Change rtl8169_runtime_suspend to power down the chip if the > > interface is down. > > The original driver has done it. I don't think you have to do it again in > rtl8169_runtime_suspend().

RE: [PATCH net-next 3/3] r8169: improve runtime pm in general and suspend unused ports

2018-01-09 Thread Hayes Wang
Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Tuesday, January 09, 2018 4:39 AM [...] > - Change rtl8169_runtime_suspend to power down the chip if the > interface is down. The original driver has done it. I don't think you have to do it again in rtl8169_runtime_suspend(). [...] > -

[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 --- 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..6cfffef 100644 --- a/drivers/net

RE: [PATCH net-next v2 0/2] r8152: adjust runtime suspend/resume

2017-06-15 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Wednesday, June 14, 2017 1:02 AM > > v2: > > For #1, replace GFP_KERNEL with GFP_NOIO for usb_submit_urb(). > > > > v1: > > Improve the flow about runtime suspend/resume and make the code > > easy to read. > > Series applied. Excuse me. I don't se

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

2017-06-14 Thread Hayes Wang
These patches are used to support new chips. Hayes Wang (3): r8152: support new chip 8050 r8152: support RTL8153B r8152: add byte_enable for ocp_read_word function drivers/net/usb/r8152.c | 687 ++-- 1 file changed, 671 insertions(+), 16

[PATCH net-next 1/3] r8152: support new chip 8050

2017-06-14 Thread Hayes Wang
The settings of the new chip are the same with RTL8152, except that its product ID is 0x8050. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 5a02053..2744405 100644

[PATCH net-next 3/3] r8152: add byte_enable for ocp_read_word function

2017-06-14 Thread Hayes Wang
eading the PHY registers. The new method is supported since RTL8153B, but it doesn't influence the previous chips. The bits of the byte_enable for the previous chips are the reserved bits, and the hw would ignore them. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 4 +++- 1

[PATCH net-next 2/3] r8152: support RTL8153B

2017-06-14 Thread Hayes Wang
This patch supports two new chips for RTL8153B. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 673 ++-- 1 file changed, 658 insertions(+), 15 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2744405..4c197da

[PATCH net-next v2 0/2] r8152: adjust runtime suspend/resume

2017-06-13 Thread Hayes Wang
v2: For #1, replace GFP_KERNEL with GFP_NOIO for usb_submit_urb(). v1: Improve the flow about runtime suspend/resume and make the code easy to read. Hayes Wang (2): r8152: split rtl8152_resume function r8152: move calling delay_autosuspend function drivers/net/usb/r8152.c | 107

[PATCH net-next v2 1/2] r8152: split rtl8152_resume function

2017-06-13 Thread Hayes Wang
Split rtl8152_resume() into rtl8152_runtime_resume() and rtl8152_system_resume(). Besides, replace GFP_KERNEL with GFP_NOIO for usb_submit_urb(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 99 ++--- 1 file changed, 61 insertions(+), 38

[PATCH net-next v2 2/2] r8152: move calling delay_autosuspend function

2017-06-13 Thread Hayes Wang
miss it. Besides, to avoid the runtime resume occurs after runtime suspend immediately, move the checking to the end of rtl8152_runtime_suspend(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/usb

RE: [PATCH net-next 1/2] r8152: split rtl8152_resume function

2017-06-12 Thread Hayes Wang
Oliver Neukum [mailto:oneu...@suse.com] > Sent: Monday, June 12, 2017 8:33 PM [...] > > +   usb_submit_urb(tp->intr_urb, GFP_KERNEL); > > If you ever built a device with included storage, this can deadlock, > as you may want to wake up a device for memory that is needed to wake > up a

[PATCH net-next 0/2] r8152: adjust runtime suspend/resume

2017-06-12 Thread Hayes Wang
Improve the flow about runtime suspend/resume and make the code easy to read. Hayes Wang (2): r8152: split rtl8152_resume function r8152: move calling delay_autosuspend function drivers/net/usb/r8152.c | 107 1 file changed, 62 insertions

[PATCH net-next 1/2] r8152: split rtl8152_resume function

2017-06-12 Thread Hayes Wang
Split rtl8152_resume() into rtl8152_runtime_resume() and rtl8152_system_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 99 ++--- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next 2/2] r8152: move calling delay_autosuspend function

2017-06-12 Thread Hayes Wang
miss it. Besides, to avoid the runtime resume occurs after runtime suspend immediately, move the checking to the end of rtl8152_runtime_suspend(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/usb

[PATCH net-next 00/11] r8152: minor adjustment

2017-06-09 Thread Hayes Wang
Adjust some code to make it reasonable or satisfy the suggestion from the engineers. Hayes Wang (11): r8152: add r8153_phy_status function r8152: adjust lpm settings for RTL8153 r8152: adjust the settings about MAC clock speed down for RTL8153 r8152: move the setting of rx aggregation

[PATCH net-next 02/11] r8152: adjust lpm settings for RTL8153

2017-06-09 Thread Hayes Wang
Enable lpm after r8153_init() and remove other enable/disable lpm. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 9239dfb..b8c904f 100644 --- a/drivers/net/usb

[PATCH net-next 01/11] r8152: add r8153_phy_status function

2017-06-09 Thread Hayes Wang
Use r8153_phy_status() to check phy status of RTL8153. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index fd31fab..9239dfb

[PATCH net-next 03/11] r8152: adjust the settings about MAC clock speed down for RTL8153

2017-06-09 Thread Hayes Wang
The MAC clock speed down could be enabled if the U1/U2 is disabled. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index b8c904f

[PATCH net-next 04/11] r8152: move the setting of rx aggregation

2017-06-09 Thread Hayes Wang
Move the setting from r8153_first_init() to r8153_init(). It only needs to be set once. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 9a794db..e569c48

[PATCH net-next 06/11] r8152: adjust U2P3 for RTL8153

2017-06-09 Thread Hayes Wang
Use another way to keep disabling the U2P3 for both RTL_VER_03 and RTL_VER_04. Move enabling U2P3 from r8153_init() to r8153_hw_phy_cfg(). The engineer ask the setting should be done after PHY settings. Disable U2P3 first in rtl8153_up(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c

[PATCH net-next 05/11] r8152: adjust rtl8153_runtime_enable function

2017-06-09 Thread Hayes Wang
Adjust the order of rtl8153_runtime_enable() according to the suggestion from the engineer. 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 e569c48..32e83fd

[PATCH net-next 07/11] r8152: move the default coalesce setting for RTL8153

2017-06-09 Thread Hayes Wang
Only RTL8153 could set coalesce, so move the default setting for rtl8152_probe() to r8153_init(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net-next 08/11] r8152: move the initialization to reset_resume function

2017-06-09 Thread Hayes Wang
Move tp->rtl_ops.init() from rtl8152_resume() to rtl8152_reset_resume(). The initialization is only necessary for reset_resume(). Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/r8152.c b/driv

[PATCH net-next 09/11] r8152: check if disabling ALDPS is finished

2017-06-09 Thread Hayes Wang
Use PLA 0xe000 bit 8 to check if disabling ALDPS is finished. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index f43b7a8..204f4b2 100644 --- a/drivers/net/usb

[PATCH net-next 10/11] r8152: avoid rx queue more than 1000 packets

2017-06-09 Thread Hayes Wang
Stop queuing rx packets if it is more than 1000. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 204f4b2..fa29583 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb

  1   2   3   >