]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/log
mirror_ubuntu-focal-kernel.git
4 years agoUBUNTU: Ubuntu-5.4.0-28.32
Thadeu Lima de Souza Cascardo [Wed, 22 Apr 2020 14:08:40 +0000 (11:08 -0300)]
UBUNTU: Ubuntu-5.4.0-28.32

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
4 years agoUBUNTU: SAUCE: s390/mm: fix page table upgrade vs 2ndary address mode accesses
Christian Borntraeger [Wed, 15 Apr 2020 13:21:01 +0000 (15:21 +0200)]
UBUNTU: SAUCE: s390/mm: fix page table upgrade vs 2ndary address mode accesses

A page table upgrade in a kernel section that uses secondary address
mode will mess up the kernel instructions as follows:

Consider the following scenario: two threads are sharing memory.
On CPU1 thread 1 does e.g. strnlen_user().  That gets to
        old_fs = enable_sacf_uaccess();
        len = strnlen_user_srst(src, size);
and
                "   la    %2,0(%1)\n"
                "   la    %3,0(%0,%1)\n"
                "   slgr  %0,%0\n"
                "   sacf  256\n"
                "0: srst  %3,%2\n"
in strnlen_user_srst().  At that point we are in secondary space mode,
control register 1 points to kernel page table and instruction fetching
happens via c1, rather than usual c13.  Interrupts are not disabled, for
obvious reasons.

On CPU2 thread 2 does MAP_FIXED mmap(), forcing the upgrade of page table
from 3-level to e.g. 4-level one.  We'd allocated new top-level table,
set it up and now we hit this:
                notify = 1;
                spin_unlock_bh(&mm->page_table_lock);
        }
        if (notify)
                on_each_cpu(__crst_table_upgrade, mm, 0);
OK, we need to actually change over to use of new page table and we
need that to happen in all threads that are currently running.  Which
happens to include the thread 1.  IPI is delivered and we have
static void __crst_table_upgrade(void *arg)
{
        struct mm_struct *mm = arg;

        if (current->active_mm == mm)
                set_user_asce(mm);
        __tlb_flush_local();
}
run on CPU1.  That does
static inline void set_user_asce(struct mm_struct *mm)
{
        S390_lowcore.user_asce = mm->context.asce;
OK, user page table address updated...
        __ctl_load(S390_lowcore.user_asce, 1, 1);
... and control register 1 set to it.
        clear_cpu_flag(CIF_ASCE_PRIMARY);
}

IPI is run in home space mode, so it's fine - insns are fetched
using c13, which always points to kernel page table.  But as soon
as we return from the interrupt, previous PSW is restored, putting
CPU1 back into secondary space mode, at which point we no longer
get the kernel instructions from the kernel mapping.

The fix is to only fixup the control registers that are currently in use
for user processes during the page table update.  We must also disable
interrupts in enable_sacf_uaccess to synchronize the cr and
thread.mm_segment updates against the on_each-cpu.

