08 Jun, 2017

1 commit

  • The USB core may call reset_resume when it fails resume asix device.
    And USB core can recovery this abnormal resume at low level driver,
    the same .resume at asix driver can work too. Add .reset_resume can
    avoid disconnecting after backing from system resume, and NFS can
    still be mounted after this commit.

    Signed-off-by: Peter Chen

    Peter Chen
     

18 Feb, 2017

4 commits

  • [ Upstream commit 2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478 ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit d41149145f98fe26dcd0bfd1d6cc095e6e041418 ]

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit 7926aff5c57b577ab0f43364ff0c59d968f6a414 ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit 5593523f968bc86d42a035c6df47d5e0979b5ace ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    References: https://bugs.debian.org/852556
    Reported-by: Lisandro Damián Nicanor Pérez Meyer
    Tested-by: Lisandro Damián Nicanor Pérez Meyer
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     

04 Feb, 2017

3 commits

  • [ Upstream commit 5b9f57516337b523f7466a53939aaaea7b78141b ]

    Another rebranded Novatel E371. qmi_wwan should drive this device, while
    cdc_ether should ignore it. Even though the USB descriptors are plain
    CDC-ETHER that USB interface is a QMI interface. Ref commit 7fdb7846c9ca
    ("qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN
    card")

    Cc: Dan Williams
    Signed-off-by: Bjørn Mork
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Bjørn Mork
     
  • [ Upstream commit 6a0b76c04ec157c88ca943debf78a8ee58469f2d ]

    Runtime suspend shouldn't be executed if the tx queue is not empty,
    because the device is not idle.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    hayeswang
     
  • [ Upstream commit 19c0f40d4fca3a47b8f784a627f0467f0138ccc8 ]

    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 support sw rx checksum only. Besides,
    the hw rx checksum for RTL_VER_02 is disabled after
    commit b9a321b48af4 ("r8152: Fix broken RX checksums."). Re-enable it.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    hayeswang
     

15 Jan, 2017

2 commits

  • [ Upstream commit 75dc692eda114cb234a46cb11893a9c3ea520934 ]

    Pause the rx and make sure the rx fifo is empty when the autosuspend
    occurs.

    If the rx data comes when the driver is canceling the rx urb, the host
    controller would stop getting the data from the device and continue
    it after next rx urb is submitted. That is, one continuing data is
    split into two different urb buffers. That let the driver take the
    data as a rx descriptor, and unexpected behavior happens.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    hayeswang
     
  • [ Upstream commit 8fb280616878b81c0790a0c33acbeec59c5711f4 ]

    Split rtl8152_suspend() into rtl8152_system_suspend() and
    rtl8152_rumtime_suspend().

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    hayeswang
     

09 Dec, 2016

1 commit

  • Telit LE922A MBIM based composition does not work properly
    with altsetting toggle done in cdc_ncm_bind_common.

    This patch adds CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE quirk
    to avoid this procedure that, instead, is mandatory for
    other modems.

    Signed-off-by: Daniele Palmas
    Reviewed-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Daniele Palmas
     

06 Dec, 2016

1 commit

  • In function lan78xx_probe(), variable ret takes the errno code on
    failures. However, when the call to usb_alloc_urb() fails, its value
    will keeps 0. 0 indicates success in the context, which is inconsistent
    with the execution result. This patch fixes the bug, assigning
    "-ENOMEM" to ret when usb_alloc_urb() returns a NULL pointer.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188771

    Signed-off-by: Pan Bian
    Acked-by: Woojung Huh
    Signed-off-by: David S. Miller

    Pan Bian
     

03 Dec, 2016

2 commits

  • This patch adds support for PID 0x1040 of Telit LE922A.

    The qmi adapter requires to have DTR set for proper working,
    so QMI_WWAN_QUIRK_DTR has been enabled.

    Signed-off-by: Daniele Palmas
    Acked-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Daniele Palmas
     
  • Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling")
    introduced a work-around in usbnet_cdc_status() for devices that exported
    cdc carrier on twice on connect. Before the commit, this behavior caused
    the link state to be incorrect. It was assumed that all CDC Ethernet
    devices would either export this behavior, or send one off and then one on
    notification (which seems to be the default behavior).

    Unfortunately, it turns out multiple devices sends a connection
    notification multiple times per second (via an interrupt), even when
    connection state does not change. This has been observed with several
    different USB LAN dongles (at least), for example 13b1:0041 (Linksys).
    After bfe9b9d2df66, the link state has been set as down and then up for
    each notification. This has caused a flood of Netlink NEWLINK messages and
    syslog to be flooded with messages similar to:

    cdc_ether 2-1:2.0 eth1: kevent 12 may have been dropped

    This commit fixes the behavior by reverting usbnet_cdc_status() to how it
    was before bfe9b9d2df66. The work-around has been moved to a separate
    status-function which is only called when a known, affect device is
    detected.

    v1->v2:

    * Do not open-code netif_carrier_ok() (thanks Henning Schild).
    * Call netif_carrier_off() instead of usb_link_change(). This prevents
    calling schedule_work() twice without giving the work queue a chance to be
    processed (thanks Bjørn Mork).

    Fixes: bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling")
    Reported-by: Henning Schild
    Signed-off-by: Kristian Evensen
    Signed-off-by: David S. Miller

    Kristian Evensen
     

02 Dec, 2016

1 commit


14 Nov, 2016

1 commit

  • If usb_submit_urb() called from the open function fails, the following
    crash may be observed.

    r8152 8-1:1.0 eth0: intr_urb submit failed: -19
    ...
    r8152 8-1:1.0 eth0: v1.08.3
    Unable to handle kernel paging request at virtual address 6b6b6b6b6b6b6b7b
    pgd = ffffffc0e7305000
    [6b6b6b6b6b6b6b7b] *pgd=0000000000000000, *pud=0000000000000000
    Internal error: Oops: 96000004 [#1] PREEMPT SMP
    ...
    PC is at notifier_chain_register+0x2c/0x58
    LR is at blocking_notifier_chain_register+0x54/0x70
    ...
    Call trace:
    [] notifier_chain_register+0x2c/0x58
    [] blocking_notifier_chain_register+0x54/0x70
    [] register_pm_notifier+0x24/0x2c
    [] rtl8152_open+0x3dc/0x3f8 [r8152]
    [] __dev_open+0xac/0x104
    [] __dev_change_flags+0xb0/0x148
    [] dev_change_flags+0x34/0x70
    [] do_setlink+0x2c8/0x888
    [] rtnl_newlink+0x328/0x644
    [] rtnetlink_rcv_msg+0x1a8/0x1d4
    [] netlink_rcv_skb+0x68/0xd0
    [] rtnetlink_rcv+0x2c/0x3c
    [] netlink_unicast+0x16c/0x234
    [] netlink_sendmsg+0x340/0x364
    [] sock_sendmsg+0x48/0x60
    [] SyS_sendto+0xe0/0x120
    [] SyS_send+0x40/0x4c
    [] el0_svc_naked+0x24/0x28

    Clean up error handling to avoid registering the notifier if the open
    function is going to fail.

    Signed-off-by: Guenter Roeck
    Signed-off-by: David S. Miller

    Guenter Roeck
     

10 Nov, 2016

1 commit

  • Add support for Cypress GX3 SuperSpeed to Gigabit Ethernet
    Bridge Controller (Vendor=04b4 ProdID=3610).

    Patch verified on x64 linux kernel 4.7.4, 4.8.6, 4.9-rc4 systems
    with the Kensington SD4600P USB-C Universal Dock with Power,
    which uses the Cypress GX3 SuperSpeed to Gigabit Ethernet Bridge
    Controller.

    A similar patch was signed-off and tested-by Allan Chou
    on 2015-12-01.

    Allan verified his similar patch on x86 Linux kernel 4.1.6 system
    with Cypress GX3 SuperSpeed to Gigabit Ethernet Bridge Controller.

    Tested-by: Allan Chou
    Tested-by: Chris Roth
    Tested-by: Artjom Simon

    Signed-off-by: Allan Chou
    Signed-off-by: Chris Roth
    Signed-off-by: David S. Miller

    Allan Chou
     

31 Oct, 2016

1 commit

  • The r8152 driver has been broken since (approx) 3.16.xx
    when support was added for hardware RX checksums
    on newer chip versions. Symptoms include random
    segfaults and silent data corruption over NFS.

    The hardware checksum logig does not work on the VER_02
    dongles I have here when used with a slow embedded system CPU.
    Google reveals others reporting similar issues on Raspberry Pi.

    So, disable hardware RX checksum support for VER_02, and fix
    an obvious coding error for IPV6 checksums in the same function.

    Because this bug results in silent data corruption,
    it is a good candidate for back-porting to -stable >= 3.16.xx.

    Signed-off-by: Mark Lord
    Signed-off-by: David S. Miller

    Mark Lord
     

28 Oct, 2016

1 commit

  • The kalmia_send_init_packet() returns zero or a negative return
    code, but gcc has no way of knowing that there cannot be a
    positive return code, so it determines that copying the ethernet
    address at the end of kalmia_bind() will access uninitialized
    data:

    drivers/net/usb/kalmia.c: In function ‘kalmia_bind’:
    arch/x86/include/asm/string_32.h:78:22: error: ‘*((void *)ðernet_addr+4)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    *((short *)to + 2) = *((short *)from + 2);
    ^
    drivers/net/usb/kalmia.c:138:5: note: ‘*((void *)ðernet_addr+4)’ was declared here

    This warning is harmless, but for consistency, we should make
    the check for the return code match what the driver does everywhere
    else and just progate it, which then gets rid of the warning.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

15 Oct, 2016

1 commit

  • Check answers from USB stack and avoid re-sending the request
    multiple times if the device does not respond.

    This fixes the following problem, observed with a probably flaky adapter.

    [62108.732707] usb 1-3: new high-speed USB device number 5 using xhci_hcd
    [62108.914421] usb 1-3: New USB device found, idVendor=0b95, idProduct=7720
    [62108.914463] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [62108.914476] usb 1-3: Product: AX88x72A
    [62108.914486] usb 1-3: Manufacturer: ASIX Elec. Corp.
    [62108.914495] usb 1-3: SerialNumber: 000001
    [62114.109109] asix 1-3:1.0 (unnamed net_device) (uninitialized):
    Failed to write reg index 0x0000: -110
    [62114.109139] asix 1-3:1.0 (unnamed net_device) (uninitialized):
    Failed to send software reset: ffffff92
    [62119.109048] asix 1-3:1.0 (unnamed net_device) (uninitialized):
    Failed to write reg index 0x0000: -110
    ...

    Since the USB timeout is 5 seconds, and the operation is retried 30 times,
    this results in

    [62278.180353] INFO: task mtpd:1725 blocked for more than 120 seconds.
    [62278.180373] Tainted: G W 3.18.0-13298-g94ace9e #1
    [62278.180383] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    ...
    [62278.180957] kworker/2:0 D 0000000000000000 0 5744 2 0x00000000
    [62278.180978] Workqueue: usb_hub_wq hub_event
    [62278.181029] ffff880177f833b8 0000000000000046 ffff88017fd00000 ffff88017b126d80
    [62278.181048] ffff880177f83fd8 ffff880065a71b60 0000000000013340 ffff880065a71b60
    [62278.181065] 0000000000000286 0000000103b1c199 0000000000001388 0000000000000002
    [62278.181081] Call Trace:
    [62278.181092] [] ? console_conditional_schedule+0x2c/0x2c
    [62278.181105] [] schedule+0x69/0x6b
    [62278.181117] [] schedule_timeout+0xe3/0x11d
    [62278.181133] [] ? trace_timer_start+0x51/0x51
    [62278.181146] [] do_wait_for_common+0x12f/0x16c
    [62278.181162] [] ? wake_up_process+0x39/0x39
    [62278.181174] [] wait_for_common+0x52/0x6d
    [62278.181187] [] wait_for_completion_timeout+0x13/0x15
    [62278.181201] [] usb_start_wait_urb+0x93/0xf1
    [62278.181214] [] usb_control_msg+0xe1/0x11d
    [62278.181230] [] usbnet_write_cmd+0x9c/0xc6 [usbnet]
    [62278.181286] [] asix_write_cmd+0x4e/0x7e [asix]
    [62278.181300] [] asix_set_sw_mii+0x25/0x4e [asix]
    [62278.181314] [] asix_mdio_read+0x51/0x109 [asix]
    ...

    Signed-off-by: Guenter Roeck
    Signed-off-by: David S. Miller

    Guenter Roeck
     

13 Oct, 2016

1 commit

  • The Quectel EC21 and EC25 need the same "set DTR" request as devices
    based on the MDM9230 chipset, but has no USB3 support. Our best guess
    is that the "set DTR" functionality depends on chipset and/or
    baseband firmware generation. But USB3 is still an optional feature.

    Since we cannot enable this unconditionally for all older devices, and
    there doesn't appear to be anything we can use in the USB descriptors
    to identify these chips, we are forced to use a device specific quirk
    flag.

    Reported-and-tested-by: Sebastian Sjoholm
    Signed-off-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Bjørn Mork
     

23 Sep, 2016

1 commit


21 Sep, 2016

5 commits


08 Sep, 2016

1 commit


07 Sep, 2016

5 commits

  • We get a few warnings when building kernel with W=1:
    drivers/net/usb/lan78xx.c:1182:6: warning: no previous prototype for 'lan78xx_defer_kevent' [-Wmissing-prototypes]
    drivers/net/usb/lan78xx.c:1409:5: warning: no previous prototype for 'lan78xx_nway_reset' [-Wmissing-prototypes]
    drivers/net/usb/lan78xx.c:2000:5: warning: no previous prototype for 'lan78xx_set_mac_addr' [-Wmissing-prototypes]
    ....

    In fact, these functions are only used in the file in which they are
    declared and don't need a declaration, but can be made static.
    so this patch marks these functions with 'static'.

    Signed-off-by: Baoyou Xie
    Signed-off-by: David S. Miller

    Baoyou Xie
     
  • Use a more common logging style

    Miscellanea:

    o Add pr_fmt to prefix each output message
    o Realign arguments

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Macros that end in an underscore are just odd.
    Add hso_dbg(level, fmt, ...) and use it everwhere instead.

    Several uses had additional unnecessary newlines as the
    macro added a newline. Remove the newline from the macro
    and add newlines to each use as appropriate.

    Remove now unused D macros.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Add mdix control through ethtool.

    Signed-off-by: Woojung Huh
    Signed-off-by: David S. Miller

    Woojung Huh
     
  • Add STRAP_STATUS defines.

    Signed-off-by: Woojung Huh
    Signed-off-by: David S. Miller

    Woojung Huh
     

02 Sep, 2016

2 commits

  • The workqueue "pegasus_workqueue" queues a single work item per pegasus
    instance and hence it doesn't require execution ordering. Hence,
    alloc_workqueue has been used to replace the deprecated
    create_singlethread_workqueue instance.

    The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
    memory pressure since it's a network driver.

    Since there are fixed number of work items, explicit concurrency
    limit is unnecessary here.

    Signed-off-by: Bhaktipriya Shridhar
    Acked-by: Tejun Heo
    Acked-by: Petko Manolov
    Signed-off-by: David S. Miller

    Bhaktipriya Shridhar
     
  • check the coding style with checkpatch.pl and fix the warnings and errors.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller

    hayeswang
     

01 Sep, 2016

5 commits

  • From: Grant Grundler

    The miii_nway_restart() causes a PHY link change activity and
    ax88772_link_reset will be called. link_reset will set
    AX_CMD_WRITE_MEDIUM_MODE register correctly.

    The asix_write_medium_mode in reset() fills in a default value to the register
    which may be different from the negotiation result. So do this first.

    Ignore the ret value since it's ignored in XXX_link_reset() functions.

    Signed-off-by: Grant Grundler
    Signed-off-by: Robert Foss
    Tested-by: Robert Foss
    Signed-off-by: David S. Miller

    Robert Foss
     
  • From: Grant Grundler

    https://lkml.org/lkml/2014/11/11/947

    Ben Hutchings is correct. IEEE 802.3 spec section "22.2.4.1.1 Reset" requires
    up to 500ms delay. Mitigate the "max" delay by polling the phy until BCM_RESET
    bit is clear.

    Signed-off-by: Grant Grundler
    Signed-off-by: Robert Foss
    Tested-by: Robert Foss
    Signed-off-by: David S. Miller

    Robert Foss
     
  • From: Allan Chou

    The change fixes AX88772x resume failure by
    - Restore incorrect AX88772A PHY registers when resetting
    - Need to stop MAC operation when suspending
    - Need to restart MII when restoring PHY

    Signed-off-by: Allan Chou
    Signed-off-by: Robert Foss
    Tested-by: Robert Foss
    Signed-off-by: David S. Miller

    Robert Foss
     
  • From: Vincent Palatin

    Check the answers from the USB stack and avoid re-sending multiple times
    the request if the device has disappeared.

    Signed-off-by: Vincent Palatin
    Signed-off-by: Robert Foss
    Tested-by: Robert Foss
    Signed-off-by: David S. Miller

    Robert Foss
     
  • From: Freddy Xin

    In order to R/W registers in suspend/resume functions, in_pm flags are
    added to some functions to determine whether the nopm version of usb
    functions is called.

    Save BMCR and ANAR PHY registers in suspend function and restore them
    in resume function.

    Reset HW in resume function to ensure the PHY works correctly.

    Signed-off-by: Freddy Xin
    Signed-off-by: Robert Foss
    Tested-by: Robert Foss
    Signed-off-by: David S. Miller

    Robert Foss