1. 23 6月, 2022 3 次提交
    • M
      xhci: turn off port power in shutdown · 83810f84
      Mathias Nyman 提交于
      If ports are not turned off in shutdown then runtime suspended
      self-powered USB devices may survive in U3 link state over S5.
      
      During subsequent boot, if firmware sends an IPC command to program
      the port in DISCONNECT state, it will time out, causing significant
      delay in the boot time.
      
      Turning off roothub port power is also recommended in xhci
      specification 4.19.4 "Port Power" in the additional note.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20220623111945.1557702-3-mathias.nyman@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83810f84
    • H
      xhci: Keep interrupt disabled in initialization until host is running. · a8089250
      Hongyu Xie 提交于
      irq is disabled in xhci_quiesce(called by xhci_halt, with bit:2 cleared
      in USBCMD register), but xhci_run(called by usb_add_hcd) re-enable it.
      It's possible that you will receive thousands of interrupt requests
      after initialization for 2.0 roothub. And you will get a lot of
      warning like, "xHCI dying, ignoring interrupt. Shouldn't IRQs be
      disabled?". This amount of interrupt requests will cause the entire
      system to freeze.
      This problem was first found on a device with ASM2142 host controller
      on it.
      
      [tidy up old code while moving it, reword header -Mathias]
      
      Cc: stable@kernel.org
      Signed-off-by: NHongyu Xie <xiehongyu1@kylinos.cn>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20220623111945.1557702-2-mathias.nyman@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8089250
    • M
      USB: serial: option: add Quectel RM500K module support · 15b694e9
      Macpaul Lin 提交于
      Add usb product id of the Quectel RM500K module.
      
      RM500K provides 2 mandatory interfaces to Linux host after enumeration.
       - /dev/ttyUSB5: this is a serial interface for control path. User needs
         to write AT commands to this device node to query status, set APN,
         set PIN code, and enable/disable the data connection to 5G network.
       - ethX: this is the data path provided as a RNDIS devices. After the
         data connection has been established, Linux host can access 5G data
         network via this interface.
      
      "RNDIS": RNDIS + ADB + AT (/dev/ttyUSB5) + MODEM COMs
      
      usb-devices output for 0x7001:
      T:  Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2c7c ProdID=7001 Rev=00.01
      S:  Manufacturer=MediaTek Inc.
      S:  Product=USB DATA CARD
      S:  SerialNumber=869206050009672
      C:  #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=ff Driver=rndis_host
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Co-developed-by: NBallon Shi <ballon.shi@quectel.com>
      Signed-off-by: NBallon Shi <ballon.shi@quectel.com>
      Signed-off-by: NMacpaul Lin <macpaul.lin@mediatek.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      15b694e9
  2. 22 6月, 2022 2 次提交
    • Y
      USB: serial: option: add Quectel EM05-G modem · 33b29dbb
      Yonglin Tan 提交于
      The EM05-G modem has 2 USB configurations that are configurable via the AT
      command AT+QCFG="usbnet",[ 0 | 2 ] which make the modem enumerate with
      the following interfaces, respectively:
      
      "RMNET"	: AT + DIAG + NMEA + Modem + QMI
      "MBIM"	: MBIM + AT + DIAG + NMEA + Modem
      
      The detailed description of the USB configuration for each mode as follows:
      
      RMNET Mode
      --------------
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 21 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2c7c ProdID=030a Rev= 3.18
      S:  Manufacturer=Quectel
      S:  Product=Quectel EM05-G
      C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      MBIM Mode
      --------------
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2c7c ProdID=030a Rev= 3.18
      S:  Manufacturer=Quectel
      S:  Product=Quectel EM05-G
      C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
      E:  Ad=89(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: NYonglin Tan <yonglin.tan@outlook.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      33b29dbb
    • J
      USB: serial: pl2303: add support for more HXN (G) types · ae60aac5
      Johan Hovold 提交于
      Add support for further HXN (G) type devices (GT variant, GL variant, GS
      variant and GR) and document the bcdDevice mapping.
      
      Note that the TA and TB types use the same bcdDevice as some GT and GE
      variants, respectively, but that the HX status request can be used to
      determine which is which.
      
      Also note that we currently do not distinguish between the various HXN
      (G) types in the driver but that this may change eventually (e.g. when
      adding GPIO support).
      Reported-by: NCharles Yeh <charlesyeh522@gmail.com>
      Link: https://lore.kernel.org/r/YrF77b9DdeumUAee@hovoldconsulting.com
      Cc: stable@vger.kernel.org	# 5.13
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ae60aac5
  3. 21 6月, 2022 3 次提交
  4. 20 6月, 2022 1 次提交
  5. 17 6月, 2022 4 次提交
    • M
      dm mirror log: round up region bitmap size to BITS_PER_LONG · 85e123c2
      Mikulas Patocka 提交于
      The code in dm-log rounds up bitset_size to 32 bits. It then uses
      find_next_zero_bit_le on the allocated region. find_next_zero_bit_le
      accesses the bitmap using unsigned long pointers. So, on 64-bit
      architectures, it may access 4 bytes beyond the allocated size.
      
      Fix this bug by rounding up bitset_size to BITS_PER_LONG.
      
      This bug was found by running the lvm2 testsuite with kasan.
      
      Fixes: 29121bd0 ("[PATCH] dm mirror log: bitset_size fix")
      Cc: stable@vger.kernel.org
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@kernel.org>
      85e123c2
    • M
      dm: fix narrow race for REQ_NOWAIT bios being issued despite no support · 1ee88de3
      Mikulas Patocka 提交于
      Starting with the commit 63a225c9fd20, device mapper has an optimization
      that it will take cheaper table lock (dm_get_live_table_fast instead of
      dm_get_live_table) if the bio has REQ_NOWAIT. The bios with REQ_NOWAIT
      must not block in the target request routine, if they did, we would be
      blocking while holding rcu_read_lock, which is prohibited.
      
      The targets that are suitable for REQ_NOWAIT optimization (and that don't
      block in the map routine) have the flag DM_TARGET_NOWAIT set. Device
      mapper will test if all the targets and all the devices in a table
      support nowait (see the function dm_table_supports_nowait) and it will set
      or clear the QUEUE_FLAG_NOWAIT flag on its request queue according to
      this check.
      
      There's a test in submit_bio_noacct: "if ((bio->bi_opf & REQ_NOWAIT) &&
      !blk_queue_nowait(q)) goto not_supported" - this will make sure that
      REQ_NOWAIT bios can't enter a request queue that doesn't support them.
      
      This mechanism works to prevent REQ_NOWAIT bios from reaching dm targets
      that don't support the REQ_NOWAIT flag (and that may block in the map
      routine) - except that there is a small race condition:
      
      submit_bio_noacct checks if the queue has the QUEUE_FLAG_NOWAIT without
      holding any locks. Immediatelly after this check, the device mapper table
      may be reloaded with a table that doesn't support REQ_NOWAIT (for example,
      if we start moving the logical volume or if we activate a snapshot).
      However the REQ_NOWAIT bio that already passed the check in
      submit_bio_noacct would be sent to device mapper, where it could be
      redirected to a dm target that doesn't support REQ_NOWAIT - the result is
      sleeping while we hold rcu_read_lock.
      
      In order to fix this race, we double-check if the target supports
      REQ_NOWAIT while we hold the table lock (so that the table can't change
      under us).
      
      Fixes: 563a225c ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio")
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@kernel.org>
      1ee88de3
    • M
      dm: fix use-after-free in dm_put_live_table_bio · 5d7362d0
      Mikulas Patocka 提交于
      dm_put_live_table_bio is called from the end of dm_submit_bio.
      However, at this point, the bio may be already finished and the caller
      may have freed the bio. Consequently, dm_put_live_table_bio accesses
      the stale "bio" pointer.
      
      Fix this bug by loading the bi_opf value and passing it to
      dm_get_live_table_bio and dm_put_live_table_bio instead of the bio.
      
      This bug was found by running the lvm2 testsuite with kasan.
      
      Fixes: 563a225c ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio")
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@kernel.org>
      5d7362d0
    • Y
      net: axienet: add missing error return code in axienet_probe() · 2e7bf4a6
      Yang Yingliang 提交于
      It should return error code in error path in axienet_probe().
      
      Fixes: 00be43a7 ("net: axienet: make the 64b addresable DMA depends on 64b archectures")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Link: https://lore.kernel.org/r/20220616062917.3601-1-yangyingliang@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      2e7bf4a6
  6. 16 6月, 2022 3 次提交
    • J
      init: Initialize noop_backing_dev_info early · 4bca7e80
      Jan Kara 提交于
      noop_backing_dev_info is used by superblocks of various
      pseudofilesystems such as kdevtmpfs. After commit 10e14073
      ("writeback: Fix inode->i_io_list not be protected by inode->i_lock
      error") this broke because __mark_inode_dirty() started to access more
      fields from noop_backing_dev_info and this led to crashes inside
      locked_inode_to_wb_and_lock_list() called from __mark_inode_dirty().
      Fix the problem by initializing noop_backing_dev_info before the
      filesystems get mounted.
      
      Fixes: 10e14073 ("writeback: Fix inode->i_io_list not be protected by inode->i_lock error")
      Reported-and-tested-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Reported-and-tested-by: NAlexandru Elisei <alexandru.elisei@arm.com>
      Reported-and-tested-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4bca7e80
    • L
      md/raid5-ppl: Fix argument order in bio_alloc_bioset() · f34fdcd4
      Logan Gunthorpe 提交于
      bio_alloc_bioset() takes a block device, number of vectors, the
      OP flags, the GFP mask and the bio set. However when the prototype
      was changed, the callisite in ppl_do_flush() had the OP flags and
      the GFP flags reversed. This introduced some sparse error:
      
        drivers/md/raid5-ppl.c:632:57: warning: incorrect type in argument 3
      				    (different base types)
        drivers/md/raid5-ppl.c:632:57:    expected unsigned int opf
        drivers/md/raid5-ppl.c:632:57:    got restricted gfp_t [usertype]
        drivers/md/raid5-ppl.c:633:61: warning: incorrect type in argument 4
        				    (different base types)
        drivers/md/raid5-ppl.c:633:61:    expected restricted gfp_t [usertype]
      				    gfp_mask
        drivers/md/raid5-ppl.c:633:61:    got unsigned long long
      
      The sparse error introduction may not have been reported correctly by
      0day due to other work that was cleaning up other sparse errors in this
      area.
      
      Fixes: 609be106 ("block: pass a block_device and opf to bio_alloc_bioset")
      Cc: stable@vger.kernel.org # 5.18+
      Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSong Liu <song@kernel.org>
      f34fdcd4
    • G
      Revert "md: don't unregister sync_thread with reconfig_mutex held" · d0a18034
      Guoqing Jiang 提交于
      The 07reshape5intr test is broke because of below path.
      
          md_reap_sync_thread
                  -> mddev_unlock
                  -> md_unregister_thread(&mddev->sync_thread)
      
      And md_check_recovery is triggered by,
      
      mddev_unlock -> md_wakeup_thread(mddev->thread)
      
      then mddev->reshape_position is set to MaxSector in raid5_finish_reshape
      since MD_RECOVERY_INTR is cleared in md_check_recovery, which means
      feature_map is not set with MD_FEATURE_RESHAPE_ACTIVE and superblock's
      reshape_position can't be updated accordingly.
      
      Fixes: 8b48ec23 ("md: don't unregister sync_thread with reconfig_mutex held")
      Reported-by: NLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: NGuoqing Jiang <guoqing.jiang@linux.dev>
      Signed-off-by: NSong Liu <song@kernel.org>
      d0a18034
  7. 15 6月, 2022 11 次提交
  8. 14 6月, 2022 13 次提交