Fixes: 0aaba41b58bc ("s390: remove all code using the access register mode")
Cc: stable@vger.kernel.org # 4.15+
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
References: CVE-2020-11884
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CVE-2020-11884
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
4 years agoUBUNTU: Start new release
Thadeu Lima de Souza Cascardo [Tue, 21 Apr 2020 20:33:14 +0000 (17:33 -0300)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
4 years agoUBUNTU: Ubuntu-5.4.0-26.30
Andrea Righi [Mon, 20 Apr 2020 16:33:49 +0000 (18:33 +0200)]
UBUNTU: Ubuntu-5.4.0-26.30

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: link-to-tracker: update tracking bug
Andrea Righi [Mon, 20 Apr 2020 14:49:24 +0000 (16:49 +0200)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1873882
Properties: no-test-build
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: Start new release
Andrea Righi [Mon, 20 Apr 2020 14:48:21 +0000 (16:48 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: update dkms package versions
Andrea Righi [Mon, 20 Apr 2020 14:46:35 +0000 (16:46 +0200)]
UBUNTU: update dkms package versions

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: SAUCE: drm/i915: prevent direct writeback from the shrinker
Andrea Righi [Mon, 20 Apr 2020 14:19:03 +0000 (16:19 +0200)]
UBUNTU: SAUCE: drm/i915: prevent direct writeback from the shrinker

BugLink: https://bugs.launchpad.net/bugs/1861359
The i915 shrinker can make the system unresponsive and kill interactive
performance by swapping out dirty objects to reclaim more memory.

Avoid the lags by preventing to swap out dirty objects from any task
(except kswapd).

This is not required in 5.5+, because it is properly fixed by commit
2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")

However, backporting this commit to 5.4 is not trivial and the
regression potential is high. A simple change like this can be a
reasonable compromise to prevent the problem and avoid the risk of
introducing other bugs.

Fixes: 2d6692e642e7 ("drm/i915: Start writeback from the shrinker")
Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: [Config] lowlatency: turn off RT_GROUP_SCHED
Paolo Pisati [Fri, 17 Apr 2020 11:29:46 +0000 (13:29 +0200)]
UBUNTU: [Config] lowlatency: turn off RT_GROUP_SCHED

BugLink: https://bugs.launchpad.net/bugs/1873315
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agonet: phy: realtek: fix handling of RTL8105e-integrated PHY
Heiner Kallweit [Mon, 20 Apr 2020 14:03:19 +0000 (16:03 +0200)]
net: phy: realtek: fix handling of RTL8105e-integrated PHY

BugLink: https://bugs.launchpad.net/bugs/1871182
[ No applicable upstream commit ]

After the referenced fix it turned out that one particular RTL8168
chip version (RTL8105e) does not work on 5.4 because no dedicated PHY
driver exists. Adding this PHY driver was done for fixing a different
issue for versions from 5.5 already. I re-send the same change for 5.4
because the commit message differs.

Fixes: 2e8c339b4946 ("r8169: fix PHY driver check on platforms w/o module softdeps")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3fcd53b1d859799686a08785afb8990566c31cfa
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
4 years agoUBUNTU: Ubuntu-5.4.0-25.29
Seth Forshee [Fri, 17 Apr 2020 13:41:17 +0000 (08:41 -0500)]
UBUNTU: Ubuntu-5.4.0-25.29

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: link-to-tracker: update tracking bug
Seth Forshee [Fri, 17 Apr 2020 13:40:13 +0000 (08:40 -0500)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1873459
Properties: no-test-build
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: Start new release
Seth Forshee [Fri, 17 Apr 2020 13:34:22 +0000 (08:34 -0500)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoPCI: vmd: Add device id for VMD device 8086:9A0B
Jon Derrick [Thu, 16 Apr 2020 08:56:59 +0000 (16:56 +0800)]
PCI: vmd: Add device id for VMD device 8086:9A0B

BugLink: https://bugs.launchpad.net/bugs/1855954
This patch adds support for this VMD device which supports the bus
restriction mode.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
(cherry picked from commit ec11e5c213cc20cac5e8310728b06793448b9f6d)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Anthony Wong <anthony.wong@canonical.com>
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoPCI: vmd: Add bus 224-255 restriction decode
Jon Derrick [Thu, 16 Apr 2020 08:56:58 +0000 (16:56 +0800)]
PCI: vmd: Add bus 224-255 restriction decode

BugLink: https://bugs.launchpad.net/bugs/1855954
VMD bus restrictions are required when IO fabric is multiplexed such
that VMD cannot use the entire bus range. This patch adds another bus
restriction decode bit that can be set by firmware to restrict the VMD
bus range to between 224-255.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
(cherry picked from commit 08bcdd22ecdb01dd60d9284a55f8220a8a40150e)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Anthony Wong <anthony.wong@canonical.com>
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoahci: Add Intel Comet Lake PCH RAID PCI ID
Jian-Hong Pan [Tue, 14 Apr 2020 10:06:19 +0000 (18:06 +0800)]
ahci: Add Intel Comet Lake PCH RAID PCI ID

BugLink: https://bugs.launchpad.net/bugs/1871812
Intel Comet Lake should use the default LPM policy for mobile chipsets.
So, add the PCI ID to the driver list of supported devices.

Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 7667e63c8af90e287f9e2d070599024cbabe63f5)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: Ubuntu-5.4.0-24.28 Ubuntu-5.4.0-24.28
Seth Forshee [Thu, 9 Apr 2020 21:49:54 +0000 (16:49 -0500)]
UBUNTU: Ubuntu-5.4.0-24.28

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: link-to-tracker: update tracking bug
Seth Forshee [Thu, 9 Apr 2020 21:47:56 +0000 (16:47 -0500)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1871939
Properties: no-test-build
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] Remove CONFIG_SND_HDA_INTEL_DETECT_DMIC from annotations
Seth Forshee [Thu, 9 Apr 2020 18:40:36 +0000 (13:40 -0500)]
UBUNTU: [Config] Remove CONFIG_SND_HDA_INTEL_DETECT_DMIC from annotations

This option was removed in a recent patch, so also remove it from
the anntations file.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Packaging] Remove riscv64 packaging from master kernel
Seth Forshee [Mon, 6 Apr 2020 19:33:34 +0000 (14:33 -0500)]
UBUNTU: [Packaging] Remove riscv64 packaging from master kernel

The riscv64 kernel is being split out into a derivative package.
Remove if from debian.master.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Debian] Allow building linux-libc-dev from linux-riscv
Seth Forshee [Mon, 6 Apr 2020 18:04:29 +0000 (13:04 -0500)]
UBUNTU: [Debian] Allow building linux-libc-dev from linux-riscv

The primary kernel for riscv64 will be built from the linux-riscv
package, so allow this one to also build linux-libc-dev.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: Start new release
Seth Forshee [Thu, 9 Apr 2020 18:26:52 +0000 (13:26 -0500)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: selftests/seccomp: allow clock_nanosleep instead of nanosleep
Thadeu Lima de Souza Cascardo [Wed, 8 Apr 2020 23:59:07 +0000 (20:59 -0300)]
UBUNTU: SAUCE: selftests/seccomp: allow clock_nanosleep instead of nanosleep

glibc 2.31 calls clock_nanosleep when its nanosleep function is used. So
the restart_syscall fails after that. In order to deal with it, we trace
clock_nanosleep and nanosleep. Then we check for either.

This works just fine on systems with both glibc 2.30 and glibc 2.31,
whereas it failed before on a system with glibc 2.31.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] CONTEXT_TRACKING_FORCE policy should be unset
Thadeu Lima de Souza Cascardo [Wed, 8 Apr 2020 21:06:21 +0000 (18:06 -0300)]
UBUNTU: [Config] CONTEXT_TRACKING_FORCE policy should be unset

BugLink: https://bugs.launchpad.net/bugs/1349028
Though that option depends on others we don't set and, thus, is not
currently prompted, we would rather have it annotated and enforced to
avoid regressing it. Enabling this option has the possible consequence
of regressing some userspace code.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] USB_OTG_FSM policy not needed
Thadeu Lima de Souza Cascardo [Wed, 8 Apr 2020 19:54:03 +0000 (16:54 -0300)]
UBUNTU: [Config] USB_OTG_FSM policy not needed

BugLink: https://bugs.launchpad.net/bugs/1047527
We don't really want to enable USB_OTG. Enabling USB_OTG_FSM is not a
problem per se. As it used to select USB_OTG instead of depending on it, it
was required to be annotated. That is not the case anymore, as it no longer
selects the problematic option.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] Remove HEADER_TEST from annotations
Thadeu Lima de Souza Cascardo [Wed, 8 Apr 2020 18:28:13 +0000 (15:28 -0300)]
UBUNTU: [Config] Remove HEADER_TEST from annotations

Upstream commit fcbb8461fd2376ba3782b5b8bd440c929b8e4980 ("kbuild: remove
header compile test") removed this option as it seems to be causing build
warnings.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] Remove PCIEASPM_DEBUG from annotations
Thadeu Lima de Souza Cascardo [Wed, 8 Apr 2020 18:28:12 +0000 (15:28 -0300)]
UBUNTU: [Config] Remove PCIEASPM_DEBUG from annotations

This option has been removed by commit
87e90283c94c76ee11d379ab5a0973382bbd0baf ("PCI/ASPM: Remove PCIEASPM_DEBUG
Kconfig option and related code"), as the sysfs interface has been replaced
by way of commit 72ea91afbfb08619696ccde610ee4d0d29cf4a1d ("PCI/ASPM: Add
sysfs attributes for controlling ASPM link states").

The config option itself was removed in a previous local commit. Remove the
corresponding annotations, considering there is an alternative interface
now.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: security/apparmor/label.c: Clean code by removing redundant instructions
Mateusz Nosek [Tue, 3 Mar 2020 18:30:23 +0000 (19:30 +0100)]
UBUNTU: SAUCE: security/apparmor/label.c: Clean code by removing redundant instructions

Previously 'label->proxy->label' value checking
and conditional reassigning were done twice in the same function.
The second one is redundant and can be removed.

Fixes: 1296c52d1ce6 ("apparmor: fix potential label refcnt leak in aa_change_profile")
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: apparmor: fix potential label refcnt leak in aa_change_profile
Xiyu Yang [Sun, 5 Apr 2020 05:11:55 +0000 (13:11 +0800)]
UBUNTU: SAUCE: apparmor: fix potential label refcnt leak in aa_change_profile

aa_change_profile() invokes aa_get_current_label(), which returns
a reference of the current task's label.

According to the comment of aa_get_current_label(), the returned
reference must be put with aa_put_label().
However, when the original object pointed by "label" becomes
unreachable because aa_change_profile() returns or a new object
is assigned to "label", reference count increased by
aa_get_current_label() is not decreased, causing a refcnt leak.

Fix this by calling aa_put_label() before aa_change_profile() return
and dropping unnecessary aa_get_current_label().

Fixes: 9fcf78cca198 ("apparmor: update domain transitions that are subsets of confinement at nnp")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: apparmor: ensure that dfa state tables have entries
John Johansen [Tue, 31 Mar 2020 06:37:54 +0000 (23:37 -0700)]
UBUNTU: SAUCE: apparmor: ensure that dfa state tables have entries

Currently it is possible to specify a state machine table with 0 length,
this is not valid as optional tables are specified by not defining
the table as present. Further this allows by-passing the base tables
range check against the next/check tables.

Fixes: d901d6a298dc ("apparmor: dfa split verification of table headers")
Reported-by: Mike Salvatore <mike.salvatore@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: aapparmor: fail unpack if profile mode is unknown
John Johansen [Thu, 19 Dec 2019 23:55:39 +0000 (15:55 -0800)]
UBUNTU: SAUCE: aapparmor: fail unpack if profile mode is unknown

Profile unpack should fail if the profile mode is not a mode that the
kernel understands.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: aapparmor: remove useless aafs_create_symlink
John Johansen [Tue, 24 Sep 2019 16:46:33 +0000 (09:46 -0700)]
UBUNTU: SAUCE: aapparmor: remove useless aafs_create_symlink

commit 1180b4c757aa ("apparmor: fix dangling symlinks to policy
rawdata after replacement") reworked how the rawdata symlink is
handled but failedto remove aafs_create_symlink which was reduced to a
useles stub.

Fixes: 1180b4c757aa ("apparmor: fix dangling symlinks to policy rawdata after replacement")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: aapparmor: add consistency check between state and dfa diff encode...
John Johansen [Sat, 31 Aug 2019 22:55:45 +0000 (15:55 -0700)]
UBUNTU: SAUCE: aapparmor: add consistency check between state and dfa diff encode flags

Check that a states diff encode flag is only set if diff encode is
enabled in the dfa header.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: apparmor: add a valid state flags check
John Johansen [Sat, 31 Aug 2019 22:55:06 +0000 (15:55 -0700)]
UBUNTU: SAUCE: apparmor: add a valid state flags check

Add a check to ensure only known state flags are set on each
state in the dfa.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoapparmor: increase left match history buffer size
John Johansen [Fri, 31 May 2019 13:54:54 +0000 (06:54 -0700)]
apparmor: increase left match history buffer size

There have been cases reported where a history buffer size of 8 was
not enough to resolve conflict overlaps. Increase the buffer to and
get rid of the size element which is currently just storing the
constant WB_HISTORY_SIZE.

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 136db994852a9b405ac1074de0e7a1c4c840b8ee)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: drm/i915: Force DPCD backlight mode for HP CML 2020 system
Kai-Heng Feng [Wed, 8 Apr 2020 09:37:40 +0000 (17:37 +0800)]
UBUNTU: SAUCE: drm/i915: Force DPCD backlight mode for HP CML 2020 system

BugLink: https://bugs.launchpad.net/bugs/1871589
There's another Samsung OLED panel needs to use DPCD aux interface to
control backlight.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE drm/i915: Force DPCD backlight mode for HP Spectre x360 Convertible...
Kai-Heng Feng [Wed, 8 Apr 2020 09:23:03 +0000 (17:23 +0800)]
UBUNTU: SAUCE drm/i915: Force DPCD backlight mode for HP Spectre x360 Convertible 13t-aw100

BugLink: https://bugs.launchpad.net/bugs/1860303
There's another OLED panel needs to use DPCD aux interface to control
backlight.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoslcan: Don't transmit uninitialized stack data in padding
Richard Palethorpe [Wed, 8 Apr 2020 08:58:24 +0000 (16:58 +0800)]
slcan: Don't transmit uninitialized stack data in padding

CVE-2020-11494

struct can_frame contains some padding which is not explicitly zeroed in
slc_bump. This uninitialized data will then be transmitted if the stack
initialization hardening feature is not enabled (CONFIG_INIT_STACK_ALL).

This commit just zeroes the whole struct including the padding.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Fixes: a1044e36e457 ("can: add slcan driver for serial/USB-serial CAN adapters")
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: security@kernel.org
Cc: wg@grandegger.com
Cc: mkl@pengutronix.de
Cc: davem@davemloft.net
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9258a2cece4ec1f020715fe3554bc2e360f6264)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: drm/i915: Synchronize active and retire callbacks
Sultan Alsawaf [Tue, 7 Apr 2020 22:27:40 +0000 (15:27 -0700)]
UBUNTU: SAUCE: drm/i915: Synchronize active and retire callbacks

Active and retire callbacks can run simultaneously, causing panics and
mayhem. The most notable case is with the intel_context_pin/unpin race
that causes ring and page table corruption. In 5.4, this race is more
noticeable because intel_ring_unpin() sets ring->vaddr to NULL and
causes a clean NULL-pointer-dereference panic, but in newer kernels this
race goes unnoticed.

Here is an example of a crash caused by this race on 5.4:
BUG: unable to handle page fault for address: 0000000000003448
RIP: 0010:gen8_emit_flush_render+0x163/0x190
Call Trace:
 execlists_request_alloc+0x25/0x40
 __i915_request_create+0x1f4/0x2c0
 i915_request_create+0x71/0xc0
 i915_gem_do_execbuffer+0xb98/0x1a80
 ? preempt_count_add+0x68/0xa0
 ? _raw_spin_lock+0x13/0x30
 ? _raw_spin_unlock+0x16/0x30
 i915_gem_execbuffer2_ioctl+0x1de/0x3c0
 ? i915_gem_busy_ioctl+0x7f/0x1d0
 ? i915_gem_execbuffer_ioctl+0x2d0/0x2d0
 drm_ioctl_kernel+0xb2/0x100
 drm_ioctl+0x209/0x360
 ? i915_gem_execbuffer_ioctl+0x2d0/0x2d0
 ksys_ioctl+0x87/0xc0
 __x64_sys_ioctl+0x16/0x20
 do_syscall_64+0x4e/0x150
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Protect the active and retire callbacks with their own lock to prevent
them from running at the same time as one another.

Fixes: 12c255b5dad1 ("drm/i915: Provide an i915_active.acquire callback")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: drm/i915: Fix ref->mutex deadlock in i915_active_wait()
Sultan Alsawaf [Tue, 7 Apr 2020 22:27:39 +0000 (15:27 -0700)]
UBUNTU: SAUCE: drm/i915: Fix ref->mutex deadlock in i915_active_wait()

The following deadlock exists in i915_active_wait() due to a double lock
on ref->mutex (call chain listed in order from top to bottom):
 i915_active_wait();
 mutex_lock_interruptible(&ref->mutex); <-- ref->mutex first acquired
 i915_active_request_retire();
 node_retire();
 active_retire();
 mutex_lock_nested(&ref->mutex, SINGLE_DEPTH_NESTING); <-- DEADLOCK

Fix the deadlock by skipping the second ref->mutex lock when
active_retire() is called through i915_active_request_retire().

Note that this bug only affects 5.4 and has since been fixed in 5.5.
Normally, a backport of the fix from 5.5 would be in order, but the
patch set that fixes this deadlock involves massive changes that are
neither feasible nor desirable for backporting [1][2][3]. Therefore,
this small patch was made to address the deadlock specifically for 5.4.

[1] 274cbf20fd10 ("drm/i915: Push the i915_active.retire into a worker")
[2] 093b92287363 ("drm/i915: Split i915_active.mutex into an irq-safe spinlock for the rbtree")
[3] 750bde2fd4ff ("drm/i915: Serialise with remote retirement")

Fixes: 12c255b5dad1 ("drm/i915: Provide an i915_active.acquire callback")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Cc: <stable@vger.kernel.org> # 5.4.x
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agox86/efi: remove unused variables
YueHaibing [Fri, 15 Nov 2019 13:08:30 +0000 (21:08 +0800)]
x86/efi: remove unused variables

BugLink: https://bugs.launchpad.net/bugs/1866909
commit ad723674d675 ("x86/efi: move common keyring handler functions
to new file") leave this unused.

Fixes: ad723674d675 ("x86/efi: move common keyring handler functions to new file")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191115130830.13320-1-yuehaibing@huawei.com
(cherry picked from commit 6f090192f8225f52ba95d08785989688cb768cca)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
4 years agoUBUNTU: SAUCE: drm/amdgpu: Remove missing firmware files from modinfo
Seth Forshee [Wed, 8 Apr 2020 13:30:12 +0000 (08:30 -0500)]
UBUNTU: SAUCE: drm/amdgpu: Remove missing firmware files from modinfo

A number of amdgpu firmware files referenced by the driver are
not in linux-firmware. This causes warnings to be printed during
initramfs generation on systems which use this driver. Remove the
MODULE_FIRMWARE statements for these files until such time as the
files are available.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: Update aufs to 5.4.3 20200302
Seth Forshee [Wed, 8 Apr 2020 12:41:33 +0000 (07:41 -0500)]
UBUNTU: SAUCE: Update aufs to 5.4.3 20200302

Import aufs5.4.3 20200302 from https://github.com/sfjro/aufs5-standalone
commit e7a55d2cf765eb18b870bf6a9baf955d8b7e3863.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Check if depth of qp is 0 before configure
Lang Cheng [Thu, 12 Mar 2020 09:50:24 +0000 (17:50 +0800)]
RDMA/hns: Check if depth of qp is 0 before configure

BugLink: https://launchpad.net/bugs/1864950
Depth of qp shouldn't be allowed to be set to zero, after ensuring that,
subsequent process can be simplified. And when qp is changed from reset to
reset, the capability of minimum qp depth was used to identify hardware of
hip06, it should be changed into a more readable form.

Link: https://lore.kernel.org/r/1584006624-11846-1-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 026ded373483c07983a6a30b70034ad0f3667a44)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp doorbell allocation flow
Xi Wang [Mon, 24 Feb 2020 06:37:38 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp doorbell allocation flow

BugLink: https://launchpad.net/bugs/1864950
Encapsulate the kernel qp doorbell allocation related code into 2
functions: alloc_qp_db() and free_qp_db().

Link: https://lore.kernel.org/r/1582526258-13825-8-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(backported from commit cfec045b822a1c3f8f47604520d3194729d9d2af)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize kernel qp wrid allocation flow
Xi Wang [Mon, 24 Feb 2020 06:37:37 +0000 (14:37 +0800)]
RDMA/hns: Optimize kernel qp wrid allocation flow

BugLink: https://launchpad.net/bugs/1864950
Encapsulate the kernel qp wrid allocation related code into 2 functions:
alloc_kernel_wrid() and free_kernel_wrid().

Link: https://lore.kernel.org/r/1582526258-13825-7-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit b37c413997100d1ad5627bf38f0ebfeee170f305)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp param setup flow
Xi Wang [Mon, 24 Feb 2020 06:37:36 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp param setup flow

BugLink: https://launchpad.net/bugs/1864950
Encapsulate the qp param setup related code into set_qp_param().

Link: https://lore.kernel.org/r/1582526258-13825-6-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit ae85bf92effc1e4d4f5b3a3a291d2440a7200e25)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp buffer allocation flow
Xi Wang [Mon, 24 Feb 2020 06:37:35 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp buffer allocation flow

BugLink: https://launchpad.net/bugs/1864950
Encapsulate qp buffer allocation related code into 3 functions:
alloc_qp_buf(), map_wqe_buf() and free_qp_buf().

Link: https://lore.kernel.org/r/1582526258-13825-5-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(backported from commit 24c22112b9c2084a362c6fe7d7ddb2bbef5b4a2e)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp number assign flow
Xi Wang [Mon, 24 Feb 2020 06:37:34 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp number assign flow

BugLink: https://launchpad.net/bugs/1864950
Encapsulate the code associated with the qp number assignment into
alloc_qpn() and free_qpn().

Link: https://lore.kernel.org/r/1582526258-13825-4-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit df83a66e1b2e1194cd6cd744f09f06448e0b8b3c)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp context create and destroy flow
Xi Wang [Mon, 24 Feb 2020 06:37:33 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp context create and destroy flow

BugLink: https://launchpad.net/bugs/1864950
Rename the qp context related functions and adjusts the code location to
distinguish between the qp context and the entire qp.

Link: https://lore.kernel.org/r/1582526258-13825-3-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit b71961d1daa040c4979760e50606f34e24642764)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize qp destroy flow
Xi Wang [Mon, 24 Feb 2020 06:37:32 +0000 (14:37 +0800)]
RDMA/hns: Optimize qp destroy flow

BugLink: https://launchpad.net/bugs/1864950
Wrap the duplicate code in hip08 and hip06 qp destruction process as
hns_roce_qp_destroy() to simply the qp destroy flow.

Link: https://lore.kernel.org/r/1582526258-13825-2-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit e365b26c6b66fe2bc800399912f7cbc875edf693)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Stop doorbell update while qp state error
Yixian Liu [Sat, 22 Feb 2020 10:25:58 +0000 (18:25 +0800)]
RDMA/hns: Stop doorbell update while qp state error

BugLink: https://launchpad.net/bugs/1864950
There are two paths to update qp producer index into hardware now, one
path is doorbell in post verbs (send and recv), the another is mailbox in
modify qp verb which is called by flush process. This will lead the
hardware to be broken to correctly generate flush cqe.  With stopping
doorbell update and holding qp spinlock in modify qp during flush process,
the problem can be solved.

Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Link: https://lore.kernel.org/r/1582367158-27030-3-git-send-email-liuyixian@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 75c994e6943c2aa887871eb6e6cea6c073b1cfd3)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Use flush framework for the case in aeq
Yixian Liu [Sat, 22 Feb 2020 10:25:57 +0000 (18:25 +0800)]
RDMA/hns: Use flush framework for the case in aeq

BugLink: https://launchpad.net/bugs/1864950
As now we already have flush framework, using it instead of current flush
process for qp error in asynchronized interrupt (aeq).

Link: https://lore.kernel.org/r/1582367158-27030-2-git-send-email-liuyixian@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 0fc99566f6eeb8c1d7e1795710b95c03a987124d)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Treat revision HIP08_A as a special case
Lang Cheng [Sat, 22 Feb 2020 09:17:19 +0000 (17:17 +0800)]
RDMA/hns: Treat revision HIP08_A as a special case

BugLink: https://launchpad.net/bugs/1864950
Set revisions that equal to or higher than HIP08_B as default to maintain
backward compatibility.

Link: https://lore.kernel.org/r/1582363039-10714-1-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit dfaf2854b02e5c45bf806c7a1d8b4706b87ddc8e)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Initialize all fields of doorbells to zero
Lang Cheng [Thu, 20 Feb 2020 01:34:31 +0000 (09:34 +0800)]
RDMA/hns: Initialize all fields of doorbells to zero

BugLink: https://launchpad.net/bugs/1864950
Prevent uninitialized fields when new fields are added, and make code look
simpler.

Link: https://lore.kernel.org/r/1582162471-50361-1-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 52c5e9e7497b728b53a84cbd5873c4b707d10d55)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: fix spelling mistake: "attatch" -> "attach"
Colin Ian King [Fri, 14 Feb 2020 00:33:38 +0000 (00:33 +0000)]
RDMA/hns: fix spelling mistake: "attatch" -> "attach"

BugLink: https://launchpad.net/bugs/1864950
There is a spelling mistake in a dev_err error message. Fix it.

Link: https://lore.kernel.org/r/20200214003338.6573-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 8d8d2b76ac3545cf6c0e9c6aa61700db98d2496a)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Delayed flush cqe process with workqueue
Yixian Liu [Thu, 6 Feb 2020 09:56:45 +0000 (17:56 +0800)]
RDMA/hns: Delayed flush cqe process with workqueue

BugLink: https://launchpad.net/bugs/1864950
HiP08 RoCE hardware lacks ability(a known hardware problem) to flush
outstanding WQEs if QP state gets into errored mode for some reason.  To
overcome this hardware problem and as a workaround, when QP is detected to
be in errored state during various legs like post send, post receive
etc[1], flush needs to be performed from the driver.

The earlier patch[1] sent to solve the hardware limitation explained in
the cover-letter had a bug in the software flushing leg. It acquired mutex
while modifying QP state to errored state and while conveying it to the
hardware using the mailbox. This caused leg to sleep while holding
spin-lock and caused crash.

Suggested Solution: we have proposed to defer the flushing of the QP in
the Errored state using the workqueue to get around with the limitation of
our hardware.

This patch specifically adds the calls to the flush handler from where
parts of the code like post_send/post_recv etc. when the QP state gets
into the errored mode.

[1] https://patchwork.kernel.org/patch/10534271/

Link: https://lore.kernel.org/r/1580983005-13899-3-git-send-email-liuyixian@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Reviewed-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit b53742865e9f09cbba4d9daa161760ec23f36aa4)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Add the workqueue framework for flush cqe handler
Yixian Liu [Thu, 6 Feb 2020 09:56:44 +0000 (17:56 +0800)]
RDMA/hns: Add the workqueue framework for flush cqe handler

BugLink: https://launchpad.net/bugs/1864950
HiP08 RoCE hardware lacks ability(a known hardware problem) to flush
outstanding WQEs if QP state gets into errored mode for some reason.  To
overcome this hardware problem and as a workaround, when QP is detected to
be in errored state during various legs like post send, post receive etc
[1], flush needs to be performed from the driver.

The earlier patch[1] sent to solve the hardware limitation explained in
the cover-letter had a bug in the software flushing leg. It acquired mutex
while modifying QP state to errored state and while conveying it to the
hardware using the mailbox. This caused leg to sleep while holding
spin-lock and caused crash.

Suggested Solution:
we have proposed to defer the flushing of the QP in the Errored state
using the workqueue to get around with the limitation of our hardware.

This patch adds the framework of the workqueue and the flush handler
function.

[1] https://patchwork.kernel.org/patch/10534271/

Link: https://lore.kernel.org/r/1580983005-13899-2-git-send-email-liuyixian@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Reviewed-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit ffd541d45726341c1830ff595fd7352b6d1cfbcd)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Optimize eqe buffer allocation flow
Xi Wang [Sun, 26 Jan 2020 14:58:35 +0000 (22:58 +0800)]
RDMA/hns: Optimize eqe buffer allocation flow

BugLink: https://launchpad.net/bugs/1864950
The eqe has a private multi-hop addressing implementation, but there is
already a set of interfaces in the hns driver that can achieve this.

So, simplify the eqe buffer allocation process by using the mtr interface
and remove large amount of repeated logic.

Link: https://lore.kernel.org/r/20200126145835.11368-1-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit d7e2d3432ae7795e5b77a77039e904ed4a769f39)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRDMA/hns: Cleanups of magic numbers
Lang Cheng [Sun, 26 Jan 2020 14:55:04 +0000 (22:55 +0800)]
RDMA/hns: Cleanups of magic numbers

BugLink: https://launchpad.net/bugs/1864950
Some magic numbers are hard to understand, so replace them with macros or
add some comments for them.

Link: https://lore.kernel.org/r/20200126145504.9700-1-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit b14c95bee83537aff423cece4ae6078759bc6f34)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: delete unnecessary logs after kzalloc fails
Yufeng Mo [Sat, 7 Mar 2020 03:42:50 +0000 (11:42 +0800)]
net: hns3: delete unnecessary logs after kzalloc fails

BugLink: https://launchpad.net/bugs/1867586
Since kernel already has logs after kzalloc fails,
it's unnecessary to print duplicate logs. So this
patch deletes these logs.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fbdc4d79fcc2e226a36c9b8e2f1cdd80ca549094)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: synchronize some print relating to reset issue
Huazhong Tan [Sat, 7 Mar 2020 03:42:49 +0000 (11:42 +0800)]
net: hns3: synchronize some print relating to reset issue

BugLink: https://launchpad.net/bugs/1867586
This patch modifies some printing relating to reset issue.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8de91e92070b5a083e4705cd4684c1802f7f730e)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: print out command code when dump fails in debugfs
Yufeng Mo [Sat, 7 Mar 2020 03:42:48 +0000 (11:42 +0800)]
net: hns3: print out command code when dump fails in debugfs

BugLink: https://launchpad.net/bugs/1867586
This patch adds a local variable to save the command code in
some dump cases which need to modify the command code, then
the failing command code can be print out for debugging.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 77ba415d192011b5ef9e9979638772b42b5d4107)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: print out status register when VF receives unknown source interrupt
Huazhong Tan [Sat, 7 Mar 2020 03:42:47 +0000 (11:42 +0800)]
net: hns3: print out status register when VF receives unknown source interrupt

BugLink: https://launchpad.net/bugs/1867586
When received an unknown vector 0 interrupt, there is not a
helpful information for user to realize that now. So this patch
prints out the value of the status register for this case, and
uses dev_info() instead of dev_dbg() in hclge_check_event_cause().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e45afb396e233b972aee187c7adb058859c5ac53)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: add a check before PF inform VF to reset
Yonglong Liu [Sat, 7 Mar 2020 03:42:46 +0000 (11:42 +0800)]
net: hns3: add a check before PF inform VF to reset

BugLink: https://launchpad.net/bugs/1867586
When setting VF's MAC from PF, if the VF driver not loaded, the
firmware will return error to PF.

So PF should check whether VF is alive before sending message to
VF when setting VF's MAC.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9091367037d3e6db590d9f8cd9a163336665ef27)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: delete some reduandant code
Guojia Liao [Sat, 7 Mar 2020 03:42:45 +0000 (11:42 +0800)]
net: hns3: delete some reduandant code

BugLink: https://launchpad.net/bugs/1867586
In hclge_add_mc_addr_common() and hclge_rm_mc_addr_common(),
variable req had been set as "0" by memset(), so it's unnecessary
to set .entry_type field as "0" with hnae3_set_bit() again.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 01c45c521a5aa2e3a077b27d090f05a20012dd65)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: remove an unnecessary resetting check in hclge_handle_hw_ras_error()
Yufeng Mo [Sat, 7 Mar 2020 03:42:44 +0000 (11:42 +0800)]
net: hns3: remove an unnecessary resetting check in hclge_handle_hw_ras_error()

BugLink: https://launchpad.net/bugs/1867586
In hclge_handle_hw_ras_error(), it is unnecessary to check
HCLGE_STATE_RST_HANDLING flag, because the reset priority
has been ensured by the process itself.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 89a85559302f473d2c7f22c774b31f979a0e62dc)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: rename macro HCLGE_MAX_NCL_CONFIG_LENGTH
Yufeng Mo [Sat, 7 Mar 2020 03:42:43 +0000 (11:42 +0800)]
net: hns3: rename macro HCLGE_MAX_NCL_CONFIG_LENGTH

BugLink: https://launchpad.net/bugs/1867586
The name of macro HCLGE_MAX_NCL_CONFIG_LENGTH is inaccurate,
this patch renames it to HCLGE_NCL_CONFIG_LENGTH_IN_EACH_CMD.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4960cabff63e09066a8d02b0375b654d41ce174f)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: fix some mixed type assignment
Guojia Liao [Sat, 7 Mar 2020 03:42:42 +0000 (11:42 +0800)]
net: hns3: fix some mixed type assignment

BugLink: https://launchpad.net/bugs/1867586
This patch cleans up some incorrect type in assignment reported by sparse
and compiler.
The warning as below:
- warning : restricted __le16 degrades to integer
- warning : cast from restricted __le32
- warning : cast from restricted __be32
- warning : cast from restricted __be16
and "mixed operation".

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 72fa490480ce5cd6a1b8ec741b369a470f93d61d)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: add missing help info for QS shaper in debugfs
Yonglong Liu [Wed, 19 Feb 2020 01:23:33 +0000 (09:23 +0800)]
net: hns3: add missing help info for QS shaper in debugfs

