- 15 7月, 2021 2 次提交
-
-
由 Takashi Iwai 提交于
r8152 driver sets up the MAC address at reset-resume, while rtl8152_set_mac_address() has the temporary autopm get/put. This may lead to a deadlock as the PM lock has been already taken for the execution of the runtime PM callback. This patch adds the workaround to avoid the superfluous autpm when called from rtl8152_reset_resume(). Link: https://bugzilla.suse.com/show_bug.cgi?id=1186194Signed-off-by: NTakashi Iwai <tiwai@suse.de> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Takashi Iwai 提交于
rtl8152_close() takes the refcount via usb_autopm_get_interface() but it doesn't release when RTL8152_UNPLUG test hits. This may lead to the imbalance of PM refcount. This patch addresses it. Link: https://bugzilla.suse.com/show_bug.cgi?id=1186194Signed-off-by: NTakashi Iwai <tiwai@suse.de> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 18 6月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
Store the information of the pipes to avoid calling usb_rcvctrlpipe(), usb_sndctrlpipe(), usb_rcvbulkpipe(), usb_sndbulkpipe(), and usb_rcvintpipe() frequently. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 17 6月, 2021 1 次提交
-
-
由 Kees Cook 提交于
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring array fields. The memcpy() is copying the entire structure, not just the first array. Adjust the source argument so the compiler can do appropriate bounds checking. Signed-off-by: NKees Cook <keescook@chromium.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 02 6月, 2021 2 次提交
-
-
由 Zheng Yongjun 提交于
wierdness ==> weirdness multicat ==> multicast limite ==> limit adddress ==> address operater ==> operator intial ==> initial smaler ==> smaller Communcation ==> Communication funcitons ==> functions everytime ==> every time Neigbor ==> Neighbor performace ==> performance Signed-off-by: NZheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
Support get_pauseparam and set_pauseparam of ethtool_ops. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 25 5月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
Verify some fields of the USB descriptor to make sure the driver could be used by the device. Besides, remove the check of endpoint number in rtl8152_probe(). usb_find_common_endpoints() includes it. BugLink: https://syzkaller.appspot.com/bug?id=912c9c373656996801b4de61f1e3cb326fe940aa Reported-by: syzbot+95afd23673f5dd295c57@syzkaller.appspotmail.com Fixes: c2198943 ("r8152: search the configuration of vendor mode") Signed-off-by: NHayes Wang <hayeswang@realtek.com> Reviewed-by: NJohan Hovold <johan@kernel.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 26 4月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
Remove DELL_TB_RX_AGG_BUG and LENOVO_MACPASSTHRU flags of rtl8152_flags. They are only set when initializing and wouldn't be change. It is enough to record them with variables. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 24 4月, 2021 2 次提交
-
-
由 Hayes Wang 提交于
Redefine REALTEK_USB_DEVICE macro with USB_DEVICE_INTERFACE_CLASS and USB_DEVICE_AND_INTERFACE_INFO to simply the code. Although checkpatch.pl shows the following error, it is more readable. ERROR: Macros with complex values should be enclosed in parentheses Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
The RTL8156 support CDC NCM mode. And users could set the configuration of the USB device between vendor and NCM mode dynamically by themselves. That is, the driver doesn't need to set vendor mode from NCM mode. Fixes: 195aae32 ("r8152: support new chips") Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 23 4月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
When the timeout occurs, we still have to run the following process for releasing patch request. Otherwise, the PHY would keep no link. Therefore, use break to stop the loop of loading firmware and release the patch request rather than return the function directly. Fixes: 4a51b0e8 ("r8152: support PHY firmware for RTL8156 series") Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 17 4月, 2021 6 次提交
-
-
由 Hayes Wang 提交于
The vendor mode is not always at config #1, so it is necessary to set the correct configuration number. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
Support new firmware type and method for RTL8156 series. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
Support RTL8153C, RTL8153D, RTL8156A, and RTL8156B. The RTL8156A and RTL8156B are the 2.5G ethernet. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 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: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
Use bits operations to record and check the firmware. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Hayes Wang 提交于
Set the maximum inter frame gap time (144ns) for speed 10M/half and 100M/half. It improves the performance for those speeds. And, there is no effect for the other speeds. For 10M/half and 100M/half, the fast inter frame gap time let the device couldn't use the feature of the aggregation 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: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 20 3月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
If the USB host controller is EHCI, the throughput is reduced from 300Mb/s to 60Mb/s, when the rx buffer size is modified from 16K to 32K. According to the EHCI spec, the maximum size of the qTD is 20K. Therefore, when the driver uses more than 20K buffer, the latency time of EHCI would be increased. And, it let the RTL8153A get worse throughput. However, the driver uses alloc_pages() for rx buffer, so I limit the rx buffer to 16K rather than 20K. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205923 Fixes: ec5791c2 ("r8152: separate the rx buffer size") Reported-by: NRobert Davies <robdavies1977@gmail.com> Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 04 3月, 2021 1 次提交
-
-
由 Hayes Wang 提交于
This reverts commit 134f98bc. The r8153_mac_clk_spd() is used for RTL8153A only, because the register table of RTL8153B is different from RTL8153A. However, this function would be called when RTL8153B calls r8153_first_init() and r8153_enter_oob(). That causes RTL8153B becomes unstable when suspending and resuming. The worst case may let the device stop working. Besides, revert this commit to disable MAC clock speed down for RTL8153A. It would avoid the known issue when enabling U1. The data of the first control transfer may be wrong when exiting U1. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 24 2月, 2021 4 次提交
-
-
由 Hayes Wang 提交于
Add rtl_eee_plus_en() and rtl_green_en(). Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Hayes Wang 提交于
Some messages are before calling register_netdev(), so replace netif_err() with dev_err(). Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Hayes Wang 提交于
Return error code if autosuspend_en, eee_get, or eee_set don't exist. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Hayes Wang 提交于
U1/U2 shoued be enabled for USB 3.0 or later. The USB 2.0 doesn't support it. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 05 2月, 2021 2 次提交
-
-
由 Hayes Wang 提交于
For runtime resuming, the RTL8153B may be resumed from the state of power cut, when enabling the feature of UPS. Then, the PHY would be reset, so it is necessary to be initailized again. Besides, the USB_U1U2_TIMER also has to be set again, so I move it from r8153b_init() to r8153b_hw_phy_cfg(). Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Hayes Wang 提交于
Replace r8153_patch_request() with rtl_phy_patch_request(). Replace r8153_pre_ram_code() with rtl_pre_ram_code(). Replace r8153_post_ram_code() with rtl_post_ram_code(). Add rtl_patch_key_set(). The new functions have an additional parameter. It is used to wait the patch request command finished. 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: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 03 2月, 2021 1 次提交
-
-
由 Emil Renner Berthing 提交于
This converts the driver to use the new tasklet API introduced in commit 12cc923f ("tasklet: Introduce new initialization API") Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 13 1月, 2021 1 次提交
-
-
由 Leon Schuermann 提交于
This USB-C Hub (17ef:721e) based on the Realtek RTL8153B chip used to use the cdc_ether driver. However, using this driver, with the system suspended the device constantly sends pause-frames as soon as the receive buffer fills up. This causes issues with other devices, where some Ethernet switches stop forwarding packets altogether. Using the Realtek driver (r8152) fixes this issue. Pause frames are no longer sent while the host system is suspended. Signed-off-by: NLeon Schuermann <leon@is.currently.online> Tested-by: NLeon Schuermann <leon@is.currently.online> Link: https://lore.kernel.org/r/20210111190312.12589-2-leon@is.currently.onlineSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 06 11月, 2020 1 次提交
-
-
由 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. Both r8152 and r8153_ecm would check the return value of rtl8152_get_version() in porbe(). If rtl8152_get_version() return none zero value, 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: NHayes Wang <hayeswang@realtek.com> Link: https://lore.kernel.org/r/1394712342-15778-392-Taiwan-albertk@realtek.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 04 11月, 2020 2 次提交
-
-
由 Lee Jones 提交于
Fixes the following W=1 kernel build warning(s): drivers/net/usb/r8152.c:992: warning: Function parameter or member 'mode_pre' not described in 'fw_phy_nc' drivers/net/usb/r8152.c:992: warning: Function parameter or member 'mode_post' not described in 'fw_phy_nc' Signed-off-by: NLee Jones <lee.jones@linaro.org> Acked-by: NHayes Wang <hayeswang@realtek.com> Link: https://lore.kernel.org/r/20201102114512.1062724-28-lee.jones@linaro.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Lee Jones 提交于
Fixes the following W=1 kernel build warning(s): drivers/net/usb/r8152.c:934: warning: Function parameter or member 'blk_hdr' not described in 'fw_mac' drivers/net/usb/r8152.c:934: warning: Function parameter or member 'reserved' not described in 'fw_mac' drivers/net/usb/r8152.c:947: warning: Function parameter or member 'blk_hdr' not described in 'fw_phy_patch_key' drivers/net/usb/r8152.c:947: warning: Function parameter or member 'reserved' not described in 'fw_phy_patch_key' drivers/net/usb/r8152.c:986: warning: Function parameter or member 'blk_hdr' not described in 'fw_phy_nc' drivers/net/usb/r8152.c:986: warning: Function parameter or member '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' not described in 'fw_phy_nc' Signed-off-by: NLee Jones <lee.jones@linaro.org> Acked-by: NHayes Wang <hayeswang@realtek.com> Link: https://lore.kernel.org/r/20201102114512.1062724-23-lee.jones@linaro.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 24 8月, 2020 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-throughSigned-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
-
- 08 8月, 2020 1 次提交
-
-
由 Thierry Reding 提交于
Query the USB device's device tree node when looking for a MAC address. The struct device embedded into the struct net_device does not have a device tree node attached at all. The reason why this went unnoticed is because the system where this was tested was one of the few development units that had its OTP programmed, as opposed to production systems where the MAC address is stored in a separate EEPROM and is passed via device tree by the firmware. Reported-by: NEJ Hsu <ejh@nvidia.com> Fixes: acb6d377 ("r8152: Use MAC address from device tree if available") Signed-off-by: NThierry Reding <treding@nvidia.com> Reviewed-by: NEJ Hsu <ejh@nvidia.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 20 5月, 2020 1 次提交
-
-
由 Marc Payne 提交于
Device id 0927 is the RTL8153B-based component of the 'Surface USB-C to Ethernet and USB Adapter' and may be used as a component of other devices in future. Tested and working with the r8152 driver. Update the cdc_ether blacklist due to the RTL8153 'network jam on suspend' issue which this device will cause (personally confirmed). Signed-off-by: NMarc Payne <marc.payne@mdpsys.co.uk> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 15 5月, 2020 1 次提交
-
-
由 Thierry Reding 提交于
If a MAC address was passed via the device tree node for the r8152 device, use it and fall back to reading from EEPROM otherwise. This is useful for devices where the r8152 EEPROM was not programmed with a valid MAC address, or if users want to explicitly set a MAC address in the bootloader and pass that to the kernel. Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 07 3月, 2020 1 次提交
-
-
由 Jakub Kicinski 提交于
Set ethtool_ops->supported_coalesce_params to let the core reject unsupported coalescing parameters. This driver did not previously reject unsupported parameters. Signed-off-by: NJakub Kicinski <kuba@kernel.org> Acked-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 03 3月, 2020 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 01 3月, 2020 1 次提交
-
-
由 You-Sheng Yang 提交于
Dell USB Type C docking WD19/WD19DC attaches additional peripherals as: /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M |__ Port 1: Dev 11, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 3: Dev 12, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 4: Dev 13, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M where usb 2-1-3 is a hub connecting all USB Type-A/C ports on the dock. When hotplugging such dock with additional usb devices already attached on it, the probing process may reset usb 2.1 port, therefore r8152 ethernet device is also reset. However, during r8152 device init there are several for-loops that, when it's unable to retrieve hardware registers due to being disconnected from USB, may take up to 14 seconds each in practice, and that has to be completed before USB may re-enumerate devices on the bus. As a result, devices attached to the dock will only be available after nearly 1 minute after the dock was plugged in: [ 216.388290] [250] r8152 2-1.4:1.0: usb_probe_interface [ 216.388292] [250] r8152 2-1.4:1.0: usb_probe_interface - got id [ 258.830410] r8152 2-1.4:1.0 (unnamed net_device) (uninitialized): PHY not ready [ 258.830460] r8152 2-1.4:1.0 (unnamed net_device) (uninitialized): Invalid header when reading pass-thru MAC addr [ 258.830464] r8152 2-1.4:1.0 (unnamed net_device) (uninitialized): Get ether addr fail This happens in, for example, r8153_init: static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, void *data, u16 type) { if (test_bit(RTL8152_UNPLUG, &tp->flags)) return -ENODEV; ... } static u16 ocp_read_word(struct r8152 *tp, u16 type, u16 index) { u32 data; ... generic_ocp_read(tp, index, sizeof(tmp), &tmp, type | byen); data = __le32_to_cpu(tmp); ... return (u16)data; } static void r8153_init(struct r8152 *tp) { ... if (test_bit(RTL8152_UNPLUG, &tp->flags)) return; for (i = 0; i < 500; i++) { if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & AUTOLOAD_DONE) break; msleep(20); } ... } Since ocp_read_word() doesn't check the return status of generic_ocp_read(), and the only exit condition for the loop is to have a match in the returned value, such loops will only ends after exceeding its maximum runs when the device has been marked as disconnected, which takes 500 * 20ms = 10 seconds in theory, 14 in practice. To solve this long latency another test to RTL8152_UNPLUG flag should be added after those 20ms sleep to skip unnecessary loops, so that the device probe can complete early and proceed to parent port reset/reprobe process. This can be reproduced on all kernel versions up to latest v5.6-rc2, but after v5.5-rc7 the reproduce rate is dramatically lowered to 1/30 or less while it was around 1/2. Signed-off-by: NYou-Sheng Yang <vicamo.yang@canonical.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 20 2月, 2020 1 次提交
-
-
由 Heiner Kallweit 提交于
Use new helper tcp_v6_gso_csum_prep in additional network drivers. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Acked-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 04 2月, 2020 1 次提交
-
-
由 Kai-Heng Feng 提交于
Device 0xa387 also supports MAC passthrough, therefore add it to the whitelst. BugLink: https://bugs.launchpad.net/bugs/1827961/comments/30Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 23 1月, 2020 1 次提交
-
-
由 Hayes Wang 提交于
When enabling this, the device would wait an internal signal which wouldn't be triggered. Then, the device couldn't enter P3 mode, so the power consumption is increased. Signed-off-by: NHayes Wang <hayeswang@realtek.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-