14 Nov, 2018

40 commits

  • [ Upstream commit 8c22e2f695920ebd94f9a53bcf2a65eb36d4dba1 ]

    The msr_pstate data is only 63 bits long and should be 64 bits.

    Add in the missing bit from res1 for AMD Family 0x17.

    Reference: https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf, page 138.

    Signed-off-by: Prarit Bhargava
    Cc: Shuah Khan
    Cc: Stafford Horne
    Signed-off-by: Shuah Khan (Samsung OSG)
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Prarit Bhargava
     
  • [ Upstream commit 78c9be61c3a5cd9e2439fd27a5ffad73a81958c7 ]

    Introduce a new flag, uc_buffer, to indicate that the controller
    requires the non-cached pages for stream buffers, either as a
    chip-specific requirement or specified via snoop=0 option.
    This improves the code-readability.

    Also, this patch fixes the incorrect behavior for C-Media chip where
    the stream buffers were never handled as non-cached due to the check
    of driver_type even if you pass snoop=0 option.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • [ Upstream commit b97db58557f4aa6d9903f8e1deea6b3d1ed0ba43 ]

    Don't reset the resp opcode for a replayed read response.
    The resp opcode could be in the middle of a write or send
    sequence, when the duplicate read request was received.
    An example sequence is as follows:
    - Receive read request for 12KB PSN 20. Transmit read response
    first, middle and last with PSNs 20,21,22.
    - Receive write first PSN 23.
    At this point the resp psn is 24 and resp opcode is write first.
    - The sender notices that PSN 20 is dropped and retransmits.
    Receive read request for 12KB PSN 20. Transmit read response
    first, middle and last with PSNs 20,21,22. The resp opcode is
    set to -1, the resp psn remains 24.
    - Receive write first PSN 23. This is processed by duplicate_request().
    The resp opcode remains -1 and resp psn remains 24.
    - Receive write middle PSN 24. check_op_seq() reports a missing
    first error since the resp opcode is -1.

    When sending an ack for a duplicate send or write request,
    use the psn of the previous ack sent. Do not use the psn
    of a read response for the ack.
    An example sequence is as follows:
    - Receive write PSN 30. Transmit ACK for PSN 30.
    - Receive read request 4KB PSN 31. Transmit read response with
    PSN 31. The resp psn is now 32.
    - The sender notices that PSN 30 is dropped and retransmits.
    Receive write PSN 30. duplicate_request() sends an ACK with
    PSN 31. That is incorrect since PSN 31 was a read request.

    Signed-off-by: Vijay Immanuel
    Signed-off-by: Doug Ledford
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Vijay Immanuel
     
  • [ Upstream commit 54f919a04cf221bc1601d1193682d4379dacacbd ]

    The driver calls clk_get() with the clock name set to NULL, which means
    that the driver could only work when probed from devicetree. From now
    on, we explicitly require the driver to be probed from devicetree.

    Signed-off-by: Paul Cercueil
    Tested-by: Mathieu Malaterre
    Signed-off-by: Vinod Koul
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Paul Cercueil
     
  • [ Upstream commit 9612f8f503804d2fd2f63aa6ba1e58bba4612d96 ]

    The IRQ work is added before the struct rtc is allocated and registered,
    but this struct is used in the IRQ handler. This may lead to a NULL pointer
    dereference.

    Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc
    before calling menelaus_add_irq_work.

    Also, this solves a possible leak as the RTC is never released.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Alexandre Belloni
     
  • [ Upstream commit 3597dfe01d12f570bc739da67f857fd222a3ea66 ]

    Instead of playing whack-a-mole and changing SEND_SIG_PRIV to
    SEND_SIG_FORCED throughout the kernel to ensure a pid namespace init
    gets signals sent by the kernel, stop allowing a pid namespace init to
    ignore SIGKILL or SIGSTOP sent by the kernel. A pid namespace init is
    only supposed to be able to ignore signals sent from itself and
    children with SIG_DFL.

    Fixes: 921cf9f63089 ("signals: protect cinit from unblocked SIG_DFL signals")
    Reviewed-by: Thomas Gleixner
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • [ Upstream commit cda9cc595f0bb6ffa51a4efc4b6533dfa4039b4c ]

    Now, we depend on fsck to ensure quota file data is ok,
    so we scan whole partition if checkpoint without umount
    flag. It's same for quota off error case, which may make
    quota file data inconsistent.

    generic/019 reports below error:

    __quota_error: 1160 callbacks suppressed
    Quota error (device zram1): write_blk: dquota write failed
    Quota error (device zram1): qtree_write_dquot: Error -28 occurred while creating quota
    Quota error (device zram1): write_blk: dquota write failed
    Quota error (device zram1): qtree_write_dquot: Error -28 occurred while creating quota
    Quota error (device zram1): write_blk: dquota write failed
    Quota error (device zram1): qtree_write_dquot: Error -28 occurred while creating quota
    Quota error (device zram1): write_blk: dquota write failed
    Quota error (device zram1): qtree_write_dquot: Error -28 occurred while creating quota
    Quota error (device zram1): write_blk: dquota write failed
    Quota error (device zram1): qtree_write_dquot: Error -28 occurred while creating quota
    VFS: Busy inodes after unmount of zram1. Self-destruct in 5 seconds. Have a nice day...

    If we failed in below path due to fail to write dquot block, we will miss
    to release quota inode, fix it.

    - f2fs_put_super
    - f2fs_quota_off_umount
    - f2fs_quota_off
    - f2fs_quota_sync
    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yunlei He
     
  • [ Upstream commit ca7fb76e091f889cfda1287c07a9358f73832b39 ]

    On io completion, the driver is taking an adapter wide lock and nulling the
    scsi command back pointer. The nulling of the back pointer is to signify the
    io was completed and the scsi_done() routine was called. However, the routine
    makes no check to see if the abort routine had done the same thing and
    possibly nulled the pointer. Thus it may doubly-complete the io.

    Make the following mods:

    - Check to make sure forward progress (call scsi_done()) only happens if the
    command pointer was non-null.

    - As the taking of the lock, which is adapter wide, is very costly on a system
    under load, null the pointer using an xchg operation rather than under lock.

    Signed-off-by: Dick Kennedy
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • [ Upstream commit 0ef01a2d95fd62bb4f536e7ce4d5e8e74b97a244 ]

    When running an mds diagnostic that passes frames with the switch, soft
    lockups are detected. The driver is in a CQE processing loop and has
    sufficient amount of traffic that it never exits the ring processing routine,
    thus the "lockup".

    Cap the number of elements in the work processing routine to 64 elements. This
    ensures that the cpu will be given up and the handler reschedule to process
    additional items.

    Signed-off-by: Dick Kennedy
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • [ Upstream commit ae61cf5b9913027c6953a79ed3894da4f47061bd ]

    When both uio and the uio drivers are built in the kernel, it is possible
    for a driver to register devices before the uio class is registered.

    This may result in a NULL pointer dereference later on in
    get_device_parent() when accessing the class glue_dirs spinlock.

    The trace looks like that:

    Unable to handle kernel NULL pointer dereference at virtual address 00000140
    [...]
    [] _raw_spin_lock+0x14/0x48
    [] device_add+0x154/0x6a0
    [] device_create_groups_vargs+0x120/0x128
    [] device_create+0x54/0x60
    [] __uio_register_device+0x120/0x4a8
    [] jaguar2_pci_probe+0x2d4/0x558
    [] local_pci_probe+0x3c/0xb8
    [] pci_device_probe+0x11c/0x180
    [] driver_probe_device+0x22c/0x2d8
    [] __driver_attach+0xbc/0xc0
    [] bus_for_each_dev+0x4c/0x98
    [] driver_attach+0x20/0x28
    [] bus_add_driver+0x1b8/0x228
    [] driver_register+0x60/0xf8
    [] __pci_register_driver+0x40/0x48

    Return EPROBE_DEFER in that case so the driver can register the device
    later.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Alexandre Belloni
     
  • [ Upstream commit cfb03be6c7e8a1591285849c361d67b09f5149f7 ]

    The following lockdep splat was observed:

    [ 1222.241750] ======================================================
    [ 1222.271301] WARNING: possible circular locking dependency detected
    [ 1222.301060] 4.16.0-10.el8+5.x86_64+debug #1 Not tainted
    [ 1222.326659] ------------------------------------------------------
    [ 1222.356565] systemd-shutdow/1 is trying to acquire lock:
    [ 1222.382660] ((&ioat_chan->timer)){+.-.}, at: [] del_timer_sync+0x5/0xf0
    [ 1222.422928]
    [ 1222.422928] but task is already holding lock:
    [ 1222.451743] (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [] ioat_shutdown+0x86/0x100 [ioatdma]
    :
    [ 1223.524987] Chain exists of:
    [ 1223.524987] (&ioat_chan->timer) --> &(&ioat_chan->cleanup_lock)->rlock --> &(&ioat_chan->prep_lock)->rlock
    [ 1223.524987]
    [ 1223.594082] Possible unsafe locking scenario:
    [ 1223.594082]
    [ 1223.622630] CPU0 CPU1
    [ 1223.645080] ---- ----
    [ 1223.667404] lock(&(&ioat_chan->prep_lock)->rlock);
    [ 1223.691535] lock(&(&ioat_chan->cleanup_lock)->rlock);
    [ 1223.728657] lock(&(&ioat_chan->prep_lock)->rlock);
    [ 1223.765122] lock((&ioat_chan->timer));
    [ 1223.784095]
    [ 1223.784095] *** DEADLOCK ***
    [ 1223.784095]
    [ 1223.813492] 4 locks held by systemd-shutdow/1:
    [ 1223.834677] #0: (reboot_mutex){+.+.}, at: [] SYSC_reboot+0x10f/0x300
    [ 1223.873310] #1: (&dev->mutex){....}, at: [] device_shutdown+0x1c8/0x660
    [ 1223.913604] #2: (&dev->mutex){....}, at: [] device_shutdown+0x1d6/0x660
    [ 1223.954000] #3: (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [] ioat_shutdown+0x86/0x100 [ioatdma]

    In the ioat_shutdown() function:

    spin_lock_bh(&ioat_chan->prep_lock);
    set_bit(IOAT_CHAN_DOWN, &ioat_chan->state);
    del_timer_sync(&ioat_chan->timer);
    spin_unlock_bh(&ioat_chan->prep_lock);

    According to the synchronization rule for the del_timer_sync() function,
    the caller must not hold locks which would prevent completion of the
    timer's handler.

    The timer structure has its own lock that manages its synchronization.
    Setting the IOAT_CHAN_DOWN bit should prevent other CPUs from
    trying to use that device anyway, there is probably no need to call
    del_timer_sync() while holding the prep_lock. So the del_timer_sync()
    call is now moved outside of the prep_lock critical section to prevent
    the circular lock dependency.

    Signed-off-by: Waiman Long
    Reviewed-by: Dave Jiang
    Signed-off-by: Vinod Koul
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Waiman Long
     
  • [ Upstream commit 8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e ]

    The ChipIdea IRQ is disabled before scheduling the otg work and
    re-enabled on otg work completion. However if the job is already
    scheduled we have to undo the effect of disable_irq int order to
    balance the IRQ disable-depth value.

    Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations")
    Signed-off-by: Loic Poulain
    Signed-off-by: Peter Chen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Loic Poulain
     
  • [ Upstream commit aae733a3f46f5ef338fbdde26e14cbb205a23de0 ]

    Fix the following sparse endianness warnings:

    drivers/crypto/caam/regs.h:95:1: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted __le32unsigned int @@
    drivers/crypto/caam/regs.h:95:1: expected unsigned int
    drivers/crypto/caam/regs.h:95:1: got restricted __le32 [usertype]
    drivers/crypto/caam/regs.h:95:1: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted __be32unsigned int @@
    drivers/crypto/caam/regs.h:95:1: expected unsigned int
    drivers/crypto/caam/regs.h:95:1: got restricted __be32 [usertype]

    drivers/crypto/caam/regs.h:92:1: sparse: cast to restricted __le32
    drivers/crypto/caam/regs.h:92:1: sparse: cast to restricted __be32

    Fixes: 261ea058f016 ("crypto: caam - handle core endianness != caam endianness")
    Reported-by: kbuild test robot
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Horia Geantă
     
  • [ Upstream commit 726d75a6d243bf6730da3216f3592503f6f0f588 ]

    Errata i870 is applicable in both EP and RC mode. Therefore rename
    function dra7xx_pcie_ep_unaligned_memaccess(), that implements errata
    workaround, to dra7xx_pcie_unaligned_memaccess() and call it for both RC
    and EP. Make sure driver probe does not fail in case the workaround is not
    applied for RC mode in order to maintain DT backward compatibility.

    Reported-by: Chris Welch
    Signed-off-by: Vignesh R
    [lorenzo.pieralisi@arm.com: reworded the log]
    Signed-off-by: Lorenzo Pieralisi
    Acked-by: Kishon Vijay Abraham I
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Vignesh R
     
  • [ Upstream commit 987d1e8dcd370d96029a3d76a0031b043c4a69ae ]

    If the ETB is already enabled in sysfs mode, the ETB reports
    success even if a perf mode is requested. Fix this by checking
    the requested mode.

    Cc: Mathieu Poirier
    Signed-off-by: Suzuki K Poulose
    Signed-off-by: Mathieu Poirier
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Suzuki K Poulose
     
  • [ Upstream commit 4c1ef72e9b71a19fb405ebfcd37c0a5e16fa44ca ]

    It is a serious driver defect to enable MSI or MSI-X more than once. Doing
    so may panic the kernel as in the stack trace below:

    Call Trace:
    sysfs_add_one+0xa5/0xd0
    create_dir+0x7c/0xe0
    sysfs_create_subdir+0x1c/0x20
    internal_create_group+0x6d/0x290
    sysfs_create_groups+0x4a/0xa0
    populate_msi_sysfs+0x1cd/0x210
    pci_enable_msix+0x31c/0x3e0
    igbuio_pci_open+0x72/0x300 [igb_uio]
    uio_open+0xcc/0x120 [uio]
    chrdev_open+0xa1/0x1e0
    [...]
    do_sys_open+0xf3/0x1f0
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b
    ---[ end trace 11042e2848880209 ]---
    Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffffa056b4fa

    We want to keep the WARN_ON() and stack trace so the driver can be fixed,
    but we can avoid the kernel panic by returning an error. We may still get
    warnings like this:

    Call Trace:
    pci_enable_msix+0x3c9/0x3e0
    igbuio_pci_open+0x72/0x300 [igb_uio]
    uio_open+0xcc/0x120 [uio]
    chrdev_open+0xa1/0x1e0
    [...]
    do_sys_open+0xf3/0x1f0
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b
    ------------[ cut here ]------------
    WARNING: at fs/sysfs/dir.c:526 sysfs_add_one+0xa5/0xd0()
    sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:03.0/0000:01:00.1/msi_irqs'

    Signed-off-by: Tonghao Zhang
    [bhelgaas: changelog, fix patch whitespace, remove !!]
    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tonghao Zhang
     
  • [ Upstream commit 19c73a691ccf6fb2f12d4e9cf9830023966cec88 ]

    Testcase to reproduce this bug:
    1. mkfs.f2fs /dev/sdd
    2. mount -t f2fs /dev/sdd /mnt/f2fs
    3. touch /mnt/f2fs/file
    4. sync
    5. chattr +A /mnt/f2fs/file
    6. xfs_io -f /mnt/f2fs/file -c "fsync"
    7. godown /mnt/f2fs
    8. umount /mnt/f2fs
    9. mount -t f2fs /dev/sdd /mnt/f2fs
    10. lsattr /mnt/f2fs/file

    -----------------N- /mnt/f2fs/file

    But actually, we expect the corrct result is:

    -------A---------N- /mnt/f2fs/file

    The reason is we didn't recover inode.i_flags field during mount,
    fix it.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Chao Yu
     
  • [ Upstream commit d595567dc4f0c1d90685ec1e2e296e2cad2643ac ]

    If we change the number of array's device after device is removed from array,
    then add the device back to array, we can see that device is added as active
    role instead of spare which we expected.

    Please see the below link for details:
    https://marc.info/?l=linux-raid&m=153736982015076&w=2

    This is caused by that we prefer to use device's previous role which is
    recorded by saved_raid_disk, but we should respect the new number of
    conf->raid_disks since it could be changed after device is removed.

    Reported-by: Gioh Kim
    Tested-by: Gioh Kim
    Acked-by: Guoqing Jiang
    Signed-off-by: Shaohua Li
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Shaohua Li
     
  • [ Upstream commit f18b2b83a727a3db208308057d2c7945f368e625 ]

    If the starting block number of either the source or destination file
    exceeds the EOF, EXT4_IOC_MOVE_EXT should return EINVAL.

    Also fixed the helper function mext_check_coverage() so that if the
    logical block is beyond EOF, make it return immediately, instead of
    looping until the block number wraps all the away around. This takes
    long enough that if there are multiple threads trying to do pound on
    an the same inode doing non-sensical things, it can end up triggering
    the kernel's soft lockup detector.

    Reported-by: syzbot+c61979f6f2cba5cb3c06@syzkaller.appspotmail.com
    Signed-off-by: Theodore Ts'o
    Cc: stable@kernel.org
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Theodore Ts'o
     
  • [ Upstream commit bb80e4fa57eb75ebd64ae9be4155da6d12c1a997 ]

    The at91sam9rl PMC is not quite the same as the at91sam9g45 one and now has
    its own compatible string. Add support for that.

    Fixes: 217bace8e548 ("ARM: dts: fix PMC compatible")
    Acked-by: Cristian Birsan
    Signed-off-by: Alexandre Belloni
    Signed-off-by: Felipe Balbi
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Alexandre Belloni
     
  • [ Upstream commit 6299cf9ec3985cac70bede8a855b5087b81a6640 ]

    We enable power management automatically for bridges where
    pci_bridge_d3_possible() returns true. However, these bridges may have
    ACPI methods such as _DSW that need to be called before D3 entry. For
    example in Lenovo Thinkpad X1 Carbon 6th _DSW method is used to prepare
    D3cold for the PCIe root port hosting Thunderbolt chain. Because wake is
    not enabled _DSW method is never called and the port does not enter
    D3cold properly consuming more power than necessary.

    Users can work this around by writing "enabled" to "wakeup" sysfs file
    under the device in question but that is not something an ordinary user
    is expected to do.

    Since we already automatically enable power management for PCIe ports
    with ->bridge_d3 set extend that to enable wake for them as well,
    assuming the port has any ACPI wakeup related objects implemented in the
    namespace (adev->wakeup.flags.valid is true). This ensures the necessary
    ACPI methods get called at appropriate times and allows the root port in
    Thinkpad X1 Carbon 6th to go into D3cold.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     
  • [ Upstream commit 11924ba5e671d6caef1516923e2bd8c72929a3fe ]

    When adding a VMCI resource, the check for an existing entry
    would ignore that the new entry could be a wildcard. This could
    result in multiple resource entries that would match a given
    handle. One disastrous outcome of this is that the
    refcounting used to ensure that delayed callbacks for VMCI
    datagrams have run before the datagram is destroyed can be
    wrong, since the refcount could be increased on the duplicate
    entry. This in turn leads to a use after free bug. This issue
    was discovered by Hangbin Liu using KASAN and syzkaller.

    Fixes: bc63dedb7d46 ("VMCI: resource object implementation")
    Reported-by: Hangbin Liu
    Reviewed-by: Adit Ranadive
    Reviewed-by: Vishnu Dasa
    Signed-off-by: Jorgen Hansen
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jorgen Hansen
     
  • [ Upstream commit 25355252607ca288f329ee033f387764883393f6 ]

    A cpumask structure on the stack can cause a warning with
    CONFIG_NR_CPUS=8192 (e.g. Ubuntu 16.04 and 18.04 use this):

    drivers/hv//channel_mgmt.c: In function ‘init_vp_index’:
    drivers/hv//channel_mgmt.c:702:1: warning: the frame size of 1032 bytes
    is larger than 1024 bytes [-Wframe-larger-than=]

    Nowadays it looks most distros enable CONFIG_CPUMASK_OFFSTACK=y, and
    hence we can work around the warning by using cpumask_var_t.

    Signed-off-by: Dexuan Cui
    Cc: K. Y. Srinivasan
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc:
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • [ Upstream commit 0d6d0d62d9505a9816716aa484ebd0b04c795063 ]

    For TPM 1.2 chips the system setup utility allows to set the TPM device in
    one of the following states:

    * Active: Security chip is functional
    * Inactive: Security chip is visible, but is not functional
    * Disabled: Security chip is hidden and is not functional

    When choosing the "Inactive" state, the TPM 1.2 device is enumerated and
    registered, but sending TPM commands fail with either TPM_DEACTIVATED or
    TPM_DISABLED depending if the firmware deactivated or disabled the TPM.

    Since these TPM 1.2 error codes don't have special treatment, inactivating
    the TPM leads to a very noisy kernel log buffer that shows messages like
    the following:

    tpm_tis 00:05: 1.2 TPM (device-id 0x0, rev-id 78)
    tpm tpm0: A TPM error (6) occurred attempting to read a pcr value
    tpm tpm0: TPM is disabled/deactivated (0x6)
    tpm tpm0: A TPM error (6) occurred attempting get random
    tpm tpm0: A TPM error (6) occurred attempting to read a pcr value
    ima: No TPM chip found, activating TPM-bypass! (rc=6)
    tpm tpm0: A TPM error (6) occurred attempting get random
    tpm tpm0: A TPM error (6) occurred attempting get random
    tpm tpm0: A TPM error (6) occurred attempting get random
    tpm tpm0: A TPM error (6) occurred attempting get random

    Let's just suppress error log messages for the TPM_{DEACTIVATED,DISABLED}
    return codes, since this is expected when the TPM 1.2 is set to Inactive.

    In that case the kernel log is cleaner and less confusing for users, i.e:

    tpm_tis 00:05: 1.2 TPM (device-id 0x0, rev-id 78)
    tpm tpm0: TPM is disabled/deactivated (0x6)
    ima: No TPM chip found, activating TPM-bypass! (rc=6)

    Reported-by: Hans de Goede
    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • [ Upstream commit 074d6f32689ce05a084b6fa3db38445745bf11cc ]

    The Mediatek's host controller has two slots, each with its own control
    registers. The host driver needs to identify what slot is connected to
    what port in order to access the device's configuration space.

    Current code retrieving slot connected to a given endpoint device.

    Assuming each slot is connected to one endpoint device as below:

    host bridge
    bus 0 --> __________|_______
    | |
    | |
    slot 0 slot 1
    bus 1 -->| bus 2 --> |
    | |
    EP 0 EP 1

    During PCI enumeration, system software will scan all the PCI devices on
    every bus starting from devfn 0. Using PCI_SLOT(devfn) for matching an
    endpoint to its slot is erroneous in that the devfn does not contain the
    hierarchical bus numbering in it. In order to match an endpoint with its
    slot (and related port), the PCI tree must be walked up to the root bus
    (where the root ports are situated) and then the PCI_SLOT(devfn)
    matching logic can be correctly applied for matching.

    This patch fixes the mtk_pcie_find_port() slot matching logic by adding
    appropriate PCI tree walking code to retrieve the slot/port a given
    endpoint is connected to.

    Signed-off-by: Honghui Zhang
    [lorenzo.pieralisi@arm.com: rewrote the commit log]
    Signed-off-by: Lorenzo Pieralisi
    Acked-by: Ryder Lee
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Honghui Zhang
     
  • [ Upstream commit 325b9313ec3be56c8e2fe03f977fee19cec75820 ]

    atmel,oc-gpio is optional. Request its irq only when atmel,oc is set
    in device tree.

    devm_gpiod_get_index_optional returns NULL if -ENOENT. Check its
    return value for NULL before error, because it is more probable that
    atmel,oc is not set.

    This fixes the following errors on boards where atmel,oc is not set in
    device tree:
    [ 0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ
    [ 0.960000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ
    [ 0.970000] at91_ohci 500000.ohci: failed to request gpio "overcurrent" IRQ

    Signed-off-by: Tudor Ambarus
    Acked-by: Nicolas Ferre
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tudor.Ambarus@microchip.com
     
  • [ Upstream commit d455f29f6d76a5f94881ca1289aaa1e90617ff5d ]

    Fix possible recursive lock warning. Its a false warning as the locks are
    part of two differnt HW Queue data structure - cmdq and creq. Debug kernel
    is throwing the following warning and stack trace.

    [ 783.914967] ============================================
    [ 783.914970] WARNING: possible recursive locking detected
    [ 783.914973] 4.19.0-rc2+ #33 Not tainted
    [ 783.914976] --------------------------------------------
    [ 783.914979] swapper/2/0 is trying to acquire lock:
    [ 783.914982] 000000002aa3949d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
    [ 783.914999]
    but task is already holding lock:
    [ 783.915002] 00000000be73920d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x2a/0x350 [bnxt_re]
    [ 783.915013]
    other info that might help us debug this:
    [ 783.915016] Possible unsafe locking scenario:

    [ 783.915019] CPU0
    [ 783.915021] ----
    [ 783.915034] lock(&(&hwq->lock)->rlock);
    [ 783.915035] lock(&(&hwq->lock)->rlock);
    [ 783.915037]
    *** DEADLOCK ***

    [ 783.915038] May be due to missing lock nesting notation

    [ 783.915039] 1 lock held by swapper/2/0:
    [ 783.915040] #0: 00000000be73920d (&(&hwq->lock)->rlock){..-.}, at: bnxt_qplib_service_creq+0x2a/0x350 [bnxt_re]
    [ 783.915044]
    stack backtrace:
    [ 783.915046] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.19.0-rc2+ #33
    [ 783.915047] Hardware name: Dell Inc. PowerEdge R730/0599V5, BIOS 1.0.4 08/28/2014
    [ 783.915048] Call Trace:
    [ 783.915049]
    [ 783.915054] dump_stack+0x90/0xe3
    [ 783.915058] __lock_acquire+0x106c/0x1080
    [ 783.915061] ? sched_clock+0x5/0x10
    [ 783.915063] lock_acquire+0xbd/0x1a0
    [ 783.915065] ? bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
    [ 783.915069] _raw_spin_lock_irqsave+0x4a/0x90
    [ 783.915071] ? bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
    [ 783.915073] bnxt_qplib_service_creq+0x232/0x350 [bnxt_re]
    [ 783.915078] tasklet_action_common.isra.17+0x197/0x1b0
    [ 783.915081] __do_softirq+0xcb/0x3a6
    [ 783.915084] irq_exit+0xe9/0x100
    [ 783.915085] do_IRQ+0x6a/0x120
    [ 783.915087] common_interrupt+0xf/0xf
    [ 783.915088]

    Use nested notation for the spin_lock to avoid this warning.

    Signed-off-by: Selvin Xavier
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Selvin Xavier
     
  • [ Upstream commit 4d6e4d12da2c308f8f976d3955c45ee62539ac98 ]

    IPCB should be cleared before icmp_send, since it may contain data from
    previous layers and the data could be misinterpreted as ip header options,
    which later caused the ihl to be set to an invalid value and resulted in
    the following stack corruption:

    [ 1083.031512] ib0: packet len 57824 (> 2048) too long to send, dropping
    [ 1083.031843] ib0: packet len 37904 (> 2048) too long to send, dropping
    [ 1083.032004] ib0: packet len 4040 (> 2048) too long to send, dropping
    [ 1083.032253] ib0: packet len 63800 (> 2048) too long to send, dropping
    [ 1083.032481] ib0: packet len 23960 (> 2048) too long to send, dropping
    [ 1083.033149] ib0: packet len 63800 (> 2048) too long to send, dropping
    [ 1083.033439] ib0: packet len 63800 (> 2048) too long to send, dropping
    [ 1083.033700] ib0: packet len 63800 (> 2048) too long to send, dropping
    [ 1083.034124] ib0: packet len 63800 (> 2048) too long to send, dropping
    [ 1083.034387] ==================================================================
    [ 1083.034602] BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0xf08/0x1310
    [ 1083.034798] Write of size 4 at addr ffff880353457c5f by task kworker/u16:0/7
    [ 1083.034990]
    [ 1083.035104] CPU: 7 PID: 7 Comm: kworker/u16:0 Tainted: G O 4.19.0-rc5+ #1
    [ 1083.035316] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu2 04/01/2014
    [ 1083.035573] Workqueue: ipoib_wq ipoib_cm_skb_reap [ib_ipoib]
    [ 1083.035750] Call Trace:
    [ 1083.035888] dump_stack+0x9a/0xeb
    [ 1083.036031] print_address_description+0xe3/0x2e0
    [ 1083.036213] kasan_report+0x18a/0x2e0
    [ 1083.036356] ? __ip_options_echo+0xf08/0x1310
    [ 1083.036522] __ip_options_echo+0xf08/0x1310
    [ 1083.036688] icmp_send+0x7b9/0x1cd0
    [ 1083.036843] ? icmp_route_lookup.constprop.9+0x1070/0x1070
    [ 1083.037018] ? netif_schedule_queue+0x5/0x200
    [ 1083.037180] ? debug_show_all_locks+0x310/0x310
    [ 1083.037341] ? rcu_dynticks_curr_cpu_in_eqs+0x85/0x120
    [ 1083.037519] ? debug_locks_off+0x11/0x80
    [ 1083.037673] ? debug_check_no_obj_freed+0x207/0x4c6
    [ 1083.037841] ? check_flags.part.27+0x450/0x450
    [ 1083.037995] ? debug_check_no_obj_freed+0xc3/0x4c6
    [ 1083.038169] ? debug_locks_off+0x11/0x80
    [ 1083.038318] ? skb_dequeue+0x10e/0x1a0
    [ 1083.038476] ? ipoib_cm_skb_reap+0x2b5/0x650 [ib_ipoib]
    [ 1083.038642] ? netif_schedule_queue+0xa8/0x200
    [ 1083.038820] ? ipoib_cm_skb_reap+0x544/0x650 [ib_ipoib]
    [ 1083.038996] ipoib_cm_skb_reap+0x544/0x650 [ib_ipoib]
    [ 1083.039174] process_one_work+0x912/0x1830
    [ 1083.039336] ? wq_pool_ids_show+0x310/0x310
    [ 1083.039491] ? lock_acquire+0x145/0x3a0
    [ 1083.042312] worker_thread+0x87/0xbb0
    [ 1083.045099] ? process_one_work+0x1830/0x1830
    [ 1083.047865] kthread+0x322/0x3e0
    [ 1083.050624] ? kthread_create_worker_on_cpu+0xc0/0xc0
    [ 1083.053354] ret_from_fork+0x3a/0x50

    For instance __ip_options_echo is failing to proceed with invalid srr and
    optlen passed from another layer via IPCB

    [ 762.139568] IPv4: __ip_options_echo rr=0 ts=0 srr=43 cipso=0
    [ 762.139720] IPv4: ip_options_build: IPCB 00000000f3cd969e opt 000000002ccb3533
    [ 762.139838] IPv4: __ip_options_echo in srr: optlen 197 soffset 84
    [ 762.139852] IPv4: ip_options_build srr=0 is_frag=0 rr_needaddr=0 ts_needaddr=0 ts_needtime=0 rr=0 ts=0
    [ 762.140269] ==================================================================
    [ 762.140713] IPv4: __ip_options_echo rr=0 ts=0 srr=0 cipso=0
    [ 762.141078] BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0x12ec/0x1680
    [ 762.141087] Write of size 4 at addr ffff880353457c7f by task kworker/u16:0/7

    Signed-off-by: Denis Drozdov
    Reviewed-by: Erez Shitrit
    Reviewed-by: Feras Daoud
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Denis Drozdov
     
  • [ Upstream commit 0f6ef65d1c6ec8deb5d0f11f86631ec4cfe8f22e ]

    If the provider driver (such as rdma_rxe) doesn't support pma counters,
    avoid exposing its directory similar to optional hw_counters directory.
    If core fails to read the PMA counter, return an error so that user can
    retry later if needed.

    Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c")
    Reported-by: Holger Hoffstätte
    Tested-by: Holger Hoffstätte
    Signed-off-by: Parav Pandit
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Parav Pandit
     
  • [ Upstream commit 47db7873136a9c57c45390a53b57019cf73c8259 ]

    In megasas_mgmt_compat_ioctl_fw(), to handle the structure
    compat_megasas_iocpacket 'cioc', a user-space structure megasas_iocpacket
    'ioc' is allocated before megasas_mgmt_ioctl_fw() is invoked to handle
    the packet. Since the two data structures have different fields, the data
    is copied from 'cioc' to 'ioc' field by field. In the copy process,
    'sense_ptr' is prepared if the field 'sense_len' is not null, because it
    will be used in megasas_mgmt_ioctl_fw(). To prepare 'sense_ptr', the
    user-space data 'ioc->sense_off' and 'cioc->sense_off' are copied and
    saved to kernel-space variables 'local_sense_off' and 'user_sense_off'
    respectively. Given that 'ioc->sense_off' is also copied from
    'cioc->sense_off', 'local_sense_off' and 'user_sense_off' should have the
    same value. However, 'cioc' is in the user space and a malicious user can
    race to change the value of 'cioc->sense_off' after it is copied to
    'ioc->sense_off' but before it is copied to 'user_sense_off'. By doing
    so, the attacker can inject different values into 'local_sense_off' and
    'user_sense_off'. This can cause undefined behavior in the following
    execution, because the two variables are supposed to be same.

    This patch enforces a check on the two kernel variables 'local_sense_off'
    and 'user_sense_off' to make sure they are the same after the copy. In
    case they are not, an error code EINVAL will be returned.

    Signed-off-by: Wenwen Wang
    Acked-by: Sumit Saxena
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Wenwen Wang
     
  • [ Upstream commit cfb634fe3052aefc4e1360fa322018c9a0b49755 ]

    According to volume 3 of the SDM, bits 63:15 and 12:4 of the exit
    qualification field for debug exceptions are reserved (cleared to
    0). However, the SDM is incorrect about bit 16 (corresponding to
    DR6.RTM). This bit should be set if a debug exception (#DB) or a
    breakpoint exception (#BP) occurred inside an RTM region while
    advanced debugging of RTM transactional regions was enabled. Note that
    this is the opposite of DR6.RTM, which "indicates (when clear) that a
    debug exception (#DB) or breakpoint exception (#BP) occurred inside an
    RTM region while advanced debugging of RTM transactional regions was
    enabled."

    There is still an issue with stale DR6 bits potentially being
    misreported for the current debug exception. DR6 should not have been
    modified before vectoring the #DB exception, and the "new DR6 bits"
    should be available somewhere, but it was and they aren't.

    Fixes: b96fb439774e1 ("KVM: nVMX: fixes to nested virt interrupt injection")
    Signed-off-by: Jim Mattson
    Reviewed-by: Sean Christopherson
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jim Mattson
     
  • [ Upstream commit 9607871f37dc3e717639694b8d0dc738f2a68efc ]

    The following code in the linux/ndctl header file:

    static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
    {
    static const char * const names[] = {
    [ND_CMD_ARS_CAP] = "ars_cap",
    [ND_CMD_ARS_START] = "ars_start",
    [ND_CMD_ARS_STATUS] = "ars_status",
    [ND_CMD_CLEAR_ERROR] = "clear_error",
    [ND_CMD_CALL] = "cmd_call",
    };

    if (cmd < ARRAY_SIZE(names) && names[cmd])
    return names[cmd];
    return "unknown";
    }

    is broken in a number of ways:

    (1) ARRAY_SIZE() is not generally defined.

    (2) g++ does not support "non-trivial" array initialisers fully yet.

    (3) Every file that calls this function will acquire a copy of names[].

    The same goes for nvdimm_cmd_name().

    Fix all three by converting to a switch statement where each case returns a
    string. That way if cmd is a constant, the compiler can trivially reduce it
    and, if not, the compiler can use a shared lookup table if it thinks that is
    more efficient.

    A better way would be to remove these functions and their arrays from the
    header entirely.

    Signed-off-by: David Howells
    Signed-off-by: Dan Williams
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     
  • [ Upstream commit fd47d919d0c336e7c22862b51ee94927ffea227a ]

    If a target disconnects during a PIO data transfer the command may fail
    when the target reconnects:

    scsi host1: DMA length is zero!
    scsi host1: cur adr[04380000] len[00000000]

    The scsi bus is then reset. This happens because the residual reached
    zero before the transfer was completed.

    The usual residual calculation relies on the Transfer Count registers.
    That works for DMA transfers but not for PIO transfers. Fix the problem
    by storing the PIO transfer residual and using that to correctly
    calculate bytes_sent.

    Fixes: 6fe07aaffbf0 ("[SCSI] m68k: new mac_esp scsi driver")
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Tested-by: Michael Schmitz
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     
  • [ Upstream commit a90e90b7d55e789c71d85b946ffb5c1ab2f137ca ]

    We have seen a customer complaining about soft lockups on !PREEMPT
    kernel config with 4.4 based kernel

    [1072141.435366] NMI watchdog: BUG: soft lockup - CPU#21 stuck for 22s! [systemd:1]
    [1072141.444090] Modules linked in: mpt3sas raid_class binfmt_misc af_packet 8021q garp mrp stp llc xfs libcrc32c bonding iscsi_ibft iscsi_boot_sysfs msr ext4 crc16 jbd2 mbcache cdc_ether usbnet mii joydev hid_generic usbhid intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel ipmi_ssif mgag200 i2c_algo_bit ttm ipmi_devintf drbg ixgbe drm_kms_helper vxlan ansi_cprng ip6_udp_tunnel drm aesni_intel udp_tunnel aes_x86_64 iTCO_wdt syscopyarea ptp xhci_pci lrw iTCO_vendor_support pps_core gf128mul ehci_pci glue_helper sysfillrect mdio pcspkr sb_edac ablk_helper cryptd ehci_hcd sysimgblt xhci_hcd fb_sys_fops edac_core mei_me lpc_ich ses usbcore enclosure dca mfd_core ipmi_si mei i2c_i801 scsi_transport_sas usb_common ipmi_msghandler shpchp fjes wmi processor button acpi_pad btrfs xor raid6_pq sd_mod crc32c_intel megaraid_sas sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua scsi_mod md_mod autofs4
    [1072141.444146] Supported: Yes
    [1072141.444149] CPU: 21 PID: 1 Comm: systemd Not tainted 4.4.121-92.80-default #1
    [1072141.444150] Hardware name: LENOVO Lenovo System x3650 M5 -[5462P4U]- -[5462P4U]-/01GR451, BIOS -[TCE136H-2.70]- 06/13/2018
    [1072141.444151] task: ffff880191bd0040 ti: ffff880191bd4000 task.ti: ffff880191bd4000
    [1072141.444153] RIP: 0010:[] [] update_classid_sock+0x29/0x40
    [1072141.444157] RSP: 0018:ffff880191bd7d58 EFLAGS: 00000286
    [1072141.444158] RAX: ffff883b177cb7c0 RBX: 0000000000000000 RCX: 0000000000000000
    [1072141.444159] RDX: 00000000000009c7 RSI: ffff880191bd7d5c RDI: ffff8822e29bb200
    [1072141.444160] RBP: ffff883a72230980 R08: 0000000000000101 R09: 0000000000000000
    [1072141.444161] R10: 0000000000000008 R11: f000000000000000 R12: ffffffff815229d0
    [1072141.444162] R13: 0000000000000000 R14: ffff881fd0a47ac0 R15: ffff880191bd7f28
    [1072141.444163] FS: 00007f3e2f1eb8c0(0000) GS:ffff882000340000(0000) knlGS:0000000000000000
    [1072141.444164] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [1072141.444165] CR2: 00007f3e2f200000 CR3: 0000001ffea4e000 CR4: 00000000001606f0
    [1072141.444166] Stack:
    [1072141.444166] ffffffa800000246 00000000000009c7 ffffffff8121d583 ffff8818312a05c0
    [1072141.444168] ffff8818312a1100 ffff880197c3b280 ffff881861422858 ffffffffffffffea
    [1072141.444170] ffffffff81522b1c ffffffff81d0ca20 ffff8817fa17b950 ffff883fdd8121e0
    [1072141.444171] Call Trace:
    [1072141.444179] [] iterate_fd+0x53/0x80
    [1072141.444182] [] write_classid+0x4c/0x80
    [1072141.444187] [] cgroup_file_write+0x9b/0x100
    [1072141.444193] [] kernfs_fop_write+0x11b/0x150
    [1072141.444198] [] __vfs_write+0x26/0x100
    [1072141.444201] [] vfs_write+0x9d/0x190
    [1072141.444203] [] SyS_write+0x42/0xa0
    [1072141.444207] [] entry_SYSCALL_64_fastpath+0x1e/0xca
    [1072141.445490] DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x1e/0xca

    If a cgroup has many tasks with many open file descriptors then we would
    end up in a large loop without any rescheduling point throught the
    operation. Add cond_resched once per task.

    Signed-off-by: Michal Hocko
    Signed-off-by: Tejun Heo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Michal Hocko
     
  • [ Upstream commit 760eea43f8c6d48684f1f34b8a02fddc1456e849 ]

    The workqueue used for monitoring the hardware may run while the device
    is already suspended. Fix this by using the freezable system workqueue
    instead, cfr. commit 51e20d0e3a60cf46 ("thermal: Prevent polling from
    happening during system suspend").

    Fixes: 608567aac3206ae8 ("thermal: da9062/61: Thermal junction temperature monitoring driver")
    Signed-off-by: Geert Uytterhoeven
    Acked-by: Steve Twiss
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • [ Upstream commit a9911937e7d332761e8c4fcbc7ba0426bdc3956f ]

    When running in AP mode, ath10k sometimes suffers from TX credit
    starvation. The issue is hard to reproduce and shows up once in a
    few days, but has been repeatedly seen with QCA9882 and a large
    range of firmwares, including 10.2.4.70.67.

    Once the module is in this state, TX credits are never replenished,
    which results in "SWBA overrun" errors, as no beacons can be sent.
    Even worse, WMI commands run in a timeout while holding the conf
    mutex for three seconds each, making any further operations slow
    and the whole system unresponsive.

    The firmware/driver never recovers from that state automatically,
    and triggering TX flush or warm restarts won't work over WMI. So
    issue a hardware restart if a WMI command times out due to missing
    TX credits. This implies a connectivity outage of about 1.4s in AP
    mode, but brings back the interface and the whole system to a usable
    state. WMI command timeouts have not been seen in absent of this
    specific issue, so taking such drastic actions seems legitimate.

    Signed-off-by: Martin Willi
    Signed-off-by: Kalle Valo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Martin Willi
     
  • [ Upstream commit 7fb94bd58dd6650a0158e68d414e185077d8b57a ]

    While VF2VF with RSS communication, RSS Type were wrongly recognized
    and RSS hash was not calculated as it should be. Packets was
    distributed on various queues by accident.
    This commit fixes that behaviour and causes proper RSS Type recognition.

    Signed-off-by: Sebastian Basierski
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sebastian Basierski
     
  • [ Upstream commit 941ab4eb66c10bc5c7234e83a7a858b2806ed151 ]

    There is a bug in FW where the sequence control may be
    incorrect, and the driver overrides it with the value
    of the ieee80211 header.

    However, in BAR there is no sequence control in the header,
    which result with arbitrary sequence.

    This access to an unknown location is bad and it makes the
    logs very confusing - so fix it.

    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sara Sharon
     
  • [ Upstream commit c309b158090d788e96ee597444965cb79b040484 ]

    After changing to the needed page, actually write the value to the
    register!

    Fixes: 09cb7dfd3f14 ("net: dsa: mv88e6xxx: describe PHY page and SerDes")
    Signed-off-by: Andrew Lunn
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andrew Lunn
     
  • [ Upstream commit b432414b996d32a1bd9afe2bd595bd5729c1477f ]

    If you look at "pinconf-groups" in debugfs for ssbi-gpio you'll notice
    it looks like nonsense.

    The problem is fairly well described in commit 1cf86bc21257 ("pinctrl:
    qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant") and
    commit 05e0c828955c ("pinctrl: msm: Fix msm_config_group_get() to be
    compliant"), but it was pointed out that ssbi-gpio has the same
    problem. Let's fix it there too.

    Fixes: b4c45fe974bc ("pinctrl: qcom: ssbi: Family A gpio & mpp drivers")
    Signed-off-by: Douglas Anderson
    Reviewed-by: Stephen Boyd
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Douglas Anderson