BugLink: https://launchpad.net/bugs/1867586
HNS3 driver can dump QS shaper configs via debugfs, but missing
help info in debugfs for this operation.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 89ec9485282a3470217628fbabf34c789b475763)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: add support for dump MAC ID and loopback status in debugfs
Yufeng Mo [Wed, 19 Feb 2020 01:23:32 +0000 (09:23 +0800)]
net: hns3: add support for dump MAC ID and loopback status in debugfs

BugLink: https://launchpad.net/bugs/1867586
The MAC ID and loopback status information are obtained from
the hardware, which will be helpful for debugging. This patch
adds support for these two items in debugfs.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ded45d406ca736b3c23e7d099318465620fcd0f1)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: add enabled TC numbers and DWRR weight info in debugfs
Yonglong Liu [Wed, 19 Feb 2020 01:23:31 +0000 (09:23 +0800)]
net: hns3: add enabled TC numbers and DWRR weight info in debugfs

BugLink: https://launchpad.net/bugs/1867586
The actual enabled TC numbers and the DWRR weight of each
TC may be helpful for debugging, so adds them into debugfs.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a8adbb8a91a4cc260aeef7d670f3735b7b52865f)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet: hns3: modify an unsuitable print when setting unknown duplex to fibre
Guangbin Huang [Wed, 19 Feb 2020 01:23:30 +0000 (09:23 +0800)]
net: hns3: modify an unsuitable print when setting unknown duplex to fibre

