1. 28 Apr, 2022 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-fixes-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio · fda05730
      Greg Kroah-Hartman authored
      Pull set of IIO fixes for 5.18 from Jonathan Cameron:
        "1st set of IIO fixes for the 5.18 cycle
      
        ad3552r:
         - Fix a bug with error codes being stored in unsigned local variable.
         - Fix IS_ERR when value is either NULL or not rather than ERR_PTR
        ad5446
         - Fix shifting of read_raw value.
        ad5592r
         - Fix missing return value being set for a fwnode property read.
        ad7280a
         - Wrong variable being used to set thresholds.
        admv8818
         - Kconfig dependency fix.
        ak8975
         - Missing regulator disable in error path.
        bmi160
         - Disable regulators in an error path.
        dac5571
         - Fix chip id detection for devices with OF bindings.
        inv_icm42600
         - Handle a case of a missing I2C NACK during initially configuration.
        ltc2688
         - Fix voltage scaling where integer part was written twice and
           decimal part not at all.
        scd4x
         - Handle error before using value.
        sx9310
         - Device property parsing against indio_dev->dev.of_node which
           hasn't been set yet.
        sx9324
         - Fix hardware gain related maths.
         - Wrong defaults for precharge internal resistance register."
      
      * tag 'iio-fixes-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
        iio: imu: inv_icm42600: Fix I2C init possible nack
        iio: dac: ltc2688: fix voltage scale read
        iio:dac:ad3552r: Fix an IS_ERR() vs NULL check
        iio: sx9324: Fix default precharge internal resistance register
        iio: dac: ad5446: Fix read_raw not returning set value
        iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
        iio:proximity:sx9324: Fix hardware gain read/write
        iio:proximity:sx_common: Fix device property parsing on DT systems
        iio: adc: ad7280a: Fix wrong variable used when setting thresholds.
        iio:filter:admv8818: select REGMAP_SPI for ADMV8818
        iio: dac: ad5592r: Fix the missing return value.
        iio: dac: dac5571: Fix chip id detection for OF devices
        iio:imu:bmi160: disable regulator in error path
        iio: scd4x: check return of scd4x_write_and_fetch
        iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
      fda05730
  2. 24 Apr, 2022 1 commit
    • Christophe Leroy's avatar
      eeprom: at25: Use DMA safe buffers · 5b47b751
      Christophe Leroy authored
      Reading EEPROM fails with following warning:
      
      [   16.357496] ------------[ cut here ]------------
      [   16.357529] fsl_spi b01004c0.spi: rejecting DMA map of vmalloc memory
      [   16.357698] WARNING: CPU: 0 PID: 371 at include/linux/dma-mapping.h:326 fsl_spi_cpm_bufs+0x2a0/0x2d8
      [   16.357775] CPU: 0 PID: 371 Comm: od Not tainted 5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty #109
      [   16.357806] NIP:  c03fbc9c LR: c03fbc9c CTR: 00000000
      [   16.357825] REGS: e68d9b20 TRAP: 0700   Not tainted  (5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty)
      [   16.357849] MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 24002282  XER: 00000000
      [   16.357931]
      [   16.357931] GPR00: c03fbc9c e68d9be0 c26d06a0 00000039 00000001 c0d36364 c0e96428 00000027
      [   16.357931] GPR08: 00000001 00000000 00000023 3fffc000 24002282 100d3dd6 100a2ffc 00000000
      [   16.357931] GPR16: 100cd280 100b0000 00000000 aff54f7e 100d0000 100d0000 00000001 100cf328
      [   16.357931] GPR24: 100cf328 00000000 00000003 e68d9e30 c156b410 e67ab4c0 e68d9d38 c24ab278
      [   16.358253] NIP [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8
      [   16.358292] LR [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8
      [   16.358325] Call Trace:
      [   16.358336] [e68d9be0] [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 (unreliable)
      [   16.358388] [e68d9c00] [c03fcb44] fsl_spi_bufs.isra.0+0x94/0x1a0
      [   16.358436] [e68d9c20] [c03fd970] fsl_spi_do_one_msg+0x254/0x3dc
      [   16.358483] [e68d9cb0] [c03f7e50] __spi_pump_messages+0x274/0x8a4
      [   16.358529] [e68d9ce0] [c03f9d30] __spi_sync+0x344/0x378
      [   16.358573] [e68d9d20] [c03fb52c] spi_sync+0x34/0x60
      [   16.358616] [e68d9d30] [c03b4dec] at25_ee_read+0x138/0x1a8
      [   16.358667] [e68d9e50] [c04a8fb8] bin_attr_nvmem_read+0x98/0x110
      [   16.358725] [e68d9e60] [c0204b14] kernfs_fop_read_iter+0xc0/0x1fc
      [   16.358774] [e68d9e80] [c0168660] vfs_read+0x284/0x410
      [   16.358821] [e68d9f00] [c016925c] ksys_read+0x6c/0x11c
      [   16.358863] [e68d9f30] [c00160e0] ret_from_syscall+0x0/0x28
      ...
      [   16.359608] ---[ end trace a4ce3e34afef0cb5 ]---
      [   16.359638] fsl_spi b01004c0.spi: unable to map tx dma
      
      This is due to the AT25 driver using buffers on stack, which is not
      possible with CONFIG_VMAP_STACK.
      
      As mentionned in kernel Documentation (Documentation/spi/spi-summary.rst):
      
        - Follow standard kernel rules, and provide DMA-safe buffers in
          your messages.  That way controller drivers using DMA aren't forced
          to make extra copies unless the hardware requires it (e.g. working
          around hardware errata that force the use of bounce buffering).
      
      Modify the driver to use a buffer located in the at25 device structure
      which is allocated via kmalloc during probe.
      
      Protect writes in this new buffer with the driver's mutex.
      
      Fixes: b587b13a ("[PATCH] SPI eeprom driver")
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Link: https://lore.kernel.org/r/230a9486fc68ea0182df46255e42a51099403642.1648032613.git.christophe.leroy@csgroup.euSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b47b751
  3. 22 Apr, 2022 5 commits
  4. 20 Apr, 2022 1 commit
  5. 16 Apr, 2022 2 commits
  6. 14 Apr, 2022 4 commits
    • Stephen Boyd's avatar
      interconnect: qcom: sdx55: Drop IP0 interconnects · 2fb251c2
      Stephen Boyd authored
      Similar to the sc7180 commit, let's drop the IP0 interconnects here
      because the IP0 resource is also used in the clk-rpmh driver on sdx55.
      It's bad to have the clk framework and interconnect framework control
      the same RPMh resource without any coordination. The rpmh driver in the
      kernel doesn't aggregate resources between clients either, so leaving
      control to clk-rpmh avoids any issues with unused interconnects turning
      off IP0 behind the back of the clk framework.
      
      Cc: Alex Elder <elder@linaro.org>
      Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Taniya Das <quic_tdas@quicinc.com>
      Cc: Mike Tipton <quic_mdtipton@quicinc.com>
      Fixes: b2150cab ("clk: qcom: rpmh: add support for SDX55 rpmh IPA clock")
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      Acked-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://lore.kernel.org/r/20220412220033.1273607-3-swboyd@chromium.orgSigned-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
      2fb251c2
    • Stephen Boyd's avatar
      interconnect: qcom: sc7180: Drop IP0 interconnects · 2f372493
      Stephen Boyd authored
      The IPA BCM resource ("IP0") on sc7180 was moved to the clk-rpmh driver
      in commit bcd63d22 ("clk: qcom: rpmh: Add IPA clock for SC7180") and
      modeled as a clk, but this interconnect driver still had it modeled as
      an interconnect. This was mostly OK because nobody used the interconnect
      definition, until the interconnect framework started dropping bandwidth
      requests on interconnects that aren't used via the sync_state callback
      in commit 7d3b0b0d ("interconnect: qcom: Use icc_sync_state"). Once
      that patch was applied the IP0 resource was going to be controlled from
      two places, the clk framework and the interconnect framework.
      
      Even then, things were probably going to be OK, because commit
      b95b668e ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in
      pre_aggregate") was needed to actually drop bandwidth requests on unused
      interconnects, of which the IPA was one of the interconnect that wasn't
      getting dropped to zero. Combining the three commits together leads to
      bad behavior where the interconnect framework is disabling the IP0
      resource because it has no users while the clk framework thinks the IP0
      resource is on because the only user, the IPA driver, has turned it on
      via clk_prepare_enable(). Depending on when sync_state is called, we can
      get into a situation like below:
      
        IPA driver probes
        IPA driver gets notified modem started
         runtime PM get()
          IPA clk enabled -> IP0 resource is ON
        sync_state runs
         interconnect zeroes out the IP0 resource -> IP0 resource is off
        IPA driver tries to access a register and blows up
      
      The crash is an unclocked access that manifest as an SError.
      
       SError Interrupt on CPU0, code 0xbe000011 -- SError
       CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166
       Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
       pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
       pc : mutex_lock+0x4c/0x80
       lr : mutex_lock+0x30/0x80
       sp : ffffffc00da9b9c0
       x29: ffffffc00da9b9c0 x28: 0000000000000000 x27: 0000000000000000
       x26: ffffffc00da9bc90 x25: ffffff80c2024010 x24: ffffff80c2024000
       x23: ffffff8083100000 x22: ffffff80831000d0 x21: ffffff80831000a8
       x20: ffffff80831000a8 x19: ffffff8083100070 x18: 00000000ffff0a00
       x17: 000000002f7254f1 x16: 0000000000000100 x15: 0000000000000000
       x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
       x11: 000000000001f0b8 x10: ffffffc00931f0b8 x9 : 0000000000000000
       x8 : 0000000000000000 x7 : fefefefefeff2f60 x6 : 0000808080808080
       x5 : 0000000000000000 x4 : 8080808080800000 x3 : ffffff80d2d4ee28
       x2 : ffffff808c1d6e40 x1 : 0000000000000000 x0 : ffffff8083100070
       Kernel panic - not syncing: Asynchronous SError Interrupt
       CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166
       Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
       Call trace:
        dump_backtrace+0xf4/0x114
        show_stack+0x24/0x30
        dump_stack_lvl+0x64/0x7c
        dump_stack+0x18/0x38
        panic+0x150/0x38c
        nmi_panic+0x88/0xa0
        arm64_serror_panic+0x74/0x80
        do_serror+0x0/0x80
        do_serror+0x58/0x80
        el1h_64_error_handler+0x34/0x4c
        el1h_64_error+0x78/0x7c
        mutex_lock+0x4c/0x80
        __gsi_channel_start+0x50/0x17c
        gsi_channel_start+0x54/0x90
        ipa_endpoint_enable_one+0x34/0xc0
        ipa_open+0x4c/0x120
      
      Remove all IP0 resource management from the interconnect driver so that
      clk-rpmh is the sole owner. This fixes the issue by preventing the
      interconnect driver from overwriting the IP0 resource data that the
      clk-rpmh driver wrote.
      
      Cc: Alex Elder <elder@linaro.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Taniya Das <quic_tdas@quicinc.com>
      Cc: Mike Tipton <quic_mdtipton@quicinc.com>
      Fixes: b95b668e ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate")
      Fixes: bcd63d22 ("clk: qcom: rpmh: Add IPA clock for SC7180")
      Fixes: 7d3b0b0d ("interconnect: qcom: Use icc_sync_state")
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Tested-by: default avatarAlex Elder <elder@linaro.org>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://lore.kernel.org/r/20220412220033.1273607-2-swboyd@chromium.orgSigned-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
      2f372493
    • Miaoqian Lin's avatar
      phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe · ce88613e
      Miaoqian Lin authored
      The pm_runtime_enable() will increase power disable depth.
      If the probe fails, we should use pm_runtime_disable() to balance
      pm_runtime_enable().
      Add missing pm_runtime_disable() for serdes_am654_probe().
      
      Fixes: 71e2f5c5 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Link: https://lore.kernel.org/r/20220301025853.1911-1-linmq006@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      ce88613e
    • Miaoqian Lin's avatar
      phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe · d644e0d7
      Miaoqian Lin authored
      The pm_runtime_enable will increase power disable depth.
      If the probe fails, we should use pm_runtime_disable() to balance
      pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to
      undo pm_runtime_use_autosuspend()
      In the PM Runtime docs:
          Drivers in ->remove() callback should undo the runtime PM changes done
          in ->probe(). Usually this means calling pm_runtime_disable(),
          pm_runtime_dont_use_autosuspend() etc.
      
      We should do this in error handling.
      
      Fixes: f7f50b2a ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Link: https://lore.kernel.org/r/20220301024615.31899-1-linmq006@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
      d644e0d7
  7. 13 Apr, 2022 3 commits
  8. 11 Apr, 2022 6 commits
  9. 10 Apr, 2022 17 commits