Skip to content
  1. Oct 20, 2023
  2. Oct 19, 2023
  3. Oct 18, 2023
  4. Oct 17, 2023
  5. Oct 16, 2023
    • Linus Torvalds's avatar
      Linux 6.6-rc6 · 58720809
      Linus Torvalds authored
      58720809
    • Linus Torvalds's avatar
      Revert "x86/smp: Put CPUs into INIT on shutdown if possible" · fbe1bf1e
      Linus Torvalds authored
      This reverts commit 45e34c8a, and the
      two subsequent fixes to it:
      
        3f874c9b ("x86/smp: Don't send INIT to non-present and non-booted CPUs")
        b1472a60 ("x86/smp: Don't send INIT to boot CPU")
      
      because it seems to result in hung machines at shutdown.  Particularly
      some Dell machines, but Thomas says
      
       "The rest seems to be Lenovo and Sony with Alderlake/Raptorlake CPUs -
        at least that's what I could figure out from the various bug reports.
      
        I don't know which CPUs the DELL machines have, so I can't say it's a
        pattern.
      
        I agree with the revert for now"
      
      Ashok Raj chimes in:
      
       "There was a report (probably this same one), and it turns out it was a
        bug in the BIOS SMI handler.
      
        The client BIOS's were waiting for the lowest APICID to be the SMI
        rendevous master. If this is MeteorLake, the BSP wasn't the one with
        the lowest APIC and it triped here.
      
        The BIOS change is also being pushed to others for assimilation :)
      
        Server BIOS's had this correctly for a while now"
      
      and it does look likely to be some bad interaction between SMI and the
      non-BSP cores having put into INIT (and thus unresponsive until reset).
      
      Link: https://bbs.archlinux.org/viewtopic.php?pid=2124429
      Link: https://www.reddit.com/r/openSUSE/comments/16qq99b/tumbleweed_shutdown_did_not_finish_completely/
      Link: https://forum.artixlinux.org/index.php/topic,5997.0.html
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=2241279
      
      
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Ashok Raj <ashok.raj@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fbe1bf1e
    • Xuan Zhuo's avatar
      virtio_net: fix the missing of the dma cpu sync · 5720c43d
      Xuan Zhuo authored
      
      
      Commit 295525e2 ("virtio_net: merge dma operations when filling
      mergeable buffers") unmaps the buffer with DMA_ATTR_SKIP_CPU_SYNC when
      the dma->ref is zero. We do that with DMA_ATTR_SKIP_CPU_SYNC, because we
      do not want to do the sync for the entire page_frag. But that misses the
      sync for the current area.
      
      This patch does cpu sync regardless of whether the ref is zero or not.
      
      Fixes: 295525e2 ("virtio_net: merge dma operations when filling mergeable buffers")
      Reported-by: default avatarMichael Roth <michael.roth@amd.com>
      Closes: http://lore.kernel.org/all/20230926130451.axgodaa6tvwqs3ut@amd.com
      
      
      Signed-off-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5720c43d
    • Zygo Blaxell's avatar
      btrfs: fix stripe length calculation for non-zoned data chunk allocation · 8a540e99
      Zygo Blaxell authored
      Commit f6fca391 "btrfs: store chunk size in space-info struct"
      broke data chunk allocations on non-zoned multi-device filesystems when
      using default chunk_size.  Commit 5da431b7 "btrfs: fix the max chunk
      size and stripe length calculation" partially fixed that, and this patch
      completes the fix for that case.
      
      After commit f6fca391 and 5da431b7, the sequence of events for
      a data chunk allocation on a non-zoned filesystem is:
      
              1.  btrfs_create_chunk calls init_alloc_chunk_ctl, which copies
              space_info->chunk_size (default 10 GiB) to ctl->max_stripe_len
              unmodified.  Before f6fca391, ctl->max_stripe_len value was
              1 GiB for non-zoned data chunks and not configurable.
      
              2.  btrfs_create_chunk calls gather_device_info which consumes
              and produces more fields of chunk_ctl.
      
              3.  gather_device_info multiplies ctl->max_stripe_len by
              ctl->dev_stripes (which is 1 in all cases except dup)
              and calls find_free_dev_extent with that number as num_bytes.
      
              4.  find_free_dev_extent locates the first dev_extent hole on
              a device which is at least as large as num_bytes.  With default
              max_chunk_size from f6fca391, it finds the first hole which is
              longer than 10 GiB, or the largest hole if that hole is shorter
              than 10 GiB.  This is different from the pre-f6fca391
              behavior, where num_bytes is 1 GiB, and find_free_dev_extent
              may choose a different hole.
      
              5.  gather_device_info repeats step 4 with all devices to find
              the first or largest dev_extent hole that can be allocated on
              each device.
      
              6.  gather_device_info sorts the device list by the hole size
              on each device, using total unallocated space on each device to
              break ties, then returns to btrfs_create_chunk with the list.
      
              7.  btrfs_create_chunk calls decide_stripe_size_regular.
      
              8.  decide_stripe_size_regular finds the largest stripe_len that
              fits across the first nr_devs device dev_extent holes that were
              found by gather_device_info (and satisfies other constraints
              on stripe_len that are not relevant here).
      
              9.  decide_stripe_size_regular caps the length of the stripe it
              computed at 1 GiB.  This cap appeared in 5da431b7 to correct
              one of the other regressions introduced in f6fca391.
      
              10.  btrfs_create_chunk creates a new chunk with the above
              computed size and number of devices.
      
      At step 4, gather_device_info() has found a location where stripe up to
      10 GiB in length could be allocated on several devices, and selected
      which devices should have a dev_extent allocated on them, but at step
      9, only 1 GiB of the space that was found on each device can be used.
      This mismatch causes new suboptimal chunk allocation cases that did not
      occur in pre-f6fca391 kernels.
      
      Consider a filesystem using raid1 profile with 3 devices.  After some
      balances, device 1 has 10x 1 GiB unallocated space, while devices 2
      and 3 have 1x 10 GiB unallocated space, i.e. the same total amount of
      space, but distributed across different numbers of dev_extent holes.
      For visualization, let's ignore all the chunks that were allocated before
      this point, and focus on the remaining holes:
      
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10x 1 GiB unallocated)
              Device 2:  [__________] (10 GiB contig unallocated)
              Device 3:  [__________] (10 GiB contig unallocated)
      
      Before f6fca391, the allocator would fill these optimally by
      allocating chunks with dev_extents on devices 1 and 2 ([12]), 1 and 3
      ([13]), or 2 and 3 ([23]):
      
              [after 0 chunk allocations]
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10 GiB)
              Device 2:  [__________] (10 GiB)
              Device 3:  [__________] (10 GiB)
      
              [after 1 chunk allocation]
              Device 1:  [12] [_] [_] [_] [_] [_] [_] [_] [_] [_]
              Device 2:  [12] [_________] (9 GiB)
              Device 3:  [__________] (10 GiB)
      
              [after 2 chunk allocations]
              Device 1:  [12] [13] [_] [_] [_] [_] [_] [_] [_] [_] (8 GiB)
              Device 2:  [12] [_________] (9 GiB)
              Device 3:  [13] [_________] (9 GiB)
      
              [after 3 chunk allocations]
              Device 1:  [12] [13] [12] [_] [_] [_] [_] [_] [_] [_] (7 GiB)
              Device 2:  [12] [12] [________] (8 GiB)
              Device 3:  [13] [_________] (9 GiB)
      
              [...]
      
              [after 12 chunk allocations]
              Device 1:  [12] [13] [12] [13] [12] [13] [12] [13] [_] [_] (2 GiB)
              Device 2:  [12] [12] [23] [23] [12] [12] [23] [23] [__] (2 GiB)
              Device 3:  [13] [13] [23] [23] [13] [23] [13] [23] [__] (2 GiB)
      
              [after 13 chunk allocations]
              Device 1:  [12] [13] [12] [13] [12] [13] [12] [13] [12] [_] (1 GiB)
              Device 2:  [12] [12] [23] [23] [12] [12] [23] [23] [12] [_] (1 GiB)
              Device 3:  [13] [13] [23] [23] [13] [23] [13] [23] [__] (2 GiB)
      
              [after 14 chunk allocations]
              Device 1:  [12] [13] [12] [13] [12] [13] [12] [13] [12] [13] (full)
              Device 2:  [12] [12] [23] [23] [12] [12] [23] [23] [12] [_] (1 GiB)
              Device 3:  [13] [13] [23] [23] [13] [23] [13] [23] [13] [_] (1 GiB)
      
              [after 15 chunk allocations]
              Device 1:  [12] [13] [12] [13] [12] [13] [12] [13] [12] [13] (full)
              Device 2:  [12] [12] [23] [23] [12] [12] [23] [23] [12] [23] (full)
              Device 3:  [13] [13] [23] [23] [13] [23] [13] [23] [13] [23] (full)
      
      This allocates all of the space with no waste.  The sorting function used
      by gather_device_info considers free space holes above 1 GiB in length
      to be equal to 1 GiB, so once find_free_dev_extent locates a sufficiently
      long hole on each device, all the holes appear equal in the sort, and the
      comparison falls back to sorting devices by total free space.  This keeps
      usable space on each device equal so they can all be filled completely.
      
      After f6fca391, the allocator prefers the devices with larger holes
      over the devices with more free space, so it makes bad allocation choices:
      
              [after 1 chunk allocation]
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10 GiB)
              Device 2:  [23] [_________] (9 GiB)
              Device 3:  [23] [_________] (9 GiB)
      
              [after 2 chunk allocations]
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10 GiB)
              Device 2:  [23] [23] [________] (8 GiB)
              Device 3:  [23] [23] [________] (8 GiB)
      
              [after 3 chunk allocations]
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10 GiB)
              Device 2:  [23] [23] [23] [_______] (7 GiB)
              Device 3:  [23] [23] [23] [_______] (7 GiB)
      
              [...]
      
              [after 9 chunk allocations]
              Device 1:  [_] [_] [_] [_] [_] [_] [_] [_] [_] [_] (10 GiB)
              Device 2:  [23] [23] [23] [23] [23] [23] [23] [23] [23] [_] (1 GiB)
              Device 3:  [23] [23] [23] [23] [23] [23] [23] [23] [23] [_] (1 GiB)
      
              [after 10 chunk allocations]
              Device 1:  [12] [_] [_] [_] [_] [_] [_] [_] [_] [_] (9 GiB)
              Device 2:  [23] [23] [23] [23] [23] [23] [23] [23] [12] (full)
              Device 3:  [23] [23] [23] [23] [23] [23] [23] [23] [_] (1 GiB)
      
              [after 11 chunk allocations]
              Device 1:  [12] [13] [_] [_] [_] [_] [_] [_] [_] [_] (8 GiB)
              Device 2:  [23] [23] [23] [23] [23] [23] [23] [23] [12] (full)
              Device 3:  [23] [23] [23] [23] [23] [23] [23] [23] [13] (full)
      
      No further allocations are possible, with 8 GiB wasted (4 GiB of data
      space).  The sort in gather_device_info now considers free space in
      holes longer than 1 GiB to be distinct, so it will prefer devices 2 and
      3 over device 1 until all but 1 GiB is allocated on devices 2 and 3.
      At that point, with only 1 GiB unallocated on every device, the largest
      hole length on each device is equal at 1 GiB, so the sort finally moves
      to ordering the devices with the most free space, but by this time it
      is too late to make use of the free space on device 1.
      
      Note that it's possible to contrive a case where the pre-f6fca391
      allocator fails the same way, but these cases generally have extensive
      dev_extent fragmentation as a precondition (e.g. many holes of 768M
      in length on one device, and few holes 1 GiB in length on the others).
      With the regression in f6fca391, bad chunk allocation can occur even
      under optimal conditions, when all dev_extent holes are exact multiples
      of stripe_len in length, as in the example above.
      
      Also note that post-f6fca391 kernels do treat dev_extent holes
      larger than 10 GiB as equal, so the bad behavior won't show up on a
      freshly formatted filesystem; however, as the filesystem ages and fills
      up, and holes ranging from 1 GiB to 10 GiB in size appear, the problem
      can show up as a failure to balance after adding or removing devices,
      or an unexpected shortfall in available space due to unequal allocation.
      
      To fix the regression and make data chunk allocation work
      again, set ctl->max_stripe_len back to the original SZ_1G, or
      space_info->chunk_size if that's smaller (the latter can happen if the
      user set space_info->chunk_size to less than 1 GiB via sysfs, or it's
      a 32 MiB system chunk with a hardcoded chunk_size and stripe_len).
      
      While researching the background of the earlier commits, I found that an
      identical fix was already proposed at:
      
        https://lore.kernel.org/linux-btrfs/de83ac46-a4a3-88d3-85ce-255b7abc5249@gmx.com/
      
      The previous review missed one detail:  ctl->max_stripe_len is used
      before decide_stripe_size_regular() is called, when it is too late for
      the changes in that function to have any effect.  ctl->max_stripe_len is
      not used directly by decide_stripe_size_regular(), but the parameter
      does heavily influence the per-device free space data presented to
      the function.
      
      Fixes: f6fca391 ("btrfs: store chunk size in space-info struct")
      CC: stable@vger.kernel.org # 6.1+
      Link: https://lore.kernel.org/linux-btrfs/20231007051421.19657-1-ce3g8jdj@umail.furryterror.org/
      
      
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarZygo Blaxell <ce3g8jdj@umail.furryterror.org>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      8a540e99
    • Linus Torvalds's avatar
      Merge tag 'usb-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 11d3f726
      Linus Torvalds authored
      Pull USB / Thunderbolt fixes from Greg KH:
       "Here are some USB and Thunderbolt driver fixes for 6.6-rc6 to resolve
        a number of small reported issues. Included in here are:
      
         - thunderbolt driver fixes
      
         - xhci driver fixes
      
         - cdns3 driver fixes
      
         - musb driver fixes
      
         - a number of typec driver fixes
      
         - a few other small driver fixes
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (22 commits)
        usb: typec: ucsi: Use GET_CAPABILITY attributes data to set power supply scope
        usb: typec: ucsi: Fix missing link removal
        usb: typec: altmodes/displayport: Signal hpd low when exiting mode
        xhci: Preserve RsvdP bits in ERSTBA register correctly
        xhci: Clear EHB bit only at end of interrupt handler
        xhci: track port suspend state correctly in unsuccessful resume cases
        usb: xhci: xhci-ring: Use sysdev for mapping bounce buffer
        usb: typec: ucsi: Clear EVENT_PENDING bit if ucsi_send_command fails
        usb: misc: onboard_hub: add support for Microchip USB2412 USB 2.0 hub
        usb: gadget: udc-xilinx: replace memcpy with memcpy_toio
        usb: cdns3: Modify the return value of cdns_set_active () to void when CONFIG_PM_SLEEP is disabled
        usb: dwc3: Soft reset phy on probe for host
        usb: hub: Guard against accesses to uninitialized BOS descriptors
        usb: typec: qcom: Update the logic of regulator enable and disable
        usb: gadget: ncm: Handle decoding of multiple NTB's in unwrap call
        usb: musb: Get the musb_qh poniter after musb_giveback
        usb: musb: Modify the "HWVers" register address
        usb: cdnsp: Fixes issue with dequeuing not queued requests
        thunderbolt: Restart XDomain discovery handshake after failure
        thunderbolt: Correct TMU mode initialization from hardware
        ...
      11d3f726
    • Linus Torvalds's avatar
      Merge tag 'tty-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 41226a36
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some small tty/serial driver fixes for 6.6-rc6 that resolve
        some reported issues. Included in here are:
      
         - serial core pm runtime fix for issue reported by many
      
         - 8250_omap driver fix
      
         - rs485 spinlock fix for reported problem
      
         - ams-delta bugfix for previous tty api changes in -rc1 that missed
           this driver that never seems to get built in any test systems
      
        All of these have been in linux-next for over a week with no reported
        problems"
      
      * tag 'tty-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        ASoC: ti: ams-delta: Fix cx81801_receive() argument types
        serial: core: Fix checks for tx runtime PM state
        serial: 8250_omap: Fix errors with no_console_suspend
        serial: Reduce spinlocked portion of uart_rs485_config()
      41226a36
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · a477e3a7
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here is a small set of char/misc and other smaller driver subsystem
        fixes for 6.6-rc6. Included in here are:
      
         - lots of iio driver fixes
      
         - binder memory leak fix
      
         - mcb driver fixes
      
         - counter driver fixes
      
         - firmware loader documentation fix
      
         - documentation update for embargoed hardware issues
      
        All of these have been in linux-next for over a week with no reported
        issues"
      
      * tag 'char-misc-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (22 commits)
        iio: pressure: ms5611: ms5611_prom_is_valid false negative bug
        dt-bindings: iio: adc: adi,ad7292: Fix additionalProperties on channel nodes
        iio: adc: ad7192: Correct reference voltage
        iio: light: vcnl4000: Don't power on/off chip in config
        iio: addac: Kconfig: update ad74413r selections
        iio: pressure: dps310: Adjust Timeout Settings
        iio: imu: bno055: Fix missing Kconfig dependencies
        iio: adc: imx8qxp: Fix address for command buffer registers
        iio: cros_ec: fix an use-after-free in cros_ec_sensors_push_data()
        iio: irsd200: fix -Warray-bounds bug in irsd200_trigger_handler
        dt-bindings: iio: rohm,bu27010: add missing vdd-supply to example
        binder: fix memory leaks of spam and pending work
        firmware_loader: Update contact emails for ABI docs
        Documentation: embargoed-hardware-issues.rst: Clarify prenotifaction
        mcb: remove is_added flag from mcb_device struct
        coresight: tmc-etr: Disable warnings for allocation failures
        coresight: Fix run time warnings while reusing ETR buffer
        iio: admv1013: add mixer_vgate corner cases
        iio: pressure: bmp280: Fix NULL pointer exception
        iio: dac: ad3552r: Correct device IDs
        ...
      a477e3a7
  6. Oct 15, 2023
  7. Oct 14, 2023
    • Amir Goldstein's avatar
      ovl: fix regression in showing lowerdir mount option · 32db5107
      Amir Goldstein authored
      
      
      Before commit b36a5780 ("ovl: modify layer parameter parsing"),
      spaces and commas in lowerdir mount option value used to be escaped using
      seq_show_option().
      
      In current upstream, when lowerdir value has a space, it is not escaped
      in /proc/mounts, e.g.:
      
        none /mnt overlay rw,relatime,lowerdir=l l,upperdir=u,workdir=w 0 0
      
      which results in broken output of the mount utility:
      
        none on /mnt type overlay (rw,relatime,lowerdir=l)
      
      Store the original lowerdir mount options before unescaping and show
      them using the same escaping used for seq_show_option() in addition to
      escaping the colon separator character.
      
      Fixes: b36a5780 ("ovl: modify layer parameter parsing")
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      32db5107