BugLink: https://launchpad.net/bugs/1867586
Currently, if device is in link down status and user uses
'ethtool -s' command to set speed but not specify duplex
mode, the duplex mode passed from ethtool to driver is
unknown value(255), and the fibre port will identify this
value as half duplex mode and print "only copper port
supports half duplex!". This message is confusing.

So for fibre port, only the setting duplex is half, prints
error and returns.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2d3db26d78805c9e06e26def0081c76e9bb0b7d6)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
Aaron Ma [Tue, 7 Apr 2020 08:23:31 +0000 (16:23 +0800)]
UBUNTU: SAUCE: drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event

BugLink: https://bugs.launchpad.net/bugs/1871316
On ARCTURUS and RENOIR, powerplay is not supported yet.
When plug in or unplug power jack, ACPI event will issue.
Then kernel NULL pointer BUG will be triggered.
Check for NULL pointers before calling.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 170dbbf5ee571dbe11f847c27a15c6e28fdacfab
 git://people.freedesktop.org/~agd5f/linux drm-next)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonet/bpfilter: remove superfluous testing message
Bruno Meneguele [Tue, 7 Apr 2020 08:13:47 +0000 (10:13 +0200)]
net/bpfilter: remove superfluous testing message

A testing message was brought by 13d0f7b814d9 ("net/bpfilter: fix dprintf
usage for /dev/kmsg") but should've been deleted before patch submission.
Although it doesn't cause any harm to the code or functionality itself, it's
totally unpleasant to have it displayed on every loop iteration with no real
use case. Thus remove it unconditionally.

Fixes: 13d0f7b814d9 ("net/bpfilter: fix dprintf usage for /dev/kmsg")
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 41c55ea6c2a7ca4c663eeec05bdf54f4e2419699)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: [Config] SND_INTEL_DSP_CONFIG=m
Hui Wang [Tue, 7 Apr 2020 07:14:48 +0000 (15:14 +0800)]
UBUNTU: [Config] SND_INTEL_DSP_CONFIG=m

