1. 30 Jun, 2020 32 commits
    • Kuppuswamy Sathyanarayanan's avatar
      drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a... · fe513506
      Kuppuswamy Sathyanarayanan authored
      drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish
      
      [ Upstream commit 388bcc6e ]
      
      If platform bus driver registration is failed then, accessing
      platform bus spin lock (&drv->driver.bus->p->klist_drivers.k_lock)
      in __platform_driver_probe() without verifying the return value
      __platform_driver_register() can lead to NULL pointer exception.
      
      So check the return value before attempting the spin lock.
      
      One such example is below:
      
      For a custom usecase, I have intentionally failed the platform bus
      registration and I expected all the platform device/driver
      registrations to fail gracefully. But I came across this panic
      issue.
      
      [    1.331067] BUG: kernel NULL pointer dereference, address: 00000000000000c8
      [    1.331118] #PF: supervisor write access in kernel mode
      [    1.331163] #PF: error_code(0x0002) - not-present page
      [    1.331208] PGD 0 P4D 0
      [    1.331233] Oops: 0002 [#1] PREEMPT SMP
      [    1.331268] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G        W         5.6.0-00049-g670d35fb0144 #165
      [    1.331341] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      [    1.331406] RIP: 0010:_raw_spin_lock+0x15/0x30
      [    1.331588] RSP: 0000:ffffc9000001be70 EFLAGS: 00010246
      [    1.331632] RAX: 0000000000000000 RBX: 00000000000000c8 RCX: 0000000000000001
      [    1.331696] RDX: 0000000000000001 RSI: 0000000000000092 RDI: 0000000000000000
      [    1.331754] RBP: 00000000ffffffed R08: 0000000000000501 R09: 0000000000000001
      [    1.331817] R10: ffff88817abcc520 R11: 0000000000000670 R12: 00000000ffffffed
      [    1.331881] R13: ffffffff82dbc268 R14: ffffffff832f070a R15: 0000000000000000
      [    1.331945] FS:  0000000000000000(0000) GS:ffff88817bd80000(0000) knlGS:0000000000000000
      [    1.332008] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    1.332062] CR2: 00000000000000c8 CR3: 000000000681e001 CR4: 00000000003606e0
      [    1.332126] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [    1.332189] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [    1.332252] Call Trace:
      [    1.332281]  __platform_driver_probe+0x92/0xee
      [    1.332323]  ? rtc_dev_init+0x2b/0x2b
      [    1.332358]  cmos_init+0x37/0x67
      [    1.332396]  do_one_initcall+0x7d/0x168
      [    1.332428]  kernel_init_freeable+0x16c/0x1c9
      [    1.332473]  ? rest_init+0xc0/0xc0
      [    1.332508]  kernel_init+0x5/0x100
      [    1.332543]  ret_from_fork+0x1f/0x30
      [    1.332579] CR2: 00000000000000c8
      [    1.332616] ---[ end trace 3bd87f12e9010b87 ]---
      [    1.333549] note: swapper/0[1] exited with preempt_count 1
      [    1.333592] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
      [    1.333736] Kernel Offset: disabled
      
      Note, this can only be triggered if a driver errors out from this call,
      which should never happen.  If it does, the driver needs to be fixed.
      Signed-off-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      Link: https://lore.kernel.org/r/20200408214003.3356-1-sathyanarayanan.kuppuswamy@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      fe513506
    • John Stultz's avatar
      serial: amba-pl011: Make sure we initialize the port.lock spinlock · 95839ab5
      John Stultz authored
      [ Upstream commit 8508f4cb ]
      
      Valentine reported seeing:
      
      [    3.626638] INFO: trying to register non-static key.
      [    3.626639] the code is fine but needs lockdep annotation.
      [    3.626640] turning off the locking correctness validator.
      [    3.626644] CPU: 7 PID: 51 Comm: kworker/7:1 Not tainted 5.7.0-rc2-00115-g8c2e9790f196 #116
      [    3.626646] Hardware name: HiKey960 (DT)
      [    3.626656] Workqueue: events deferred_probe_work_func
      [    3.632476] sd 0:0:0:0: [sda] Optimal transfer size 8192 bytes not a multiple of physical block size (16384 bytes)
      [    3.640220] Call trace:
      [    3.640225]  dump_backtrace+0x0/0x1b8
      [    3.640227]  show_stack+0x20/0x30
      [    3.640230]  dump_stack+0xec/0x158
      [    3.640234]  register_lock_class+0x598/0x5c0
      [    3.640235]  __lock_acquire+0x80/0x16c0
      [    3.640236]  lock_acquire+0xf4/0x4a0
      [    3.640241]  _raw_spin_lock_irqsave+0x70/0xa8
      [    3.640245]  uart_add_one_port+0x388/0x4b8
      [    3.640248]  pl011_register_port+0x70/0xf0
      [    3.640250]  pl011_probe+0x184/0x1b8
      [    3.640254]  amba_probe+0xdc/0x180
      [    3.640256]  really_probe+0xe0/0x338
      [    3.640257]  driver_probe_device+0x60/0xf8
      [    3.640259]  __device_attach_driver+0x8c/0xd0
      [    3.640260]  bus_for_each_drv+0x84/0xd8
      [    3.640261]  __device_attach+0xe4/0x140
      [    3.640263]  device_initial_probe+0x1c/0x28
      [    3.640265]  bus_probe_device+0xa4/0xb0
      [    3.640266]  deferred_probe_work_func+0x7c/0xb8
      [    3.640269]  process_one_work+0x2c0/0x768
      [    3.640271]  worker_thread+0x4c/0x498
      [    3.640272]  kthread+0x14c/0x158
      [    3.640275]  ret_from_fork+0x10/0x1c
      
      Which seems to be due to the fact that after allocating the uap
      structure, nothing initializes the spinlock.
      
      Its a little confusing, as uart_port_spin_lock_init() is one
      place where the lock is supposed to be initialized, but it has
      an exception for the case where the port is a console.
      
      This makes it seem like a deeper fix is needed to properly
      register the console, but I'm not sure what that entails, and
      Andy suggested that this approach is less invasive.
      
      Thus, this patch resolves the issue by initializing the spinlock
      in the driver, and resolves the resulting warning.
      
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: linux-serial@vger.kernel.org
      Reported-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Reviewed-and-tested-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Link: https://lore.kernel.org/r/20200428184050.6501-1-john.stultz@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      95839ab5
    • Russell King's avatar
      i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output · 9367d6e8
      Russell King authored
      [ Upstream commit 88b73ee7 ]
      
      The IRQ log output is supposed to appear on a single line.  However,
      commit 3a2dc167 ("i2c: pxa: Update debug function to dump more info
      on error") resulted in it being printed one-entry-per-line, which is
      excessively long.
      
      Fixing this is not a trivial matter; using pr_cont() doesn't work as
      the previous dev_dbg() may not have been compiled in, or may be
      dynamic.
      
      Since the rest of this function output is at error level, and is also
      debug output, promote this to error level as well to avoid this
      problem.
      
      Reduce the number of always zero prefix digits to save screen real-
      estate.
      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>
      9367d6e8
    • Matej Dujava's avatar
      staging: sm750fb: add missing case while setting FB_VISUAL · af1a71e2
      Matej Dujava authored
      [ Upstream commit fa901333 ]
      
      Switch statement does not contain all cases: 8, 16, 24, 32.
      This patch will add missing one (24)
      
      Fixes: 81dee67e ("staging: sm750fb: add sm750 to staging")
      Signed-off-by: default avatarMatej Dujava <mdujava@kocurkovo.cz>
      Link: https://lore.kernel.org/r/1588277366-19354-2-git-send-email-mdujava@kocurkovo.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      af1a71e2
    • Raghavendra Rao Ananta's avatar
      tty: hvc: Fix data abort due to race in hvc_open · b6c61e4f
      Raghavendra Rao Ananta authored
      [ Upstream commit e2bd1dcb ]
      
      Potentially, hvc_open() can be called in parallel when two tasks calls
      open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add()
      callback in the function fails, where it sets the tty->driver_data to
      NULL, the parallel hvc_open() can see this NULL and cause a memory abort.
      Hence, serialize hvc_open and check if tty->private_data is NULL before
      proceeding ahead.
      
      The issue can be easily reproduced by launching two tasks simultaneously
      that does nothing but open() and close() on /dev/hvcX.
      For example:
      $ ./simple_open_close /dev/hvc0 & ./simple_open_close /dev/hvc0 &
      Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
      Link: https://lore.kernel.org/r/20200428032601.22127-1-rananta@codeaurora.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b6c61e4f
    • Julian Wiedmann's avatar
      s390/qdio: put thinint indicator after early error · f8c7afcb
      Julian Wiedmann authored
      [ Upstream commit 75e82bec ]
      
      qdio_establish() calls qdio_setup_thinint() via qdio_setup_irq().
      If the subsequent qdio_establish_thinint() fails, we miss to put the
      DSCI again. Thus the DSCI isn't available for re-use. Given enough of
      such errors, we could end up with having only the shared DSCI available.
      
      Merge qdio_setup_thinint() into qdio_establish_thinint(), and deal with
      such an error internally.
      
      Fixes: 779e6e1c ("[S390] qdio: new qdio driver.")
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f8c7afcb
    • Alexander Tsoy's avatar
      ALSA: usb-audio: Improve frames size computation · 5ef30e44
      Alexander Tsoy authored
      [ Upstream commit f0bd62b6 ]
      
      For computation of the the next frame size current value of fs/fps and
      accumulated fractional parts of fs/fps are used, where values are stored
      in Q16.16 format. This is quite natural for computing frame size for
      asynchronous endpoints driven by explicit feedback, since in this case
      fs/fps is a value provided by the feedback endpoint and it's already in
      the Q format. If an error is accumulated over time, the device can
      adjust fs/fps value to prevent buffer overruns/underruns.
      
      But for synchronous endpoints the accuracy provided by these computations
      is not enough. Due to accumulated error the driver periodically produces
      frames with incorrect size (+/- 1 audio sample).
      
      This patch fixes this issue by implementing a different algorithm for
      frame size computation. It is based on accumulating of the remainders
      from division fs/fps and it doesn't accumulate errors over time. This
      new method is enabled for synchronous and adaptive playback endpoints.
      Signed-off-by: default avatarAlexander Tsoy <alexander@tsoy.me>
      Link: https://lore.kernel.org/r/20200424022449.14972-1-alexander@tsoy.meSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      5ef30e44
    • Tyrel Datwyler's avatar
      scsi: ibmvscsi: Don't send host info in adapter info MAD after LPM · 1e492f9b
      Tyrel Datwyler authored
      [ Upstream commit 4919b33b ]
      
      The adapter info MAD is used to send the client info and receive the host
      info as a response. A persistent buffer is used and as such the client info
      is overwritten after the response. During the course of a normal adapter
      reset the client info is refreshed in the buffer in preparation for sending
      the adapter info MAD.
      
      However, in the special case of LPM where we reenable the CRQ instead of a
      full CRQ teardown and reset we fail to refresh the client info in the
      adapter info buffer. As a result, after Live Partition Migration (LPM) we
      erroneously report the host's info as our own.
      
      [mkp: typos]
      
      Link: https://lore.kernel.org/r/20200603203632.18426-1-tyreld@linux.ibm.comSigned-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1e492f9b
    • Simon Arlott's avatar
      scsi: sr: Fix sr_probe() missing deallocate of device minor · 0ac65cee
      Simon Arlott authored
      [ Upstream commit 6555781b ]
      
      If the cdrom fails to be registered then the device minor should be
      deallocated.
      
      Link: https://lore.kernel.org/r/072dac4b-8402-4de8-36bd-47e7588969cd@0882a8b5-c6c3-11e9-b005-00805fc181feSigned-off-by: default avatarSimon Arlott <simon@octiron.net>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      0ac65cee
    • ashimida's avatar
      mksysmap: Fix the mismatch of '.L' symbols in System.map · ef9fe743
      ashimida authored
      [ Upstream commit 72d24acc ]
      
      When System.map was generated, the kernel used mksysmap to
      filter the kernel symbols, but all the symbols with the
      second letter 'L' in the kernel were filtered out, not just
      the symbols starting with 'dot + L'.
      
      For example:
      ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
      ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
      ffff0000088028e0 t bLength_show
      ......
      ffff0000092e0408 b PLLP_OUTC_lock
      ffff0000092e0410 b PLLP_OUTA_lock
      
      The original intent should be to filter out all local symbols
      starting with '.L', so the dot should be escaped.
      
      Fixes: 00902e98 ("mksysmap: Add h8300 local symbol pattern")
      Signed-off-by: default avatarashimida <ashimida@linux.alibaba.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ef9fe743
    • Wang Hai's avatar
      yam: fix possible memory leak in yam_init_driver · 9cf93884
      Wang Hai authored
      [ Upstream commit 98749b71 ]
      
      If register_netdev(dev) fails, free_netdev(dev) needs
      to be called, otherwise a memory leak will occur.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9cf93884
    • Pingfan Liu's avatar
      powerpc/crashkernel: Take "mem=" option into account · 45d44c0c
      Pingfan Liu authored
      [ Upstream commit be5470e0 ]
      
      'mem=" option is an easy way to put high pressure on memory during
      some test. Hence after applying the memory limit, instead of total
      mem, the actual usable memory should be considered when reserving mem
      for crashkernel. Otherwise the boot up may experience OOM issue.
      
      E.g. it would reserve 4G prior to the change and 512M afterward, if
      passing
      crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G",
      and mem=5G on a 256G machine.
      
      This issue is powerpc specific because it puts higher priority on
      fadump and kdump reservation than on "mem=". Referring the following
      code:
          if (fadump_reserve_mem() == 0)
                  reserve_crashkernel();
          ...
          /* Ensure that total memory size is page-aligned. */
          limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
          memblock_enforce_memory_limit(limit);
      
      While on other arches, the effect of "mem=" takes a higher priority
      and pass through memblock_phys_mem_size() before calling
      reserve_crashkernel().
      Signed-off-by: default avatarPingfan Liu <kernelfans@gmail.com>
      Reviewed-by: default avatarHari Bathini <hbathini@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1585749644-4148-1-git-send-email-kernelfans@gmail.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      45d44c0c
    • Xiyu Yang's avatar
      nfsd: Fix svc_xprt refcnt leak when setup callback client failed · 69151594
      Xiyu Yang authored
      [ Upstream commit a4abc6b1 ]
      
      nfsd4_process_cb_update() invokes svc_xprt_get(), which increases the
      refcount of the "c->cn_xprt".
      
      The reference counting issue happens in one exception handling path of
      nfsd4_process_cb_update(). When setup callback client failed, the
      function forgets to decrease the refcnt increased by svc_xprt_get(),
      causing a refcnt leak.
      
      Fix this issue by calling svc_xprt_put() when setup callback client
      failed.
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      69151594
    • Kajol Jain's avatar
      powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run · 89211133
      Kajol Jain authored
      [ Upstream commit b4ac18ee ]
      
      Commit 2b206ee6 ("powerpc/perf/hv-24x7: Display change in counter
      values")' added to print _change_ in the counter value rather then raw
      value for 24x7 counters. Incase of transactions, the event count
      is set to 0 at the beginning of the transaction. It also sets
      the event's prev_count to the raw value at the time of initialization.
      Because of setting event count to 0, we are seeing some weird behaviour,
      whenever we run multiple 24x7 events at a time.
      
      For example:
      
      command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/,
      			   hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}"
      	  		   -C 0 -I 1000 sleep 100
      
           1.000121704                120 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           1.000121704                  5 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           2.000357733                  8 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           2.000357733                 10 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.000641884                 56 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           4.000641884 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           5.000791887 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
      
      Getting these large values in case we do -I.
      
      As we are setting event_count to 0, for interval case, overall event_count is not
      coming in incremental order. As we may can get new delta lesser then previous count.
      Because of which when we print intervals, we are getting negative value which create
      these large values.
      
      This patch removes part where we set event_count to 0 in function
      'h_24x7_event_read'. There won't be much impact as we do set event->hw.prev_count
      to the raw value at the time of initialization to print change value.
      
      With this patch
      In power9 platform
      
      command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/,
      		           hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}"
      			   -C 0 -I 1000 sleep 100
      
           1.000117685                 93 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           1.000117685                  1 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           2.000349331                 98 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           2.000349331                  2 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           3.000495900                131 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           3.000495900                  4 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.000645920                204 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           4.000645920                 61 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.284169997                 22 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
      Suggested-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Tested-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200525104308.9814-2-kjain@linux.ibm.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      89211133
    • Alain Volmat's avatar
      clk: clk-flexgen: fix clock-critical handling · f09c833c
      Alain Volmat authored
      [ Upstream commit a403bbab ]
      
      Fixes an issue leading to having all clocks following a critical
      clocks marked as well as criticals.
      
      Fixes: fa6415af ("clk: st: clk-flexgen: Detect critical clocks")
      Signed-off-by: default avatarAlain Volmat <avolmat@me.com>
      Link: https://lkml.kernel.org/r/20200322140740.3970-1-avolmat@me.comReviewed-by: default avatarPatrice Chotard <patrice.chotard@st.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f09c833c
    • Xiyu Yang's avatar
      scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event · 15e816ae
      Xiyu Yang authored
      [ Upstream commit 7217e6e6 ]
      
      In order to create or activate a new node, lpfc_els_unsol_buffer() invokes
      lpfc_nlp_init() or lpfc_enable_node() or lpfc_nlp_get(), all of them will
      return a reference of the specified lpfc_nodelist object to "ndlp" with
      increased refcnt.
      
      When lpfc_els_unsol_buffer() returns, local variable "ndlp" becomes
      invalid, so the refcount should be decreased to keep refcount balanced.
      
      The reference counting issue happens in one exception handling path of
      lpfc_els_unsol_buffer(). When "ndlp" in DEV_LOSS, the function forgets to
      decrease the refcnt increased by lpfc_nlp_init() or lpfc_enable_node() or
      lpfc_nlp_get(), causing a refcnt leak.
      
      Fix this issue by calling lpfc_nlp_put() when "ndlp" in DEV_LOSS.
      
      Link: https://lore.kernel.org/r/1590416184-52592-1-git-send-email-xiyuyang19@fudan.edu.cnReviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
      Reviewed-by: default avatarJames Smart <james.smart@broadcom.com>
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      15e816ae
    • Marek Szyprowski's avatar
      mfd: wm8994: Fix driver operation if loaded as modules · d93d04be
      Marek Szyprowski authored
      [ Upstream commit d4f9b542 ]
      
      WM8994 chip has built-in regulators, which might be used for chip
      operation. They are controlled by a separate wm8994-regulator driver,
      which should be loaded before this driver calls regulator_get(), because
      that driver also provides consumer-supply mapping for the them. If that
      driver is not yet loaded, regulator core substitute them with dummy
      regulator, what breaks chip operation, because the built-in regulators are
      never enabled. Fix this by annotating this driver with MODULE_SOFTDEP()
      "pre" dependency to "wm8994_regulator" module.
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d93d04be
    • Qian Cai's avatar
      vfio/pci: fix memory leaks in alloc_perm_bits() · 58d4c2ef
      Qian Cai authored
      [ Upstream commit 3e63b94b ]
      
      vfio_pci_disable() calls vfio_config_free() but forgets to call
      free_perm_bits() resulting in memory leaks,
      
      unreferenced object 0xc000000c4db2dee0 (size 16):
        comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s)
        hex dump (first 16 bytes):
          00 00 ff 00 ff ff ff ff ff ff ff ff ff ff 00 00  ................
        backtrace:
          [<00000000a6a4552d>] alloc_perm_bits+0x58/0xe0 [vfio_pci]
          [<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci]
          init_pci_cap_msi_perm at drivers/vfio/pci/vfio_pci_config.c:1125
          (inlined by) vfio_msi_cap_len at drivers/vfio/pci/vfio_pci_config.c:1180
          (inlined by) vfio_cap_len at drivers/vfio/pci/vfio_pci_config.c:1241
          (inlined by) vfio_cap_init at drivers/vfio/pci/vfio_pci_config.c:1468
          (inlined by) vfio_config_init at drivers/vfio/pci/vfio_pci_config.c:1707
          [<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci]
          [<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio]
          [<000000009e34c54f>] ksys_ioctl+0xd8/0x130
          [<000000006577923d>] sys_ioctl+0x28/0x40
          [<000000006d7b1cf2>] system_call_exception+0x114/0x1e0
          [<0000000008ea7dd5>] system_call_common+0xf0/0x278
      unreferenced object 0xc000000c4db2e330 (size 16):
        comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s)
        hex dump (first 16 bytes):
          00 ff ff 00 ff ff ff ff ff ff ff ff ff ff 00 00  ................
        backtrace:
          [<000000004c71914f>] alloc_perm_bits+0x44/0xe0 [vfio_pci]
          [<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci]
          [<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci]
          [<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio]
          [<000000009e34c54f>] ksys_ioctl+0xd8/0x130
          [<000000006577923d>] sys_ioctl+0x28/0x40
          [<000000006d7b1cf2>] system_call_exception+0x114/0x1e0
          [<0000000008ea7dd5>] system_call_common+0xf0/0x278
      
      Fixes: 89e1f7d4 ("vfio: Add PCI device driver")
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      [aw: rolled in follow-up patch]
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      58d4c2ef
    • 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 8 commits