Граф коммитов

983481 Коммитов

Автор SHA1 Сообщение Дата
Peter Zijlstra 640f17c824 workqueue: Restrict affinity change to rescuer
create_worker() will already set the right affinity using
kthread_bind_mask(), this means only the rescuer will need to change
it's affinity.

Howveer, while in cpu-hot-unplug a regular task is not allowed to run
on online&&!active as it would be pushed away quite agressively. We
need KTHREAD_IS_PER_CPU to survive in that environment.

Therefore set the affinity after getting that magic flag.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210121103506.826629830@infradead.org
2021-01-22 15:09:43 +01:00
Peter Zijlstra 5c25b5ff89 workqueue: Tag bound workers with KTHREAD_IS_PER_CPU
Mark the per-cpu workqueue workers as KTHREAD_IS_PER_CPU.

Workqueues have unfortunate semantics in that per-cpu workers are not
default flushed and parked during hotplug, however a subset does
manual flush on hotplug and hard relies on them for correctness.

Therefore play silly games..

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210121103506.693465814@infradead.org
2021-01-22 15:09:42 +01:00
Peter Zijlstra ac687e6e8c kthread: Extract KTHREAD_IS_PER_CPU
There is a need to distinguish geniune per-cpu kthreads from kthreads
that happen to have a single CPU affinity.

Geniune per-cpu kthreads are kthreads that are CPU affine for
correctness, these will obviously have PF_KTHREAD set, but must also
have PF_NO_SETAFFINITY set, lest userspace modify their affinity and
ruins things.

However, these two things are not sufficient, PF_NO_SETAFFINITY is
also set on other tasks that have their affinities controlled through
other means, like for instance workqueues.

Therefore another bit is needed; it turns out kthread_create_per_cpu()
already has such a bit: KTHREAD_IS_PER_CPU, which is used to make
kthread_park()/kthread_unpark() work correctly.

Expose this flag and remove the implicit setting of it from
kthread_create_on_cpu(); the io_uring usage of it seems dubious at
best.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210121103506.557620262@infradead.org
2021-01-22 15:09:42 +01:00
Peter Zijlstra 22f667c97a sched: Don't run cpu-online with balance_push() enabled
We don't need to push away tasks when we come online, mark the push
complete right before the CPU dies.

XXX hotplug state machine has trouble with rollback here.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210121103506.415606087@infradead.org
2021-01-22 15:09:42 +01:00
Lai Jiangshan 547a77d02f workqueue: Use cpu_possible_mask instead of cpu_active_mask to break affinity
The scheduler won't break affinity for us any more, and we should
"emulate" the same behavior when the scheduler breaks affinity for
us.  The behavior is "changing the cpumask to cpu_possible_mask".

And there might be some other CPUs online later while the worker is
still running with the pending work items.  The worker should be allowed
to use the later online CPUs as before and process the work items ASAP.
If we use cpu_active_mask here, we can't achieve this goal but
using cpu_possible_mask can.

Fixes: 06249738a4 ("workqueue: Manually break affinity on hotplug")
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210111152638.2417-4-jiangshanlai@gmail.com
2021-01-22 15:09:41 +01:00
Valentin Schneider 36c6e17bf1 sched/core: Print out straggler tasks in sched_cpu_dying()
Since commit

  1cf12e08bc ("sched/hotplug: Consolidate task migration on CPU unplug")

tasks are expected to move themselves out of a out-going CPU. For most
tasks this will be done automagically via BALANCE_PUSH, but percpu kthreads
will have to cooperate and move themselves away one way or another.

Currently, some percpu kthreads (workqueues being a notable exemple) do not
cooperate nicely and can end up on an out-going CPU at the time
sched_cpu_dying() is invoked.

Print the dying rq's tasks to shed some light on the stragglers.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/20210113183141.11974-1-valentin.schneider@arm.com
2021-01-22 15:09:41 +01:00
Ricky Wu 31b081066e misc: rtsx: init value of aspm_enabled
make sure ASPM state sync with pcr->aspm_enabled
init value pcr->aspm_enabled

Cc: stable@vger.kernel.org
Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20210122081906.19100-1-ricky_wu@realtek.com
Fixes: d928061c31 ("misc: rtsx: modify en/disable aspm function")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-22 11:04:53 +01:00
Linus Torvalds 17749851eb tty: fix up hung_up_tty_write() conversion
In commit "tty: implement write_iter", I left the write_iter conversion
of the hung up tty case alone, because I incorrectly thought it didn't
matter.

Jiri showed me the errors of my ways, and pointed out the problems with
that incomplete conversion.  Fix it all up.

Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/CAHk-=wh+-rGsa=xruEWdg_fJViFG8rN9bpLrfLz=_yBYh2tBhA@mail.gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-22 11:01:55 +01:00
Krzysztof Kozlowski 9ecd1d2b30 i2c: sprd: depend on COMMON_CLK to fix compile tests
The I2C_SPRD uses Common Clock Framework thus it cannot be built on
platforms without it (e.g. compile test on MIPS with LANTIQ):

    /usr/bin/mips-linux-gnu-ld: drivers/i2c/busses/i2c-sprd.o: in function `sprd_i2c_probe':
    i2c-sprd.c:(.text.sprd_i2c_probe+0x254): undefined reference to `clk_set_parent'

Fixes: 4a2d5f663d ("i2c: Enable compile testing for more drivers")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-01-22 10:13:33 +01:00
Fabio Estevam a4166340a6 Revert "i2c: imx: Remove unused .id_table support"
Coldfire platforms are non-DT users of this driver, so
keep the .id_table support.

This reverts commit c610199cd3.