BugLink: https://bugs.launchpad.net/bugs/1871284
Signed-off-by: Hui Wang <hui.wang@canonical.com>
[ saf: add snd-intel-nhlt to modules.ignore, remove annotations
  changes, run updateconfigs ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda: Rename back to dmic_detect option
Takashi Iwai [Tue, 7 Apr 2020 07:14:47 +0000 (15:14 +0800)]
ALSA: hda: Rename back to dmic_detect option

BugLink: https://bugs.launchpad.net/bugs/1871284
We've got quite a few bug reports showing the SOF driver being loaded
unintentionally recently, and the reason seems to be that users didn't
know the module option change: with the recent kernel, a new option
dsp_driver=1 has to be passed to a new module snd-intel-dspcfg
instead of snd_hda_intel.dmic_detect=0 option.

That is, actually there are two tricky things here:
- We changed the whole detection in another module and another
  option semantics.
- The existing option for skipping the DSP probe was also renamed.

For avoiding the confusion and giving user more hint, this patch
reverts the renamed option dsp_driver back to dmic_detect for
snd-hda-intel module, and show the warning about the module option
change when the non-default value is passed.

Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code")
Link: https://lore.kernel.org/r/20200109082000.26729-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 7fba6aea4472f01a404d81a12237ae9a1ff418ce)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda: More constifications
Takashi Iwai [Tue, 7 Apr 2020 07:14:46 +0000 (15:14 +0800)]
ALSA: hda: More constifications

BugLink: https://bugs.launchpad.net/bugs/1871284
Apply const prefix to the remaining possible places: the string
tables, the rate tables, the verb tables, the index tables, etc.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit bf82326fce53321c3f9088874dc12dcbd6d0ca06)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda: Allow non-Intel device probe gracefully
Takashi Iwai [Tue, 7 Apr 2020 07:14:45 +0000 (15:14 +0800)]
ALSA: hda: Allow non-Intel device probe gracefully

