1. 30 Jun, 2020 14 commits
    • Emmanuel Nicolet's avatar
      ps3disk: use the default segment boundary · 72ad08b8
      Emmanuel Nicolet authored
      [ Upstream commit 720bc316 ]
      
      Since commit dcebd755 ("block: use bio_for_each_bvec() to compute
      multi-page bvec count"), the kernel will bug_on on the PS3 because
      bio_split() is called with sectors == 0:
      
        kernel BUG at block/bio.c:1853!
        Oops: Exception in kernel mode, sig: 5 [#1]
        BE PAGE_SIZE=4K MMU=Hash PREEMPT SMP NR_CPUS=8 NUMA PS3
        Modules linked in: firewire_sbp2 rtc_ps3(+) soundcore ps3_gelic(+) \
        ps3rom(+) firewire_core ps3vram(+) usb_common crc_itu_t
        CPU: 0 PID: 97 Comm: blkid Not tainted 5.3.0-rc4 #1
        NIP:  c00000000027d0d0 LR: c00000000027d0b0 CTR: 0000000000000000
        REGS: c00000000135ae90 TRAP: 0700   Not tainted  (5.3.0-rc4)
        MSR:  8000000000028032 <SF,EE,IR,DR,RI>  CR: 44008240  XER: 20000000
        IRQMASK: 0
        GPR00: c000000000289368 c00000000135b120 c00000000084a500 c000000004ff8300
        GPR04: 0000000000000c00 c000000004c905e0 c000000004c905e0 000000000000ffff
        GPR08: 0000000000000000 0000000000000001 0000000000000000 000000000000ffff
        GPR12: 0000000000000000 c0000000008ef000 000000000000003e 0000000000080001
        GPR16: 0000000000000100 000000000000ffff 0000000000000000 0000000000000004
        GPR20: c00000000062fd7e 0000000000000001 000000000000ffff 0000000000000080
        GPR24: c000000000781788 c00000000135b350 0000000000000080 c000000004c905e0
        GPR28: c00000000135b348 c000000004ff8300 0000000000000000 c000000004c90000
        NIP [c00000000027d0d0] .bio_split+0x28/0xac
        LR [c00000000027d0b0] .bio_split+0x8/0xac
        Call Trace:
        [c00000000135b120] [c00000000027d130] .bio_split+0x88/0xac (unreliable)
        [c00000000135b1b0] [c000000000289368] .__blk_queue_split+0x11c/0x53c
        [c00000000135b2d0] [c00000000028f614] .blk_mq_make_request+0x80/0x7d4
        [c00000000135b3d0] [c000000000283a8c] .generic_make_request+0x118/0x294
        [c00000000135b4b0] [c000000000283d34] .submit_bio+0x12c/0x174
        [c00000000135b580] [c000000000205a44] .mpage_bio_submit+0x3c/0x4c
        [c00000000135b600] [c000000000206184] .mpage_readpages+0xa4/0x184
        [c00000000135b750] [c0000000001ff8fc] .blkdev_readpages+0x24/0x38
        [c00000000135b7c0] [c0000000001589f0] .read_pages+0x6c/0x1a8
        [c00000000135b8b0] [c000000000158c74] .__do_page_cache_readahead+0x118/0x184
        [c00000000135b9b0] [c0000000001591a8] .force_page_cache_readahead+0xe4/0xe8
        [c00000000135ba50] [c00000000014fc24] .generic_file_read_iter+0x1d8/0x830
        [c00000000135bb50] [c0000000001ffadc] .blkdev_read_iter+0x40/0x5c
        [c00000000135bbc0] [c0000000001b9e00] .new_sync_read+0x144/0x1a0
        [c00000000135bcd0] [c0000000001bc454] .vfs_read+0xa0/0x124
        [c00000000135bd70] [c0000000001bc7a4] .ksys_read+0x70/0xd8
        [c00000000135be20] [c00000000000a524] system_call+0x5c/0x70
        Instruction dump:
        7fe3fb78 482e30dc 7c0802a6 482e3085 7c9e2378 f821ff71 7ca42b78 7d3e00d0
        7c7d1b78 79290fe0 7cc53378 69290001 <0b090000> 81230028 7bca0020 7929ba62
        [ end trace 313fec760f30aa1f ]---
      
      The problem originates from setting the segment boundary of the
      request queue to -1UL. This makes get_max_segment_size() return zero
      when offset is zero, whatever the max segment size. The test with
      BLK_SEG_BOUNDARY_MASK fails and 'mask - (mask & offset) + 1' overflows
      to zero in the return statement.
      
      Not setting the segment boundary and using the default
      value (BLK_SEG_BOUNDARY_MASK) fixes the problem.
      Signed-off-by: default avatarEmmanuel Nicolet <emmanuel.nicolet@gmail.com>
      Signed-off-by: default avatarGeoff Levand <geoff@infradead.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/060a416c43138f45105c0540eff1a45539f7e2fc.1589049250.git.geoff@infradead.orgSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      72ad08b8
    • Pali Rohár's avatar
      PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register · 9a91d525
      Pali Rohár authored
      [ Upstream commit 90c6cb4a ]
      
      Trying to change Link Status register does not have any effect as this
      is a read-only register. Trying to overwrite bits for Negotiated Link
      Width does not make sense.
      
      In future proper change of link width can be done via Lane Count Select
      bits in PCIe Control 0 register.
      
      Trying to unconditionally enable ASPM L0s via ASPM Control bits in Link
      Control register is wrong. There should be at least some detection if
      endpoint supports L0s as isn't mandatory.
      
      Moreover ASPM Control bits in Link Control register are controlled by
      pcie/aspm.c code which sets it according to system ASPM settings,
      immediately after aardvark driver probes. So setting these bits by
      aardvark driver has no long running effect.
      
      Remove code which touches ASPM L0s bits from this driver and let
      kernel's ASPM implementation to set ASPM state properly.
      
      Some users are reporting issues that this code is problematic for some
      Intel wifi cards and removing it fixes them, see e.g.:
      https://bugzilla.kernel.org/show_bug.cgi?id=196339
      
      If problems with Intel wifi cards occur even after this commit, then
      pcie/aspm.c code could be modified / hooked to not enable ASPM L0s state
      for affected problematic cards.
      
      Link: https://lore.kernel.org/r/20200430080625.26070-3-pali@kernel.orgTested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9a91d525
    • Oliver Neukum's avatar
      usblp: poison URBs upon disconnect · 372a8b5a
      Oliver Neukum authored
      [ Upstream commit 296a193b ]
      
      syzkaller reported an URB that should have been killed to be active.
      We do not understand it, but this should fix the issue if it is real.
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/20200507085806.5793-1-oneukum@suse.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      372a8b5a
    • 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 26 commits