1. 30 Jun, 2020 11 commits
    • Russell King's avatar
      i2c: pxa: clear all master action bits in i2c_pxa_stop_message() · 18f7ec3a
      Russell King authored
      [ Upstream commit e81c979f ]
      
      If we timeout during a message transfer, the control register may
      contain bits that cause an action to be set. Read-modify-writing the
      register leaving these bits set may trigger the hardware to attempt
      one of these actions unintentionally.
      
      Always clear these bits when cleaning up after a message or after
      a timeout.
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      18f7ec3a
    • Andreas Klinger's avatar
      iio: bmp280: fix compensation of humidity · 6dd652f6
      Andreas Klinger authored
      [ Upstream commit dee2dabc ]
      
      Limit the output of humidity compensation to the range between 0 and 100
      percent.
      
      Depending on the calibration parameters of the individual sensor it
      happens, that a humidity above 100 percent or below 0 percent is
      calculated, which don't make sense in terms of relative humidity.
      
      Add a clamp to the compensation formula as described in the datasheet of
      the sensor in chapter 4.2.3.
      
      Although this clamp is documented, it was never in the driver of the
      kernel.
      
      It depends on the circumstances (calibration parameters, temperature,
      humidity) if one can see a value above 100 percent without the clamp.
      The writer of this patch was working with this type of sensor without
      noting this error. So it seems to be a rare event when this bug occures.
      Signed-off-by: default avatarAndreas Klinger <ak@it-klinger.de>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6dd652f6
    • Viacheslav Dubeyko's avatar
      scsi: qla2xxx: Fix issue with adapter's stopping state · 66949914
      Viacheslav Dubeyko authored
      [ Upstream commit 803e4555 ]
      
      The goal of the following command sequence is to restart the adapter.
      However, the tgt_stop flag remains set, indicating that the adapter is
      still in stopping state even after re-enabling it.
      
      echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging
      modprobe target_core_mod
      modprobe tcm_qla2xxx
      mkdir /sys/kernel/config/target/qla2xxx
      mkdir /sys/kernel/config/target/qla2xxx/<port-name>
      mkdir /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1
      echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
      echo 0 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
      echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
      
      kernel: PID 1396:qla_target.c:1555 qlt_stop_phase1(): tgt_stop 0x0, tgt_stopped 0x0
      kernel: qla2xxx [0001:00:02.0]-e803:1: PID 1396:qla_target.c:1567: Stopping target for host 1(c0000000033557e8)
      kernel: PID 1396:qla_target.c:1579 qlt_stop_phase1(): tgt_stop 0x1, tgt_stopped 0x0
      kernel: PID 1396:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0
      kernel: qla2xxx [0001:00:02.0]-e801:1: PID 1396:qla_target.c:1316: Scheduling sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7
      <skipped>
      kernel: qla2xxx [0001:00:02.0]-290a:1: PID 340:qla_target.c:1187: qlt_unreg_sess sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7
      <skipped>
      kernel: qla2xxx [0001:00:02.0]-f801:1: PID 340:qla_target.c:1145: Unregistration of sess c00000002d5cd800 21:00:00:24:ff:7f:35:c7 finished fcp_cnt 0
      kernel: PID 340:qla_target.c:1155 qlt_free_session_done(): tgt_stop 0x1, tgt_stopped 0x0
      kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled.
      <skipped>
      kernel: qla2xxx [0001:00:02.0]-28f1:1: PID 346:qla_os.c:3956: Mark all dev lost
      kernel: PID 346:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0
      kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end.
      <skipped>
      kernel: PID 1396:qla_target.c:6812 qlt_enable_vha(): tgt_stop 0x1, tgt_stopped 0x0
      <skipped>
      kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled.
      <skipped>
      kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end.
      
      qlt_handle_cmd_for_atio() rejects the request to send commands because the
      adapter is in the stopping state:
      
      kernel: PID 0:qla_target.c:4442 qlt_handle_cmd_for_atio(): tgt_stop 0x1, tgt_stopped 0x0
      kernel: qla2xxx [0001:00:02.0]-3861:1: PID 0:qla_target.c:4447: New command while device c000000005314600 is shutting down
      kernel: qla2xxx [0001:00:02.0]-e85f:1: PID 0:qla_target.c:5728: qla_target: Unable to send command to target
      
      This patch calls qla_stop_phase2() in addition to qlt_stop_phase1() in
      tcm_qla2xxx_tpg_enable_store() and tcm_qla2xxx_npiv_tpg_enable_store(). The
      qlt_stop_phase1() marks adapter as stopping (tgt_stop == 0x1, tgt_stopped
      == 0x0) but qlt_stop_phase2() marks adapter as stopped (tgt_stop == 0x0,
      tgt_stopped == 0x1).
      
      Link: https://lore.kernel.org/r/52be1e8a3537f6c5407eae3edd4c8e08a9545ea5.camel@yadro.comReviewed-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
      Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
      Signed-off-by: default avatarViacheslav Dubeyko <v.dubeiko@yadro.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      66949914
    • Dan Carpenter's avatar
      ALSA: isa/wavefront: prevent out of bounds write in ioctl · e6851746
      Dan Carpenter authored
      [ Upstream commit 7f0d5053 ]
      
      The "header->number" comes from the ioctl and it needs to be clamped to
      prevent out of bounds writes.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20200501094011.GA960082@mwandaSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e6851746
    • Linus Walleij's avatar
      ARM: integrator: Add some Kconfig selections · 136476d3
      Linus Walleij authored
      [ Upstream commit d2854bbe ]
      
      The CMA and DMA_CMA Kconfig options need to be selected
      by the Integrator in order to produce boot console on some
      Integrator systems.
      
      The REGULATOR and REGULATOR_FIXED_VOLTAGE need to be
      selected in order to boot the system from an external
      MMC card when using MMCI/PL181 from the device tree
      probe path.
      
      Select these things directly from the Kconfig so we are
      sure to be able to bring the systems up with console
      from any device tree.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      136476d3
    • Jon Hunter's avatar
      backlight: lp855x: Ensure regulators are disabled on probe failure · bf54b9ef
      Jon Hunter authored
      [ Upstream commit d8207c15 ]
      
      If probing the LP885x backlight fails after the regulators have been
      enabled, then the following warning is seen when releasing the
      regulators ...
      
       WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 _regulator_put.part.28+0x158/0x160
       Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables x_tables ipv6 nf_defrag_ipv6
       CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1
       Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
      
       ...
      
       Call trace:
        _regulator_put.part.28+0x158/0x160
        regulator_put+0x34/0x50
        devm_regulator_release+0x10/0x18
        release_nodes+0x12c/0x230
        devres_release_all+0x34/0x50
        really_probe+0x1c0/0x370
        driver_probe_device+0x58/0x100
        device_driver_attach+0x6c/0x78
        __driver_attach+0xb0/0xf0
        bus_for_each_dev+0x68/0xc8
        driver_attach+0x20/0x28
        bus_add_driver+0x160/0x1f0
        driver_register+0x60/0x110
        i2c_register_driver+0x40/0x80
        lp855x_driver_init+0x20/0x1000 [lp855x_bl]
        do_one_initcall+0x58/0x1a0
        do_init_module+0x54/0x1d0
        load_module+0x1d80/0x21c8
        __do_sys_finit_module+0xe8/0x100
        __arm64_sys_finit_module+0x18/0x20
        el0_svc_common.constprop.3+0xb0/0x168
        do_el0_svc+0x20/0x98
        el0_sync_handler+0xf4/0x1b0
        el0_sync+0x140/0x180
      
      Fix this by ensuring that the regulators are disabled, if enabled, on
      probe failure.
      
      Finally, ensure that the vddio regulator is disabled in the driver
      remove handler.
      Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bf54b9ef
    • Bryan O'Donoghue's avatar
      clk: qcom: msm8916: Fix the address location of pll->config_reg · 7cd829f2
      Bryan O'Donoghue authored
      [ Upstream commit f47ab3c2 ]
      
      During the process of debugging a processor derived from the msm8916 which
      we found the new processor was not starting one of its PLLs.
      
      After tracing the addresses and writes that downstream was doing and
      comparing to upstream it became obvious that we were writing to a different
      register location than downstream when trying to configure the PLL.
      
      This error is also present in upstream msm8916.
      
      As an example clk-pll.c::clk_pll_recalc_rate wants to write to
      pll->config_reg updating the bit-field POST_DIV_RATIO. That bit-field is
      defined in PLL_USER_CTL not in PLL_CONFIG_CTL. Taking the BIMC PLL as an
      example
      
      lm80-p0436-13_c_qc_snapdragon_410_processor_hrd.pdf
      
      0x01823010 GCC_BIMC_PLL_USER_CTL
      0x01823014 GCC_BIMC_PLL_CONFIG_CTL
      
      This pattern is repeated for gpll0, gpll1, gpll2 and bimc_pll.
      
      This error is likely not apparent since the bootloader will already have
      initialized these PLLs.
      
      This patch corrects the location of config_reg from PLL_CONFIG_CTL to
      PLL_USER_CTL for all relevant PLLs on msm8916.
      
      Fixes commit 3966fab8 ("clk: qcom: Add MSM8916 Global Clock Controller support")
      
      Cc: Georgi Djakov <georgi.djakov@linaro.org>
      Cc: Andy Gross <agross@kernel.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Link: https://lkml.kernel.org/r/20200329124116.4185447-1-bryan.odonoghue@linaro.orgSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7cd829f2
    • Andy Shevchenko's avatar
      iio: pressure: bmp280: Tolerate IRQ before registering · ca33fc77
      Andy Shevchenko authored
      [ Upstream commit 97b31a6f ]
      
      With DEBUG_SHIRQ enabled we have a kernel crash
      
      [  116.482696] BUG: kernel NULL pointer dereference, address: 0000000000000000
      
      ...
      
      [  116.606571] Call Trace:
      [  116.609023]  <IRQ>
      [  116.611047]  complete+0x34/0x50
      [  116.614206]  bmp085_eoc_irq+0x9/0x10 [bmp280]
      
      because DEBUG_SHIRQ mechanism fires an IRQ before registration and drivers
      ought to be able to handle an interrupt happening before request_irq() returns.
      
      Fixes: aae95394 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt")
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ca33fc77
    • Adam Honse's avatar
      i2c: piix4: Detect secondary SMBus controller on AMD AM4 chipsets · 4b2abe8a
      Adam Honse authored
      [ Upstream commit f27237c1 ]
      
      The AMD X370 and other AM4 chipsets (A/B/X 3/4/5 parts) and Threadripper
      equivalents have a secondary SMBus controller at I/O port address
      0x0B20.  This bus is used by several manufacturers to control
      motherboard RGB lighting via embedded controllers.  I have been using
      this bus in my OpenRGB project to control the Aura RGB on many
      motherboards and ASRock also uses this bus for their Polychrome RGB
      controller.
      
      I am not aware of any CZ-compatible platforms which do not have the
      second SMBus channel.  All of AMD's AM4- and Threadripper- series
      chipsets that OpenRGB users have tested appear to have this secondary
      bus.  I also noticed this secondary bus is present on older AMD
      platforms including my FM1 home server.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587Signed-off-by: default avatarAdam Honse <calcprogrammer1@gmail.com>
      Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
      Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      4b2abe8a
    • Rikard Falkeborn's avatar
      clk: sunxi: Fix incorrect usage of round_down() · efe93a77
      Rikard Falkeborn authored
      [ Upstream commit ee25d974 ]
      
      round_down() can only round to powers of 2. If round_down() is asked
      to round to something that is not a power of 2, incorrect results are
      produced. The incorrect results can be both too large and too small.
      
      Instead, use rounddown() which can round to any number.
      
      Fixes: 6a721db1 ("clk: sunxi: Add A31 clocks support")
      Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      efe93a77
    • Enric Balletbo i Serra's avatar
      power: supply: bq24257_charger: Replace depends on REGMAP_I2C with select · a00ddd7b
      Enric Balletbo i Serra authored
      [ Upstream commit 87c3d579 ]
      
      regmap is a library function that gets selected by drivers that need
      it. No driver modules should depend on it. Depending on REGMAP_I2C makes
      this driver only build if another driver already selected REGMAP_I2C,
      as the symbol can't be selected through the menu kernel configuration.
      
      Fixes: 2219a935 ("power_supply: Add TI BQ24257 charger driver")
      Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      a00ddd7b
  2. 20 Jun, 2020 29 commits