]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
22 months agoUBUNTU: Ubuntu-5.15.0-36.37 Ubuntu-5.15.0-36.37
Kleber Sacilotto de Souza [Tue, 31 May 2022 16:39:02 +0000 (18:39 +0200)]
UBUNTU: Ubuntu-5.15.0-36.37

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: debian/dkms-versions -- update from kernel-versions (main/2022.05.30)
Kleber Sacilotto de Souza [Tue, 31 May 2022 16:38:01 +0000 (18:38 +0200)]
UBUNTU: debian/dkms-versions -- update from kernel-versions (main/2022.05.30)

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: link-to-tracker: update tracking bug
Kleber Sacilotto de Souza [Tue, 31 May 2022 16:37:27 +0000 (18:37 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1975998
Properties: no-test-build
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agodrm/amd: Don't reset dGPUs if the system is going to s2idle
Mario Limonciello [Thu, 26 May 2022 08:34:00 +0000 (10:34 +0200)]
drm/amd: Don't reset dGPUs if the system is going to s2idle

BugLink: https://bugs.launchpad.net/bugs/1975804
An A+A configuration on ASUS ROG Strix G513QY proves that the ASIC
reset for handling aborted suspend can't work with s2idle.

This functionality was introduced in commit daf8de0874ab5b ("drm/amdgpu:
always reset the asic in suspend (v2)").  A few other commits have
gone on top of the ASIC reset, but this still doesn't work on the A+A
configuration in s2idle.

Avoid doing the reset on dGPUs specifically when using s2idle.

Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2008
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit 7123d39dc24dcd21ff23d75f46f926b15269b9da)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoRevert "drm/amd/pm: keep the BACO feature enabled for suspend"
Alex Deucher [Thu, 26 May 2022 08:34:00 +0000 (10:34 +0200)]
Revert "drm/amd/pm: keep the BACO feature enabled for suspend"

BugLink: https://bugs.launchpad.net/bugs/1975804
This reverts commit eaa090538e8d21801c6d5f94590c3799e6a528b5.

Commit ebc002e3ee78 ("drm/amdgpu: don't use BACO for reset in S3")
stops using BACO for reset during suspend, so it's no longer
necessary to leave BACO enabled during suspend.  This fixes
resume from suspend on the navy flounder dGPU in the ASUS ROG
Strix G513QY.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2008
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1982
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit a56f445f807b0276fc0660c330bf93a9ea78e8ea)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoHID: amd_sfh: Add support for sensor discovery
Basavaraj Natikar [Thu, 26 May 2022 07:57:00 +0000 (09:57 +0200)]
HID: amd_sfh: Add support for sensor discovery

BugLink: https://bugs.launchpad.net/bugs/1975798
Sensor discovery status fails in case of broken sensors or
platform not supported. Hence disable driver on failure
of sensor discovery.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit b5d7f43e97dabfa04a4be5ff027ce7da119332be)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agos390/cpumf: add new extended counter set for IBM z16
Thomas Richter [Fri, 20 May 2022 19:16:00 +0000 (21:16 +0200)]
s390/cpumf: add new extended counter set for IBM z16

BugLink: https://bugs.launchpad.net/bugs/1974433
Export the extended counter set counters of the IBM z16 via sysfs.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit c9311de71635d3eaa158df8516b9b99a92d60a0c linux-next)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoKVM: s390: vsie/gmap: reduce gmap_rmap overhead
Christian Borntraeger [Thu, 19 May 2022 06:39:00 +0000 (08:39 +0200)]
KVM: s390: vsie/gmap: reduce gmap_rmap overhead

BugLink: https://bugs.launchpad.net/bugs/1974017
there are cases that trigger a 2nd shadow event for the same
vmaddr/raddr combination. (prefix changes, reboots, some known races)
This will increase memory usages and it will result in long latencies
when cleaning up, e.g. on shutdown. To avoid cases with a list that has
hundreds of identical raddrs we check existing entries at insert time.
As this measurably reduces the list length this will be faster than
traversing the list at shutdown time.

In the long run several places will be optimized to create less entries
and a shrinker might be necessary.

Fixes: 4be130a08420 ("s390/mm: add shadow gmap support")
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20220429151526.1560-1-borntraeger@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
(cherry picked from commit a06afe8383080c630a7a528b8382fc6bb4925b61)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoNFS: Fix up nfs_ctx_key_to_expire()
Trond Myklebust [Tue, 17 May 2022 05:46:00 +0000 (07:46 +0200)]
NFS: Fix up nfs_ctx_key_to_expire()

BugLink: https://bugs.launchpad.net/bugs/1968096
If the cached credential exists but doesn't have any expiration callback
then exit early.
Fix up atomicity issues when replacing the credential with a new one
since the existing code could lead to refcount leaks.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
(cherry picked from commit ca05cbae2a0468e5d78e9b4605936a8bf5da328b)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agodrm/amd/display: Initialise encoder assignment when initialising dc_state
Jimmy Kizito [Tue, 17 May 2022 08:28:00 +0000 (10:28 +0200)]
drm/amd/display: Initialise encoder assignment when initialising dc_state

BugLink: https://bugs.launchpad.net/bugs/1971417
[Why]
Link encoder assignment tracking variables need to be (re)initialised
whenever dc_state is (re)initialised. Otherwise variables used for
dynamic encoder assignment (especially the link encoder availability
pool) are out of sync with dc_state and future encoder assignments are
invalid.

[How]
Initialise encoder assignment variables when creating new dc_state
resource.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7a47c8820a1d97e6cb5bcef6b65529f1389b0e13)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agodrm/amd/display: Query all entries in assignment table during updates.
Jimmy Kizito [Tue, 17 May 2022 08:28:00 +0000 (10:28 +0200)]
drm/amd/display: Query all entries in assignment table during updates.

BugLink: https://bugs.launchpad.net/bugs/1971417
[Why]
Stream ordering and count can vary from one state to the next. Only
checking a subset of entries in the encoder assignment table can lead to
invalid encoder assignments.

[How]
Check all entries in encoder assignment table when querying it.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit aadb06f9c9729ee3af1543f54da966644ebc5be7)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agodrm/amd/display: fix stale info in link encoder assignment
Roy Chan [Tue, 17 May 2022 08:28:00 +0000 (10:28 +0200)]
drm/amd/display: fix stale info in link encoder assignment

BugLink: https://bugs.launchpad.net/bugs/1971417
[Why]
The link encoder assignment leaves the old stream data when it was
unassigned. When the clear encoder assignment is called, it based on the
old stale data to access the de-allocated stream.

[How]
There should be no need to explicitly clean up the link encoder
assignment if the unassign loop does the work properly, the loop should
base on the current state to clean up the assignment.

Also, the unassignment should better clean up the values in the
assignement slots as well.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Roy Chan <roy.chan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e43098f6abb033142810e695c1b3d9cf61e19849)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agodrm/amd/display: Clear encoder assignments when state cleared.
Jimmy Kizito [Tue, 17 May 2022 08:28:00 +0000 (10:28 +0200)]
drm/amd/display: Clear encoder assignments when state cleared.

BugLink: https://bugs.launchpad.net/bugs/1971417
[Why]
State can be cleared without removing individual streams (by
calling dc_remove_stream_from_ctx()). This can leave the
encoder assignment module in an incoherent state and cause
future assignments to be incorrect.

[How]
Clear encoder assignments when committing 0 streams or
re-initializing hardware.

Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 589bd2f03f87563d6dc4f480d47e5aabc09e4784)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agortw88: add ieee80211:sta_rc_update ops
Po-Hao Huang [Thu, 19 May 2022 08:16:00 +0000 (10:16 +0200)]
rtw88: add ieee80211:sta_rc_update ops