Fixes: c610199cd3 (i2c: imx: Remove unused .id_table support")
Reported-by: Sascha Hauer <sha@pengutronix.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-01-22 09:49:04 +01:00
Linus Torvalds 83d09ad4b9 OpenRISC fixes for 5.11
Fixes include:
  * Compiler warning fixup for new Litex SoC driver
  * Sparse warning fixup for iounmap
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE2cRzVK74bBA6Je/xw7McLV5mJ+QFAmAKGqoACgkQw7McLV5m
 J+QhTw/+Pr6A2NaHKMQy+D3iI/zMxp9L99ltJiqpHZCakiPkQlPUkrj0H92M7t4e
 sK72IJYJgHruxERO6IGllKynSO8l4nOLg9M0ZArk4TDOATaxVCKAtlsMZeabhXiO
 /GhIGTs6CG0kSstdqvA6jvlo/R9VEnd/D0yO5YwINc4975RNG39c6WhV1Z9kAPIq
 baIXzvBQeOeiI5gJ8rQCbSEneHItFi6/4BlMBAQTSQNbetNRvHA7sj7nBCxsmLzS
 uggd6AM09oMsFjj2Ov6zZqA/W48Dh1KMciUiAGYkhazdTxxJX8BhlMwA7bTtW4O+
 mNofAVUTyn2B9RsaHTA8hGT7ZBfmgHTKbGzyrbgpOdjQ7mykSr8rAaMgNGXvdZoA
 aSfpnwZiPChS22YbvP/IY0WF0RscFHPtVkdm5AEDDRBP1DRSynEBTiuirF2RuzDD
 BiEo3ijesCOdugokWPvXwTfNaftNR3S4JbMr/9YABXF9x9ZQ05oJk12g4P5zMV+S
 tW4APfCvk4CHXU5MRDvm+mSCBpxMp/IVhAvY/iOb1L8d010zTBv6DdpN7kWFS6Ay
 r8fFRybrGCxTgD3VSnHHqQtkRbeKbnnvhQZ6DqOqQ2pQYOXckwwpfy9wkNL7M8h7
 iu6Df3VsM9Yg+aFWq6JxkvDJYJp7TVwv33ppJMIvX/Lq4qUxw/E=
 =L9VO
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://github.com/openrisc/linux

Pull OpenRISC fixes from Stafford Horne:

 - Compiler warning fixup for new Litex SoC driver

 - Sparse warning fixup for iounmap

* tag 'for-linus' of git://github.com/openrisc/linux:
  openrisc: io: Add missing __iomem annotation to iounmap()
  soc: litex: Fix compile warning when device tree is not configured
2021-01-21 18:35:02 -08:00
Linus Torvalds 36ada25026 drm fixes for 5.11-rc5
core:
 - atomic: Release state on error
 - syncobj: Fix use-after-free
 - ttm: Don't use GFP_TRANSHUGE_LIGTH
 - vram-helper: Fix memory leak in vmap
 
 vc4:
 - Unify driver naming for PCM
 
 i915:
 - HDCP fixes
 - PMU wakeref fix
 - Fix HWSP validity race
 - Fix DP protocol converter accidental 4:4:4->4:2:0 conversion for RGB
 
 amdgpu:
 - Green Sardine fixes
 - Vangogh fixes
 - Renoir fixes
 - Misc display fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJgChT/AAoJEAx081l5xIa+COEP/jKRjCZNcgEID4mKzKRTlujz
 VinINe+l9RUGgbYNhDLWMz7qmOjk0+EKr6KAZHPOCpDZpVxhpfNJmlAHSmvNBd96
 19CH2GXukR/QySzieKYVGd4t16fMLMq66He//7HdktlavhAkRlKUR2a9zJBbBdNW
 EGm0g8UMkfLkp9JN05kO+w5I8hcfF8jpAEI2XHK6ShJs0dmZUh5+DajHfkvOjbUx
 FBeGg3iUITaiHnsn1aJpjbuXFbggctMEw0+z4pmLgXAn7IKZZvziQVixFtmP5U56
 Ji0mIW8rwaOqm7+yIKYpt57+x+V6dcLMrEwCZ+sut7FK1DVDZ7y4LYci1gnY7T+0
 IC34sfw1oyti5PyK5rzS54/SOclZy11MD0+41t4ai0fhH06lmkbB6mgVLW8+OIT1
 JDpUIh7vURXTtNXV4joNmams72dYWPn7Nd4Q7bTRBlqIiasvHnTVOUGgc53S+t2h
 RJU2qv1ycip4tX4xwAEycdtdpH/cuyM/taW/+b2zhpKdJ3d0B6L4GCNquLRI225W
 TzNaqx7dsxCbEltKfAx7A/q0ojfJTE70PN7xsL/PYiP5GTO77qVz7OI5q6kT8Egv
 vdrMtdSJPKQ+7WdzTY+DJ1DwnnaX9InqrsPp4Lhs41je8gakWmjp/7TCdLWg008D
 Fa4gh/TsXJV4IaOPpDsT
 =aTWK
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2021-01-22' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Regular fixes pull, nothing too major in here, just some core fixes,
  one vc4, bunch of i915 and a bunch of amdgpu.

  core:
   - atomic: Release state on error
   - syncobj: Fix use-after-free
   - ttm: Don't use GFP_TRANSHUGE_LIGTH
   - vram-helper: Fix memory leak in vmap

  vc4:
   - Unify driver naming for PCM

  i915:
   - HDCP fixes
   - PMU wakeref fix
   - Fix HWSP validity race
   - Fix DP protocol converter accidental 4:4:4->4:2:0 conversion for RGB

  amdgpu:
   - Green Sardine fixes
   - Vangogh fixes
   - Renoir fixes
   - Misc display fixes"

* tag 'drm-fixes-2021-01-22' of git://anongit.freedesktop.org/drm/drm: (21 commits)
  drm/amdgpu: update mmhub mgcg&ls for mmhub_v2_3
  drm/amdgpu: modify GCR_GENERAL_CNTL for Vangogh
  drm/amdgpu/pm: no need GPU status set since mmnbif_gpu_BIF_DOORBELL_FENCE_CNTL added in FSDL
  drm/amd/display: Fixed corruptions on HPDRX link loss restore
  drm/amd/display: Use hardware sequencer functions for PG control
  drm/amd/display: Change function decide_dp_link_settings to avoid infinite looping
  drm/amd/display: Allow PSTATE chnage when no displays are enabled
  drm/amd/display: Update dram_clock_change_latency for DCN2.1
  drm/amdgpu: remove gpu info firmware of green sardine
  drm/amd/display: DCN2X Find Secondary Pipe properly in MPO + ODM Case
  drm/syncobj: Fix use-after-free
  drm/vram-helper: Reuse existing page mappings in vmap
  drm/atomic: put state on error path
  drm/i915: Only enable DFP 4:4:4->4:2:0 conversion when outputting YCbCr 4:4:4
  drm/i915: Check for rq->hwsp validity after acquiring RCU lock
  drm/i915/pmu: Don't grab wakeref when enabling events
  drm/i915/gt: Prevent use of engine->wa_ctx after error
  drm/vc4: Unify PCM card's driver_name
  drm/ttm: stop using GFP_TRANSHUGE_LIGHT
  drm/i915/hdcp: Get conn while content_type changed
  ...
2021-01-21 17:16:10 -08:00
Dave Airlie 06ee38dc2a Merge tag 'amd-drm-fixes-5.11-2021-01-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.11-2021-01-21:

amdgpu:
- Green Sardine fixes
- Vangogh fixes
- Renoir fixes
- Misc display fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210121160129.3981-1-alexander.deucher@amd.com
2021-01-22 09:43:21 +10:00
Dave Airlie 5f9986a6cd Merge tag 'drm-intel-fixes-2021-01-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.11-rc5:
- HDCP fixes
- PMU wakeref fix
- Fix HWSP validity race
- Fix DP protocol converter accidental 4:4:4->4:2:0 conversion for RGB

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87a6t2kzgb.fsf@intel.com
2021-01-22 09:28:23 +10:00
Dave Airlie f722f5bea1 Short summary of fixes pull (less than what git shortlog provides):
* drm/atomic: Release state on error
  * drm/syncobj: Fix use-after-free
  * drm/ttm: Don't use GFP_TRANSHUGE_LIGTH
  * drm/vc4: Unify driver naming for PCM
  * drm/vram-helper: Fix memory leak in vmap
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmAIHQwACgkQaA3BHVML
 eiO8fgf/UPOq1nZXv6WtmNXhQbXS8dcOchzIytliNvVQn0VZ7fB4FZ+w+s3Yu/Vs
 HchWP4jhqlAhK+9NzYLTJ25EigcsJ8IDlpgPo1HenmnMxMl6fN3xP0hwwFA+Usv3
 3yYboXpBEvUTesL6AEiAw+7L/FKnTSMhqwynRNMKjDmLbn40VQM7RxWMIbUKY9cu
 dzzYI6fOcmjWryd/rJQ1cA4k+JOPIC9rbvcY0OzaZOFCUOEeK6icvbG/ARk4BXvQ
 mh7ykD8u126c0ATvAPuwSzy9eSuetQ3HwKDGWS7mIlZa2CdhkSeOypa9spozuDxa
 Nd8dZWG6CcCBQ/Vwb8Ey7fM4JZ9Pig==
 =gLTY
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2021-01-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Short summary of fixes pull (less than what git shortlog provides):

 * drm/atomic: Release state on error
 * drm/syncobj: Fix use-after-free
 * drm/ttm: Don't use GFP_TRANSHUGE_LIGTH
 * drm/vc4: Unify driver naming for PCM
 * drm/vram-helper: Fix memory leak in vmap

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YAgdYGNoH7pC29rz@linux-uq9g
2021-01-22 09:19:52 +10:00
Gayatri Kammela 6e1239c139 x86/cpu: Add another Alder Lake CPU to the Intel family
Add Alder Lake mobile CPU model number to Intel family.

Signed-off-by: Gayatri Kammela <gayatri.kammela@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210121215004.11618-1-tony.luck@intel.com
2021-01-21 23:01:51 +01:00
Josh Poimboeuf 1d489151e9 objtool: Don't fail on missing symbol table
Thanks to a recent binutils change which doesn't generate unused
symbols, it's now possible for thunk_64.o be completely empty without
CONFIG_PREEMPTION: no text, no data, no symbols.

We could edit the Makefile to only build that file when
CONFIG_PREEMPTION is enabled, but that will likely create confusion
if/when the thunks end up getting used by some other code again.

Just ignore it and move on.

Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1254
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2021-01-21 15:49:58 -06:00
Josh Poimboeuf 655cf86548 objtool: Don't fail the kernel build on fatal errors
This is basically a revert of commit 644592d328 ("objtool: Fail the
kernel build on fatal errors").

That change turned out to be more trouble than it's worth.  Failing the
build is an extreme measure which sometimes gets too much attention and
blocks CI build testing.

These fatal-type warnings aren't yet as rare as we'd hope, due to the
ever-increasing matrix of supported toolchains/plugins and their
fast-changing nature as of late.

Also, there are more people (and bots) looking for objtool warnings than
ever before, so even non-fatal warnings aren't likely to be ignored for
long.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2021-01-21 15:49:39 -06:00
Jin Yao 8adc0a06d6 perf script: Fix overrun issue for dynamically-allocated PMU type number
When unpacking the event which is from dynamic PMU, the array
output[OUTPUT_TYPE_MAX] may be overrun. For example, type number of SKL
uncore_imc is 10, but OUTPUT_TYPE_MAX is 7 now (OUTPUT_TYPE_MAX =
PERF_TYPE_MAX + 1).

/* In builtin-script.c */

process_event()
{
        unsigned int type = output_type(attr->type);

        if (output[type].fields == 0)
                return;
}

output[10] is overrun.

Create a type OUTPUT_TYPE_OTHER for dynamic PMU events, then
output_type(attr->type) will return OUTPUT_TYPE_OTHER here.

Note that if PERF_TYPE_MAX ever changed, then there would be a conflict
between old perf.data files that had a dynamicaliy allocated PMU number
that would then be the same as a fixed PERF_TYPE.

Example:

  # perf record --switch-events -C 0 -e "{cpu-clock,uncore_imc/data_reads/,uncore_imc/data_writes/}:SD" -a -- sleep 1
  # perf script

  Before:
         swapper     0 [000] 1479253.987551:     277766               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.987797:     246709               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.988127:     329883               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.988273:     146393               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.988523:     249977               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.988877:     354090               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.989023:     145940               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.989383:     359856               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1479253.989523:     140082               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])

  After:
         swapper     0 [000] 1397040.402011:     272384               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1397040.402011:       5396  uncore_imc/data_reads/:
         swapper     0 [000] 1397040.402011:        967 uncore_imc/data_writes/:
         swapper     0 [000] 1397040.402259:     249153               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1397040.402259:       7231  uncore_imc/data_reads/:
         swapper     0 [000] 1397040.402259:       1297 uncore_imc/data_writes/:
         swapper     0 [000] 1397040.402508:     249108               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
         swapper     0 [000] 1397040.402508:       5333  uncore_imc/data_reads/:
         swapper     0 [000] 1397040.402508:       1008 uncore_imc/data_writes/:

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Link: https://lore.kernel.org/r/20201209005828.21302-1-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-01-21 17:25:33 -03:00
John Garry 3d6e79ee9e perf metricgroup: Fix system PMU metrics
Joakim reports that getting "perf stat" for multiple system PMU metrics
segfaults:

  $ perf stat -a -I 1000 -M imx8mm_ddr_write.all,imx8mm_ddr_write.all
  Segmentation fault
  $