BugLink: https://bugs.launchpad.net/bugs/1871284
The recent addition of snd_intel_dsp_driver_probe() check caused a
spurious kernel warning when the driver is loaded for a non-Intel
hardware due to snd_BUG_ON().  Moreover, for such a hardware, we
should always return SND_INTEL_DSP_DRIVER_ANY, not check the
dsp_driver option at all.

This patch fixes these issues for non-Intel devices.

Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20191028130634.3501-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 91636a82044a2821201b54faac4d1d2425260842)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda: fix intel DSP config
Pierre-Louis Bossart [Tue, 7 Apr 2020 07:14:44 +0000 (15:14 +0800)]
ALSA: hda: fix intel DSP config

BugLink: https://bugs.launchpad.net/bugs/1871284
Reshuffle list of devices by historical order and add correct
information as needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20191022174313.29087-2-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit cc8f81c7e625168a60843b2b39e3a327cf5170fe)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda: add Intel DSP configuration / probe code
Jaroslav Kysela [Tue, 7 Apr 2020 07:14:43 +0000 (15:14 +0800)]
ALSA: hda: add Intel DSP configuration / probe code

BugLink: https://bugs.launchpad.net/bugs/1871284
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  https://github.com/thesofproject/linux/pull/927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 82d9d54a6c0ee8b12211fa4e59fd940a2da4e063)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoKEYS: reaching the keys quotas correctly
Yang Xu [Tue, 7 Apr 2020 06:12:47 +0000 (14:12 +0800)]
KEYS: reaching the keys quotas correctly

