1. 13 Nov, 2018 40 commits
    • Javier Martinez Canillas's avatar
      tpm: suppress transmit cmd error logs when TPM 1.2 is disabled/deactivated · 6057caad
      Javier Martinez Canillas authored
      [ Upstream commit 0d6d0d62 ]
      
      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: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6057caad
    • Honghui Zhang's avatar
      PCI: mediatek: Fix mtk_pcie_find_port() endpoint/port matching logic · 38ee346a
      Honghui Zhang authored
      [ Upstream commit 074d6f32 ]
      
      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: default avatarHonghui Zhang <honghui.zhang@mediatek.com>
      [lorenzo.pieralisi@arm.com: rewrote the commit log]
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarRyder Lee <ryder.lee@mediatek.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38ee346a
    • Tudor.Ambarus@microchip.com's avatar
      usb: host: ohci-at91: fix request of irq for optional gpio · 07335466
      Tudor.Ambarus@microchip.com authored
      [ Upstream commit 325b9313 ]
      
      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: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      07335466
    • Selvin Xavier's avatar
      RDMA/bnxt_re: Fix recursive lock warning in debug kernel · 88018bc0
      Selvin Xavier authored
      [ Upstream commit d455f29f ]
      
      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]  <IRQ>
      [  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]  </IRQ>
      
      Use nested notation for the spin_lock to avoid this warning.
      Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      88018bc0
    • Denis Drozdov's avatar
      IB/ipoib: Clear IPCB before icmp_send · b0203472
      Denis Drozdov authored
      [ Upstream commit 4d6e4d12 ]
      
      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: default avatarDenis Drozdov <denisd@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Reviewed-by: default avatarFeras Daoud <ferasda@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b0203472
    • Parav Pandit's avatar
      RDMA/core: Do not expose unsupported counters · 670ebdf0
      Parav Pandit authored
      [ Upstream commit 0f6ef65d ]
      
      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: 35c4cbb1 ("IB/core: Create get_perf_mad function in sysfs.c")
      Reported-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
      Tested-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      670ebdf0
    • Wenwen Wang's avatar
      scsi: megaraid_sas: fix a missing-check bug · 4877db2e
      Wenwen Wang authored
      [ Upstream commit 47db7873 ]
      
      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: default avatarWenwen Wang <wang6495@umn.edu>
      Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4877db2e
    • Jim Mattson's avatar
      KVM: nVMX: Clear reserved bits of #DB exit qualification · 7d6c6f83
      Jim Mattson authored
      [ Upstream commit cfb634fe ]
      
      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: b96fb439 ("KVM: nVMX: fixes to nested virt interrupt injection")
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Reviewed-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7d6c6f83
    • David Howells's avatar
      UAPI: ndctl: Fix g++-unsupported initialisation in headers · be5658a1
      David Howells authored
      [ Upstream commit 9607871f ]
      
      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: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be5658a1
    • Finn Thain's avatar
      scsi: esp_scsi: Track residual for PIO transfers · 94dc21c6
      Finn Thain authored
      [ Upstream commit fd47d919 ]
      
      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: 6fe07aaf ("[SCSI] m68k: new mac_esp scsi driver")
      Tested-by: default avatarStan Johnson <userm57@yahoo.com>
      Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
      Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94dc21c6
    • Michal Hocko's avatar
      cgroup, netclassid: add a preemption point to write_classid · 09d43edc
      Michal Hocko authored
      [ Upstream commit a90e90b7 ]
      
      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:[<ffffffff815229f9>]  [<ffffffff815229f9>] 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]  [<ffffffff8121d583>] iterate_fd+0x53/0x80
      [1072141.444182]  [<ffffffff81522b1c>] write_classid+0x4c/0x80
      [1072141.444187]  [<ffffffff8111328b>] cgroup_file_write+0x9b/0x100
      [1072141.444193]  [<ffffffff81278bcb>] kernfs_fop_write+0x11b/0x150
      [1072141.444198]  [<ffffffff81201566>] __vfs_write+0x26/0x100
      [1072141.444201]  [<ffffffff81201bed>] vfs_write+0x9d/0x190
      [1072141.444203]  [<ffffffff812028c2>] SyS_write+0x42/0xa0
      [1072141.444207]  [<ffffffff815f58c3>] 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: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      09d43edc
    • Geert Uytterhoeven's avatar
      thermal: da9062/61: Prevent hardware access during system suspend · 0a76f5c5
      Geert Uytterhoeven authored
      [ Upstream commit 760eea43 ]
      
      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 51e20d0e ("thermal: Prevent polling from
      happening during system suspend").
      
      Fixes: 608567aa ("thermal: da9062/61: Thermal junction temperature monitoring driver")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarSteve Twiss <stwiss.opensource@diasemi.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0a76f5c5
    • Martin Willi's avatar
      ath10k: schedule hardware restart if WMI command times out · ef5d27e1
      Martin Willi authored
      [ Upstream commit a9911937 ]
      
      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: default avatarMartin Willi <martin@strongswan.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef5d27e1
    • Sebastian Basierski's avatar
      ixgbevf: VF2VF TCP RSS · ca18ed44
      Sebastian Basierski authored
      [ Upstream commit 7fb94bd5 ]
      
      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: default avatarSebastian Basierski <sebastianx.basierski@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca18ed44
    • Sara Sharon's avatar
      iwlwifi: mvm: fix BAR seq ctrl reporting · 8692ff19
      Sara Sharon authored
      [ Upstream commit 941ab4eb ]
      
      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: default avatarSara Sharon <sara.sharon@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8692ff19
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Fix writing to a PHY page. · 189f9829
      Andrew Lunn authored
      [ Upstream commit c309b158 ]
      
      After changing to the needed page, actually write the value to the
      register!
      
      Fixes: 09cb7dfd ("net: dsa: mv88e6xxx: describe PHY page and SerDes")
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      189f9829
    • Douglas Anderson's avatar
      pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant · b7111ec0
      Douglas Anderson authored
      [ Upstream commit b432414b ]
      
      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 1cf86bc2 ("pinctrl:
      qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant") and
      commit 05e0c828 ("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: b4c45fe9 ("pinctrl: qcom: ssbi: Family A gpio & mpp drivers")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarStephen Boyd <sboyd@kernel.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7111ec0
    • Douglas Anderson's avatar
      pinctrl: spmi-mpp: Fix pmic_mpp_config_get() to be compliant · 49d44c0a
      Douglas Anderson authored
      [ Upstream commit 0d5b476f ]
      
      If you look at "pinconf-groups" in debugfs for ssbi-mpp you'll notice
      it looks like nonsense.
      
      The problem is fairly well described in commit 1cf86bc2 ("pinctrl:
      qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant") and
      commit 05e0c828 ("pinctrl: msm: Fix msm_config_group_get() to be
      compliant"), but it was pointed out that ssbi-mpp has the same
      problem.  Let's fix it there too.
      
      NOTE: in case it's helpful to someone reading this, the way to tell
      whether to do the -EINVAL or not is to look at the PCONFDUMP for a
      given attribute.  If the last element (has_arg) is false then you need
      to do the -EINVAL trick.
      
      ALSO NOTE: it seems unlikely that the values returned when we try to
      get PIN_CONFIG_BIAS_PULL_UP will actually be printed since "has_arg"
      is false for that one, but I guess it's still fine to return different
      values so I kept doing that.  It seems like another driver (ssbi-gpio)
      uses a custom attribute (PM8XXX_QCOM_PULL_UP_STRENGTH) for something
      similar so maybe a future change should do that here too.
      
      Fixes: cfb24f6e ("pinctrl: Qualcomm SPMI PMIC MPP pin controller driver")
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarStephen Boyd <sboyd@kernel.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      49d44c0a
    • Stephen Boyd's avatar
      pinctrl: qcom: spmi-mpp: Fix drive strength setting · 6b196dd5
      Stephen Boyd authored
      [ Upstream commit 89c68b10 ]
      
      It looks like we parse the drive strength setting here, but never
      actually write it into the hardware to update it. Parse the setting and
      then write it at the end of the pinconf setting function so that it
      actually sticks in the hardware.
      
      Fixes: 0e948042 ("pinctrl: qcom: spmi-mpp: Implement support for sink mode")
      Cc: Doug Anderson <dianders@chromium.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b196dd5
    • Hans de Goede's avatar
      ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers · 2a9dc99f
      Hans de Goede authored
      [ Upstream commit 24071406 ]
      
      Bay and Cherry Trail DSTDs represent a different set of devices depending
      on which OS the device think it is booting. One set of decices for Windows
      and another set of devices for Android which targets the Android-x86 Linux
      kernel fork (which e.g. used to have its own display driver instead of
      using the i915 driver).
      
      Which set of devices we are actually going to get is out of our control,
      this is controlled by the ACPI OSID variable, which gets either set through
      an EFI setup option, or sometimes is autodetected. So we need to support
      both.
      
      This commit adds support for the 80862286 and 808622C0 ACPI HIDs which we
      get for the first resp. second DMA controller on Cherry Trail devices when
      OSID is set to Android.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a9dc99f
    • Masami Hiramatsu's avatar
      kprobes: Return error if we fail to reuse kprobe instead of BUG_ON() · 0e0b860f
      Masami Hiramatsu authored
      [ Upstream commit 819319fc ]
      
      Make reuse_unused_kprobe() to return error code if
      it fails to reuse unused kprobe for optprobe instead
      of calling BUG_ON().
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S . Miller <davem@davemloft.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Naveen N . Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/153666124040.21306.14150398706331307654.stgit@devboxSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e0b860f
    • Paolo Valente's avatar
      block, bfq: correctly charge and reset entity service in all cases · d4d73f1f
      Paolo Valente authored
      [ Upstream commit cbeb869a ]
      
      BFQ schedules entities (which represent either per-process queues or
      groups of queues) as a function of their timestamps. In particular, as
      a function of their (virtual) finish times. The finish time of an
      entity is computed as a function of the budget assigned to the entity,
      assuming, tentatively, that the entity, once in service, will receive
      an amount of service equal to its budget. Then, when the entity is
      expired because it finishes to be served, this finish time is updated
      as a function of the actual service received by the entity. This
      allows the entity to be correctly charged with only the service
      received, and then to be correctly re-scheduled.
      
      Yet an entity may receive service also while not being the entity in
      service (in the scheduling environment of its parent entity), for
      several reasons. If the entity remains with no backlog while receiving
      this 'unofficial' service, then it is expired. Also on such an
      expiration, the finish time of the entity should be updated to account
      for only the service actually received by the entity. Unfortunately,
      such an update is not performed for an entity expiring without being
      the entity in service.
      
      In a similar vein, the service counter of the entity in service is
      reset when the entity is expired, to be ready to be used for next
      service cycle. This reset too should be performed also in case an
      entity is expired because it remains empty after receiving service
      while not being the entity in service. But in this case the reset is
      not performed.
      
      This commit performs the above update of the finish time and reset of
      the service received, also for an entity expiring while not being the
      entity in service.
      Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d4d73f1f
    • Antoine Tenart's avatar
      net: phy: phylink: ensure the carrier is off when starting phylink · 4c2f34ab
      Antoine Tenart authored
      [ Upstream commit aeeb2e8f ]
      
      Phylink made an assumption about the carrier state being down when
      calling phylink_start(). If this assumption isn't satisfied, the
      internal phylink state could misbehave and a net device could end up not
      being functional.
      
      This patch fixes this by explicitly calling netif_carrier_off() in
      phylink_start().
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
      Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c2f34ab
    • Arend van Spriel's avatar
      brcmfmac: fix for proper support of 160MHz bandwidth · 4484de12
      Arend van Spriel authored
      [ Upstream commit 330994e8 ]
      
      Decoding of firmware channel information was not complete for 160MHz
      support. This resulted in the following warning:
      
        WARNING: CPU: 2 PID: 2222 at .../broadcom/brcm80211/brcmutil/d11.c:196
      	brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil]
        Modules linked in: brcmfmac(O) brcmutil(O) sha256_generic cfg80211 ...
        CPU: 2 PID: 2222 Comm: kworker/2:0 Tainted: G           O
        4.17.0-wt-testing-x64-00002-gf1bed50 #1
        Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011
        Workqueue: events request_firmware_work_func
        RIP: 0010:brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil]
        RSP: 0018:ffffc90000047bd0 EFLAGS: 00010206
        RAX: 000000000000e832 RBX: ffff8801146fe910 RCX: ffff8801146fd3c0
        RDX: 0000000000002800 RSI: 0000000000000070 RDI: ffffc90000047c30
        RBP: ffffc90000047bd0 R08: 0000000000000000 R09: ffffffffa0798c80
        R10: ffff88012bca55e0 R11: ffff880110a4ea00 R12: ffff8801146f8000
        R13: ffffc90000047c30 R14: ffff8801146fe930 R15: ffff8801138e02e0
        FS:  0000000000000000(0000) GS:ffff88012bc80000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f18ce8b8070 CR3: 000000000200a003 CR4: 00000000000206e0
        Call Trace:
         brcmf_setup_wiphybands+0x212/0x780 [brcmfmac]
         brcmf_cfg80211_attach+0xae2/0x11a0 [brcmfmac]
         brcmf_attach+0x1fc/0x4b0 [brcmfmac]
         ? __kmalloc+0x13c/0x1c0
         brcmf_pcie_setup+0x99b/0xe00 [brcmfmac]
         brcmf_fw_request_done+0x16a/0x1f0 [brcmfmac]
         request_firmware_work_func+0x36/0x60
         process_one_work+0x146/0x350
         worker_thread+0x4a/0x3b0
         kthread+0x102/0x140
         ? process_one_work+0x350/0x350
         ? kthread_bind+0x20/0x20
         ret_from_fork+0x35/0x40
        Code: 66 90 0f b7 07 55 48 89 e5 89 c2 88 47 02 88 47 03 66 81 e2 00 38
      	66 81 fa 00 18 74 6e 66 81 fa 00 20 74 39 66 81 fa 00 10 74 14 <0f>
      	0b 66 25 00 c0 74 20 66 3d 00 c0 75 20 c6 47 04 01 5d c3 66
        ---[ end trace 550c46682415b26d ]---
        brcmfmac: brcmf_construct_chaninfo: Ignoring unexpected firmware channel 50
      
      This patch adds the missing stuff to properly handle this.
      Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
      Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
      Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4484de12
    • YueHaibing's avatar
      pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux · 5c27d053
      YueHaibing authored
      [ Upstream commit 69f8455f ]
      
      'ret' should be returned while pmic_mpp_write_mode_ctl fails.
      
      Fixes: 0e948042 ("pinctrl: qcom: spmi-mpp: Implement support for sink mode")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c27d053
    • Ben Hutchings's avatar
      x86: boot: Fix EFI stub alignment · fcc506ca
      Ben Hutchings authored
      [ Upstream commit 9c1442a9 ]
      
      We currently align the end of the compressed image to a multiple of
      16.  However, the PE-COFF header included in the EFI stub says that
      the file alignment is 32 bytes, and when adding an EFI signature to
      the file it must first be padded to this alignment.
      
      sbsigntool commands warn about this:
      
        warning: file-aligned section .text extends beyond end of file
        warning: checksum areas are greater than image size. Invalid section table?
      
      Worse, pesign -at least when creating a detached signature- uses the
      hash of the unpadded file, resulting in an invalid signature if
      padding is required.
      
      Avoid both these problems by increasing alignment to 32 bytes when
      CONFIG_EFI_STUB is enabled.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fcc506ca
    • Christian Hewitt's avatar
      Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth · 71ef2fef
      Christian Hewitt authored
      [ Upstream commit a357ea09 ]
      
      This patch adds the device ID for the AMPAK AP6335 combo module used
      in the 1st generation WeTek Hub Android/LibreELEC HTPC box. The WiFI
      chip identifies itself as BCM4339, while Bluetooth identifies itself
      as BCM4335 (rev C0):
      
      ```
      [    4.864248] Bluetooth: hci0: BCM: chip id 86
      [    4.866388] Bluetooth: hci0: BCM: features 0x2f
      [    4.889317] Bluetooth: hci0: BCM4335C0
      [    4.889332] Bluetooth: hci0: BCM4335C0 (003.001.009) build 0000
      [    9.778383] Bluetooth: hci0: BCM4335C0 (003.001.009) build 0268
      ```
      
      Output from hciconfig:
      
      ```
      hci0:	Type: Primary  Bus: UART
      	BD Address: 43:39:00:00:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
      	UP RUNNING
      	RX bytes:7567 acl:234 sco:0 events:386 errors:0
      	TX bytes:53844 acl:77 sco:0 commands:304 errors:0
      	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
      	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
      	Link policy: RSWITCH SNIFF
      	Link mode: SLAVE ACCEPT
      	Name: 'HUB'
      	Class: 0x0c0000
      	Service Classes: Rendering, Capturing
      	Device Class: Miscellaneous,
      	HCI Version: 4.0 (0x6)  Revision: 0x10c
      	LMP Version: 4.0 (0x6)  Subversion: 0x6109
      	Manufacturer: Broadcom Corporation (15)
      ```
      Signed-off-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71ef2fef
    • Will Deacon's avatar
      signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack · b66d0bb1
      Will Deacon authored
      [ Upstream commit 22839869 ]
      
      The sigaltstack(2) system call fails with -ENOMEM if the new alternative
      signal stack is found to be smaller than SIGMINSTKSZ. On architectures
      such as arm64, where the native value for SIGMINSTKSZ is larger than
      the compat value, this can result in an unexpected error being reported
      to a compat task. See, for example:
      
        https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904385
      
      This patch fixes the problem by extending do_sigaltstack to take the
      minimum signal stack size as an additional parameter, allowing the
      native and compat system call entry code to pass in their respective
      values. COMPAT_SIGMINSTKSZ is just defined as SIGMINSTKSZ if it has not
      been defined by the architecture.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Reported-by: default avatarSteve McIntyre <steve.mcintyre@arm.com>
      Tested-by: default avatarSteve McIntyre <93sam@debian.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b66d0bb1
    • Gustavo A. R. Silva's avatar
      mtd: rawnand: atmel: Fix potential NULL pointer dereference · 2d2b73cf
      Gustavo A. R. Silva authored
      [ Upstream commit fbed2028 ]
      
      There is a potential execution path in which function
      of_find_compatible_node() returns NULL. In such a case,
      we end up having a NULL pointer dereference when accessing
      pointer *nfc_np* in function of_clk_get().
      
      So, we better don't take any chances and fix this by null
      checking pointer *nfc_np* before calling of_clk_get().
      
      Addresses-Coverity-ID: 1473052 ("Dereference null return value")
      Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Acked-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2d2b73cf
    • Viresh Kumar's avatar
      cpufreq: dt: Try freeing static OPPs only if we have added them · bd8dfdcc
      Viresh Kumar authored
      [ Upstream commit 51c99dd2 ]
      
      We can not call dev_pm_opp_of_cpumask_remove_table() freely anymore
      since the latest OPP core updates as that uses reference counting to
      free resources. There are cases where no static OPPs are added (using
      DT) for a platform and trying to remove the OPP table may end up
      decrementing refcount which is already zero and hence generating
      warnings.
      
      Lets track if we were able to add static OPPs or not and then only
      remove the table based on that. Some reshuffling of code is also done to
      do that.
      Reported-by: default avatarNiklas Cassel <niklas.cassel@linaro.org>
      Tested-by: default avatarNiklas Cassel <niklas.cassel@linaro.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd8dfdcc
    • Dou Liyang's avatar
      ACPI / processor: Fix the return value of acpi_processor_ids_walk() · 85e20b47
      Dou Liyang authored
      [ Upstream commit d0381bf4 ]
      
      ACPI driver should make sure all the processor IDs in their ACPI Namespace
      are unique. the driver performs a depth-first walk of the namespace tree
      and calls the acpi_processor_ids_walk() to check the duplicate IDs.
      
      But, the acpi_processor_ids_walk() mistakes the return value. If a
      processor is checked, it returns true which causes the walk break
      immediately, and other processors will never be checked.
      
      Repace the value with AE_OK which is the standard acpi_status value.
      And don't abort the namespace walk even on error.
      
      Fixes: 8c8cb30f (acpi/processor: Implement DEVICE operator for processor enumeration)
      Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85e20b47
    • Lubomir Rintel's avatar
      x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC · 0d7a5178
      Lubomir Rintel authored
      [ Upstream commit d92116b8 ]
      
      On OLPC XO-1, the RTC is discovered via device tree from the arch
      initcall. Don't let the PC platform register another one from its device
      initcall, it's not going to work:
      
        sysfs: cannot create duplicate filename '/devices/platform/rtc_cmos'
        CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #12
        Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014
        Call Trace:
         dump_stack+0x16/0x18
         sysfs_warn_dup+0x46/0x58
         sysfs_create_dir_ns+0x76/0x9b
         kobject_add_internal+0xed/0x209
         ? __schedule+0x3fa/0x447
         kobject_add+0x5b/0x66
         device_add+0x298/0x535
         ? insert_resource_conflict+0x2a/0x3e
         platform_device_add+0x14d/0x192
         ? io_delay_init+0x19/0x19
         platform_device_register+0x1c/0x1f
         add_rtc_cmos+0x16/0x31
         do_one_initcall+0x78/0x14a
         ? do_early_param+0x75/0x75
         kernel_init_freeable+0x152/0x1e0
         ? rest_init+0xa2/0xa2
         kernel_init+0x8/0xd5
         ret_from_fork+0x2e/0x38
        kobject_add_internal failed for rtc_cmos with -EEXIST, don't try to
          register things with the same name in the same directory.
        platform rtc_cmos: registered platform RTC device (no PNP device found)
      Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      CC: "H. Peter Anvin" <hpa@zytor.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: x86-ml <x86@kernel.org>
      Link: http://lkml.kernel.org/r/20181004160808.307738-1-lkundrak@v3.skSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d7a5178
    • Emmanuel Grumbach's avatar
      iwlwifi: mvm: clear HW_RESTART_REQUESTED when stopping the interface · 37107588
      Emmanuel Grumbach authored
      [ Upstream commit 155f7e04 ]
      
      Fix a bug that happens in the following scenario:
      1) suspend without WoWLAN
      2) mac80211 calls drv_stop because of the suspend
      3) __iwl_mvm_mac_stop deallocates the aux station
      4) during drv_stop the firmware crashes
      5) iwlmvm:
      	* sets IWL_MVM_STATUS_HW_RESTART_REQUESTED
      	* asks mac80211 to kick the restart flow
      6) mac80211 puts the restart worker into a freezable
         queue which means that the worker will not run for now
         since the workqueue is already frozen
      7) ...
      8) resume
      9) mac80211 runs ieee80211_reconfig as part of the resume
      10) mac80211 detects that a restart flow has been requested
          and that we are now resuming from suspend and cancels
          the restart worker
      11) mac80211 calls drv_start()
      12) __iwl_mvm_mac_start checks that IWL_MVM_STATUS_HW_RESTART_REQUESTED
          clears it, sets IWL_MVM_STATUS_IN_HW_RESTART and calls
          iwl_mvm_restart_cleanup()
      13) iwl_fw_error_dump gets called and accesses the device
          to get debug data
      14) iwl_mvm_up adds the aux station
      15) iwl_mvm_add_aux_sta() allocates an internal station for
          the aux station
      16) iwl_mvm_allocate_int_sta() tests IWL_MVM_STATUS_IN_HW_RESTART
          and doesn't really allocate a station ID for the aux
          station
      17) a new queue is added for the aux station
      
      Note that steps from 5 to 9 aren't really part of the
      problem but were described for the sake of completeness.
      
      Once the iwl_mvm_mac_stop() is called, the device is not
      accessible, meaning that step 12) can't succeed and we'll
      see the following:
      
      drivers/net/wireless/intel/iwlwifi/pcie/trans.c:2122 iwl_trans_pcie_grab_nic_access+0xc0/0x1d6 [iwlwifi]()
      Timeout waiting for hardware access (CSR_GP_CNTRL 0x080403d8)
      Call Trace:
      [<ffffffffc03e6ad3>] iwl_trans_pcie_grab_nic_access+0xc0/0x1d6 [iwlwifi]
      [<ffffffffc03e6a13>] iwl_trans_pcie_dump_regs+0x3fd/0x3fd [iwlwifi]
      [<ffffffffc03dad42>] iwl_fw_error_dump+0x4f5/0xe8b [iwlwifi]
      [<ffffffffc04bd43e>] __iwl_mvm_mac_start+0x5a/0x21a [iwlmvm]
      [<ffffffffc04bd6d2>] iwl_mvm_mac_start+0xd4/0x103 [iwlmvm]
      [<ffffffffc042d378>] drv_start+0xa1/0xc5 [iwl7000_mac80211]
      [<ffffffffc045a339>] ieee80211_reconfig+0x145/0xf50 [mac80211]
      [<ffffffffc044788b>] ieee80211_resume+0x62/0x66 [mac80211]
      [<ffffffffc0366c5b>] wiphy_resume+0xa9/0xc6 [cfg80211]
      
      The station id of the aux station is set to 0xff in step 3
      and because we don't really allocate a new station id for
      the auxliary station (as explained in 16), we end up sending
      a command to the firmware asking to connect the queue
      to station id 0xff. This makes the firmware crash with the
      following information:
      
      0x00002093 | ADVANCED_SYSASSERT
      0x000002F0 | trm_hw_status0
      0x00000000 | trm_hw_status1
      0x00000B38 | branchlink2
      0x0001978C | interruptlink1
      0x00000000 | interruptlink2
      0xFF080501 | data1
      0xDEADBEEF | data2
      0xDEADBEEF | data3
      Firmware error during reconfiguration - reprobe!
      FW error in SYNC CMD SCD_QUEUE_CFG
      
      Fix this by clearing IWL_MVM_STATUS_HW_RESTART_REQUESTED
      in iwl_mvm_mac_stop(). We won't be able to collect debug
      data anyway and when we will brought up again, we will
      have a clean state from the firmware perspective.
      Since we won't have IWL_MVM_STATUS_IN_HW_RESTART set in
      step 12) we won't get to the 2093 ASSERT either.
      
      Fixes: bf8b286f ("iwlwifi: mvm: defer setting IWL_MVM_STATUS_IN_HW_RESTART")
      Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      37107588
    • Shaul Triebitz's avatar
      iwlwifi: pcie: avoid empty free RB queue · 709c3305
      Shaul Triebitz authored
      [ Upstream commit 868a1e86 ]
      
      If all free RB queues are empty, the driver will never restock the
      free RB queue.  That's because the restocking happens in the Rx flow,
      and if the free queue is empty there will be no Rx.
      
      Although there's a background worker (a.k.a. allocator) allocating
      memory for RBs so that the Rx handler can restock them, the worker may
      run only after the free queue has become empty (and then it is too
      late for restocking as explained above).
      
      There is a solution for that called 'emergency': If the number of used
      RB's reaches half the amount of all RB's, the Rx handler will not wait
      for the allocator but immediately allocate memory for the used RB's
      and restock the free queue.
      
      But, since the used RB's is per queue, it may happen that the used
      RB's are spread between the queues such that the emergency check will
      fail for each of the queues
      (and still run out of RBs, causing the above symptom).
      
      To fix it, move to emergency mode if the sum of *all* used RBs (for
      all Rx queues) reaches half the amount of all RB's
      Signed-off-by: default avatarShaul Triebitz <shaul.triebitz@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      709c3305
    • Yu Zhao's avatar
      mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01 · f349beaa
      Yu Zhao authored
      [ Upstream commit 51698949 ]
      
      This device reports SDHCI_CLOCK_INT_STABLE even though it's not
      ready to take SDHCI_CLOCK_CARD_EN. The symptom is that reading
      SDHCI_CLOCK_CONTROL after enabling the clock shows absence of the
      bit from the register (e.g. expecting 0x0000fa07 = 0x0000fa03 |
      SDHCI_CLOCK_CARD_EN but only observed the first operand).
      
      mmc1: Timeout waiting for hardware cmd interrupt.
      mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00000603
      mmc1: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
      mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
      mmc1: sdhci: Present:   0x01ff0001 | Host ctl: 0x00000001
      mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
      mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000fa03
      mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
      mmc1: sdhci: Int enab:  0x00ff0083 | Sig enab: 0x00ff0083
      mmc1: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000000
      mmc1: sdhci: Caps:      0x25fcc8bf | Caps_1:   0x00002077
      mmc1: sdhci: Cmd:       0x00000000 | Max curr: 0x005800c8
      mmc1: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
      mmc1: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
      mmc1: sdhci: Host ctl2: 0x00000008
      mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
      mmc1: sdhci: ============================================
      
      The problem happens during wakeup from S3. Adding a delay quirk
      after power up reliably fixes the problem.
      Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f349beaa
    • Prarit Bhargava's avatar
      cpupower: Fix coredump on VMWare · b5d5f109
      Prarit Bhargava authored
      [ Upstream commit f69ffc5d ]
      
      cpupower crashes on VMWare guests.  The guests have the AMD PStateDef MSR
      (0xC0010064 + state number) set to zero.  As a result fid and did are zero
      and the crash occurs because of a divide by zero (cof = fid/did).  This
      can be prevented by checking the enable bit in the PStateDef MSR before
      calculating cof.  By doing this the value of pstate[i] remains zero and
      the value can be tested before displaying the active Pstates.
      
      Check the enable bit in the PstateDef register for all supported families
      and only print out enabled Pstates.
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Stafford Horne <shorne@gmail.com>
      Signed-off-by: default avatarShuah Khan (Samsung OSG) <shuah@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5d5f109
    • Sanskriti Sharma's avatar
      perf strbuf: Match va_{add,copy} with va_end · 1ab8d2db
      Sanskriti Sharma authored
      [ Upstream commit ce49d843 ]
      
      Ensure that all code paths in strbuf_addv() call va_end() on the
      ap_saved copy that was made.
      
      Fixes the following coverity complaint:
      
        Error: VARARGS (CWE-237): [#def683]
        tools/perf/util/strbuf.c:106: missing_va_end: va_end was not called
        for "ap_saved".
      Signed-off-by: default avatarSanskriti Sharma <sansharm@redhat.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Joe Lawrence <joe.lawrence@redhat.com>
      Link: http://lkml.kernel.org/r/1538490554-8161-2-git-send-email-sansharm@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ab8d2db
    • Sanskriti Sharma's avatar
      perf tools: Cleanup trace-event-info 'tdata' leak · 2e8e70e5
      Sanskriti Sharma authored
      [ Upstream commit faedbf3f ]
      
      Free tracing_data structure in tracing_data_get() error paths.
      
      Fixes the following coverity complaint:
      
        Error: RESOURCE_LEAK (CWE-772):
        leaked_storage: Variable "tdata" going out of scope leaks the storage
      Signed-off-by: default avatarSanskriti Sharma <sansharm@redhat.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Joe Lawrence <joe.lawrence@redhat.com>
      Link: http://lkml.kernel.org/r/1538490554-8161-3-git-send-email-sansharm@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e8e70e5
    • Sanskriti Sharma's avatar
      perf tools: Free temporary 'sys' string in read_event_files() · 52ff94ce
      Sanskriti Sharma authored
      [ Upstream commit 1e44224f ]
      
      For each system in a given pevent, read_event_files() reads in a
      temporary 'sys' string.  Be sure to free this string before moving onto
      to the next system and/or leaving read_event_files().
      
      Fixes the following coverity complaints:
      
        Error: RESOURCE_LEAK (CWE-772):
      
        tools/perf/util/trace-event-read.c:343: overwrite_var: Overwriting
        "sys" in "sys = read_string()" leaks the storage that "sys" points to.
      
        tools/perf/util/trace-event-read.c:353: leaked_storage: Variable "sys"
        going out of scope leaks the storage it points to.
      Signed-off-by: default avatarSanskriti Sharma <sansharm@redhat.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Joe Lawrence <joe.lawrence@redhat.com>
      Link: http://lkml.kernel.org/r/1538490554-8161-6-git-send-email-sansharm@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52ff94ce
    • Nathan Chancellor's avatar
      spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare} · 8515f4ea
      Nathan Chancellor authored
      [ Upstream commit a1108c7b ]
      
      Clang warns when one enumerated type is implicitly converted to another.
      
      drivers/spi/spi-ep93xx.c:342:62: warning: implicit conversion from
      enumeration type 'enum dma_transfer_direction' to different enumeration
      type 'enum dma_data_direction' [-Wenum-conversion]
              nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      ./include/linux/dma-mapping.h:428:58: note: expanded from macro
      'dma_map_sg'
      #define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
                                     ~~~~~~~~~~~~~~~~          ^
      drivers/spi/spi-ep93xx.c:348:57: warning: implicit conversion from
      enumeration type 'enum dma_transfer_direction' to different enumeration
      type 'enum dma_data_direction' [-Wenum-conversion]
                      dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      ./include/linux/dma-mapping.h:429:62: note: expanded from macro
      'dma_unmap_sg'
      #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
                                       ~~~~~~~~~~~~~~~~~~          ^
      drivers/spi/spi-ep93xx.c:377:56: warning: implicit conversion from
      enumeration type 'enum dma_transfer_direction' to different enumeration
      type 'enum dma_data_direction' [-Wenum-conversion]
              dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      ./include/linux/dma-mapping.h:429:62: note: expanded from macro
      'dma_unmap_sg'
      #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
                                       ~~~~~~~~~~~~~~~~~~          ^
      3 warnings generated.
      
      dma_{,un}map_sg expect an enum of type dma_data_direction but this
      driver uses dma_transfer_direction for everything. Convert the driver to
      use dma_data_direction for these two functions.
      
      There are two places that strictly require an enum of type
      dma_transfer_direction: the direction member in struct dma_slave_config
      and the direction parameter in dmaengine_prep_slave_sg. To avoid using
      an explicit cast, add a simple function, ep93xx_dma_data_to_trans_dir,
      to safely map between the two types because they are not 1 to 1 in
      meaning.
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8515f4ea