1. 22 5月, 2020 10 次提交
  2. 16 5月, 2020 1 次提交
  3. 15 5月, 2020 9 次提交
  4. 14 5月, 2020 13 次提交
    • L
      usb: host: xhci-plat: keep runtime active when removing host · 1449cb2c
      Li Jun 提交于
      While removing the host (e.g. for USB role switch from host to device),
      if runtime pm is enabled by user, below oops occurs on dwc3 and cdns3
      platforms.
      Keeping the xhci-plat device active during host removal, and disabling
      runtime pm before calling pm_runtime_set_suspended() fixes them.
      
      oops1:
      Unable to handle kernel NULL pointer dereference at virtual address
      0000000000000240
      Internal error: Oops: 96000004 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.4.3-00107-g64d454a-dirty
      Hardware name: FSL i.MX8MP EVK (DT)
      Workqueue: pm pm_runtime_work
      pstate: 60000005 (nZCv daif -PAN -UAO)
      pc : xhci_suspend+0x34/0x698
      lr : xhci_plat_runtime_suspend+0x2c/0x38
      sp : ffff800011ddbbc0
      Call trace:
       xhci_suspend+0x34/0x698
       xhci_plat_runtime_suspend+0x2c/0x38
       pm_generic_runtime_suspend+0x28/0x40
       __rpm_callback+0xd8/0x138
       rpm_callback+0x24/0x98
       rpm_suspend+0xe0/0x448
       rpm_idle+0x124/0x140
       pm_runtime_work+0xa0/0xf8
       process_one_work+0x1dc/0x370
       worker_thread+0x48/0x468
       kthread+0xf0/0x120
       ret_from_fork+0x10/0x1c
      
      oops2:
      usb 2-1: USB disconnect, device number 2
      xhci-hcd xhci-hcd.1.auto: remove, state 4
      usb usb2: USB disconnect, device number 1
      xhci-hcd xhci-hcd.1.auto: USB bus 2 deregistered
      xhci-hcd xhci-hcd.1.auto: remove, state 4
      usb usb1: USB disconnect, device number 1
      Unable to handle kernel NULL pointer dereference at virtual address
      0000000000000138
      Internal error: Oops: 96000004 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 2 PID: 7 Comm: kworker/u8:0 Not tainted 5.6.0-rc4-next-20200304-03578
      Hardware name: Freescale i.MX8QXP MEK (DT)
      Workqueue: 1-0050 tcpm_state_machine_work
      pstate: 20000005 (nzCv daif -PAN -UAO)
      pc : xhci_free_dev+0x214/0x270
      lr : xhci_plat_runtime_resume+0x78/0x88
      sp : ffff80001006b5b0
      Call trace:
       xhci_free_dev+0x214/0x270
       xhci_plat_runtime_resume+0x78/0x88
       pm_generic_runtime_resume+0x30/0x48
       __rpm_callback+0x90/0x148
       rpm_callback+0x28/0x88
       rpm_resume+0x568/0x758
       rpm_resume+0x260/0x758
       rpm_resume+0x260/0x758
       __pm_runtime_resume+0x40/0x88
       device_release_driver_internal+0xa0/0x1c8
       device_release_driver+0x1c/0x28
       bus_remove_device+0xd4/0x158
       device_del+0x15c/0x3a0
       usb_disable_device+0xb0/0x268
       usb_disconnect+0xcc/0x300
       usb_remove_hcd+0xf4/0x1dc
       xhci_plat_remove+0x78/0xe0
       platform_drv_remove+0x30/0x50
       device_release_driver_internal+0xfc/0x1c8
       device_release_driver+0x1c/0x28
       bus_remove_device+0xd4/0x158
       device_del+0x15c/0x3a0
       platform_device_del.part.0+0x20/0x90
       platform_device_unregister+0x28/0x40
       cdns3_host_exit+0x20/0x40
       cdns3_role_stop+0x60/0x90
       cdns3_role_set+0x64/0xd8
       usb_role_switch_set_role.part.0+0x3c/0x68
       usb_role_switch_set_role+0x20/0x30
       tcpm_mux_set+0x60/0xf8
       tcpm_reset_port+0xa4/0xf0
       tcpm_detach.part.0+0x28/0x50
       tcpm_state_machine_work+0x12ac/0x2360
       process_one_work+0x1c8/0x470
       worker_thread+0x50/0x428
       kthread+0xfc/0x128
       ret_from_fork+0x10/0x18
      Code: c8037c02 35ffffa3 17ffe7c3 f9800011 (c85f7c01)
      ---[ end trace 45b1a173d2679e44 ]---
      
      [minor commit message cleanup  -Mathias]
      Cc: Baolin Wang <baolin.wang@linaro.org>
      Cc: <stable@vger.kernel.org>
      Fixes: b0c69b4b ("usb: host: plat: Enable xHCI plat runtime PM")
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Tested-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NLi Jun <jun.li@nxp.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20200514110432.25564-3-mathias.nyman@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1449cb2c
    • S
      usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list · 3c6f8cb9
      Sriharsha Allenki 提交于
      On platforms with IOMMU enabled, multiple SGs can be coalesced into one
      by the IOMMU driver. In that case the SG list processing as part of the
      completion of a urb on a bulk endpoint can result into a NULL pointer
      dereference with the below stack dump.
      
      <6> Unable to handle kernel NULL pointer dereference at virtual address 0000000c
      <6> pgd = c0004000
      <6> [0000000c] *pgd=00000000
      <6> Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      <2> PC is at xhci_queue_bulk_tx+0x454/0x80c
      <2> LR is at xhci_queue_bulk_tx+0x44c/0x80c
      <2> pc : [<c08907c4>]    lr : [<c08907bc>]    psr: 000000d3
      <2> sp : ca337c80  ip : 00000000  fp : ffffffff
      <2> r10: 00000000  r9 : 50037000  r8 : 00004000
      <2> r7 : 00000000  r6 : 00004000  r5 : 00000000  r4 : 00000000
      <2> r3 : 00000000  r2 : 00000082  r1 : c2c1a200  r0 : 00000000
      <2> Flags: nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
      <2> Control: 10c0383d  Table: b412c06a  DAC: 00000051
      <6> Process usb-storage (pid: 5961, stack limit = 0xca336210)
      <snip>
      <2> [<c08907c4>] (xhci_queue_bulk_tx)
      <2> [<c0881b3c>] (xhci_urb_enqueue)
      <2> [<c0831068>] (usb_hcd_submit_urb)
      <2> [<c08350b4>] (usb_sg_wait)
      <2> [<c089f384>] (usb_stor_bulk_transfer_sglist)
      <2> [<c089f2c0>] (usb_stor_bulk_srb)
      <2> [<c089fe38>] (usb_stor_Bulk_transport)
      <2> [<c089f468>] (usb_stor_invoke_transport)
      <2> [<c08a11b4>] (usb_stor_control_thread)
      <2> [<c014a534>] (kthread)
      
      The above NULL pointer dereference is the result of block_len and the
      sent_len set to zero after the first SG of the list when IOMMU driver
      is enabled. Because of this the loop of processing the SGs has run
      more than num_sgs which resulted in a sg_next on the last SG of the
      list which has SG_END set.
      
      Fix this by check for the sg before any attributes of the sg are
      accessed.
      
      [modified reason for null pointer dereference in commit message subject -Mathias]
      Fixes: f9c589e1 ("xhci: TD-fragment, align the unsplittable case with a bounce buffer")
      Cc: stable@vger.kernel.org
      Signed-off-by: NSriharsha Allenki <sallenki@codeaurora.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20200514110432.25564-2-mathias.nyman@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c6f8cb9
    • J
      usb: cdns3: gadget: make a bunch of functions static · 172b14b4
      Jason Yan 提交于
      Fix the following sparse warning:
      
      drivers/usb/cdns3/gadget.c:85:6: warning: symbol
      'cdns3_clear_register_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:140:26: warning: symbol
      'cdns3_next_align_buf' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:151:22: warning: symbol
      'cdns3_next_priv_request' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:193:5: warning: symbol 'cdns3_ring_size' was
      not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:348:6: warning: symbol
      'cdns3_move_deq_to_next_trb' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:514:20: warning: symbol
      'cdns3_wa2_gadget_giveback' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:554:5: warning: symbol
      'cdns3_wa2_gadget_ep_queue' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:839:6: warning: symbol
      'cdns3_wa1_restore_cycle_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1907:6: warning: symbol
      'cdns3_stream_ep_reconfig' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1928:6: warning: symbol
      'cdns3_configure_dmult' was not declared. Should it be static?
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      172b14b4
    • R
      usb: mtu3: constify struct debugfs_reg32 · 6045dd7e
      Rikard Falkeborn 提交于
      mtu3_prb_regs is never changed and can therefore be made const.
      
      This allows the compiler to put it in the text section instead of the
      data section.
      
      Before:
         text    data     bss     dec     hex filename
        19966    7120       0   27086    69ce drivers/usb/mtu3/mtu3_debugfs.o
      
      After:
         text    data     bss     dec     hex filename
        20142    6992       0   27134    69fe drivers/usb/mtu3/mtu3_debugfs.o
      Signed-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      6045dd7e
    • S
      usb: gadget: udc: atmel: Make some symbols static · 4210f3a6
      Samuel Zou 提交于
      Fix the following sparse warnings:
      
      drivers/usb/gadget/udc/atmel_usba_udc.c:188:30: warning: symbol 'queue_dbg_fops' was not declared.
      drivers/usb/gadget/udc/atmel_usba_udc.c:196:30: warning: symbol 'regs_dbg_fops' was not declared.
      
      queue_dbg_fops and regs_dbg_fops have only call within atmel_usba_udc.c
      They should be static
      
      Fixes: 914a3f3b ("USB: add atmel_usba_udc driver")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NSamuel Zou <zou_wei@huawei.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      4210f3a6
    • A
      usb: raw-gadget: fix null-ptr-deref when reenabling endpoints · da39b5ee
      Andrey Konovalov 提交于
      Currently we preassign gadget endpoints to raw-gadget endpoints during
      initialization. Fix resetting this assignment in raw_ioctl_ep_disable(),
      otherwise we will get null-ptr-derefs when an endpoint is reenabled.
      Signed-off-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      da39b5ee
    • A
      usb: raw-gadget: support stalling/halting/wedging endpoints · c61769bd
      Andrey Konovalov 提交于
      Raw Gadget is currently unable to stall/halt/wedge gadget endpoints,
      which is required for proper emulation of certain USB classes.
      
      This patch adds a few more ioctls:
      
      - USB_RAW_IOCTL_EP0_STALL allows to stall control endpoint #0 when
        there's a pending setup request for it.
      - USB_RAW_IOCTL_SET/CLEAR_HALT/WEDGE allow to set/clear halt/wedge status
        on non-control non-isochronous endpoints.
      
      Fixes: f2c2e717 ("usb: gadget: add raw-gadget interface")
      Signed-off-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      c61769bd
    • A
      usb: raw-gadget: fix gadget endpoint selection · 97df5e57
      Andrey Konovalov 提交于
      Currently automatic gadget endpoint selection based on required features
      doesn't work. Raw Gadget tries iterating over the list of available
      endpoints and finding one that has the right direction and transfer type.
      Unfortunately selecting arbitrary gadget endpoints (even if they satisfy
      feature requirements) doesn't work, as (depending on the UDC driver) they
      might have fixed addresses, and one also needs to provide matching
      endpoint addresses in the descriptors sent to the host.
      
      The composite framework deals with this by assigning endpoint addresses
      in usb_ep_autoconfig() before enumeration starts. This approach won't work
      with Raw Gadget as the endpoints are supposed to be enabled after a
      set_configuration/set_interface request from the host, so it's too late to
      patch the endpoint descriptors that had already been sent to the host.
      
      For Raw Gadget we take another approach. Similarly to GadgetFS, we allow
      the user to make the decision as to which gadget endpoints to use.
      
      This patch adds another Raw Gadget ioctl USB_RAW_IOCTL_EPS_INFO that
      exposes information about all non-control endpoints that a currently
      connected UDC has. This information includes endpoints addresses, as well
      as their capabilities and limits to allow the user to choose the most
      fitting gadget endpoint.
      
      The USB_RAW_IOCTL_EP_ENABLE ioctl is updated to use the proper endpoint
      validation routine usb_gadget_ep_match_desc().
      
      These changes affect the portability of the gadgets that use Raw Gadget
      when running on different UDCs. Nevertheless, as long as the user relies
      on the information provided by USB_RAW_IOCTL_EPS_INFO to dynamically
      choose endpoint addresses, UDC-agnostic gadgets can still be written with
      Raw Gadget.
      
      Fixes: f2c2e717 ("usb: gadget: add raw-gadget interface")
      Signed-off-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      97df5e57
    • H
      net: phy: fix aneg restart in phy_ethtool_set_eee · 9de5d235
      Heiner Kallweit 提交于
      phy_restart_aneg() enables aneg in the PHY. That's not what we want
      if phydev->autoneg is disabled. In this case still update EEE
      advertisement register, but don't enable aneg and don't trigger an
      aneg restart.
      
      Fixes: f75abeb8 ("net: phy: restart phy autonegotiation after EEE advertisment change")
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9de5d235
    • C
      drm/i915: Handle idling during i915_gem_evict_something busy loops · 955da9d7
      Chris Wilson 提交于
      i915_gem_evict_something() is charged with finding a slot within the GTT
      that we may reuse. Since our goal is not to stall, we first look for a
      slot that only overlaps idle vma. To this end, on the first pass we move
      any active vma to the end of the search list. However, we only stopped
      moving active vma after we see the first active vma twice. If during the
      search, that first active vma completed, we would not notice and keep on
      extending the search list.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1746
      Fixes: 2850748e ("drm/i915: Pull i915_vma_pin under the vm->mutex")
      Fixes: b1e3177b ("drm/i915: Coordinate i915_active with its own mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200509115217.26853-1-chris@chris-wilson.co.uk
      (cherry picked from commit 73e28cc4)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      955da9d7
    • F
      net: broadcom: Select BROADCOM_PHY for BCMGENET · 99addbe3
      Florian Fainelli 提交于
      The GENET controller on the Raspberry Pi 4 (2711) is typically
      interfaced with an external Broadcom PHY via a RGMII electrical
      interface. To make sure that delays are properly configured at the PHY
      side, ensure that we the dedicated Broadcom PHY driver
      (CONFIG_BROADCOM_PHY) is enabled for this to happen.
      
      Fixes: 402482a6 ("net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed")
      Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99addbe3
    • W
      s390/ism: fix error return code in ism_probe() · 29b74cb7
      Wei Yongjun 提交于
      Fix to return negative error code -ENOMEM from the smcd_alloc_dev()
      error handling case instead of 0, as done elsewhere in this function.
      
      Fixes: 684b89bc ("s390/ism: add device driver for internal shared memory")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29b74cb7
    • S
      hwmon: (da9052) Synchronize access with mfd · 333e22db
      Samu Nuutamo 提交于
      When tsi-as-adc is configured it is possible for in7[0123]_input read to
      return an incorrect value if a concurrent read to in[456]_input is
      performed. This is caused by a concurrent manipulation of the mux
      channel without proper locking as hwmon and mfd use different locks for
      synchronization.
      
      Switch hwmon to use the same lock as mfd when accessing the TSI channel.
      
      Fixes: 4f16cab1 ("hwmon: da9052: Add support for TSI channel")
      Signed-off-by: NSamu Nuutamo <samu.nuutamo@vincit.fi>
      [rebase to current master, reword commit message slightly]
      Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      333e22db
  5. 13 5月, 2020 7 次提交