1. Apr 12, 2023
  2. Apr 11, 2023
  3. Apr 07, 2023
  4. Apr 06, 2023
    • Douglas Anderson's avatar
      regulator: core: Avoid lockdep reports when resolving supplies · cba6cfdc
      Douglas Anderson authored
      An automated bot told me that there was a potential lockdep problem
      with regulators. This was on the chromeos-5.15 kernel, but I see
      nothing that would be different downstream compared to upstream. The
      bot said:
        ============================================
        WARNING: possible recursive locking detected
        5.15.104-lockdep-17461-gc1e499ed6604 #1 Not tainted
        --------------------------------------------
        kworker/u16:4/115 is trying to acquire lock:
        ffffff8083110170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: create_regulator+0x398/0x7ec
      
        but task is already holding lock:
        ffffff808378e170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: ww_mutex_trylock+0x3c/0x7b8
      
        other info that might help us debug this:
         Possible unsafe locking scenario:
      
               CPU0
               ----
          lock(regulator_ww_class_mutex);
          lock(regulator_ww_class_mutex);
      
         *** DEADLOCK ***
      
         May be due to missing lock nesting notation
      
        4 locks held by kworker/u16:4/115:
         #0: ffffff808006a948 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x520/0x1348
         #1: ffffffc00e0a7cc0 ((work_completion)(&entry->work)){+.+.}-{0:0}, at: process_one_work+0x55c/0x1348
         #2: ffffff80828a2260 (&dev->mutex){....}-{3:3}, at: __device_attach_async_helper+0xd0/0x2a4
         #3: ffffff808378e170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: ww_mutex_trylock+0x3c/0x7b8
      
        stack backtrace:
        CPU: 2 PID: 115 Comm: kworker/u16:4 Not tainted 5.15.104-lockdep-17461-gc1e499ed6604 #1 9292e52fa83c0e23762b2b3aa1bacf5787a4d5da
        Hardware name: Google Quackingstick (rev0+) (DT)
        Workqueue: events_unbound async_run_entry_fn
        Call trace:
         dump_backtrace+0x0/0x4ec
         show_stack+0x34/0x50
         dump_stack_lvl+0xdc/0x11c
         dump_stack+0x1c/0x48
         __lock_acquire+0x16d4/0x6c74
         lock_acquire+0x208/0x750
         __mutex_lock_common+0x11c/0x11f8
         ww_mutex_lock+0xc0/0x440
         create_regulator+0x398/0x7ec
         regulator_resolve_supply+0x654/0x7c4
         regulator_register_resolve_supply+0x30/0x120
         class_for_each_device+0x1b8/0x230
         regulator_register+0x17a4/0x1f40
         devm_regulator_register+0x60/0xd0
         reg_fixed_voltage_probe+0x728/0xaec
         platform_probe+0x150/0x1c8
         really_probe+0x274/0xa20
         __driver_probe_device+0x1dc/0x3f4
         driver_probe_device+0x78/0x1c0
         __device_attach_driver+0x1ac/0x2c8
         bus_for_each_drv+0x11c/0x190
         __device_attach_async_helper+0x1e4/0x2a4
         async_run_entry_fn+0xa0/0x3ac
         process_one_work+0x638/0x1348
         worker_thread+0x4a8/0x9c4
         kthread+0x2e4/0x3a0
         ret_from_fork+0x10/0x20
      
      The problem was first reported soon after we made many of the
      regulators probe asynchronously, though nothing I've seen implies that
      the problems couldn't have also happened even without that.
      
      I haven't personally been able to reproduce the lockdep issue, but the
      issue does look somewhat legitimate. Specifically, it looks like in
      regulator_resolve_supply() we are holding a "rdev" lock while calling
      set_supply() -> create_regulator() which grabs the lock of a
      _different_ "rdev" (the one for our supply). This is not necessarily
      safe from a lockdep perspective since there is no documented ordering
      between these two locks.
      
      In reality, we should always be locking a regulator before the
      supplying regulator, so I don't expect there to be any real deadlocks
      in practice. However, the regulator framework in general doesn't
      express this to lockdep.
      
      Let's fix the issue by simply grabbing the two locks involved in the
      same way we grab multiple locks elsewhere in the regulator framework:
      using the "wound/wait" mechanisms.
      
      Fixes: eaa7995c
      
       ("regulator: core: avoid regulator_resolve_supply() race condition")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://lore.kernel.org/r/20230329143317.RFC.v2.2.I30d8e1ca10cfbe5403884cdd192253a2e063eb9e@changeid
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      cba6cfdc
    • Douglas Anderson's avatar
      regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow() · b83a1772
      Douglas Anderson authored
      When a codepath locks a rdev using ww_mutex_lock_slow() directly then
      that codepath is responsible for incrementing the "ref_cnt" and also
      setting the "mutex_owner" to "current".
      
      The regulator core consistently got that right for "ref_cnt" but
      didn't always get it right for "mutex_owner". Let's fix this.
      
      It's unlikely that this truly matters because the "mutex_owner" is
      only needed if we're going to do subsequent locking of the same
      rdev. However, even though it's not truly needed it seems less
      surprising if we consistently set "mutex_owner" properly.
      
      Fixes: f8702f9e
      
       ("regulator: core: Use ww_mutex for regulators locking")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://lore.kernel.org/r/20230329143317.RFC.v2.1.I4e9d433ea26360c06dd1381d091c82bb1a4ce843@changeid
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      b83a1772
  5. Apr 03, 2023
  6. Apr 02, 2023
    • Linus Torvalds's avatar
      Merge tag '6.3-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · f7772da6
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
       "Four cifs/smb3 client (reconnect and DFS related) fixes, including two
        for stable:
      
         - DFS oops fix
      
         - DFS reconnect recursion fix
      
         - An SMB1 parallel reconnect fix
      
         - Trivial dead code removal in smb2_reconnect"
      
      * tag '6.3-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: get rid of dead check in smb2_reconnect()
        cifs: prevent infinite recursion in CIFSGetDFSRefer()
        cifs: avoid races in parallel reconnects in smb1
        cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL
      f7772da6
    • Linus Torvalds's avatar
      Merge tag 'input-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 00c7b5f4
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - fixes to ALPS and Focaltech PS/2 drivers dealing with the breakage of
         switching to -funsigned-char
      
       - quirks to i8042 to better handle Lifebook A574/H and TUXEDO devices
      
       - a quirk to Goodix touchscreen driver to handle Yoga Book X90F
      
       - a fix for incorrectly merged patch to xpad game controller driver
      
      * tag 'input-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: i8042 - add TUXEDO devices to i8042 quirk tables for partial fix
        Input: alps - fix compatibility with -funsigned-char
        Input: focaltech - use explicitly signed char type
        Input: xpad - fix incorrectly applied patch for MAP_PROFILE_BUTTON
        Input: goodix - add Lenovo Yoga Book X90F to nine_bytes_report DMI table
        Input: i8042 - add quirk for Fujitsu Lifebook A574/H
      00c7b5f4
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 93e2b017
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some pin control fixes for the v6.3 series.
      
        The most notable and urgent one is probably the AMD fix which affects
        AMD laptops, found by the Chromium people.
      
        Summary:
      
         - Fix up the Kconfig options for MediaTek MT7981
      
         - Fix the irq domain name in the AT91-PIO4 driver
      
         - Fix some alternative muxing modes in the Ocelot driver
      
         - Allocate the GPIO numbers dynamically in the STM32 driver
      
         - Disable and mask interrupts on resume in the AMD driver
      
         - Fix a typo in the Qualcomm SM8550 pin control device tree bindings"
      
      * tag 'pinctrl-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        dt-bindings: pinctrl: qcom,sm8550-lpass-lpi: allow input-enabled and bias-bus-hold
        pinctrl: amd: Disable and mask interrupts on resume
        pinctrl: stm32: use dynamic allocation of GPIO base
        pinctrl: ocelot: Fix alt mode for ocelot
        pinctrl: at91-pio4: fix domain name assignment
        pinctrl: mediatek: fix naming inconsistency
        pinctrl: mediatek: add missing options to PINCTRL_MT7981
      93e2b017
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.3-2' of... · ce0c2375
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix linux-headers debian package
      
       - Fix a merge_config.sh error due to a misspelled variable
      
       - Fix modversion for 32-bit build machines
      
      * tag 'kbuild-fixes-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        modpost: Fix processing of CRCs on 32-bit build machines
        scripts: merge_config: Fix typo in variable name.
        kbuild: deb-pkg: set version for linux-headers paths
      ce0c2375
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 92367fdf
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
      
       - Maintainer update for S390 IOMMU driver
      
       - A fix for the set_platform_dma_ops() call-back in the Exynos
         IOMMU driver
      
       - Intel VT-d fixes from Lu Baolu:
          - Fix a lockdep splat
          - Fix a supplement of the specification
          - Fix a warning in perfmon code
      
      * tag 'iommu-fixes-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/vt-d: Fix an IOMMU perfmon warning when CPU hotplug
        iommu/vt-d: Allow zero SAGAW if second-stage not supported
        iommu/vt-d: Remove unnecessary locking in intel_irq_remapping_alloc()
        iommu/exynos: Fix set_platform_dma_ops() callback
        MAINTAINERS: Update s390-iommu driver maintainer information
      92367fdf
  7. Apr 01, 2023