BugLink: https://bugs.launchpad.net/bugs/1869644
Currently, when we add a new user key, the calltrace as below:

add_key()
  key_create_or_update()
    key_alloc()
    __key_instantiate_and_link
      generic_key_instantiate
        key_payload_reserve
          ......

Since commit a08bf91ce28e ("KEYS: allow reaching the keys quotas exactly"),
we can reach max bytes/keys in key_alloc, but we forget to remove this
limit when we reserver space for payload in key_payload_reserve. So we
can only reach max keys but not max bytes when having delta between plen
and type->def_datalen. Remove this limit when instantiating the key, so we
can keep consistent with key_alloc.

Also, fix the similar problem in keyctl_chown_key().

Fixes: 0b77f5bfb45c ("keys: make the keyring quotas controllable through /proc/sys")
Fixes: a08bf91ce28e ("KEYS: allow reaching the keys quotas exactly")
Cc: stable@vger.kernel.org # 5.0.x
Cc: Eric Biggers <ebiggers@google.com>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
(cherry picked from commit 2e356101e72ab1361821b3af024d64877d9a798d)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: rtw88: Move driver IQK to set channel before association for 11N chip
Ping-Ke Shih [Tue, 7 Apr 2020 06:05:17 +0000 (14:05 +0800)]
UBUNTU: SAUCE: rtw88: Move driver IQK to set channel before association for 11N chip

BugLink: https://bugs.launchpad.net/bugs/1871300
Originally, driver do IQK after auth/assoc, but it's doing 4-way handshake
if we connect to an AP with WPA2 security. Since 11N chips use software IQK
that causes more than 100ms, so IQK and 4-way handshake can be overlap, then
4-way handshake may be failed. To resolve this issue, move IQK prior to
issue auth.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Change-Id: I019fe3d6cf2cdc6c0454558904bfc5c2f0c7e6ea
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: rtw88: fix rate for a while after being connected
Ping-Ke Shih [Tue, 7 Apr 2020 06:05:15 +0000 (14:05 +0800)]
UBUNTU: SAUCE: rtw88: fix rate for a while after being connected

BugLink: https://bugs.launchpad.net/bugs/1871300
Use low rate to issue auth/assoc to ensure AP can receive these packets
with higher probability.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Change-Id: Ic500bbd14687d623e1e98a2ab6f9ba15055201a9
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoUBUNTU: SAUCE: rtw88: No retry and report for auth and assoc
Ping-Ke Shih [Tue, 7 Apr 2020 06:05:13 +0000 (14:05 +0800)]
UBUNTU: SAUCE: rtw88: No retry and report for auth and assoc

BugLink: https://bugs.launchpad.net/bugs/1871300
The certain AP can't handle quick auth/assoc retry proerply, so disable
auth/assoc L2 retry and doesn't report TX status immediately, then wait for
cfg80211 connection retry that in period of 100ms.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Change-Id: I663fc017049b3e663dc3cc0619e00d8e04d0de7e
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoALSA: hda/realtek: Enable mute LED on an HP system
Kai-Heng Feng [Mon, 6 Apr 2020 12:09:11 +0000 (20:09 +0800)]
ALSA: hda/realtek: Enable mute LED on an HP system

BugLink: https://bugs.launchpad.net/bugs/1871090
The system in question uses ALC285, and it uses GPIO 0x04 to control its
mute LED.

The mic mute LED can be controlled by GPIO 0x01, however the system uses
DMIC so we should use that to control mic mute LED.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200327044626.29582-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit f5a88b0accc24c4a9021247d7a3124f90aa4c586)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoselftests/powerpc: Turn off timeout setting for benchmarks, dscr, signal, tm
Po-Hsu Lin [Mon, 6 Apr 2020 05:57:45 +0000 (13:57 +0800)]
selftests/powerpc: Turn off timeout setting for benchmarks, dscr, signal, tm

BugLink: https://bugs.launchpad.net/bugs/1864642
Some specific tests in powerpc can take longer than the default 45
seconds that added in commit 852c8cbf34d3 ("selftests/kselftest/runner.sh:
Add 45 second timeout per test") to run, the following test result was
collected across 2 Power8 nodes and 1 Power9 node in our pool:
  powerpc/benchmarks/futex_bench - 52s
  powerpc/dscr/dscr_sysfs_test - 116s
  powerpc/signal/signal_fuzzer - 88s
  powerpc/tm/tm_unavailable_test - 168s
  powerpc/tm/tm-poison - 240s

Thus they will fail with TIMEOUT error. Disable the timeout setting
for these sub-tests to allow them finish properly.

https://bugs.launchpad.net/bugs/1864642
Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second timeout per test")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200318060004.10685-1-po-hsu.lin@canonical.com
(backported from commit 850507f30c38dff21ed557cb98ab16db26c32bbc)
[PHLin: fuzzy context adjustment]
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoRevert "UBUNTU: SAUCE: selftests/powerpc -- Disable timeout for benchmark and tm...
Po-Hsu Lin [Mon, 6 Apr 2020 05:57:44 +0000 (13:57 +0800)]
Revert "UBUNTU: SAUCE: selftests/powerpc -- Disable timeout for benchmark and tm tests"

BugLink: https://bugs.launchpad.net/bugs/1864642
This reverts commit 6bd338f9bce51c049194539a2dc27a45808080c1.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme: Fix parsing of ANA log page
Prabhath Sajeepa [Mon, 28 Oct 2019 22:56:48 +0000 (16:56 -0600)]
nvme: Fix parsing of ANA log page

BugLink: https://bugs.launchpad.net/bugs/1856340
Check validity of offset into ANA log buffer before accessing
nvme_ana_group_desc. This check ensures the size of ANA log buffer >=
offset + sizeof(nvme_ana_group_desc)

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Prabhath Sajeepa <psajeepa@purestorage.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 64fab7290dc3561729bbc1e35895a517eb2e549e)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme: resync include/linux/nvme.h with nvmecli
Revanth Rajashekar [Mon, 14 Oct 2019 17:16:07 +0000 (11:16 -0600)]
nvme: resync include/linux/nvme.h with nvmecli

