[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 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 -- To unsubscribe from

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: drivers/net/usb/r8152.c USB net driver outdated

2017-12-01 Thread Hayes Wang
Cameron Seader [mailto:csea...@suse.com] > Sent: Thursday, November 30, 2017 11:40 PM [...] > I have experienced with kernel 4.14 and the driver 1.09.9 that when a > system goes into sleep mode and then comes out of sleep that the network > interface gets set to speed 100 in half duplex. I then

RE: drivers/net/usb/r8152.c USB net driver outdated

2017-11-29 Thread Hayes Wang
Cameron Seader [mailto:csea...@suse.com] > Sent: Wednesday, November 29, 2017 10:51 AM [...] > The upstream kernel seems to be outdated with version 1.09.9 of the > drivers/net/usb/r8152.c driver. There is newer hardware now which > requires the newer version where running with the old one becomes

[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

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

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

2017-06-15 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-15 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 <hayesw...@realtek.com> --- 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

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

2017-06-15 Thread Hayes Wang
en reading 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 <hayesw...@realtek.com> --- drivers/net

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

2017-06-15 Thread Hayes Wang
This patch supports two new chips for RTL8153B. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- 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/r

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 99 ++--- 1 file c

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-)

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 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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-)

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 99 ++--- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/drivers/n

[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 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 <hayesw...@realtek.com> --- 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

[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 <hayesw...@realtek.com> --- 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

[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 <hayesw...@realtek.com> --- 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/r

[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 <hayesw...@realtek.

[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 <hayesw...@realtek.com> --- 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/r

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/r

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dr

[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 <hayesw...@realtek.com> --- 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

[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 <hayesw...@realtek.com> --- 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/r

[PATCH net-next 11/11] r8152: replace napi_complete with napi_complete_done

2017-06-09 Thread Hayes Wang
Change from using napi_complete to napi_complete_done to allow for the use of gro_flush_timeout in tuning network processing. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb

[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 <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/n

RE: [PATCH] Fix for new version of realtek r8153

2017-05-03 Thread Hayes Wang
jake Briggs [mailto:nexus...@gmail.com] > Sent: Wednesday, May 03, 2017 7:21 AM [...] > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index 07f788c49d57..2a55459fdfac 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c > @@ -4277,6 +4277,7 @@ static void

[PATCH net] r8152: prevent the driver from transmitting packets with carrier off

2017-03-23 Thread Hayes Wang
similar case is 1. unplug the cable. 2. interrupt transfer queue a work_queue for linking change. 3. device enters the ALDPS mode. 4. a tx occurs before the work_queue is called. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 18 --

[PATCH net 0/2] r8152: fix the rx settings of RTL8153

2017-03-20 Thread Hayes Wang
The RMS and the rx early size should base on the same rx size. However, the RMS is set to 9K bytes now and the rx early depends on mtu. For using the rx buffer effectively, sync the two settings according to the mtu. Hayes Wang (2): r8152: set the RMS of RTL8153 according to the mtu r8152

[PATCH net 1/2] r8152: set the RMS of RTL8153 according to the mtu

2017-03-20 Thread Hayes Wang
Set the received maximum size (RMS) according to the mtu size. It is unnecessary to receive a packet which is more than the size we could transmit. Besides, this could let the rx buffer be used effectively. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.

[PATCH net 2/2] r8152: fix the rx early size of RTL8153

2017-03-20 Thread Hayes Wang
revert commit a59e6d815226 ("r8152: correct the rx early size") and fix the rx early size as (rx buffer size - rx packet size - rx desc size - alignment) / 4 Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 7 --- 1 file changed, 4

RE: [PATCH net-next] r8152: simply the arguments

2017-03-16 Thread Hayes Wang
David Laight [mailto:david.lai...@aculab.com] > Sent: Thursday, March 16, 2017 10:28 PM [...] > If you are really lucky the compiler will optimise it away. > Otherwise it will generate another local variable and possibly > a register spill to stack. However, I could reduce the time for

[PATCH net-next] r8152: check hw version first

2017-03-16 Thread Hayes Wang
Check hw version first in probe(). Do nothing if the driver doesn't support the chip. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 102 ++-- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/drive

[PATCH v2 net-next] r8152: simply the arguments

2017-03-16 Thread Hayes Wang
Replace >napi with napi and tp->netdev with netdev. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 43 ++- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next] r8152: simply the arguments

2017-03-16 Thread Hayes Wang
Replace >napi with napi and tp->netdev with netdev. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 44 +++- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net] r8152: fix the list rx_done may be used without initialization

2017-03-14 Thread Hayes Wang
[r8152] PGD 0 Oops: 0002 [#1] SMP Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 986243c..bb3eedd 100644 --- a/drivers/net/usb/r8152.c +++ b/d

RE: [PATCH] net: usb: r8152: use new api ethtool_{get|set}_link_ksettings

2017-03-13 Thread Hayes Wang
> As I don't have the hardware, I'd be very pleased if > someone may test this patch. > > Signed-off-by: Philippe Reynes <trem...@gmail.com> > --- > drivers/net/usb/r8152.c | 21 - > 1 files changed, 12 insertions(+), 9 deletions(-)

RE: [PATCH net v3 0/4] r8152: fix scheduling napi

2017-01-25 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Thursday, January 26, 2017 11:48 AM [...] > Series applied. Thank you very much. I would try to find better way, too. Best Regards, Hayes -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to

RE: [PATCH net v2 0/4] r8152: fix scheduling napi

2017-01-25 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Thursday, January 26, 2017 3:31 AM [...] > I think the fundamental issue is that since you can't stop URBs from > queueing up, you cannot properly synchronize NAPI and schedule polling > properly. > > From my perspective what happened here is you

RE: NAPI on USB network drivers

2017-01-25 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Wednesday, January 25, 2017 10:13 PM [...] > You also could use napi_complete_done() instead of napi_complete(), as > it allows users to tune the performance vs latency for GRO. > > Looking at this driver, I do not see any limitation on the

[PATCH net v3 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend

2017-01-25 Thread Hayes Wang
Adjust the setting of the flag of SELECTIVE_SUSPEND to prevent start_xmit() from calling napi_schedule() directly during runtime suspend. After calling napi_disable() or clearing the flag of WORK_ENABLE, scheduling the napi is useless. Signed-off-by: Hayes Wang <hayesw...@realtek.

[PATCH net v3 3/4] r8152: re-schedule napi for tx

2017-01-25 Thread Hayes Wang
Re-schedule napi after napi_complete() for tx, if it is necessay. In r8152_poll(), if the tx is completed after tx_bottom() and before napi_complete(), the scheduling of napi would be lost. Then, no one handles the next tx until the next napi_schedule() is called. Signed-off-by: Hayes Wang

[PATCH net v3 4/4] r8152: check rx after napi is enabled

2017-01-25 Thread Hayes Wang
Schedule the napi after napi_enable() for rx, if it is necessary. If the rx is completed when napi is disabled, the sheduling of napi would be lost. Then, no one handles the rx packet until next napi is scheduled. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152

[PATCH net v3 0/4] r8152: fix scheduling napi

2017-01-25 Thread Hayes Wang
ule() during runtime suspend or after napi_disable(). 2. re-schedule the napi for tx if it is necessary. 3. check if any rx is finished or not after napi_enable(). Hayes Wang (4): r8152: avoid start_xmit to call napi_schedule during autosuspend r8152: avoid start_xmit to schedule napi when n

[PATCH net v3 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled

2017-01-25 Thread Hayes Wang
Stop the tx when the napi is disabled to prevent napi_schedule() is called. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2

RE: [PATCH net v2 3/4] r8152: re-schedule napi for tx

2017-01-25 Thread Hayes Wang
Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Wednesday, January 25, 2017 9:57 PM [...] > > napi_complete(napi); > > if (!list_empty(>rx_done)) > > napi_schedule(napi); > > + else if (!skb_queue_empty(>tx_queue) && > > +

RE: NAPI on USB network drivers

2017-01-25 Thread Hayes Wang
Oliver Neukum [mailto:oneu...@suse.com] > Sent: Wednesday, January 25, 2017 5:35 PM [...] > looking at r8152 I noticed that it uses NAPI. I never considered > this for the generic USB networking code as you cannot disable > interrupts for USB. Is it still worth it? What are the benefits? You

[PATCH net v2 0/4] r8152: fix scheduling napi

2017-01-25 Thread Hayes Wang
the napi for tx if it is necessary. 3. check if any rx is finished or not after napi_enable(). Hayes Wang (4): r8152: avoid start_xmit to call napi_schedule during autosuspend r8152: avoid start_xmit to schedule napi when napi is disabled r8152: re-schedule napi for tx r8152: check rx

[PATCH net v2 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled

2017-01-25 Thread Hayes Wang
Stop the tx when the napi is disabled to prevent napi_schedule() is called. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2

[PATCH net v2 4/4] r8152: check rx after napi is enabled

2017-01-25 Thread Hayes Wang
Schedule the napi after napi_enable() for rx, if it is necessary. If the rx is completed when napi is disabled, the sheduling of napi would be lost. Then, no one handles the rx packet until next napi is scheduled. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152

[PATCH net v2 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend

2017-01-25 Thread Hayes Wang
Adjust the setting of the flag of SELECTIVE_SUSPEND to prevent start_xmit() from calling napi_schedule() directly during runtime suspend. After calling napi_disable() or clearing the flag of WORK_ENABLE, scheduling the napi is useless. Signed-off-by: Hayes Wang <hayesw...@realtek.

[PATCH net v2 3/4] r8152: re-schedule napi for tx

2017-01-25 Thread Hayes Wang
Re-schedule napi after napi_complete() for tx, if it is necessay. In r8152_poll(), if the tx is completed after tx_bottom() and before napi_complete(), the scheduling of napi would be lost. Then, no one handles the next tx until the next napi_schedule() is called. Signed-off-by: Hayes Wang

[PATCH net-next] r8152: fix the wrong spelling

2017-01-24 Thread Hayes Wang
Replace rumtime with runtime. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- 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 f3b48ad..d59d773 100644 --- a/drivers/net/usb/r8152.c

[PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend

2017-01-24 Thread Hayes Wang
Adjust the setting of the flag of SELECTIVE_SUSPEND to prevent start_xmit() from calling napi_schedule() directly during runtime suspend. After calling napi_disable() or clearing the flag of WORK_ENABLE, scheduling the napi is useless. Signed-off-by: Hayes Wang <hayesw...@realtek.

[PATCH net 0/4] r8152: fix scheduling napi

2017-01-24 Thread Hayes Wang
if any rx is finished or not after napi_enable(). Hayes Wang (4): r8152: avoid start_xmit to call napi_schedule during autosuspend r8152: avoid start_xmit to schedule napi when napi is disabled r8152: re-schedule napi for tx r8152: check rx after napi is enabled drivers/net/usb/r8152.c | 26

[PATCH net 4/4] r8152: check rx after napi is enabled

2017-01-24 Thread Hayes Wang
Schedule the napi after napi_enable() for rx, if it is necessary. If the rx is completed when napi is disabled, the sheduling of napi would be lost. Then, no one handles the rx packet until next napi is scheduled. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152

[PATCH net 3/4] r8152: re-schedule napi for tx

2017-01-24 Thread Hayes Wang
Re-schedule napi after napi_complete() for tx, if it is necessay. In r8152_poll(), if the tx is completed after tx_bottom() and before napi_complete(), the scheduling of napi would be lost. Then, no one handles the next tx until the next napi_schedule() is called. Signed-off-by: Hayes Wang

[PATCH net 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled

2017-01-24 Thread Hayes Wang
Stop the tx when the napi is disabled to prevent napi_schedule() is called. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2

[PATCH net] r8152: don't execute runtime suspend if the tx is not empty

2017-01-22 Thread Hayes Wang
Runtime suspend shouldn't be executed if the tx queue is not empty, because the device is not idle. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net] r8152: fix rtl8152_post_reset function

2017-01-19 Thread Hayes Wang
The rtl8152_post_reset() should sumbit rx urb and interrupt transfer, otherwise the rx wouldn't work and the linking change couldn't be detected. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/n

RE: [PATCH net] r8152: fix the rx doesn't work

2017-01-19 Thread Hayes Wang
> Subject: [PATCH net] r8152: fix the rx doesn't work > > The rtl8152_post_reset() doesn't submit the rx urb, so the rx wouldn't work. > > Signed-off-by: Hayes Wang <hayesw...@realtek.com> Excuse me. Please ignore this patch. I would submit another one. -- To unsubscribe

[PATCH net] r8152: fix the rx doesn't work

2017-01-19 Thread Hayes Wang
The rtl8152_post_reset() doesn't submit the rx urb, so the rx wouldn't work. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index f3b48ad..e8f4f88

[PATCH net] r8152: fix the sw rx checksum is unavailable

2017-01-11 Thread Hayes Wang
Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index be41856..f3b48ad 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@

[PATCH net 0/2] r8152: fix autosuspend issue

2017-01-10 Thread Hayes Wang
Avoid rx is split into two parts when runtime suspend occurs. Hayes Wang (2): r8152: split rtl8152_suspend function r8152: fix rx issue for runtime suspend drivers/net/usb/r8152.c | 80 +++-- 1 file changed, 64 insertions(+), 16 deletions

[PATCH net 2/2] r8152: fix rx issue for runtime suspend

2017-01-10 Thread Hayes Wang
different urb buffers. That let the driver take the data as a rx descriptor, and unexpected behavior happens. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/d

[PATCH net 1/2] r8152: split rtl8152_suspend function

2017-01-10 Thread Hayes Wang
Split rtl8152_suspend() into rtl8152_system_suspend() and rtl8152_rumtime_suspend(). Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 57 ++--- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/drive

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2017-01-08 Thread Hayes Wang
Ansis Atteka [mailto:aatt...@nicira.com] > Sent: Tuesday, January 03, 2017 8:41 AM [...] > Hayes, in your iperf reproduction environment did you > 1) connect sender and receiver directly with an Ethernet cable? > 2) use iperf's TCP mode instead of UDP mode, because I believe that > with UDP mode

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-12-08 Thread Hayes Wang
Mark Lord I find an issue about autosuspend, and it may result in the same problem with you. I don't sure if this is helpful to you, because it only occurs when enabling the autosuspend. Best Regards, Hayes /* * Copyright (c) 2014 Realtek Semiconductor Corp. All rights

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-30 Thread Hayes Wang
Mark Lord [...] > > Not sure why, because there really is no other way for the data to > > appear where it does at the beginning of that URB buffer. > > > > This does seem a rather unexpected burden to place upon someone > > reporting a regression in a USB network driver that

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-25 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Friday, November 25, 2016 3:11 AM [...] > On 16-11-24 02:00 PM, Greg KH wrote: > > On Thu, Nov 24, 2016 at 01:34:08PM -0500, Mark Lord wrote: > >> One thought: bulk data streams are byte streams, not packets. > >> Scheduling on the USB bus can break up

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-24 Thread Hayes Wang
> Mark Lord [mailto:ml...@pobox.com] > > Sent: Friday, November 25, 2016 12:44 AM > [...] > > The bad data in this case is ASCII: > > > > "SRC=m3400:/ TARGET=/m340" > > > > This data is what is seen in /run/mount/utab, a file that is read/written > > over NFS > on > > each boot. > > > >

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-24 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Friday, November 25, 2016 12:44 AM [...] > The bad data in this case is ASCII: > > "SRC=m3400:/ TARGET=/m340" > > This data is what is seen in /run/mount/utab, a file that is read/written > over NFS on > each boot. > > "SRC=m3400:/

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-24 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Thursday, November 24, 2016 11:25 PM [...] > x86 has near fully-coherent memory, so it is the "easy" platform > to get things working on. But Linux supports a very diverse number > of platforms, with varying degrees of cache/memory coherency, > and it

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-24 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Thursday, November 24, 2016 8:31 PM [...] > Nope. Guard zones did not fix it, so it's probably not a prefetch issue. > Oddly, adding a couple of memory barriers to specific places in the driver > does help, A LOT. Still not 100%, but it did pass 1800

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-24 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Wednesday, November 23, 2016 9:41 PM [...] > >static void r8153_set_rx_early_size(struct r8152 *tp) > >{ > >u32 mtu = tp->netdev->mtu; > >u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4; > > > >ocp_write_word(tp,

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-23 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Thursday, November 24, 2016 3:30 AM [...] > Worth repeating: other dongles we have tried, eg. those using the asix driver, > do not cause us any troubles here. Only the r8152 dongles do. I couldn't tell you why you would see the problem. I have tested

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-23 Thread Hayes Wang
Mark Lord [ml...@pobox.com] [...] > What does this code do: > >static void r8153_set_rx_early_size(struct r8152 *tp) > >{ > >u32 mtu = tp->netdev->mtu; > >u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4; > > > >ocp_write_word(tp, MCU_TYPE_USB,

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-22 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Friday, November 18, 2016 8:03 PM [..] > How does the RTL8152 know that the limit is 16KB, > rather than some other number? Is this a hardwired number > in the hardware, or is it a parameter that the software > sends to the chip during initialization?

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-17 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Thursday, November 17, 2016 9:42 PM [...] > What the above sample shows, is the URB transfer buffer ran out of space in > the > middle > of a packet, and the hardware then tried to just continue that same packet in > the > next URB, > without an rx_desc

RE: [PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-16 Thread Hayes Wang
[...] > Fix the hw rx checksum is always enabled, and the user couldn't switch > it to sw rx checksum. > > Note that the RTL_VER_01 only supports sw rx checksum only. Besides, > the hw rx checksum for RTL_VER_02 is disabled after > commit b9a321b48af4 ("r8152: Fix broken RX checksums.").

RE: [PATCH net 2/2] r8152: rx descriptor check

2016-11-16 Thread Hayes Wang
Francois Romieu [mailto:rom...@fr.zoreil.com] > Sent: Tuesday, November 15, 2016 9:11 AM [...] > If it was possible to get it wrong once, it should be possible to > get it wrong twice, especially if some part of the hardware design > is recycled. I don't mean anything else. I agree with you.

RE: [PATCH net 2/2] r8152: rx descriptor check

2016-11-13 Thread Hayes Wang
Mark Lord [mailto:ml...@pobox.com] > Sent: Monday, November 14, 2016 4:34 AM [...] > Perhaps the driver > is somehow accessing the buffer space again after doing usb_submit_urb()? > That would certainly produce this kind of behaviour. I don't think so. First, the driver only read the received

RE: [PATCH net 2/2] r8152: rx descriptor check

2016-11-13 Thread Hayes Wang
David Miller [mailto:da...@davemloft.net] > Sent: Monday, November 14, 2016 1:40 AM [...] > If you add this patch now, there is a much smaller likelyhood that you > will work with a high priority to figure out _why_ this is happening. > > For all we know this could be a platform bug in the DMA

RE: [PATCH net 2/2] r8152: rx descriptor check

2016-11-13 Thread Hayes Wang
Francois Romieu [mailto:rom...@fr.zoreil.com] > Sent: Friday, November 11, 2016 8:13 PM [...] > Invalid packet size corrupted receive descriptors in Realtek's device > reminds of CVE-2009-4537. Do you mean that the driver would get a packet exceed the size which is set to RxMaxSize? I check it

[PATCH net 0/2] r8152: rx patches

2016-11-10 Thread Hayes Wang
Let the rx sw checksum available and add some checks for rx desc. Hayes Wang (2): r8152: fix the sw rx checksum is unavailable r8152: rx descriptor check drivers/net/usb/r8152.c | 46 +- 1 file changed, 45 insertions(+), 1 deletion(-) -- 2.7.4

[PATCH net 1/2] r8152: fix the sw rx checksum is unavailable

2016-11-10 Thread Hayes Wang
Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 75c5168..0e42a78 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@

[PATCH net 2/2] r8152: rx descriptor check

2016-11-10 Thread Hayes Wang
For some platforms, the data in memory is not the same with the one from the device. That is, the data of memory is unbelievable. The check is used to find out this situation. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.

[PATCH net-next] r8152: add new products of Lenovo

2016-10-17 Thread Hayes Wang
Add the following four products of Lenovo and sort the order of the list. VID PID 0x17ef 0x3062 0x17ef 0x3069 0x17ef 0x720c 0x17ef 0x7214 Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/n

[PATCH net 3/5] r8152: move PHY settings to hw_phy_cfg

2016-09-20 Thread Hayes Wang
Move the PHY relative settings together to hw_phy_cfg(). Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index dbf11ba..9

[PATCH net 1/5] r8152: move some functions

2016-09-20 Thread Hayes Wang
Move the following functions forward. r8152_mmd_indirect() r8152_mmd_read() r8152_mmd_write() r8152_eee_en() r8152b_enable_eee() r8153_eee_en() r8153_enable_eee() r8152b_enable_fc() r8153_aldps_en() Signed-off-by: Hayes Wang

[PATCH net 0/5] r8152: correct the flow of PHY

2016-09-20 Thread Hayes Wang
First, to enable the PHY as early as possible. Some settings may fail if the PHY is power down. Move the other PHY settings to hw_phy_cfg() to make sure the order is correct. Finally, disable ALDPS and EEE before updating the PHY for RTL8153. Hayes Wang (5): r8152: move some functions r8152

[PATCH net 4/5] r8152: remove r8153_enable_eee

2016-09-20 Thread Hayes Wang
Remove r8153_enable_eee(). Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 9ce5bd5..e7a05dd 100644 --- a/drivers/net/usb/r

[PATCH net 5/5] r8152: disable ALDPS and EEE before setting PHY

2016-09-20 Thread Hayes Wang
Disable ALDPS and EEE to avoid the possible failure when setting the PHY. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e

[PATCH net 2/5] r8152: move enabling PHY

2016-09-20 Thread Hayes Wang
Move enabling PHY to init(), otherwise some other settings may fail. Signed-off-by: Hayes Wang <hayesw...@realtek.com> --- drivers/net/usb/r8152.c | 43 +-- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/drivers/net/usb/r8152.c b/d

RE: [PATCH net-next 0/3] r8152: configuration setting

2016-09-08 Thread Hayes Wang
Bjørn Mork [mailto:bj...@mork.no] > Sent: Thursday, September 08, 2016 3:55 PM [...] > Yes, I see that. But is that strictly necessary? Couldn't you just say: > "CDC ECM is supported by cdc_ether and therefore limited to the features > implemented by cdc_ether. If you want feature X, then please

  1   2   3   4   5   6   >