BugLink: https://bugs.launchpad.net/bugs/1969326
Adding this allows us to get notification when bitrate configuration
of the station changes. Update according parameters to firmware so
the rate control algorithm can work properly.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220407095858.46807-2-pkshih@realtek.com
(backported from commit c1edc86472fc3a5aa3b5c5c53c4e20f6a24992a6 linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agortw88: 8821c: fix debugfs rssi value
Po-Hao Huang [Thu, 19 May 2022 08:16:00 +0000 (10:16 +0200)]
rtw88: 8821c: fix debugfs rssi value

BugLink: https://bugs.launchpad.net/bugs/1969326
RSSI value per frame is reported to mac80211 but not maintained in
our own statistics, add it back to help us debug.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220407095858.46807-7-pkshih@realtek.com
(cherry picked from commit ece31c93d4d68f7eb8eea4431b052aacdb678de2 linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agortw88: do PHY calibration while starting AP
Ping-Ke Shih [Thu, 19 May 2022 08:16:00 +0000 (10:16 +0200)]
rtw88: do PHY calibration while starting AP

BugLink: https://bugs.launchpad.net/bugs/1969326
Calling calibration to yield expected PHY performance. We do this in STA
mode, so do this in AP mode as well.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220407095858.46807-6-pkshih@realtek.com
(cherry picked from commit f5207c122102cac22c78f438610d937a924aee3a linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agortw88: 8821c: Enable TX report for management frames
Po-Hao Huang [Thu, 19 May 2022 08:16:00 +0000 (10:16 +0200)]
rtw88: 8821c: Enable TX report for management frames

BugLink: https://bugs.launchpad.net/bugs/1969326
Without this setting, hardware would not report to driver even if
management frames are transmitted successfully. So we fix it.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220407095858.46807-5-pkshih@realtek.com
(cherry picked from commit f1c4dabfe68df7321cba0a07a30b2776a303abb2 linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agortw88: Add update beacon flow for AP mode
Po-Hao Huang [Thu, 19 May 2022 08:16:00 +0000 (10:16 +0200)]
rtw88: Add update beacon flow for AP mode

BugLink: https://bugs.launchpad.net/bugs/1969326
To support stations in power saving mode, AP should notify stations
that there are frames buffered at the AP via TIM during beacons.
Driver used to transmit identical beacons that were downloaded to
hardware during the initiation phase. This beacon will become
obsolete over time.

If the beacon does not contain sufficient information, station would
not be able to percept that there is data to receive. Hence it won't
wake up and start the PS-poll procedure, this could lead to timeout
and/or lost data segments. In order to resolve this issue, driver will
now download beacon to hardware whenever the content is updated.

Enable hardware to update dtim_count for more efficiency, this reduces
the overhead of downloading beacon at every beacon interval since most
of the time only the dtim_count needs to be updated.

Change queue mapping for broadcast/multicast frames to high queue, so
these frames can be prioritized and sent when dtim_count is zero.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220407095858.46807-4-pkshih@realtek.com
(backported from commit f2217968ffdae702c21cc00fa804fbbd9ee6bb4b linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: overlayfs: prevent dereferencing struct file in ovl_vm_prfile_set()
Andrea Righi [Mon, 16 May 2022 15:36:00 +0000 (17:36 +0200)]
UBUNTU: SAUCE: overlayfs: prevent dereferencing struct file in ovl_vm_prfile_set()

BugLink: https://bugs.launchpad.net/bugs/1973620
With the following commit we re-introduced a SAUCE patch that has been
dropped starting with 5.13:

 37e9bac9203b ("UBUNTU: SAUCE: overlayfs: fix incorrect mnt_id of files opened from map_files")

However the forward-ported patch introduced a potential NULL pointer
dereference bug:

BUG: kernel NULL pointer dereference, address: 0000000000000008
[  447.039738] #PF: supervisor read access in kernel mode
[  447.040369] #PF: error_code(0x0000) - not-present page
[  447.041002] PGD 0 P4D 0
[  447.041325] Oops: 0000 [#1] SMP NOPTI
[  447.041798] CPU: 0 PID: 73766 Comm: sudo Not tainted 5.15.0-28-generic #29~20.04.1-Ubuntu
[  447.042800] Hardware name: OpenStack Foundation OpenStack Nova, BIOS Ubuntu-1.8.2-1ubuntu1+esm1 04/01/2014
[  447.043979] RIP: 0010:aa_file_perm+0x3a/0x470
[  447.044565] Code: 54 53 48 83 ec 68 48 89 7d 80 89 4d 8c 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 48 63 05 01 0a 19 01 48 03 82 c0 00 00 00 <4c> 8b 68 08 f6 46 40 02 0f 85 d0 00 00 00 41 f6 45 40 02 0f 85 c5
[  447.046837] RSP: 0018:ffffaefe80a4bca8 EFLAGS: 00010246
[  447.047481] RAX: 0000000000000000 RBX: ffff96e4038abd01 RCX: 0000000000000004
[  447.048351] RDX: ffff96e4038abd00 RSI: ffff96e401215eb8 RDI: ffffffff9c22a2ac
[  447.049241] RBP: ffffaefe80a4bd38 R08: 0000000000000000 R09: 0000000000000000
[  447.050121] R10: 0000000000000000 R11: 0000000000000000 R12: ffff96e401215eb8
[  447.051040] R13: ffff96e4038abd00 R14: ffffffff9c22a2ac R15: 0000000000000004
[  447.051942] FS:  00007eff3c0f8c80(0000) GS:ffff96e45e400000(0000) knlGS:0000000000000000
[  447.052981] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  447.053696] CR2: 0000000000000008 CR3: 0000000002be2000 CR4: 00000000003506f0
[  447.054571] Call Trace:
[  447.054883]  <TASK>
[  447.055154]  ? unlock_page_memcg+0x2f/0x40
[  447.055668]  ? page_remove_rmap+0x4b/0x320
[  447.056180]  common_file_perm+0x72/0x170
[  447.056669]  apparmor_file_permission+0x1c/0x20
[  447.057237]  security_file_permission+0x30/0x1a0
[  447.057898]  rw_verify_area+0x35/0x60
[  447.058392]  vfs_read+0x6d/0x1a0
[  447.058842]  ksys_read+0xb1/0xe0
[  447.059276]  __x64_sys_read+0x1a/0x20
[  447.059732]  do_syscall_64+0x5c/0xc0
[  447.060183]  ? __set_current_blocked+0x3b/0x60
[  447.060738]  ? exit_to_user_mode_prepare+0x3d/0x1c0
[  447.061434]  ? syscall_exit_to_user_mode+0x27/0x50
[  447.062099]  ? do_syscall_64+0x69/0xc0
[  447.062603]  ? irqentry_exit_to_user_mode+0x9/0x20
[  447.063210]  ? irqentry_exit+0x19/0x30
[  447.063678]  ? exc_page_fault+0x89/0x160
[  447.064165]  ? asm_exc_page_fault+0x8/0x30
[  447.064675]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[  447.065298] RIP: 0033:0x7eff3c2cb002

This panic happens only when AUFS is enabled (that is required to
"activates" this feature).

This bug happens because we don't need to decrement anymore the refcount
for the previous vm_file value in ovl_vm_prfile_set(). So make sure to
drop the offending fput() to prevent the kernel panic above.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoRevert "UBUNTU: [Config] enable Intel DMA remapping options by default"
Andrea Righi [Thu, 5 May 2022 12:34:00 +0000 (14:34 +0200)]
Revert "UBUNTU: [Config] enable Intel DMA remapping options by default"

BugLink: https://bugs.launchpad.net/bugs/1971699
It seems that enabling IOMMU can cause some weird gfx problems, see for
example:

 https://bugs.launchpad.net/bugs/1971146
 https://bugs.launchpad.net/bugs/1965882

Even if upstream decided to enable these options by default, it is
probably safer for now to keep IOMMU disabled, to prevent potential
issues like those mentioned above.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Zachary Tahenakos <zachary.tahenakos@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machine
Andy Chi [Thu, 19 May 2022 06:26:00 +0000 (08:26 +0200)]
ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machine

BugLink: https://bugs.launchpad.net/bugs/1974111
The HP EliteBook 630 is using ALC236 codec which used 0x02 to control mute LED
and 0x01 to control micmute LED. Therefore, add a quirk to make it works.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220513121648.28584-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 024a7ad9eb4df626ca8c77fef4f67fd0ebd559d2 linux-next)
Signed-off-by: Andy Chi <andy.chi@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agox86/mm: Include spinlock_t definition in pgtable.
Sebastian Andrzej Siewior [Wed, 11 May 2022 15:54:00 +0000 (17:54 +0200)]
x86/mm: Include spinlock_t definition in pgtable.

BugLink: https://bugs.launchpad.net/bugs/1972899
This header file provides forward declartion for pgd_lock but does not
include the header defining its type. This works since the definition of
spinlock_t is usually included somehow via printk.

By trying to avoid recursive includes on PREEMPT_RT I avoided the loop
in printk and as a consequnce kernel/intel.c failed to compile due to
missing type definition.

Include the needed definition for spinlock_t.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/20211102165224.wpz4zyhsvwccx5p3@linutronix.de
(cherry picked from commit 35fa745286ac44ee26ed100c2bd2553368ad193b)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Philip Cox <philip.cox@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Packaging] drop do_<mod> arch specific configs
You-Sheng Yang (vicamo) [Wed, 25 May 2022 11:23:00 +0000 (13:23 +0200)]
UBUNTU: [Packaging] drop do_<mod> arch specific configs

BugLink: https://bugs.launchpad.net/bugs/1969434
They should been assigned automatically based on the latest
dkms-versions.

Also disable building any dkms for mainline builds.

Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Packaging] support standalone dkms module builds
You-Sheng Yang (vicamo) [Wed, 25 May 2022 11:23:00 +0000 (13:23 +0200)]
UBUNTU: [Packaging] support standalone dkms module builds

BugLink: https://bugs.launchpad.net/bugs/1969434
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] drop intel_ulpss in favor of by LJCA
You-Sheng Yang (vicamo) [Tue, 17 May 2022 10:55:50 +0000 (18:55 +0800)]
UBUNTU: [Config] drop intel_ulpss in favor of by LJCA

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: intel_ulpss: Replaced by LJCA and remove
Hao Yao [Sat, 2 Apr 2022 01:57:52 +0000 (09:57 +0800)]
UBUNTU: SAUCE: intel_ulpss: Replaced by LJCA and remove

BugLink: https://bugs.launchpad.net/bugs/1964983
Check https://github.com/intel/ivsc-driver

Signed-off-by: Hao Yao <hao.yao@intel.com>
(backported from commit c3da4198f8fa357e916cc11ee155b8a38685a270 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: mei: cleanup header file including
Wentong Wu [Wed, 4 May 2022 01:23:19 +0000 (09:23 +0800)]
UBUNTU: SAUCE: mei: cleanup header file including

BugLink: https://bugs.launchpad.net/bugs/1964983
cleanup header file including

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit be08c991057aa5f9c33eef7d7067cd1f50eb1ada github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: assume stub enum failed as a warning
Ye Xiang [Wed, 23 Feb 2022 08:58:53 +0000 (16:58 +0800)]
UBUNTU: SAUCE: ljca: assume stub enum failed as a warning

BugLink: https://bugs.launchpad.net/bugs/1964983
Because some old version FW does not support USB2SPI function,
this patch assumes stub enum failed as a warning, so that this
driver can be compatible with old version FW. This patch
reduces the stub enum timeout, so it blocks os start less
time when USB2SPI does not being supported. And this patch
also optimize error handling path when probing failed.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 4c5b2a125b75b8dde47e0cd4ec2bbcdc32cd0a2e github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: fix a typo issue
Ye Xiang [Mon, 21 Feb 2022 08:14:38 +0000 (16:14 +0800)]
UBUNTU: SAUCE: ljca: fix a typo issue

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 121fc191164e950ebc1f0ff50dbe6756dcb29d74 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: i2c-ljca: fix a null pointer access issue on tgl
Ye Xiang [Sat, 19 Feb 2022 16:46:32 +0000 (00:46 +0800)]
UBUNTU: SAUCE: i2c-ljca: fix a null pointer access issue on tgl

BugLink: https://bugs.launchpad.net/bugs/1964983
When there is no UID method in DSDT for LJCA I2C device, uid1 will
be NULL. So we precheck uid1 before using it.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit e8064f0f127bc1a6b4ccae3146d00a7beff435c3 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: fix race condition issue in runtime PM
Ye Xiang [Thu, 10 Feb 2022 04:06:40 +0000 (12:06 +0800)]
UBUNTU: SAUCE: ljca: fix race condition issue in runtime PM

BugLink: https://bugs.launchpad.net/bugs/1964983
A parent device may begin to write, when device is in autosuspend
path. That will make them waiting for each other done.
And the active_transfers may be unbalenced. This patch fixes the
issues.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit efcac8e33ae68cf4e8b148f2042e4d2ef616c863 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SACUE: ljca: disable parallelly stub write
Ye Xiang [Wed, 26 Jan 2022 14:19:52 +0000 (22:19 +0800)]
UBUNTU: SACUE: ljca: disable parallelly stub write

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit c26e0aa4ae4561240eef95cb3eebb33d5c0e0909 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: spi: ljca: return when a sub-transaction first failed
Ye Xiang [Wed, 26 Jan 2022 07:16:34 +0000 (15:16 +0800)]
UBUNTU: SAUCE: spi: ljca: return when a sub-transaction first failed

BugLink: https://bugs.launchpad.net/bugs/1964983
Stop transfer remained data if a sub-transaction transfer failed.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 63f89c365a318e00ed27ddd86772ca6b0a296b81 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: media: pci: intel: Avoid UBSAN warnings of index bound and shift
Hao Yao [Wed, 30 Mar 2022 12:44:40 +0000 (20:44 +0800)]
UBUNTU: SAUCE: media: pci: intel: Avoid UBSAN warnings of index bound and shift

BugLink: https://bugs.launchpad.net/bugs/1958006
UBSAN is default enabled on 5.15 kernel on Ubuntu. The code to
allocate resources in IPU can cause some array-index-out-of-bounds
and shift-out-of-bounds warnings, so it needs to be fixed.

Signed-off-by: Hao Yao <hao.yao@intel.com>
(cherry picked from commit 8dcb7d8df28fd311a72f3d996b02231e38aac8a7 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU6: 2022-04-01 Andrews MLK PV release
Hao Yao [Fri, 1 Apr 2022 03:28:01 +0000 (11:28 +0800)]
UBUNTU: SAUCE: IPU6: 2022-04-01 Andrews MLK PV release

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: Hao Yao <hao.yao@intel.com>
(backported from commit 8d3d4b24973354d7a522debe1b18f21f825092dc github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] IPU6: enable OV02C10 sensor
You-Sheng Yang [Wed, 30 Mar 2022 15:15:49 +0000 (23:15 +0800)]
UBUNTU: [Config] IPU6: enable OV02C10 sensor

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU6: 2022-03-11 alpha release for Andrews MLK
Hao Yao [Wed, 30 Mar 2022 15:15:48 +0000 (23:15 +0800)]
UBUNTU: SAUCE: IPU6: 2022-03-11 alpha release for Andrews MLK

BugLink: https://bugs.launchpad.net/bugs/1964983
Signed-off-by: Hao Yao <hao.yao@intel.com>
(cherry picked from commit 778819bef3d8ac8d6b24342372e006b7b43e381e github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU6: drop unnecessary cflags manipulation
You-Sheng Yang [Thu, 7 Apr 2022 03:33:27 +0000 (11:33 +0800)]
UBUNTU: SAUCE: IPU6: drop unnecessary cflags manipulation

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] make Intel IPU6 modules amd64 only
You-Sheng Yang [Fri, 11 Mar 2022 14:46:42 +0000 (22:46 +0800)]
UBUNTU: [Config] make Intel IPU6 modules amd64 only

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: disable autosuspend by default
Ye Xiang [Wed, 1 Dec 2021 02:14:37 +0000 (10:14 +0800)]
UBUNTU: SAUCE: ljca: disable autosuspend by default

BugLink: https://bugs.launchpad.net/bugs/1955383
Because it will cost more than 100ms in PM before calling LJCA
resume when enabling autosuspend, which will make first LJCA transfer
after resume use more than 100ms, we disable autosuspend temporarily.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 3cc092e1e2ccee536c5da23a105431bfdd8952d6 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: i2c-ljca: fix a potential issue
Ye Xiang [Wed, 1 Dec 2021 05:56:13 +0000 (13:56 +0800)]
UBUNTU: SAUCE: i2c-ljca: fix a potential issue

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit cf218331b4a149865621b7b1f4435a59bb4d07c1 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: mei_vsc: distinguish platform with different camera sensor
Ye Xiang [Thu, 11 Nov 2021 13:25:55 +0000 (21:25 +0800)]
UBUNTU: SAUCE: mei_vsc: distinguish platform with different camera sensor

BugLink: https://bugs.launchpad.net/bugs/1955383
Distinguish platform with different camera sensor by
camera model name from acpi. Then we could download
different FW to VSC according to the camera model.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 85cac41780cd4a1f5d84bd7e64aa9b1036cf877e github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ivsc: add delay for acquire camera to wait firmware ready
Wentong Wu [Wed, 10 Nov 2021 10:02:25 +0000 (18:02 +0800)]
UBUNTU: SAUCE: ivsc: add delay for acquire camera to wait firmware ready

BugLink: https://bugs.launchpad.net/bugs/1955383
Add delay for acquire camera to wait firmware ready.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit bf1e109299244c0070d0a8a98476c99132e73488 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: add multi ACPI HID support
Ye Xiang [Thu, 11 Nov 2021 16:41:22 +0000 (00:41 +0800)]
UBUNTU: SAUCE: ljca: add multi ACPI HID support

BugLink: https://bugs.launchpad.net/bugs/1955383
Precheck GPIO/I2C/SPI ACPI Device HID before
enumeration.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 11f55ee365786229f6a77885a817ead89e5e5a56 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: mei_vsc: add ACPI HID for ADL
Ye Xiang [Thu, 11 Nov 2021 16:14:54 +0000 (00:14 +0800)]
UBUNTU: SAUCE: mei_vsc: add ACPI HID for ADL

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit c8e2655d0d5e04ae00037a0a37b6c84781d9ec10 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: mei-vsc: switch wait event to uninterruptible
Ye Xiang [Wed, 10 Nov 2021 02:23:17 +0000 (10:23 +0800)]
UBUNTU: SAUCE: mei-vsc: switch wait event to uninterruptible

BugLink: https://bugs.launchpad.net/bugs/1955383
Change wakeup ack wait queue to uninterruptible to avoid
unexpected signal interrupt normal hardware transaction.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit c130eb32d87f76974dd2a47d320a6e7ee26cc880 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ljca: switch wait event to uninterruptible
Ye Xiang [Wed, 10 Nov 2021 02:21:41 +0000 (10:21 +0800)]
UBUNTU: SAUCE: ljca: switch wait event to uninterruptible

BugLink: https://bugs.launchpad.net/bugs/1955383
Change ack wait queue to uninterruptible to avoid
unexpected signal interrupt normal hardware transaction.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 1ec53c517383e7537e66e80049788578c2c1ccba github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ivsc: add soft dependencies for intel_vsc module
Wentong Wu [Tue, 19 Oct 2021 15:50:15 +0000 (23:50 +0800)]
UBUNTU: SAUCE: ivsc: add soft dependencies for intel_vsc module

BugLink: https://bugs.launchpad.net/bugs/1955383
Add soft dependencies, mei_csi and mei_ace, for intel_vsc module.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit 539c6057e0af4d0ab3f5721863ad5da99bfc0205 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: ivsc: return error when device not ready
Wentong Wu [Tue, 19 Oct 2021 15:09:49 +0000 (23:09 +0800)]
UBUNTU: SAUCE: ivsc: return error when device not ready

BugLink: https://bugs.launchpad.net/bugs/1955383
Return error when device not ready instead of blocking
the calling thread.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit 06dec7c7fe2becaeaaab68e9bc386bf93fe80fa9 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] ivsc: enable Intel VSC drivers
You-Sheng Yang [Tue, 2 Nov 2021 10:13:40 +0000 (18:13 +0800)]
UBUNTU: [Config] ivsc: enable Intel VSC drivers

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: intel visual sensing controller(VSC) driver first release
Wentong Wu [Fri, 17 Sep 2021 14:40:48 +0000 (22:40 +0800)]
UBUNTU: SAUCE: intel visual sensing controller(VSC) driver first release

BugLink: https://bugs.launchpad.net/bugs/1955383
(backported from commit badabfda2bcd7fa7e06178c880c7ad16f02414f2 github.com/intel/ivsc-driver)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: Fix build error for kernel 5.15
Ignacio Hernandez [Thu, 2 Dec 2021 05:47:59 +0000 (21:47 -0800)]
UBUNTU: SAUCE: Fix build error for kernel 5.15

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Ignacio Hernandez <ignacio.hernandez@gmail.com>
(cherry picked from commit 8659a022b39a23409c18341c3877689c0ce2ecb3 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] IPU6: enable OV01A10 sensor
You-Sheng Yang [Tue, 2 Nov 2021 09:27:20 +0000 (17:27 +0800)]
UBUNTU: [Config] IPU6: enable OV01A10 sensor

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU6 driver release for kernel 5.14 on 2021-11-01
Hao Yao [Mon, 1 Nov 2021 02:04:55 +0000 (10:04 +0800)]
UBUNTU: SAUCE: IPU6 driver release for kernel 5.14 on 2021-11-01

BugLink: https://bugs.launchpad.net/bugs/1955383
Add support for both Tiger Lake and Alder Lake platforms.
Add support for OV01A10 sensor.

Signed-off-by: Hao Yao <hao.yao@intel.com>
(backported from commit 1f26f0c8cb13d14c22d9f7010b1b4774b89136a9 github.com/intel/ipu6-drivers
added CONFIG_VIDEO_OV01A10 to drivers/media/i2c/Kconfig)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: Fix build error on Kernel 5.13
Wang Yating [Thu, 19 Aug 2021 15:37:18 +0000 (23:37 +0800)]
UBUNTU: SAUCE: Fix build error on Kernel 5.13

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 65dae1929b4e63fb9e52b7dc79dabb78af21f289 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: sensor HM11b1 brightness bugfix
Wang Yating [Thu, 19 Aug 2021 15:37:17 +0000 (23:37 +0800)]
UBUNTU: SAUCE: sensor HM11b1 brightness bugfix

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit eca28d1aa048216dc034b134e65e1b47602ee4a6 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU6 driver release for kernel 5.13
Wang Yating [Thu, 29 Jul 2021 06:48:32 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU6 driver release for kernel 5.13

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit d6b6959e1ba207eb1ae16ad296818ceae12879c4 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: change power control driver to acpi driver
Wang Yating [Thu, 29 Jul 2021 06:48:31 +0000 (14:48 +0800)]
UBUNTU: SAUCE: change power control driver to acpi driver

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 7d9bc3bff21401cf08a99eb37eaead0e86464c8a github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: intel/ipu6: Remove unnecessary video devices
Wang Yating [Thu, 29 Jul 2021 06:48:30 +0000 (14:48 +0800)]
UBUNTU: SAUCE: intel/ipu6: Remove unnecessary video devices

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 362375c928d184fb0b4187df7da1ffd506bbd07f github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: Fix ov01a1s IQ issues
Wang Yating [Thu, 29 Jul 2021 06:48:29 +0000 (14:48 +0800)]
UBUNTU: SAUCE: Fix ov01a1s IQ issues

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit f06a7aba2573b9ff53e7b186325c4e890066ee5d github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: [Config] updateconfigs for IPU6 driver
You-Sheng Yang [Thu, 29 Jul 2021 06:48:28 +0000 (14:48 +0800)]
UBUNTU: [Config] updateconfigs for IPU6 driver

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: integrate IPU6 builds
Wang Yating [Thu, 29 Jul 2021 06:48:27 +0000 (14:48 +0800)]
UBUNTU: SAUCE: integrate IPU6 builds

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: Fix ov01a1s output mirror issue
Wang Yating [Thu, 29 Jul 2021 06:48:26 +0000 (14:48 +0800)]
UBUNTU: SAUCE: Fix ov01a1s output mirror issue

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 3fd5c5eed1088e127e21f4391f34ce839048cc17 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU driver release WW14
Wang Yating [Thu, 29 Jul 2021 06:48:25 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW14

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 59cd6e387868e95822a438b7c35cc9eb963f0a9a github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU driver release WW04
Wang Yating [Thu, 29 Jul 2021 06:48:24 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW04

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 626e9311e21f3f36f41f756f22f43d589d9de781 github.com/intel/ipu6-drivers
still build ipu3)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU driver release WW52
Wang Yating [Thu, 29 Jul 2021 06:48:23 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW52

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 71392b666a028c77126a9098fedb1fb30fc30568 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU driver release WW48 with MCU
Wang Yating [Thu, 29 Jul 2021 06:48:22 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW48 with MCU

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit d127576fe1f1ea9a138618d88ce694b7ddb650f8 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: IPU driver release WW48
Wang Yating [Thu, 29 Jul 2021 06:48:21 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW48

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 5e7f876527d932189e6e7d30f0dba5651068f0df github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: SAUCE: intel ipu drivers first release
Wang Yating [Thu, 29 Jul 2021 06:48:20 +0000 (14:48 +0800)]
UBUNTU: SAUCE: intel ipu drivers first release

BugLink: https://bugs.launchpad.net/bugs/1955383
Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit ade34d8d514046f0d24879c95bfb5aa622b16073 github.com/intel/ipu6-drivers)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 months agoUBUNTU: Start new release
Kleber Sacilotto de Souza [Tue, 31 May 2022 16:25:08 +0000 (18:25 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
23 months agoUBUNTU: Ubuntu-5.15.0-35.36
Thadeu Lima de Souza Cascardo [Sat, 21 May 2022 00:43:49 +0000 (21:43 -0300)]
UBUNTU: Ubuntu-5.15.0-35.36

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
23 months agoUBUNTU: Start new release
Thadeu Lima de Souza Cascardo [Sat, 21 May 2022 00:43:16 +0000 (21:43 -0300)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
23 months agoUBUNTU: SAUCE: debug: Lock down kgdb
Stephen Brennan [Thu, 14 Apr 2022 20:27:45 +0000 (13:27 -0700)]
UBUNTU: SAUCE: debug: Lock down kgdb

KGDB and KDB allow read and write access to kernel memory, and thus
should not be allowed during lockdown. An attacker with access to a
serial port (for example, via a hypervisor console, which some cloud
vendors provide over the network) could trigger the debugger and use it
to bypass lockdown. Ensure KDB and KGDB cannot be used during lockdown.

This fixes CVE-2022-21499.

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
CVE-2022-21499
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
23 months agoUBUNTU: Ubuntu-5.15.0-34.35
Stefan Bader [Fri, 20 May 2022 12:58:09 +0000 (14:58 +0200)]
UBUNTU: Ubuntu-5.15.0-34.35

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoUBUNTU: link-to-tracker: update tracking bug
Stefan Bader [Fri, 20 May 2022 12:52:59 +0000 (14:52 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1974322
Properties: no-test-build
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/amdgpu: explicitly check for s0ix when evicting resources
Mario Limonciello [Mon, 9 May 2022 05:12:20 +0000 (13:12 +0800)]
drm/amdgpu: explicitly check for s0ix when evicting resources

BugLink: https://bugs.launchpad.net/bugs/1972134
This codepath should be running in both s0ix and s3, but only does
currently because s3 and s0ix are both set in the s0ix case.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e53d9665ab003df0ece8f869fcd3c2bbbecf7190)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/amdgpu: unify BO evicting method in amdgpu_ttm
Nirmoy Das [Mon, 9 May 2022 05:12:19 +0000 (13:12 +0800)]
drm/amdgpu: unify BO evicting method in amdgpu_ttm

BugLink: https://bugs.launchpad.net/bugs/1972134
Unify BO evicting functionality for possible memory
types in amdgpu_ttm.c.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 58144d283712c9e80e528e001af6ac5aeee71af2)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agogpio: Request interrupts after IRQ is initialized
Mario Limonciello [Wed, 4 May 2022 17:18:29 +0000 (01:18 +0800)]
gpio: Request interrupts after IRQ is initialized

BugLink: https://bugs.launchpad.net/bugs/1971597
Commit 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members
before initialization") attempted to fix a race condition that lead to a
NULL pointer, but in the process caused a regression for _AEI/_EVT
declared GPIOs.

This manifests in messages showing deferred probing while trying to
allocate IRQs like so:

  amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517
  amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x002C to IRQ, err -517
  amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517
  [ .. more of the same .. ]

The code for walking _AEI doesn't handle deferred probing and so this
leads to non-functional GPIO interrupts.

Fix this issue by moving the call to `acpi_gpiochip_request_interrupts`
to occur after gc->irc.initialized is set.

Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization")
Link: https://lore.kernel.org/linux-gpio/BL1PR12MB51577A77F000A008AA694675E2EF9@BL1PR12MB5157.namprd12.prod.outlook.com/
Link: https://bugzilla.suse.com/show_bug.cgi?id=1198697
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215850
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1979
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1976
Reported-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Shreeya Patel <shreeya.patel@collabora.com>
Tested-By: Samuel Čavoj <samuel@cavoj.net>
Tested-By: lukeluk498@gmail.com Link:
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-and-tested-by: Takashi Iwai <tiwai@suse.de>
Cc: Shreeya Patel <shreeya.patel@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 06fb4ecfeac7e00d6704fa5ed19299f2fefb3cc9)
Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
Acked-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoUBUNTU: [Config] CONFIG_HISI_PMU=m
Ike Panhc [Fri, 29 Apr 2022 06:45:58 +0000 (14:45 +0800)]
UBUNTU: [Config] CONFIG_HISI_PMU=m

BugLink: https://launchpad.net/bugs/1956086
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops
Andy Chi [Wed, 27 Apr 2022 07:56:16 +0000 (15:56 +0800)]
ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops

BugLink: https://bugs.launchpad.net/bugs/1970552
On HP Laptops, requires the same ALC285_FIXUP_HP_GPIO_LED quirk to
make its audio LEDs work.

So apply the quirk, and make it the last one since it's an LED quirk.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops")
Link: https://lore.kernel.org/r/20220422090845.230071-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5f5d8890789c90470d9571a283f0b789acd594af linux-next)
Signed-off-by: Andy Chi <andy.chi@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoRevert "rfkill: make new event layout opt-in"
Stefan Bader [Mon, 2 May 2022 12:30:03 +0000 (14:30 +0200)]
Revert "rfkill: make new event layout opt-in"

BugLink: https://bugs.launchpad.net/bugs/1971418
This reverts commit ac64634a166a658b21428d1d0be0b454b6b0a0c1 since it
could cause problems with network-manager. It would require adaption
so it requests the larger message sizes.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoUBUNTU: SAUCE: vmd: fixup bridge ASPM by driver name instead
You-Sheng Yang [Mon, 11 Apr 2022 09:24:08 +0000 (17:24 +0800)]
UBUNTU: SAUCE: vmd: fixup bridge ASPM by driver name instead

BugLink: https://bugs.launchpad.net/bugs/1942160
Additional VMD bridge IDs needed for new Alder Lake platforms, but
actually there is no a complete list for them. Here we match bridge
devices if they're directly attached to a VMD controller instead.

Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook 845...
Andy Chi [Mon, 25 Apr 2022 09:23:36 +0000 (17:23 +0800)]
ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook 845/865 G9

BugLink: https://bugs.launchpad.net/bugs/1970178
On HP EliteBook 845 G9 and EliteBook 865 G9, the audio LEDs can be enabled by
ALC285_FIXUP_HP_MUTE_LED. So use it accordingly.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops")
Link: https://lore.kernel.org/r/20220421063606.39772-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit b3fbe53610b5ed8f0370ec4c7e6c8a1f261ddf70)
Signed-off-by: Andy Chi <andy.chi@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoALSA: hda/realtek: Enable headset mic on Lenovo P360
Kai-Heng Feng [Wed, 30 Mar 2022 07:36:20 +0000 (15:36 +0800)]
ALSA: hda/realtek: Enable headset mic on Lenovo P360

BugLink: https://bugs.launchpad.net/bugs/1967069
Lenovo P360 is another platform equipped with ALC897, and it needs
ALC897_FIXUP_HEADSET_MIC_PIN quirk to make its headset mic work.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20220325160501.705221-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5a8738571747c1e275a40b69a608657603867b7e)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoBluetooth: btusb: Improve stability for QCA devices
Zijun Hu [Fri, 1 Apr 2022 11:32:52 +0000 (19:32 +0800)]
Bluetooth: btusb: Improve stability for QCA devices

BugLink: https://bugs.launchpad.net/bugs/1967067
WCN6855 2.1 will reset to apply firmware downloaded, so wait
a moment for reset done then go ahead to improve stability.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(cherry picked from commit 599ece4f8f073097904d411ee70280a2ec890ad3)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/i915/xelpd: Add Pipe Color Lut caps to platform config
Uma Shankar [Thu, 21 Apr 2022 06:15:33 +0000 (14:15 +0800)]
drm/i915/xelpd: Add Pipe Color Lut caps to platform config

BugLink: https://bugs.launchpad.net/bugs/1967274
XE_LPD has 128 Lut entries for Degamma, with additional 3 entries for
extended range. It has 511 entries for gamma with additional 2 entries
for extended range.

v2: Updated lut size for 10bit gamma, added lut_tests (Ville)

v3: Dropped the gamma lut tests fields (Ville)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-4-uma.shankar@intel.com
(backported from commit 1c7ab5affa5e73ed75732be2f2fabe1ae86c82e1)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/i915/xelpd: Enable Pipe Degamma
Uma Shankar [Thu, 21 Apr 2022 06:15:32 +0000 (14:15 +0800)]
drm/i915/xelpd: Enable Pipe Degamma

BugLink: https://bugs.launchpad.net/bugs/1967274
Enable Pipe Degamma for XE_LPD. Extend the legacy implementation
to incorparate the extended lut size for XE_LPD.

v2: Added a helper for degamma lut size (Ville)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-3-uma.shankar@intel.com
(cherry picked from commit 17815f624a90579aeac4b700f8434e9ff6a6d001)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/i915: Use unlocked register accesses for LUT loads
Ville Syrjälä [Thu, 21 Apr 2022 06:15:31 +0000 (14:15 +0800)]
drm/i915: Use unlocked register accesses for LUT loads

BugLink: https://bugs.launchpad.net/bugs/1967274
We have to bash in a lot of registers to load the higher
precision LUT modes. The locking overhead is significant, especially
as we have to get this done as quickly as possible during vblank.
So let's switch to unlocked accesses for these. Fortunately the LUT
registers are mostly spread around such that two pipes do not have
any registers on the same cacheline. So as long as commits on the
same pipe are serialized (which they are) we should get away with
this without angering the hardware.

The only exceptions are the PREC_PIPEGCMAX registers on ilk/snb which
we don't use atm as they are only used in the 12bit gamma mode. If/when
we add support for that we may need to remember to still serialize
those registers, though I'm not sure ilk/snb are actually affected
by the same cacheline issue. I think ivb/hsw at least were, but they
use a different set of registers for the precision LUT.

I have a test case which is updating the LUTs on two pipes from a
single atomic commit. Running that in a loop for a minute I get the
following worst case with the locks in place:
 intel_crtc_vblank_work_start: pipe B, frame=10037, scanline=1081
 intel_crtc_vblank_work_start: pipe A, frame=12274, scanline=769
 intel_crtc_vblank_work_end: pipe A, frame=12274, scanline=58
 intel_crtc_vblank_work_end: pipe B, frame=10037, scanline=74

And here's the worst case with the locks removed:
 intel_crtc_vblank_work_start: pipe B, frame=5869, scanline=1081
 intel_crtc_vblank_work_start: pipe A, frame=7616, scanline=769
 intel_crtc_vblank_work_end: pipe B, frame=5869, scanline=1096
 intel_crtc_vblank_work_end: pipe A, frame=7616, scanline=777

The test was done on a snb using the 10bit 1024 entry LUT mode.
The vtotals for the two displays are 793 and 1125. So we can
see that with the locks ripped out the LUT updates are pretty
nicely confined within the vblank, whereas with the locks in
place we're routinely blasting past the vblank end which causes
visual artifacts near the top of the screen.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-5-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
(cherry picked from commit 115e0f687d29649b8805e3417e089e785b0ea61d)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agodrm/i915/xelpd: Enable Pipe color support for D13 platform
Uma Shankar [Thu, 21 Apr 2022 06:15:30 +0000 (14:15 +0800)]
drm/i915/xelpd: Enable Pipe color support for D13 platform

BugLink: https://bugs.launchpad.net/bugs/1967274
Enable pipe color support for Display 13 platforms. Currently
limit to just 10bit gamma and later extend it for logarithmic
gamma, once the new UAPI is agreed by community and implemented
by a userspace consumer.

v2: Updated dev_priv to i915 (Ville)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-2-uma.shankar@intel.com
(cherry picked from commit e83c18cffaedb1cd5da935b06d49308f92ea50cb)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoUBUNTU: upstream stable to v5.15.35
Kamal Mostafa [Wed, 20 Apr 2022 21:58:35 +0000 (14:58 -0700)]
UBUNTU: upstream stable to v5.15.35

BugLink: https://bugs.launchpad.net/bugs/1969857
Ignore: yes
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoLinux 5.15.35
Greg Kroah-Hartman [Wed, 20 Apr 2022 07:34:22 +0000 (09:34 +0200)]
Linux 5.15.35

BugLink: https://bugs.launchpad.net/bugs/1969857
Link: https://lore.kernel.org/r/20220418121200.312988959@linuxfoundation.org
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/r/20220419073048.315594917@linuxfoundation.org
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: Fix UAF bugs in ax25 timers
Duoming Zhou [Fri, 15 Apr 2022 16:14:22 +0000 (19:14 +0300)]
ax25: Fix UAF bugs in ax25 timers

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 82e31755e55fbcea6a9dfaae5fe4860ade17cbc0 upstream.

There are race conditions that may lead to UAF bugs in
ax25_heartbeat_expiry(), ax25_t1timer_expiry(), ax25_t2timer_expiry(),
ax25_t3timer_expiry() and ax25_idletimer_expiry(), when we call
ax25_release() to deallocate ax25_dev.

One of the UAF bugs caused by ax25_release() is shown below:

      (Thread 1)                    |      (Thread 2)
ax25_dev_device_up() //(1)          |
...                                 | ax25_kill_by_device()
ax25_bind()          //(2)          |
ax25_connect()                      | ...
 ax25_std_establish_data_link()     |
  ax25_start_t1timer()              | ax25_dev_device_down() //(3)
   mod_timer(&ax25->t1timer,..)     |
                                    | ax25_release()
   (wait a time)                    |  ...
                                    |  ax25_dev_put(ax25_dev) //(4)FREE
   ax25_t1timer_expiry()            |
    ax25->ax25_dev->values[..] //USE|  ...
     ...                            |

We increase the refcount of ax25_dev in position (1) and (2), and
decrease the refcount of ax25_dev in position (3) and (4).
The ax25_dev will be freed in position (4) and be used in
ax25_t1timer_expiry().

The fail log is shown below:
==============================================================

[  106.116942] BUG: KASAN: use-after-free in ax25_t1timer_expiry+0x1c/0x60
[  106.116942] Read of size 8 at addr ffff88800bda9028 by task swapper/0/0
[  106.116942] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-06123-g0905eec574
[  106.116942] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-14
[  106.116942] Call Trace:
...
[  106.116942]  ax25_t1timer_expiry+0x1c/0x60
[  106.116942]  call_timer_fn+0x122/0x3d0
[  106.116942]  __run_timers.part.0+0x3f6/0x520
[  106.116942]  run_timer_softirq+0x4f/0xb0
[  106.116942]  __do_softirq+0x1c2/0x651
...

This patch adds del_timer_sync() in ax25_release(), which could ensure
that all timers stop before we deallocate ax25_dev.

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[OP: backport to 5.15: adjust context]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: Fix NULL pointer dereferences in ax25 timers
Duoming Zhou [Fri, 15 Apr 2022 16:14:21 +0000 (19:14 +0300)]
ax25: Fix NULL pointer dereferences in ax25 timers

BugLink: https://bugs.launchpad.net/bugs/1969857
commit fc6d01ff9ef03b66d4a3a23b46fc3c3d8cf92009 upstream.

The previous commit 7ec02f5ac8a5 ("ax25: fix NPD bug in ax25_disconnect")
move ax25_disconnect into lock_sock() in order to prevent NPD bugs. But
there are race conditions that may lead to null pointer dereferences in
ax25_heartbeat_expiry(), ax25_t1timer_expiry(), ax25_t2timer_expiry(),
ax25_t3timer_expiry() and ax25_idletimer_expiry(), when we use
ax25_kill_by_device() to detach the ax25 device.

One of the race conditions that cause null pointer dereferences can be
shown as below:

      (Thread 1)                    |      (Thread 2)
ax25_connect()                      |
 ax25_std_establish_data_link()     |
  ax25_start_t1timer()              |
   mod_timer(&ax25->t1timer,..)     |
                                    | ax25_kill_by_device()
   (wait a time)                    |  ...
                                    |  s->ax25_dev = NULL; //(1)
   ax25_t1timer_expiry()            |
    ax25->ax25_dev->values[..] //(2)|  ...
     ...                            |

We set null to ax25_cb->ax25_dev in position (1) and dereference
the null pointer in position (2).

The corresponding fail log is shown below:
===============================================================
BUG: kernel NULL pointer dereference, address: 0000000000000050
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.17.0-rc6-00794-g45690b7d0
RIP: 0010:ax25_t1timer_expiry+0x12/0x40
...
Call Trace:
 call_timer_fn+0x21/0x120
 __run_timers.part.0+0x1ca/0x250
 run_timer_softirq+0x2c/0x60
 __do_softirq+0xef/0x2f3
 irq_exit_rcu+0xb6/0x100
 sysvec_apic_timer_interrupt+0xa2/0xd0
...

This patch moves ax25_disconnect() before s->ax25_dev = NULL
and uses del_timer_sync() to delete timers in ax25_disconnect().
If ax25_disconnect() is called by ax25_kill_by_device() or
ax25->ax25_dev is NULL, the reason in ax25_disconnect() will be
equal to ENETUNREACH, it will wait all timers to stop before we
set null to s->ax25_dev in ax25_kill_by_device().

Fixes: 7ec02f5ac8a5 ("ax25: fix NPD bug in ax25_disconnect")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
[OP: backport to 5.15: adjust context]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: fix NPD bug in ax25_disconnect
Duoming Zhou [Fri, 15 Apr 2022 16:14:20 +0000 (19:14 +0300)]
ax25: fix NPD bug in ax25_disconnect

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 7ec02f5ac8a5be5a3f20611731243dc5e1d9ba10 upstream.

The ax25_disconnect() in ax25_kill_by_device() is not
protected by any locks, thus there is a race condition
between ax25_disconnect() and ax25_destroy_socket().
when ax25->sk is assigned as NULL by ax25_destroy_socket(),
a NULL pointer dereference bug will occur if site (1) or (2)
dereferences ax25->sk.

ax25_kill_by_device()                | ax25_release()
  ax25_disconnect()                  |   ax25_destroy_socket()
    ...                              |
    if(ax25->sk != NULL)             |     ...
      ...                            |     ax25->sk = NULL;
      bh_lock_sock(ax25->sk); //(1)  |     ...
      ...                            |
      bh_unlock_sock(ax25->sk); //(2)|

This patch moves ax25_disconnect() into lock_sock(), which can
synchronize with ax25_destroy_socket() in ax25_release().

Fail log:
===============================================================
BUG: kernel NULL pointer dereference, address: 0000000000000088
...
RIP: 0010:_raw_spin_lock+0x7e/0xd0
...
Call Trace:
ax25_disconnect+0xf6/0x220
ax25_device_event+0x187/0x250
raw_notifier_call_chain+0x5e/0x70
dev_close_many+0x17d/0x230
rollback_registered_many+0x1f1/0x950
unregister_netdevice_queue+0x133/0x200
unregister_netdev+0x13/0x20
...

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
[OP: backport to 5.15: adjust context]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: fix UAF bug in ax25_send_control()
Duoming Zhou [Fri, 15 Apr 2022 16:14:19 +0000 (19:14 +0300)]
ax25: fix UAF bug in ax25_send_control()

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 5352a761308397a0e6250fdc629bb3f615b94747 upstream.

There are UAF bugs in ax25_send_control(), when we call ax25_release()
to deallocate ax25_dev. The possible race condition is shown below:

      (Thread 1)              |     (Thread 2)
ax25_dev_device_up() //(1)    |
                              | ax25_kill_by_device()
ax25_bind()          //(2)    |
ax25_connect()                | ...
 ax25->state = AX25_STATE_1   |
 ...                          | ax25_dev_device_down() //(3)

      (Thread 3)
ax25_release()                |
 ax25_dev_put()  //(4) FREE   |
 case AX25_STATE_1:           |
  ax25_send_control()         |
   alloc_skb()       //USE    |

The refcount of ax25_dev increases in position (1) and (2), and
decreases in position (3) and (4). The ax25_dev will be freed
before dereference sites in ax25_send_control().

The following is part of the report:

[  102.297448] BUG: KASAN: use-after-free in ax25_send_control+0x33/0x210
[  102.297448] Read of size 8 at addr ffff888009e6e408 by task ax25_close/602
[  102.297448] Call Trace:
[  102.303751]  ax25_send_control+0x33/0x210
[  102.303751]  ax25_release+0x356/0x450
[  102.305431]  __sock_release+0x6d/0x120
[  102.305431]  sock_close+0xf/0x20
[  102.305431]  __fput+0x11f/0x420
[  102.305431]  task_work_run+0x86/0xd0
[  102.307130]  get_signal+0x1075/0x1220
[  102.308253]  arch_do_signal_or_restart+0x1df/0xc00
[  102.308253]  exit_to_user_mode_prepare+0x150/0x1e0
[  102.308253]  syscall_exit_to_user_mode+0x19/0x50
[  102.308253]  do_syscall_64+0x48/0x90
[  102.308253]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[  102.308253] RIP: 0033:0x405ae7

This patch defers the free operation of ax25_dev and net_device after
all corresponding dereference sites in ax25_release() to avoid UAF.

Fixes: 9fd75b66b8f6 ("ax25: Fix refcount leaks caused by ax25_cb_del()")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[OP: backport to 5.15: adjust dev_put_track()->dev_put()]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: Fix refcount leaks caused by ax25_cb_del()
Duoming Zhou [Fri, 15 Apr 2022 16:14:18 +0000 (19:14 +0300)]
ax25: Fix refcount leaks caused by ax25_cb_del()

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 9fd75b66b8f68498454d685dc4ba13192ae069b0 upstream.

The previous commit d01ffb9eee4a ("ax25: add refcount in ax25_dev to
avoid UAF bugs") and commit feef318c855a ("ax25: fix UAF bugs of
net_device caused by rebinding operation") increase the refcounts of
ax25_dev and net_device in ax25_bind() and decrease the matching refcounts
in ax25_kill_by_device() in order to prevent UAF bugs, but there are
reference count leaks.

The root cause of refcount leaks is shown below:

     (Thread 1)                      |      (Thread 2)
ax25_bind()                          |
 ...                                 |
 ax25_addr_ax25dev()                 |
  ax25_dev_hold()   //(1)            |
  ...                                |
 dev_hold_track()   //(2)            |
 ...                                 | ax25_destroy_socket()
                                     |  ax25_cb_del()
                                     |   ...
                                     |   hlist_del_init() //(3)
                                     |
                                     |
     (Thread 3)                      |
ax25_kill_by_device()                |
 ...                                 |
 ax25_for_each(s, &ax25_list) {      |
  if (s->ax25_dev == ax25_dev) //(4) |
   ...                               |

Firstly, we use ax25_bind() to increase the refcount of ax25_dev in
position (1) and increase the refcount of net_device in position (2).
Then, we use ax25_cb_del() invoked by ax25_destroy_socket() to delete
ax25_cb in hlist in position (3) before calling ax25_kill_by_device().
Finally, the decrements of refcounts in ax25_kill_by_device() will not
be executed, because no s->ax25_dev equals to ax25_dev in position (4).

This patch adds decrements of refcounts in ax25_release() and use
lock_sock() to do synchronization. If refcounts decrease in ax25_release(),
the decrements of refcounts in ax25_kill_by_device() will not be
executed and vice versa.

Fixes: d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs")
Fixes: 87563a043cef ("ax25: fix reference count leaks of ax25_dev")
Fixes: feef318c855a ("ax25: fix UAF bugs of net_device caused by rebinding operation")
Reported-by: Thomas Osterried <thomas@osterried.de>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
[OP: backport to 5.15: adjust dev_put_track()->dev_put()]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: fix UAF bugs of net_device caused by rebinding operation
Duoming Zhou [Fri, 15 Apr 2022 16:14:17 +0000 (19:14 +0300)]
ax25: fix UAF bugs of net_device caused by rebinding operation

BugLink: https://bugs.launchpad.net/bugs/1969857
commit feef318c855a361a1eccd880f33e88c460eb63b4 upstream.

The ax25_kill_by_device() will set s->ax25_dev = NULL and
call ax25_disconnect() to change states of ax25_cb and
sock, if we call ax25_bind() before ax25_kill_by_device().

However, if we call ax25_bind() again between the window of
ax25_kill_by_device() and ax25_dev_device_down(), the values
and states changed by ax25_kill_by_device() will be reassigned.

Finally, ax25_dev_device_down() will deallocate net_device.
If we dereference net_device in syscall functions such as
ax25_release(), ax25_sendmsg(), ax25_getsockopt(), ax25_getname()
and ax25_info_show(), a UAF bug will occur.

One of the possible race conditions is shown below:

      (USE)                   |      (FREE)
ax25_bind()                   |
                              |  ax25_kill_by_device()
ax25_bind()                   |
ax25_connect()                |    ...
                              |  ax25_dev_device_down()
                              |    ...
                              |    dev_put_track(dev, ...) //FREE
ax25_release()                |    ...
  ax25_send_control()         |
    alloc_skb()      //USE    |

the corresponding fail log is shown below:
===============================================================
BUG: KASAN: use-after-free in ax25_send_control+0x43/0x210
...
Call Trace:
  ...
  ax25_send_control+0x43/0x210
  ax25_release+0x2db/0x3b0
  __sock_release+0x6d/0x120
  sock_close+0xf/0x20
  __fput+0x11f/0x420
  ...
Allocated by task 1283:
  ...
  __kasan_kmalloc+0x81/0xa0
  alloc_netdev_mqs+0x5a/0x680
  mkiss_open+0x6c/0x380
  tty_ldisc_open+0x55/0x90
  ...
Freed by task 1969:
  ...
  kfree+0xa3/0x2c0
  device_release+0x54/0xe0
  kobject_put+0xa5/0x120
  tty_ldisc_kill+0x3e/0x80
  ...

In order to fix these UAF bugs caused by rebinding operation,
this patch adds dev_hold_track() into ax25_bind() and
corresponding dev_put_track() into ax25_kill_by_device().

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
[OP: backport to 5.15: adjust dev_put_track()->dev_put() and
dev_hold_track()->dev_hold()]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: fix reference count leaks of ax25_dev
Duoming Zhou [Fri, 15 Apr 2022 16:14:16 +0000 (19:14 +0300)]
ax25: fix reference count leaks of ax25_dev

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 87563a043cef044fed5db7967a75741cc16ad2b1 upstream.

The previous commit d01ffb9eee4a ("ax25: add refcount in ax25_dev
to avoid UAF bugs") introduces refcount into ax25_dev, but there
are reference leak paths in ax25_ctl_ioctl(), ax25_fwd_ioctl(),
ax25_rt_add(), ax25_rt_del() and ax25_rt_opt().

This patch uses ax25_dev_put() and adjusts the position of
ax25_addr_ax25dev() to fix reference cout leaks of ax25_dev.

Fixes: d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220203150811.42256-1-duoming@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[OP: backport to 5.15: adjust context]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agoax25: add refcount in ax25_dev to avoid UAF bugs
Duoming Zhou [Fri, 15 Apr 2022 16:14:15 +0000 (19:14 +0300)]
ax25: add refcount in ax25_dev to avoid UAF bugs

BugLink: https://bugs.launchpad.net/bugs/1969857
commit d01ffb9eee4af165d83b08dd73ebdf9fe94a519b upstream.

If we dereference ax25_dev after we call kfree(ax25_dev) in
ax25_dev_device_down(), it will lead to concurrency UAF bugs.
There are eight syscall functions suffer from UAF bugs, include
ax25_bind(), ax25_release(), ax25_connect(), ax25_ioctl(),
ax25_getname(), ax25_sendmsg(), ax25_getsockopt() and
ax25_info_show().

One of the concurrency UAF can be shown as below:

  (USE)                       |    (FREE)
                              |  ax25_device_event
                              |    ax25_dev_device_down
ax25_bind                     |    ...
  ...                         |      kfree(ax25_dev)
  ax25_fillin_cb()            |    ...
    ax25_fillin_cb_from_dev() |
  ...                         |

The root cause of UAF bugs is that kfree(ax25_dev) in
ax25_dev_device_down() is not protected by any locks.
When ax25_dev, which there are still pointers point to,
is released, the concurrency UAF bug will happen.

This patch introduces refcount into ax25_dev in order to
guarantee that there are no pointers point to it when ax25_dev
is released.

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
[OP: backport to 5.15: adjusted context]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
23 months agocpufreq: intel_pstate: ITMT support for overclocked system
Srinivas Pandruvada [Fri, 19 Nov 2021 05:18:01 +0000 (21:18 -0800)]
cpufreq: intel_pstate: ITMT support for overclocked system

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 03c83982a0278207709143ba78c5a470179febee upstream.

On systems with overclocking enabled, CPPC Highest Performance can be
hard coded to 0xff. In this case even if we have cores with different
highest performance, ITMT can't be enabled as the current implementation
depends on CPPC Highest Performance.

On such systems we can use MSR_HWP_CAPABILITIES maximum performance field
when CPPC.Highest Performance is 0xff.

Due to legacy reasons, we can't solely depend on MSR_HWP_CAPABILITIES as
in some older systems CPPC Highest Performance is the only way to identify
different performing cores.

Reported-by: Michael Larabel <Michael@MichaelLarabel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Michael Larabel <Michael@MichaelLarabel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>