BugLink: https://bugs.launchpad.net/bugs/1856340
Update enumerations and structures in include/linux/nvme.h
to resync with the nvmecli.

All the updates are mentioned in the ratified NVMe 1.4 spec
https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 48c9e85b23464a7d1e3ebd70b79cc3a2d97d3222)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme-fc: ensure association_id is cleared regardless of a Disconnect LS
James Smart [Fri, 27 Sep 2019 21:27:22 +0000 (14:27 -0700)]
nvme-fc: ensure association_id is cleared regardless of a Disconnect LS

BugLink: https://bugs.launchpad.net/bugs/1856340
Code today only clears the association_id if a Disconnect LS is transmit.

Remove ambiguity and unconditionally clear the association_id if the
association has been terminated.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit bcde5f0fc7d318c98d4234b52bcc1a87fc2162d9)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme-fc: clarify error messages
James Smart [Fri, 27 Sep 2019 22:27:11 +0000 (15:27 -0700)]
nvme-fc: clarify error messages

BugLink: https://bugs.launchpad.net/bugs/1856340
Change wording on a couple of messages to clarify what happened.

Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 7db394848ece0e0706dfe8e4940b24e949f3b88f)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme-fc: Set new cmd set indicator in nvme-fc cmnd iu
James Smart [Fri, 27 Sep 2019 21:51:36 +0000 (14:51 -0700)]
nvme-fc: Set new cmd set indicator in nvme-fc cmnd iu

BugLink: https://bugs.launchpad.net/bugs/1856340
Set the new category field in the FC-NVME CMND_IU based on queue number.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 44fbf3bb1ac3dbebc6bd07eb68abf2d0badfae65)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme-fc and nvmet-fc: sync with FC-NVME-2 header changes
James Smart [Fri, 27 Sep 2019 21:51:35 +0000 (14:51 -0700)]
nvme-fc and nvmet-fc: sync with FC-NVME-2 header changes

BugLink: https://bugs.launchpad.net/bugs/1856340
Sync sources with revised structure and field names to correspond with
FC-NVME-2 header sync-up.

Tested interoperability with success:
- prior initiator with new target
- prior target with new initiator
- new on new

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 53b2b2f59967c0b7eb4df265136b1cc25b9fb287)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agonvme-fc: Sync nvme-fc header to FC-NVME-2
James Smart [Fri, 27 Sep 2019 21:51:34 +0000 (14:51 -0700)]
nvme-fc: Sync nvme-fc header to FC-NVME-2

BugLink: https://bugs.launchpad.net/bugs/1856340
Sync the header to FC-NVME-2 r1.06 (T11-2019-00210-v001).

Includes some minor mods where pre-release field names changed
by the time the spec was released.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit f16583614222d015968541f2e50447c67c277f74)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoscsi: lpfc: add RDF registration and Link Integrity FPIN logging
James Smart [Mon, 10 Feb 2020 17:31:55 +0000 (09:31 -0800)]
scsi: lpfc: add RDF registration and Link Integrity FPIN logging

BugLink: https://bugs.launchpad.net/bugs/1855303
This patch modifies lpfc to register for Link Integrity events via the use
of an RDF ELS and to perform Link Integrity FPIN logging.

Specifically, the driver was modified to:

 - Format and issue the RDF ELS immediately following SCR registration.
   This registers the ability of the driver to receive FPIN ELS.

 - Adds decoding of the FPIN els into the received descriptors, with
   logging of the Link Integrity event information. After decoding, the ELS
   is delivered to the scsi fc transport to be delivered to any user-space
   applications.

 - To aid in logging, simple helpers were added to create enum to name
   string lookup functions that utilize the initialization helpers from the
   fc_els.h header.

 - Note: base header definitions for the ELS's don't populate the
   descriptor payloads. As such, lpfc creates it's own version of the
   structures, using the base definitions (mostly headers) and additionally
   declaring the descriptors that will complete the population of the ELS.

Link: https://lore.kernel.org/r/20200210173155.547-3-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit df3fe76658ed47617741819a501e2bd2ae446962 linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoscsi: fc: Update Descriptor definition and add RDF and Link Integrity FPINs
James Smart [Mon, 10 Feb 2020 17:31:54 +0000 (09:31 -0800)]
scsi: fc: Update Descriptor definition and add RDF and Link Integrity FPINs

BugLink: https://bugs.launchpad.net/bugs/1855303
Update the FC headers for the RDF ELS and populate out the FPIN ELS and the
Link integrity FPIN payload.

RDF is used to register for diagnostic events.
FPIN is how the fabric reports a diagnostic event.

Specifically, this patch:

 - Adds the formal definition of TLV descriptors that are now used in a lot
   of the FC spec. The simplistic fc_fn_desc structure, basically no more
   than the tlv definition, is removed.

 - Small tlv helper functions are added as defines.

 - The list of known Descriptor tags (identifying the TLV) is expanded and
   a name initializer introduced.

 - The LSRI descriptor, returned in many new ELS response payloads is
   added.

 - The RDF ELS code is added, and the RDF request response structures
   added.

 - The FPIN els definition is corrected.

 - A full definition of a Link Integrity Notification descriptor is added,

[mkp: rolled in kbuild warning fix]

Link: https://lore.kernel.org/r/20200210173155.547-2-jsmart2021@gmail.com
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 73ec6d2748dc35db2b32cf3c182a27c4a0837b9b linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoscsi: lpfc: Copyright updates for 12.6.0.4 patches
James Smart [Tue, 28 Jan 2020 00:23:12 +0000 (16:23 -0800)]
scsi: lpfc: Copyright updates for 12.6.0.4 patches

BugLink: https://bugs.launchpad.net/bugs/1855303
Update copyrights to 2020 for files modified in the 12.6.0.4 patch set.

Link: https://lore.kernel.org/r/20200128002312.16346-13-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 145e5a8a5cbd0c608dfe653c92edb70a580bdbf6 linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoscsi: lpfc: Update lpfc version to 12.6.0.4
James Smart [Tue, 28 Jan 2020 00:23:11 +0000 (16:23 -0800)]
scsi: lpfc: Update lpfc version to 12.6.0.4

BugLink: https://bugs.launchpad.net/bugs/1855303
Update lpfc version to 12.6.0.4

Link: https://lore.kernel.org/r/20200128002312.16346-12-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ad6203f975263752e9738a33eacbc92f5bb6f636 linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
4 years agoscsi: lpfc: Clean up hba max_lun_queue_depth checks
James Smart [Tue, 28 Jan 2020 00:23:09 +0000 (16:23 -0800)]
scsi: lpfc: Clean up hba max_lun_queue_depth checks

BugLink: https://bugs.launchpad.net/bugs/1855303
The current code does some odd +1 over maximum xri count checks and
requires that the lun_queue_count can't be bigger than maximum xri count
divided by 8. These items are bogus.

Clean the code up to cap lun_queue_count to maximum xri count.

Link: https://lore.kernel.org/r/20200128002312.16346-10-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f6770e7d2329f0b05223fffea9eb821fd2dd038a linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>