1. 04 Jul, 2024 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-for-6.11b' of... · 14c4dc8b
      Greg Kroah-Hartman authored
      Merge tag 'iio-for-6.11b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
      
      Jonathan writes:
      
      IIO: 2nd set of new device support, features and cleanup for 6.11
      
      The big one here is we finally have Paul Cercueil's (and others)
      DMA buffer support for IIO devices enabling high speed zero
      copy transfer of data to and from sensors supported by IIO (and for
      example USB).  This should aid with upstream support of a range of
      higher performance ADCs and DACs.
      
      Two merges from other trees
      - spi/spi_devm_optimize used for simplification in ad7944.
      - dmaengine/topic_dma_vec to enable the DMABUF series.
      
      One feature with impact outside IIO.
      - Richer set of dev_err_probe() like helpers to cover ERR_PTR() cases.
      
      New device support
      ==================
      adi,ad7173
      - Add support for AD4111, AD4112, AD4114, AD4115 and ADC4116 pseudo
        differential ADCs. Major driver rework was needed to enabled these.
      adi,ad7944
      - Use devm_spi_optimize_message() to avoid a local devm cleanup
        callback. This is the example case from the patch set, others will
        follow.
      mediatek,mt6359-auxadc
      - New driver for this ADC IP found in MT6357, MT6358 and MT6359 PMICs.
      st,accel
      - Add support for the LIS2DS12 accelerometer
      ti,ads1119
      - New driver for this 16 bit 2-differential or 4-single ended channel
        ADC.
      
      Features
      ========
      dt-bindings
      - Introduce new common-mode-channel property to help handle pseudo
        differential ADCs where we have something that looks like one side
        of differential input, but which is only suited for use with a
        slow moving reference.
      adi,adf4350
      - Support use as a clock provider.
      iio-hmwon
      - Support reading of labels from IIO devices by their consumers and
        use this in the hwmon bridge.
      
      Cleanup and minor fixes
      =======================
      Treewide
      - Use regmap_clear_bits() / regmap_set_bits() to simplify open coded
        equivalents.
      - Use devm_regulator_get_enable_read_voltage() to replace equivalent
        opencoded boilerplate. In some cases enabled complete conversion to
        devm handling and removal of explicit remove() callbacks.
      - Introduce dev_err_ptr_probe() and other variants and make use of
        of them in a couple of examples driver cleanups. Will find use in
        many more drivers soon.
      adi,ad7192
      - Introduce local struct device *dev and use dev_err_probe() to give
        more readable code.
      adi,adi-axi-adc/dac
      - Improved consistency of messages using dev_err_probe()
      adi,adis
      - Split the trigger handling into cases that needed paging and those that
        don't resulting in more readable code.
      - Use cleanup.h to simplify error paths via scoped cleanup.
      - Add adis specific lock helpers and make use of them in a number of drivers.
      adi,ad7192
      - Update maintainer (Alisa-Dariana Roman)
      adi,ad7606
      - dt-binding cleanup.
      avago,apds9306
      - Add a maintainer entry (Subhajit Ghosh)
      linear,ltc2309
      - Fix a wrong endian type.
      st,stm32-dfsdm
      - Fix a missing port property in the dt-binding.
      st,sensors
      - Relax whoami match failure to a warning print rather than probe failure.
        This enables fallback compatibles to existing parts from those that don't
        necessarily even exit yet.
      
      * tag 'iio-for-6.11b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (112 commits)
        iio: adc: ad7173: Fix uninitialized symbol is_current_chan
        iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC
        math.h: Add unsigned 8 bits fractional numbers type
        dt-bindings: iio: adc: Add MediaTek MT6359 PMIC AUXADC
        iio: common: scmi_iio: convert to dev_err_probe()
        iio: backend: make use of dev_err_cast_probe()
        iio: temperature: ltc2983: convert to dev_err_probe()
        dev_printk: add new dev_err_probe() helpers
        iio: xilinx-ams: Add labels
        iio: adc: ad7944: use devm_spi_optimize_message()
        Documentation: iio: Document high-speed DMABUF based API
        iio: buffer-dmaengine: Support new DMABUF based userspace API
        iio: buffer-dma: Enable support for DMABUFs
        iio: core: Add new DMABUF interface infrastructure
        MAINTAINERS: Update AD7192 driver maintainer
        iio: adc: ad7192: use devm_regulator_get_enable_read_voltage
        iio: st_sensors: relax WhoAmI check in st_sensors_verify_id()
        MAINTAINERS: Add AVAGO APDS9306
        dt-bindings: iio: adc: adi,ad7606: comment and sort the compatible names
        dt-bindings: iio: adc: adi,ad7606: add missing datasheet link
        ...
      14c4dc8b
  2. 03 Jul, 2024 22 commits
  3. 02 Jul, 2024 1 commit
  4. 01 Jul, 2024 12 commits
  5. 30 Jun, 2024 4 commits
    • Linus Torvalds's avatar
      Linux 6.10-rc6 · 22a40d14
      Linus Torvalds authored
      22a40d14
    • Linus Torvalds's avatar
      Merge tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux · aca7c377
      Linus Torvalds authored
      Pull ata fixes from Niklas Cassel:
      
       - Add NOLPM quirk for for all Crucial BX SSD1 models.
      
         Considering that we now have had bug reports for 3 different BX SSD1
         variants from Crucial with the same product name, make the quirk more
         inclusive, to catch more device models from the same generation.
      
       - Fix a trivial NULL pointer dereference in the error path for
         ata_host_release().
      
       - Create a ata_port_free(), so that we don't miss freeing ata_port
         struct members when freeing a struct ata_port.
      
       - Fix a trivial double free in the error path for ata_host_alloc().
      
       - Ensure that we remove the libata "remapped NVMe device count" sysfs
         entry on .probe() error.
      
      * tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
        ata: ahci: Clean up sysfs file on error
        ata: libata-core: Fix double free on error
        ata,scsi: libata-core: Do not leak memory for ata_port struct members
        ata: libata-core: Fix null pointer dereference on error
        ata: libata-core: Add ATA_HORKAGE_NOLPM for all Crucial BX SSD1 models
      aca7c377
    • Niklas Cassel's avatar
      ata: ahci: Clean up sysfs file on error · eeb25a09
      Niklas Cassel authored
      .probe() (ahci_init_one()) calls sysfs_add_file_to_group(), however,
      if probe() fails after this call, we currently never call
      sysfs_remove_file_from_group().
      
      (The sysfs_remove_file_from_group() call in .remove() (ahci_remove_one())
      does not help, as .remove() is not called on .probe() error.)
      
      Thus, if probe() fails after the sysfs_add_file_to_group() call, the next
      time we insmod the module we will get:
      
      sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:04.0/remapped_nvme'
      CPU: 11 PID: 954 Comm: modprobe Not tainted 6.10.0-rc5 #43
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0x5d/0x80
       sysfs_warn_dup.cold+0x17/0x23
       sysfs_add_file_mode_ns+0x11a/0x130
       sysfs_add_file_to_group+0x7e/0xc0
       ahci_init_one+0x31f/0xd40 [ahci]
      
      Fixes: 894fba7f ("ata: ahci: Add sysfs attribute to show remapped NVMe device count")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Link: https://lore.kernel.org/r/20240629124210.181537-10-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      eeb25a09
    • Niklas Cassel's avatar
      ata: libata-core: Fix double free on error · ab9e0c52
      Niklas Cassel authored
      If e.g. the ata_port_alloc() call in ata_host_alloc() fails, we will jump
      to the err_out label, which will call devres_release_group().
      devres_release_group() will trigger a call to ata_host_release().
      ata_host_release() calls kfree(host), so executing the kfree(host) in
      ata_host_alloc() will lead to a double free:
      
      kernel BUG at mm/slub.c:553!
      Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 11 PID: 599 Comm: (udev-worker) Not tainted 6.10.0-rc5 #47
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
      RIP: 0010:kfree+0x2cf/0x2f0
      Code: 5d 41 5e 41 5f 5d e9 80 d6 ff ff 4d 89 f1 41 b8 01 00 00 00 48 89 d9 48 89 da
      RSP: 0018:ffffc90000f377f0 EFLAGS: 00010246
      RAX: ffff888112b1f2c0 RBX: ffff888112b1f2c0 RCX: ffff888112b1f320
      RDX: 000000000000400b RSI: ffffffffc02c9de5 RDI: ffff888112b1f2c0
      RBP: ffffc90000f37830 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffc90000f37610 R11: 617461203a736b6e R12: ffffea00044ac780
      R13: ffff888100046400 R14: ffffffffc02c9de5 R15: 0000000000000006
      FS:  00007f2f1cabe980(0000) GS:ffff88813b380000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f2f1c3acf75 CR3: 0000000111724000 CR4: 0000000000750ef0
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? __die_body.cold+0x19/0x27
       ? die+0x2e/0x50
       ? do_trap+0xca/0x110
       ? do_error_trap+0x6a/0x90
       ? kfree+0x2cf/0x2f0
       ? exc_invalid_op+0x50/0x70
       ? kfree+0x2cf/0x2f0
       ? asm_exc_invalid_op+0x1a/0x20
       ? ata_host_alloc+0xf5/0x120 [libata]
       ? ata_host_alloc+0xf5/0x120 [libata]
       ? kfree+0x2cf/0x2f0
       ata_host_alloc+0xf5/0x120 [libata]
       ata_host_alloc_pinfo+0x14/0xa0 [libata]
       ahci_init_one+0x6c9/0xd20 [ahci]
      
      Ensure that we will not call kfree(host) twice, by performing the kfree()
      only if the devres_open_group() call failed.
      
      Fixes: dafd6c49 ("libata: ensure host is free'd on error exit paths")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Link: https://lore.kernel.org/r/20240629124210.181537-9-cassel@kernel.orgSigned-off-by: default avatarNiklas Cassel <cassel@kernel.org>
      ab9e0c52