Skip to content
  1. Feb 06, 2021
  2. Feb 02, 2021
  3. Feb 01, 2021
  4. Jan 31, 2021
    • Linus Walleij's avatar
      leds: rt8515: Add Richtek RT8515 LED driver · e1c6edcb
      Linus Walleij authored
      
      
      This adds a driver for the Richtek RT8515 dual channel
      torch/flash white LED driver.
      
      This LED driver is found in some mobile phones from
      Samsung such as the GT-S7710 and GT-I8190.
      
      A V4L interface is added.
      
      We do not have a proper datasheet for the RT8515 but
      it turns out that RT9387A has a public datasheet and
      is essentially the same chip. We designed the driver
      in accordance with this datasheet. The day someone
      needs to drive a RT9387A this driver can probably
      easily be augmented to handle that chip too.
      
      Sakari Ailus, Pavel Machek and Andy Shevchenko helped
      significantly in getting this driver right.
      
      Cc: Sakari Ailus <sakari.ailus@iki.fi>
      Cc: newbytee@protonmail.com
      Cc: Stephan Gerhold <stephan@gerhold.net>
      Cc: linux-media@vger.kernel.org
      Cc: phone-devel@vger.kernel.org
      Reviewed-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      e1c6edcb
    • Linus Walleij's avatar
      dt-bindings: leds: Add DT binding for Richtek RT8515 · c8283eb7
      Linus Walleij authored
      
      
      Add a YAML devicetree binding for the Richtek RT8515
      dual channel flash/torch LED driver.
      
      Cc: Sakari Ailus <sakari.ailus@iki.fi>
      Cc: newbytee@protonmail.com
      Cc: Stephan Gerhold <stephan@gerhold.net>
      Cc: phone-devel@vger.kernel.org
      Cc: linux-media@vger.kernel.org
      Cc: devicetree@vger.kernel.org
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      c8283eb7
    • Andrea Righi's avatar
      leds: trigger: fix potential deadlock with libata · 27af8e2c
      Andrea Righi authored
      We have the following potential deadlock condition:
      
       ========================================================
       WARNING: possible irq lock inversion dependency detected
       5.10.0-rc2+ #25 Not tainted
       --------------------------------------------------------
       swapper/3/0 just changed the state of lock:
       ffff8880063bd618 (&host->lock){-...}-{2:2}, at: ata_bmdma_interrupt+0x27/0x200
       but this lock took another, HARDIRQ-READ-unsafe lock in the past:
        (&trig->leddev_list_lock){.+.?}-{2:2}
      
       and interrupts could create inverse lock ordering between them.
      
       other info that might help us debug this:
        Possible interrupt unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(&trig->leddev_list_lock);
                                      local_irq_disable();
                                      lock(&host->lock);
                                      lock(&trig->leddev_list_lock);
         <Interrupt>
           lock(&host->lock);
      
        *** DEADLOCK ***
      
       no locks held by swapper/3/0.
      
       the shortest dependencies between 2nd lock and 1st lock:
        -> (&trig->leddev_list_lock){.+.?}-{2:2} ops: 46 {
           HARDIRQ-ON-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             rfkill_global_led_trigger_worker+0x94/0xb0
                             process_one_work+0x240/0x560
                             worker_thread+0x58/0x3d0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           IN-SOFTIRQ-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             kbd_bh+0x9e/0xc0
                             tasklet_action_common.constprop.0+0xe9/0x100
                             tasklet_action+0x22/0x30
                             __do_softirq+0xcc/0x46d
                             run_ksoftirqd+0x3f/0x70
                             smpboot_thread_fn+0x116/0x1f0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           SOFTIRQ-ON-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             rfkill_global_led_trigger_worker+0x94/0xb0
                             process_one_work+0x240/0x560
                             worker_thread+0x58/0x3d0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           INITIAL READ USE at:
                                 lock_acquire+0x15f/0x420
                                 _raw_read_lock+0x42/0x90
                                 led_trigger_event+0x2b/0x70
                                 rfkill_global_led_trigger_worker+0x94/0xb0
                                 process_one_work+0x240/0x560
                                 worker_thread+0x58/0x3d0
                                 kthread+0x151/0x170
                                 ret_from_fork+0x1f/0x30
         }
         ... key      at: [<ffffffff83da4c00>] __key.0+0x0/0x10
         ... acquired at:
          _raw_read_lock+0x42/0x90
          led_trigger_blink_oneshot+0x3b/0x90
          ledtrig_disk_activity+0x3c/0xa0
          ata_qc_complete+0x26/0x450
          ata_do_link_abort+0xa3/0xe0
          ata_port_freeze+0x2e/0x40
          ata_hsm_qc_complete+0x94/0xa0
          ata_sff_hsm_move+0x177/0x7a0
          ata_sff_pio_task+0xc7/0x1b0
          process_one_work+0x240/0x560
          worker_thread+0x58/0x3d0
          kthread+0x151/0x170
          ret_from_fork+0x1f/0x30
      
       -> (&host->lock){-...}-{2:2} ops: 69 {
          IN-HARDIRQ-W at:
                           lock_acquire+0x15f/0x420
                           _raw_spin_lock_irqsave+0x52/0xa0
                           ata_bmdma_interrupt+0x27/0x200
                           __handle_irq_event_percpu+0xd5/0x2b0
                           handle_irq_event+0x57/0xb0
                           handle_edge_irq+0x8c/0x230
                           asm_call_irq_on_stack+0xf/0x20
                           common_interrupt+0x100/0x1c0
                           asm_common_interrupt+0x1e/0x40
                           native_safe_halt+0xe/0x10
                           arch_cpu_idle+0x15/0x20
                           default_idle_call+0x59/0x1c0
                           do_idle+0x22c/0x2c0
                           cpu_startup_entry+0x20/0x30
                           start_secondary+0x11d/0x150
                           secondary_startup_64_no_verify+0xa6/0xab
          INITIAL USE at:
                          lock_acquire+0x15f/0x420
                          _raw_spin_lock_irqsave+0x52/0xa0
                          ata_dev_init+0x54/0xe0
                          ata_link_init+0x8b/0xd0
                          ata_port_alloc+0x1f1/0x210
                          ata_host_alloc+0xf1/0x130
                          ata_host_alloc_pinfo+0x14/0xb0
                          ata_pci_sff_prepare_host+0x41/0xa0
                          ata_pci_bmdma_prepare_host+0x14/0x30
                          piix_init_one+0x21f/0x600
                          local_pci_probe+0x48/0x80
                          pci_device_probe+0x105/0x1c0
                          really_probe+0x221/0x490
                          driver_probe_device+0xe9/0x160
                          device_driver_attach+0xb2/0xc0
                          __driver_attach+0x91/0x150
                          bus_for_each_dev+0x81/0xc0
                          driver_attach+0x1e/0x20
                          bus_add_driver+0x138/0x1f0
                          driver_register+0x91/0xf0
                          __pci_register_driver+0x73/0x80
                          piix_init+0x1e/0x2e
                          do_one_initcall+0x5f/0x2d0
                          kernel_init_freeable+0x26f/0x2cf
                          kernel_init+0xe/0x113
                          ret_from_fork+0x1f/0x30
        }
        ... key      at: [<ffffffff83d9fdc0>] __key.6+0x0/0x10
        ... acquired at:
          __lock_acquire+0x9da/0x2370
          lock_acquire+0x15f/0x420
          _raw_spin_lock_irqsave+0x52/0xa0
          ata_bmdma_interrupt+0x27/0x200
          __handle_irq_event_percpu+0xd5/0x2b0
          handle_irq_event+0x57/0xb0
          handle_edge_irq+0x8c/0x230
          asm_call_irq_on_stack+0xf/0x20
          common_interrupt+0x100/0x1c0
          asm_common_interrupt+0x1e/0x40
          native_safe_halt+0xe/0x10
          arch_cpu_idle+0x15/0x20
          default_idle_call+0x59/0x1c0
          do_idle+0x22c/0x2c0
          cpu_startup_entry+0x20/0x30
          start_secondary+0x11d/0x150
          secondary_startup_64_no_verify+0xa6/0xab
      
      This lockdep splat is reported after:
      commit e9181886 ("locking: More accurate annotations for read_lock()")
      
      To clarify:
       - read-locks are recursive only in interrupt context (when
         in_interrupt() returns true)
       - after acquiring host->lock in CPU1, another cpu (i.e. CPU2) may call
         write_lock(&trig->leddev_list_lock) that would be blocked by CPU0
         that holds trig->leddev_list_lock in read-mode
       - when CPU1 (ata_ac_complete()) tries to read-lock
         trig->leddev_list_lock, it would be blocked by the write-lock waiter
         on CPU2 (because we are not in interrupt context, so the read-lock is
         not recursive)
       - at this point if an interrupt happens on CPU0 and
         ata_bmdma_interrupt() is executed it will try to acquire host->lock,
         that is held by CPU1, that is currently blocked by CPU2, so:
      
         * CPU0 blocked by CPU1
         * CPU1 blocked by CPU2
         * CPU2 blocked by CPU0
      
           *** DEADLOCK ***
      
      The deadlock scenario is better represented by the following schema
      (thanks to Boqun Feng <boqun.feng@gmail.com> for the schema and the
      detailed explanation of the deadlock condition):
      
       CPU 0:                          CPU 1:                        CPU 2:
       -----                           -----                         -----
       led_trigger_event():
         read_lock(&trig->leddev_list_lock);
       				<workqueue>
       				ata_hsm_qc_complete():
       				  spin_lock_irqsave(&host->lock);
       								write_lock(&trig->leddev_list_lock);
       				  ata_port_freeze():
       				    ata_do_link_abort():
       				      ata_qc_complete():
       					ledtrig_disk_activity():
       					  led_trigger_blink_oneshot():
       					    read_lock(&trig->leddev_list_lock);
       					    // ^ not in in_interrupt() context, so could get blocked by CPU 2
       <interrupt>
         ata_bmdma_interrupt():
           spin_lock_irqsave(&host->lock);
      
      Fix by using read_lock_irqsave/irqrestore() in led_trigger_event(), so
      that no interrupt can happen in between, preventing the deadlock
      condition.
      
      Apply the same change to led_trigger_blink_setup() as well, since the
      same deadlock scenario can also happen in power_supply_update_bat_leds()
      -> led_trigger_blink() -> led_trigger_blink_setup() (workqueue context),
      and potentially prevent other similar usages.
      
      Link: https://lore.kernel.org/lkml/20201101092614.GB3989@xps-13-7390/
      Fixes: eb25cb99
      
       ("leds: convert IDE trigger to common disk trigger")
      Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      27af8e2c
    • Zheng Yongjun's avatar
      leds: leds-ariel: convert comma to semicolon · 47854d2d
      Zheng Yongjun authored
      
      
      Replace a comma between expression statements by a semicolon.
      
      Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
      Reviewed-by: default avatarAlexander Dahl <ada@thorsis.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      47854d2d
    • Zheng Yongjun's avatar
      leds: leds-lm3533: convert comma to semicolon · 4e04b118
      Zheng Yongjun authored
      
      
      Replace a comma between expression statements by a semicolon.
      
      Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      4e04b118
    • Linus Torvalds's avatar
      Merge tag '5.11-rc5-smb3' of git://git.samba.org/sfrench/cifs-2.6 · 6642d600
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Four cifs patches found in additional testing of the conversion to the
        new mount API: three small option processing ones, and one fixing domain
        based DFS referrals"
      
      * tag '5.11-rc5-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: fix dfs domain referrals
        cifs: returning mount parm processing errors correctly
        cifs: fix mounts to subdirectories of target
        cifs: ignore auto and noauto options if given
      6642d600
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ad8b3c1e
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two minor fixes in drivers. Both changing strings (one in a comment,
        one in a module help text) with no code impact"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix description for parameter ql2xenforce_iocb_limit
        scsi: target: iscsi: Fix typo in comment
      ad8b3c1e
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/openrisc/linux · 03e319e5
      Linus Torvalds authored
      Pull OpenRISC fix from Stafford Horne:
       "Fix config dependencies for Litex SOC driver causing issues on um"
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        soc: litex: Properly depend on HAS_IOMEM
      03e319e5
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 8c947645
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Cleanups on properties with standard unit suffixes
      
       - Fix overwriting dma_range_map if there's no 'dma-ranges' property
      
       - Fix a bug when creating a /chosen node from ARM ATAGs
      
       - Add missing properties for TI j721e USB binding
      
       - Several doc reference updates due to DT schema conversions
      
      * tag 'devicetree-fixes-for-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: Cleanup standard unit properties
        of/device: Update dma_range_map only when dev has valid dma-ranges
        ARM: zImage: atags_to_fdt: Fix node names on added root nodes
        dt-bindings: usb: j721e: add ranges and dma-coherent props
        dt-bindings:iio:adc: update adc.yaml reference
        dt-bindings: memory: mediatek: update mediatek,smi-larb.yaml references
        dt-bindings: display: mediatek: update mediatek,dpi.yaml reference
        ASoC: audio-graph-card: update audio-graph-card.yaml reference
      8c947645
    • Linus Torvalds's avatar
      Merge tag 's390-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 3bf25531
      Linus Torvalds authored
      Pull s390 fixes from Vasily Gorbik:
      
       - Fix max number of VCPUs reported via ultravisor information sysfs
         interface.
      
       - Fix memory leaks during vfio-ap resources clean up on KVM pointer
         invalidation notification.
      
       - Fix potential specification exception by avoiding unnecessary
         interrupts disable after queue reset in vfio-ap.
      
      * tag 's390-5.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: uv: Fix sysfs max number of VCPUs reporting
        s390/vfio-ap: No need to disable IRQ after queue reset
        s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated
      3bf25531
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e37c0fba
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt:
       "A fix to avoid initializing max_mapnr to be too large, which may
        manifest on NUMA systems"
      
      * tag 'riscv-for-linus-5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Fixup pfn_valid error with wrong max_mapnr
      e37c0fba
  5. Jan 30, 2021