While the same works without issue for a single metric.

The logic in metricgroup__add_metric_sys_event_iter() is broken, in that
add_metric() @m argument should be NULL for each new metric. Fix by not
passing a holder for that, and rather make local in
metricgroup__add_metric_sys_event_iter().

Fixes: be335ec28e ("perf metricgroup: Support adding metrics for system PMUs")
Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxarm@openeuler.org
Link: https://lore.kernel.org/r/1611050655-44020-1-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-01-21 17:25:33 -03:00
John Garry 9c880c24cb perf metricgroup: Fix for metrics containing duration_time
Metrics containing duration_time cause a segfault:

  $ perf stat -v -M L1D_Cache_Fill_BW sleep 1
  Using CPUID GenuineIntel-6-3D-4
  metric expr 64 * l1d.replacement / 1000000000 / duration_time for L1D_Cache_Fill_BW
  found event duration_time
  found event l1d.replacement
  adding {l1d.replacement}:W,duration_time
  l1d.replacement -> cpu/umask=0x1,(null)=0x1e8483,event=0x51/
  Segmentation fault
  $

In commit c2337d6719 ("perf metricgroup: Fix metrics using aliases
covering multiple PMUs"), the logic in find_evsel_group() when iter'ing
events was changed to not only select events in same group, but also for
aliased PMUs.

Checking whether events were for aliased PMUs was done by comparing the
event PMU name. This was not safe for duration_time event, which has no
associated PMU (and no PMU name), so fix by checking if the event PMU name
is set also.

Committer testing:

Reproduced the bug, then, on a:

  $ grep -m1 ^'model name' /proc/cpuinfo
  model name	: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  $

We now get:

  $ perf stat -M L1D_Cache_Fill_BW sleep 1

   Performance counter stats for 'sleep 1':

               4,141      l1d.replacement:u
       1,001,285,107 ns   duration_time:u

         1.001285107 seconds time elapsed

         0.000000000 seconds user
         0.001119000 seconds sys

  $

Detais from -v:

  Using CPUID GenuineIntel-6-8E-A
  metric expr 64 * l1d.replacement / 1000000000 / duration_time for L1D_Cache_Fill_BW
  found event duration_time
  found event l1d.replacement
  adding {l1d.replacement}:W,duration_time
  l1d.replacement -> cpu/(null)=0x1e8483,umask=0x1,event=0x51/
  Control descriptor is not initialized
  Warning:
  kernel.perf_event_paranoid=2, trying to fall back to excluding kernel and hypervisor  samples
  Warning:
  kernel.perf_event_paranoid=2, trying to fall back to excluding kernel and hypervisor  samples
  l1d.replacement:u: 4592 612201 612201
  duration_time:u: 1001478621 1001478621 1001478621

Fixes: c2337d6719 ("perf metricgroup: Fix metrics using aliases covering multiple PMUs")
Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxarm@openeuler.org
Link: https://lore.kernel.org/r/1611159518-226883-1-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-01-21 17:25:33 -03:00
Adrian Hunter fc705fecf3 perf evlist: Fix id index for heterogeneous systems
perf_evlist__set_sid_idx() updates perf_sample_id with the evlist map
index, CPU number and TID. It is passed indexes to the evsel's cpu and
thread maps, but references the evlist's maps instead. That results in
using incorrect CPU numbers on heterogeneous systems. Fix it by using
evsel maps.

The id index (PERF_RECORD_ID_INDEX) is used by AUX area tracing when in
sampling mode. Having an incorrect CPU number causes the trace data to
be attributed to the wrong CPU, and can result in decoder errors because
the trace data is then associated with the wrong process.

Committer notes:

Keep the class prefix convention in the function name, switching from
perf_evlist__set_sid_idx() to perf_evsel__set_sid_idx().

Fixes: 3c659eedad ("perf tools: Add id index")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20210121125446.11287-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-01-21 17:25:33 -03:00
Hannes Reinecke 809b1e4945 dm: avoid filesystem lookup in dm_get_dev_t()
This reverts commit
644bda6f34 ("dm table: fall back to getting device using name_to_dev_t()")

dm_get_dev_t() is just used to convert an arbitrary 'path' string
into a dev_t. It doesn't presume that the device is present; that
check will be done later, as the only caller is dm_get_device(),
which does a dm_get_table_device() later on, which will properly
open the device.

So if the path string already _is_ in major:minor representation
we can convert it directly, avoiding a recursion into the filesystem
to lookup the block device.

This avoids a hang in multipath_message() when the filesystem is
inaccessible.

Fixes: 644bda6f34 ("dm table: fall back to getting device using name_to_dev_t()")
Cc: stable@vger.kernel.org
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-01-21 15:06:45 -05:00
Ignat Korchagin 004b8ae9e2 dm crypt: fix copy and paste bug in crypt_alloc_req_aead
In commit d68b29584c ("dm crypt: use GFP_ATOMIC when allocating
crypto requests from softirq") code was incorrectly copy and pasted
from crypt_alloc_req_skcipher()'s crypto request allocation code to
crypt_alloc_req_aead(). It is OK from runtime perspective as both
simple encryption request pointer and AEAD request pointer are part of
a union, but may confuse code reviewers.

Fixes: d68b29584c ("dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-01-21 15:06:44 -05:00
Mikulas Patocka 5c02406428 dm integrity: conditionally disable "recalculate" feature
Otherwise a malicious user could (ab)use the "recalculate" feature
that makes dm-integrity calculate the checksums in the background
while the device is already usable. When the system restarts before all
checksums have been calculated, the calculation continues where it was
interrupted even if the recalculate feature is not requested the next
time the dm device is set up.

Disable recalculating if we use internal_hash or journal_hash with a
key (e.g. HMAC) and we don't have the "legacy_recalculate" flag.

This may break activation of a volume, created by an older kernel,
that is not yet fully recalculated -- if this happens, the user should
add the "legacy_recalculate" flag to constructor parameters.

Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Daniel Glockner <dg@emlix.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-01-21 15:05:21 -05:00
Linus Torvalds 9f29bd8b2e \n
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEq1nRK9aeMoq1VSgcnJ2qBz9kQNkFAmAJfUoACgkQnJ2qBz9k
 QNnH+Qf/Q/e0zGxGW7Snj6Kz4VL9yHwfvQUdZPFashv+Uff1jnPkXQbnJia2mUNE
 6g4XsMTuXTF13TvNmf93MBHAmlJSicUfRNqyDx9HP0VrNy2NarIwDcN4yAoOs2cZ
 jwzwOVDJmDf/EALVv+6JUySRq/v5f4EEihtYjVEXxVNh7rZiLOBYnY5wPLvicU3h
 ButzuOnH0F4aqBKuZsanJYDIswmJ05awxy4wu4SWoyghc+KUc61pXeND1KHa4LoR
 1A4NL7OcjZkpHvaWCw8FKgEQnyTyvbi78aSSrOLcZhdT6l5jQt8xaRwz66zk9Yw2
 mxQe9YefTcvlmm8iNn3B7QxMmJmZ7g==
 =agn9
 -----END PGP SIGNATURE-----

Merge tag 'fs_for_v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fs and udf fixes from Jan Kara:
 "A lazytime handling fix from Eric Biggers and a fix of UDF session
  handling for large devices"

* tag 'fs_for_v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: fix the problem that the disc content is not displayed
  fs: fix lazytime expiration handling in __writeback_single_inode()
2021-01-21 11:45:40 -08:00
Mikulas Patocka 2d06dfecb1 dm integrity: fix a crash if "recalculate" used without "internal_hash"
Recalculate can only be specified with internal_hash.

Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-01-21 14:41:43 -05:00
Greg Kroah-Hartman b11f623cc8 This tag contains the following bug fixes for 5.11-rc5/6:
- Clear the fence field in the PCI counters packet before sending
   the packet to the F/W. Not clearing it might cause the driver
   and F/W to get out-of-sync
 
 - Fix backward compatibility in the uapi of IDLE check that is
   part of the INFO IOCTL.
 
 - Tell the F/W to not access the Host (device outbound) while
   the driver removes the device. If that happens, the server
   might crash.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEE7TEboABC71LctBLFZR1NuKta54AFAmAJ06ETHG9nYWJiYXlA
 a2VybmVsLm9yZwAKCRBlHU24q1rngJZSB/9zAWGpMoQd1RzglMDfuLqnrGWtFHq5
 CmqJXPmDUXf059f7Rj0Mw/Ce6jnzreBgRzL4GJ31gVPGD5Bi2IvAv7uO3qJtOwkq
 ceeLqvS5T30FhGUqTId5JW9eGjj5MfkXALNWunl+AzeJfahCFygltrA4FtTf7i/X
 YzV9kwT01njb5/NAi5IEcs8T13+n913WIyLmzt7G90brOonP2m1lETNBShx7M0dL
 8hlCs2ULPD3x4ErAmLbyZInD4kJjuU65KgZhUzxVYzg73q+vUl/5dN9GoJy4SAhb
 shIhdkRcu201MjNexiogMmwez9+8M6lcPinpfMrvfH+YGW4QZHrTR6WQ
 =HJ7o
 -----END PGP SIGNATURE-----

Merge tag 'misc-habanalabs-fixes-2021-01-21' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-linus

Oded writes:

This tag contains the following bug fixes for 5.11-rc5/6:

- Clear the fence field in the PCI counters packet before sending
  the packet to the F/W. Not clearing it might cause the driver
  and F/W to get out-of-sync

- Fix backward compatibility in the uapi of IDLE check that is
  part of the INFO IOCTL.

- Tell the F/W to not access the Host (device outbound) while
  the driver removes the device. If that happens, the server
  might crash.

* tag 'misc-habanalabs-fixes-2021-01-21' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux:
  habanalabs: disable FW events on device removal
  habanalabs: fix backward compatibility of idle check
  habanalabs: zero pci counters packet before submit to FW
2021-01-21 20:38:51 +01:00
Linus Torvalds 2561bbbe2e Printk fixes for 5.11-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEESH4wyp42V4tXvYsjUqAMR0iAlPIFAmAJmRwACgkQUqAMR0iA
 lPLxAxAAgBEj8XqRiQh51mDyGCFkHR0NJ2WqSRa50HHhw/mCipwl40jwTsOol2xs
 REodcmswBBvZVApqtWlN+U24j3VaU0gyjpt9ndfkkG9c5PeKlpryGnlABd4Zw3SP
 m8NHkO2rQtdAgVm6AaNd17mYXtZV9a820SNhiDrqxylNDHR1DJW31MoQTpyY4SqE
 zcFyOFabA/zAc869IEnbpiZ8AO6n1lQCJa0C+D+mI70jgy7YEmD0eGkxRTpjoMDS
 ms/iTjelxfWHsuNzQ+85q/931hdz53/Ri3a+HHjDVZSL/e/yxRyr9sOM0XLPVQDy
 2xoHbqTZo4YCYaWSj0ePuW9Sl2yzxuuDtovNEUyssjP+22YV9en9qiHgViZqW9HN
 saruWYZytnpGp4YMFChgen4rxd7jbdxZZzaYOJdJWy2aRn3MfDXrg7aO97MhU4HS
 TeHGee430VYrUc28Nzhnd+wGyAtPDVlGSnZdT+AIo+Uv4a4iK8ULv/58mTM2DvrJ
 Nzln/pwSBf7ddarO8pvdAggmsBAxyBEQ8NUPbeSwiZ2BEIRnO+hT7mDLZ/6TNY83
 jeBDZP7hxo5MfDMhUPkoTdxlZxETnHFrihopChcHjtw+Gz1mb27n1iFactWaLirg
 J+E+/dKbdmxtcKyT3NoqGvcEj08pk/ImtuCPK11b23CzUFTkLrk=
 =l1hI
 -----END PGP SIGNATURE-----

Merge tag 'printk-for-5.11-printk-rework-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull printk fixes from Petr Mladek:

 - Fix line counting and buffer size calculation. Both regressions
   caused that a reader buffer might not get filled as much as possible.

 - Restore non-documented behavior of printk() reader API and make it
   official.

   It did not fill the last byte of the provided buffer before 5.10. Two
   architectures, powerpc and um, used it to add the trailing '\0'.
   There might theoretically be more callers depending on this behavior
   in userspace.

* tag 'printk-for-5.11-printk-rework-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk: fix buffer overflow potential for print_text()
  printk: fix kmsg_dump_get_buffer length calulations
  printk: ringbuffer: fix line counting
2021-01-21 11:37:22 -08:00
Linus Torvalds 6a52f4cf86 ACPI fix for 5.11-rc5
Modify a helper function in the ACPI core to match the behavior
 expected by its users so as to prevent NULL pointer dereferences
 and occasional memory corruption from occurring (Hans de Goede).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmAJyzESHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxMqUP/16WwsmD/09ArqK15naoRJT89KGXyK9L
 RmF9OSXKzgRi8AY3BMZP4yPpMECZtyoCYzY8A82n1ypi67AKB8sRq1+EvVRdGla/
 ioHqIB1kWEAmkX0kBuYYMN2GT0RQFN43Xdpx7u4j9AHwzdTG+/4WGCy/WeQpgF3D
 DAyNtI0aJXvJ7wUH+n/976w6E3hxaW5zHiq+4Q3smIx6uPj3wsjlchvIRs5RmfnA
 pzq9U9wZjFBq9ov8hYDP5ObzHTR3XS4vY1aQOpfoK1k9sKtIlgI0q49AdibPfQP5
 PPf8idLftqJFrGyijFmAyCb0vwaS9jJvcTR/hX7DQqAQHPRGAxltzaazW8XtXAlj
 NLykdaaxYc1n3+Zy49TW0i8Gg01JN3Z3ja5laxfbL2wXsCdFIP4BG49ry63cE+x2
 8ubyyMo8+yNzH3sc4OgjID0PVs8C2tP6oHNQo7e3N3svaIh0xnfj/3hBH8Bw0MSK
 4s34IYXPNqmXgMGyssXOMDpxUeVhuRxSQXwCUxb6hHfJf8fikQZ90Xmh92tMH8Yn
 Xd6AVQag6PiRhO79wE6KimI6W1j/fRq6APFG0umF0qzH2vfLLYkc10psZemYDXkU
 Qu7ZAV2HtmpJWfiKI+AdJPimX01uZ1/tyaR5ywImZI/uFfPXEoJ5bx7sxHo36wXl
 dtdc/cmygyRl
 =E7AD
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Modify a helper function in the ACPI core to match the behavior
  expected by its users so as to prevent NULL pointer dereferences and
  occasional memory corruption from occurring (Hans de Goede)"

* tag 'acpi-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: scan: Make acpi_bus_get_device() clear return pointer on error
2021-01-21 11:28:30 -08:00
Linus Torvalds 120fbdb84f sound fixes for 5.11-rc5
Here is a collection of sound fixes targeted for 5.11-rc5.  Most
 notably, USB-audio still got a few intensive changes for covering the
 regressions while the rest are all small fixes.
 
 - A trivial fix for sequencer OSS emulation error path
 - HD-audio runtime PM regression fix, a few quirks and new IDs
 - USB-audio regression fixes for Pioneer device, Logitech webcams, etc
 - ASoC SOF Intel coverage
 - MAINTAINERS file update
 - A fix in the jack handling in ASoC HDMI codec
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmAJj6sOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9uSg//cMS9BjlRT63nK6GIpBMY76FHkJT9Layj7AFD
 DLElEnUslberM+4/UiFtLM3bSaIuOH+BUgTcBgs4tADA/kGHsz/+/idx7aZSMYcP
 Qh1SbRetNVCcOwT5+tzYJYjMYG2f4RRRUKJ1YTns5w/0p8NCfUSTxGpZbm38rILN
 8FuOjRkcR3awCbEYI9q4VbRAbeF7b0WU1JVF1d/eXFdiYWkiZvCZoH9Tl8wgptvF
 1ijVemE6mvGh3xpTwxfU1IDfxd9B6vDumIrKvjUJ8L3tuz1sMvaC05nOz1UuFbus
 uE4B53Jy8/DbzqDbiUmrOVh80qRpp9JMOWgEnYi9ro7QoQHgvVEksuWDmQxhtNhk
 ogyYMdKhB2zDcZBVHgdK8gWk/gpaH3QeUQwVaFYPEnQJLn/4NxATVr8S+X99Dtix
 AhKpThRdGwcmnkKPFzvxm63pnl3uqLeB73hCJMC7fB7FAskFr4Bwi8MVJ0ZE95jD
 /A/oxvKBClt5goi+1EzNXFD371i1u3B/FWcVESVdgt1CZyXR/wSi/zaGgzuk5i/H
 9WtEPlqyHNfjsiUbwMnF1nrkZxIimFWrNNpO5cwm8MzDgBQMy/AniOisZBg4AkSD
 XN0VGQ4ZxtfxBhNJtXJRSYI/JM7cTJ1/J/yDN3toVgCtXxKlxyLe3EcJNFUxpixT
 j/n+dz4=
 =r+rh
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Here is a collection of sound fixes targeted for 5.11-rc5. Most
  notably, USB-audio still got a few intensive changes for covering the
  regressions while the rest are all small fixes.

   - A trivial fix for sequencer OSS emulation error path

   - HD-audio runtime PM regression fix, a few quirks and new IDs

   - USB-audio regression fixes for Pioneer device, Logitech webcams,
     etc

   - ASoC SOF Intel coverage

   - MAINTAINERS file update

   - A fix in the jack handling in ASoC HDMI codec"

* tag 'sound-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Fix hw constraints dependencies
  ALSA: hda: Balance runtime/system PM if direct-complete is disabled
  ALSA: usb-audio: Avoid implicit feedback on Pioneer devices
  ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1
  ALSA: usb-audio: Fix UAC1 rate setup for secondary endpoints
  MAINTAINERS: update qcom ASoC drivers list
  MAINTAINERS: update maintainers of qcom audio
  ALSA: hda: Add Cometlake-R PCI ID
  ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
  ALSA: hda/via: Add minimum mute flag
  ALSA: hda/realtek - Limit int mic boost on Acer Aspire E5-575T
  ALSA: usb-audio: Always apply the hw constraints for implicit fb sync
  ASoC: SOF: Intel: fix page fault at probe if i915 init fails
  ALSA: hda: Add AlderLake-P PCI ID and HDMI codec vid
  ASoC: SOF: Intel: hda: Avoid checking jack on system suspend
  ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN
  ASoC: SOF: Intel: hda: Resume codec to do jack detection
  MAINTAINERS: update references to stm32 audio bindings
  ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
2021-01-21 11:25:35 -08:00
Linus Torvalds d7631e4378 gpio fixes for v5.11-rc5
- rework the character device code to avoid a frame size warning
 - fix printk format issues in gpio-tools
 - warn on redefinition of the to_irq callback in core gpiolib code
 - fix PWM period calculation in gpio-mvebu
 - make gpio-sifive Kconfig entry consistent with other drivers
 - fix a build issue in gpio-tegra
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmAJSRUACgkQEacuoBRx
 13INyQ/8CXh1/nBTx8LkLPNXkmv/RTA0AKjEBuhY/VVYHwhhZ17rTisc3+2LfQ4N
 dbS1taI5J1GVqk8yrKrcjESZxAuduwokhR5ciRZbHDFMEii6hhH7RuN7Evxd9DCr
 1kMhv0X/dRG/C6xAawP6nS8wpf/tOzv71wBpp7MT//ZzZGWx49jMtyEkqijjqH8n
 lQnoZdBw7vMVvxhXa6WXc3i9N8hAOS3YAFAs9NtDvabGpvIaCSgU43e4we6pYHND
 0OHD2+V3FYpRYsenoOmOoRLZheMQ/Z0DjWKkvBQburl1n6ZLaCtdjAi1MoG5FhbN
 49VJhyPTOlw1xsmTm/2Fg4WzktDi95gsQzef25bhhTBVoETOen6gBxK2RsdUmpzm
 zQX1wUrINGfzcfQhStIvjyznHZRabGuxDlFN9UH3mGnDVzWepuqCvY9s2/zmU4eU
 OtCTWsM9TTmlRiU/bIqC5/aSJyZJ/d1stiacRCsfPJ4Gmb4zsm9y/cILMporiRPJ
 JEd4T0jUSo94QLcrSSse15TBVVOA9TydFrDgVE3HBAZbqf+eaRG/fYKRABs6cX+H
 VNhIRi1mjj2rr1UwmCYcEtuT3ODthXS7lTAGmLt7hAzSHCxMsO+pSQ2BPdGanb9O
 GKWs/owyZm1be4e3yVdQfrQ4/+LimqpyN8uDSU4RbfuNrHiSLxw=
 =1H0g
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - rework the character device code to avoid a frame size warning

 - fix printk format issues in gpio-tools

 - warn on redefinition of the to_irq callback in core gpiolib code

 - fix PWM period calculation in gpio-mvebu

 - make gpio-sifive Kconfig entry consistent with other drivers

 - fix a build issue in gpio-tegra

* tag 'gpio-fixes-for-v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: tegra: Add missing dependencies
  gpio: sifive: select IRQ_DOMAIN_HIERARCHY rather than depend on it
  gpio: mvebu: fix pwm .get_state period calculation
  gpiolib: add a warning on gpiochip->to_irq defined
  tools: gpio: fix %llu warning in gpio-watch.c
  tools: gpio: fix %llu warning in gpio-event-mon.c
  gpiolib: cdev: fix frame size warning in gpio_ioctl()
2021-01-21 11:19:59 -08:00
Linus Torvalds 63858ac326 Pin control fixes for the v5.11 kernel.
These are all driver fixes, the Qualcomm stuff is the most
 widely used and important:
 
 - The main matter is a complicated fixup for the Qualcomm
   deep sleep states. This manifests in how interrupts get
   handled or in some cases not handled in cooperation with
   the PDC (Power Domain Controller). It's one of these really
   hardcore bug fixes that signifies high maturity of the
   platform.
 
 - Fix a register layout problem in the JZ4760 driver.
 
 - Fix a register offset in the Aspeed G6 driver.
 
 - Fix a compiler warning in the Nomadik driver.
 
 - Fix a fallback code path in the mediatek driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmAJQAAACgkQQRCzN7AZ
 XXMXNQ/9GSYkl2Q3gRS/XYFRXzIu8PEiwkirzU/zs7k18M5Y7H5EDmDQRMvZWV5F
 fdZBz9YuUysDfJYHWisgQd/tZWrtDEiK5WSgk6lKQh5easfOr3fA4Fy12ccoBZFx
 n1G6Azda+OrpJxAMc2QOyeBLk3VPs2zOQ6osI8UnrPinP8xyXLFqk5e69JicBH4v
 hmC0215VFKuSkLa2aCYjjBheESbUia4Gsasvaqbz6Ffzr/ixbCS2CvYJpB9aES9y
 lrcUFsRofO2xEYxjVoVmmWtdzvyRGsMOySpx2/ip6zgwSMraGo57ecD8MdKu/TpZ
 DS6dN7xKIW5Oj2Rb5Xy1ME7OoOsYQWlRw8SgrzzTt1nE/1UtL/1CEaWFYhYM5RN7
 MGznLOxo0PJKF+vr5uddA22IxQMidkCuo59mS63gDjVImX51S5zCVM6dzSqeOhoP
 0V0S8VQ833ddr4/v3FWTVxGAgbEbfkt5xJDfHu1y5CeUUzBrEr3hrWpNDrTANJG9
 Ea7BCVEFYbut8TCjT1YQv35RbqJhHD79AmCLDJU4r/M5WedUKRxwDjY9YPlIU8e9
 gRONTXuqZf2pXRnZ/pWAcpAiyg1GmTIhNa2mMtyTMh2yOOApiPDZNtqOcpAm9Zoz
 E05qv/1WYWfp10qmWRSuz68a71dALprUjqTTpGbP5qXlFdxP0O0=
 =sEqd
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 "These are all driver fixes, the Qualcomm stuff is the most widely used
  and important:

   - The main matter is a complicated fixup for the Qualcomm deep sleep
     states.

     This manifests in how interrupts get handled or in some cases not
     handled in cooperation with the PDC (Power Domain Controller). It's
     one of these really hardcore bug fixes that signifies high maturity
     of the platform.

   - Fix a register layout problem in the JZ4760 driver

   - Fix a register offset in the Aspeed G6 driver

   - Fix a compiler warning in the Nomadik driver

   - Fix a fallback code path in the mediatek driver"

* tag 'pinctrl-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: qcom: Don't clear pending interrupts when enabling
  pinctrl: qcom: Properly clear "intr_ack_high" interrupts when unmasking
  pinctrl: qcom: No need to read-modify-write the interrupt status
  pinctrl: qcom: Allow SoCs to specify a GPIO function that's not 0
  pinctrl: mediatek: Fix fallback call path
  pinctrl: nomadik: Remove unused variable in nmk_gpio_dbg_show_one
  pinctrl: aspeed: g6: Fix PWMG0 pinctrl setting
  pinctrl: ingenic: Rename registers from JZ4760_GPIO_* to JZ4770_GPIO_*
  pinctrl: ingenic: Fix JZ4760 support
2021-01-21 11:14:24 -08:00
Saravana Kannan e020ff611b driver core: Fix device link device name collision
The device link device's name was of the form:
<supplier-dev-name>--<consumer-dev-name>

This can cause name collision as reported here [1] as device names are
not globally unique. Since device names have to be unique within the
bus/class, add the bus/class name as a prefix to the device names used to
construct the device link device name.

So the devuce link device's name will be of the form:
<supplier-bus-name>:<supplier-dev-name>--<consumer-bus-name>:<consumer-dev-name>

[1] - https://lore.kernel.org/lkml/20201229033440.32142-1-michael@walle.cc/

Fixes: 287905e68d ("driver core: Expose device link details in sysfs")
Cc: stable@vger.kernel.org
Reported-by: Michael Walle <michael@walle.cc>
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20210110175408.1465657-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 20:12:40 +01:00
Oded Gabbay 2dc4a6d791 habanalabs: disable FW events on device removal
When device is removed, we need to make sure the F/W won't send us
any more events because during the remove process we disable the
interrupts.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
2021-01-21 20:30:22 +02:00
Oded Gabbay f8abaf379b habanalabs: fix backward compatibility of idle check
Need to take the lower 32 bits of the driver's 64-bit idle mask and put
it in the legacy 32-bit variable that the userspace reads to know the
idle mask.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
2021-01-21 20:30:22 +02:00
Ofir Bitton 9354f1b421 habanalabs: zero pci counters packet before submit to FW
Driver does not zero some pci counters packets before sending
to FW. This causes an out of sync PI/CI between driver and FW.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
2021-01-21 20:30:22 +02:00
Alexander Shishkin cb5c681ab9 intel_th: pci: Add Alder Lake-P support
This adds support for the Trace Hub in Alder Lake-P.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20210115195917.3184-3-alexander.shishkin@linux.intel.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:54:43 +01:00
Wang Hui 927633a6d2 stm class: Fix module init return on allocation failure
In stm_heartbeat_init(): return value gets reset after the first
iteration by stm_source_register_device(), so allocation failures
after that will, after a clean up, return success. Fix that.

Fixes: 1192918530 ("stm class: Add heartbeat stm source device")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hui <john.wanghui@huawei.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20210115195917.3184-2-alexander.shishkin@linux.intel.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:54:37 +01:00
Rafael J. Wysocki 3d1cf435e2 driver core: Extend device_is_dependent()
If the device passed as the target (second argument) to
device_is_dependent() is not completely registered (that is, it has
been initialized, but not added yet), but the parent pointer of it
is set, it may be missing from the list of the parent's children
and device_for_each_child() called by device_is_dependent() cannot
be relied on to catch that dependency.

For this reason, modify device_is_dependent() to check the ancestors
of the target device by following its parent pointer in addition to
the device_for_each_child() walk.

Fixes: 9ed9895370 ("driver core: Functional dependencies tracking support")
Reported-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/17705994.d592GUb2YH@kreacher
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:46:34 +01:00
Christoph Hellwig f2d6c2708b kernfs: wire up ->splice_read and ->splice_write
Wire up the splice_read and splice_write methods to the default
helpers using ->read_iter and ->write_iter now that those are
implemented for kernfs.  This restores support to use splice and
sendfile on kernfs files.

Fixes: 36e2c7421f ("fs: don't allow splice read/write without explicit ops")
Reported-by: Siddharth Gupta <sidgup@codeaurora.org>
Tested-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210120204631.274206-4-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:30:28 +01:00
Christoph Hellwig cc099e0b39 kernfs: implement ->write_iter
Switch kernfs to implement the write_iter method instead of plain old
write to prepare to supporting splice and sendfile again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210120204631.274206-3-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:30:28 +01:00
Christoph Hellwig 4eaad21a6a kernfs: implement ->read_iter
Switch kernfs to implement the read_iter method instead of plain old
read to prepare to supporting splice and sendfile again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210120204631.274206-2-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-21 18:30:28 +01:00
Ilya Dryomov 9d5ae6f3c5 libceph: fix "Boolean result is used in bitwise operation" warning
This line dates back to 2013, but cppcheck complained because commit
2f713615dd ("libceph: move msgr1 protocol implementation to its own
file") moved it.  Add parenthesis to silence the warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-01-21 16:49:59 +01:00
Aaron Liu 39263a2f88 drm/amdgpu: update mmhub mgcg&ls for mmhub_v2_3
Starting from vangogh, the ATCL2 and DAGB0 registers relative
to mgcg/ls has changed.

For MGCG:
Replace mmMM_ATC_L2_MISC_CG with mmMM_ATC_L2_CGTT_CLK_CTRL.

For MGLS:
Replace mmMM_ATC_L2_MISC_CG with mmMM_ATC_L2_CGTT_CLK_CTRL.
Add DAGB0_(WR/RD)_CGTT_CLK_CTRL registers.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-21 10:46:05 -05:00
Jinzhou Su 8f0d60fe8b drm/amdgpu: modify GCR_GENERAL_CNTL for Vangogh
GCR_GENERAL_CNTL is defined differently in gc_10_1_0_offset.h and
gc_10_3_0_offset.h. Update GCR_GENERAL_CNTL for Vangogh.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-21 10:46:05 -05:00
Prike Liang 51e87da7d4 drm/amdgpu/pm: no need GPU status set since mmnbif_gpu_BIF_DOORBELL_FENCE_CNTL added in FSDL
In the renoir there is no need GpuChangeState message set to exit gfxoff in the s0i3 resume since
mmnbif_gpu_BIF_DOORBELL_FENCE_CNTL has been added in the s0i3 FSDL.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2021-01-21 10:46:05 -05:00
Vladimir Stempen 4b08d8c783 drm/amd/display: Fixed corruptions on HPDRX link loss restore
[why]
Heavy corruption or blank screen reported on wake,
with 6k display connected and FEC enabled

[how]
When Disable/Enable stream for display pipes on HPDRX,
DC should take into account ODM split pipes.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Vladimir Stempen <vladimir.stempen@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Anson Jacob <anson.jacob@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-21 10:46:05 -05:00
Nicholas Kazlauskas c74f865f14 drm/amd/display: Use hardware sequencer functions for PG control
[Why & How]
These can differ per ASIC or not be present. Don't call the dcn20 ones
directly but rather the ones defined by the ASIC init table.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Anson Jacob <anson.jacob@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-21 10:46:05 -05:00
Bing Guo 4716a7c50c drm/amd/display: Change function decide_dp_link_settings to avoid infinite looping
Why:
Function decide_dp_link_settings() loops infinitely when required bandwidth
can't be supported.

How:
Check the required bandwidth against verified_link_cap before trying to
find a link setting for it.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Bing Guo <bing.guo@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Anson Jacob <anson.jacob@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-21 10:46:05 -05:00