Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668409 > unrolled thread

[PATCH for v4.9 LTS 01/86] sparc64: Handle PIO & MEM non-resumable errors.

Started by"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
First post2017-06-18 00:30 +0200
Last post2017-06-18 00:50 +0200
Articles 20 on this page of 81 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH for v4.9 LTS 01/86] sparc64: Handle PIO & MEM non-resumable  errors. "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 80/86] be2net: don't delete MAC on close on  unprivileged BE3 VFs "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 81/86] be2net: fix MAC addr setting on privileged  BE3 VFs "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 85/86] perf probe: Fix to probe on gcc generated  functions in modules "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 03/86] net: ethtool: add support for 2500BaseT  and 5000BaseT link modes "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 59/86] usb: gadget: composite: Fix function used  to free memory "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 79/86] be2net: fix status check in  be_cmd_pmac_add() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 50/86] Documentation: devicetree: change the  mediatek ethernet compatible string "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 82/86] perf probe: Fix to show correct locations  for events on modules "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 84/86] tipc: allocate user memory with GFP_KERNEL  flag "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 22/86] net: phy: dp83848: add DP83620 PHY support "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 10/86] ARM64: dts: meson-gx: Add firmware  reserved memory zones "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 60/86] usb: dwc3: exynos fix axius clock error  path to do cleanup "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 20/86] drm/amdgpu: fix program vce instance logic  error. "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 76/86] swiotlb: ensure that page-sized mappings  are page-aligned "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 32/86] Btrfs: fix truncate down when no_holes  feature is enabled "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 83/86] net: phy: dp83867: allow  RGMII_TXID/RGMII_RXID interface types "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 54/86] net: phy: marvell: fix Marvell 88E1512  used in SGMII mode "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 52/86] perf/x86/intel/uncore: Fix hardcoded  socket 0 assumption in the Haswell init code "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 65/86] drm/amd/powerplay: fix vce cg logic error  on CZ/St. "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:30 +0200
    [PATCH for v4.9 LTS 43/86] vfio/spapr: fail tce_iommu_attach_group()  when iommu_data is null "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 33/86] virtio_console: fix a crash in  config_work_handler "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 55/86] mac80211: recalculate min channel width on  VHT opmode changes "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 49/86] kernel/panic.c: add missing \n "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 74/86] aio: fix lock dep warning "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 47/86] vxlan: do not age static remote mac  entries "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 36/86] xen-netfront: Fix Rx stall during network  stress and OOM "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 40/86] amd-xgbe: Check xgbe_init() return code "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 29/86] objtool: Fix IRET's opcode "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 67/86] pmem: return EIO on read_pmem() failure "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 56/86] perf/x86/intel: Use ULL constant to  prevent undefined shift behaviour "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 30/86] gianfar: Do not reuse pages from emergency  reserve "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 21/86] drm/amdgpu: add support for new hainan  variants "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 35/86] net: sctp: fix array overrun read on  sctp_timer_tbl "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 57/86] HID: i2c-hid: Add sleep between POWER ON  and RESET "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 46/86] ip6_tunnel: must reload ipv6h in  ip6ip6_tnl_xmit() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 78/86] usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM  value "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 53/86] pinctrl: intel: Set pin direction properly "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 86/86] net/mlx4_core: Eliminate warning messages  for SRQ_LIMIT under SRIOV "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 42/86] drm/amdgpu: check ring being ready before  using "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 70/86] x86/tsc: Add the Intel Denverton Processor  to native_calibrate_tsc() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 37/86] scsi: virtio_scsi: Reject commands when  virtqueue is broken "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 64/86] drm/radeon/si: load special ucode for  certain MC configs "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 58/86] scsi: lpfc: avoid double free of resource  identifiers "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 51/86] drm/etnaviv: trick drm_mm into giving out  a low IOVA "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 62/86] arm64: assembler: make adr_l work in  modules under KASLR "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 69/86] KVM: arm64: Access CNTHCTL_EL2 bit fields  correctly on VHE systems "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 41/86] net: dsa: Check return value of  phy_connect_direct() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 63/86] net: thunderx: acpi: fix LMAC  initialization "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 75/86] coredump: Ensure proper size of sparse  core files "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 71/86] x86/mpx: Use compatible types in  comparison to fix sparse error "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 44/86] mlxsw: spectrum_router: Correctly  reallocate adjacency entries "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 45/86] virtio_net: fix PAGE_SIZE > 64k "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 38/86] iwlwifi: fix kernel crash when  unregistering thermal zone "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 34/86] swiotlb-xen: update dev_addr after  swapping pages "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 68/86] mac80211: initialize SMPS field in HT  capabilities "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:40 +0200
    [PATCH for v4.9 LTS 14/86] KVM: x86: fix fixing of hypercalls "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 24/86] net: ethtool: Initialize buffer when  querying device channel settings "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 23/86] powerpc/eeh: Enable IO path on permanent  error "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 26/86] xen-netback: protect resource cleaning on  XenBus disconnect "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 07/86] net: phy: use boolean dt properties for  eee broken modes "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 04/86] net: phy: add an option to disable EEE  advertisement "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 08/86] dt: bindings: net: use boolean dt  properties for eee broken modes "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in compat  mode "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
      Re: [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in  compat mode Eric Biggers <ebiggers@google.com> - 2017-06-19 19:10 +0200
        Re: [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in  compat mode Richard Weinberger <richard@nod.at> - 2017-06-19 21:30 +0200
          Re: [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in  compat mode "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-19 21:50 +0200
            Re: [PATCH for v4.9 LTS 13/86] ubifs: allow encryption ioctls in  compat mode Richard Weinberger <richard@nod.at> - 2017-06-19 22:10 +0200
    [PATCH for v4.9 LTS 25/86] xen-netback: fix memory leaks on XenBus  disconnect "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 11/86] ARM64: dts: meson-gxbb-odroidc2: fix GbE  tx link breakage "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 27/86] bnxt_en: Fix "uninitialized variable" bug  in TPA code path. "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 02/86] sparc64: Zero pages on allocation for  mondo and error queues. "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 31/86] Btrfs: Fix deadlock between direct IO and  fast fsync "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 19/86] qla2xxx: Fix erroneous invalid handle  message "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 06/86] net: phy: fix sign type error in  genphy_config_eee_advert "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 15/86] scsi: sd: Fix wrong DPOFUA disable in  sd_read_cache_type "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 16/86] stmmac: add missing of_node_put "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 05/86] dt-bindings: net: add EEE capability  constants "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 18/86] qla2xxx: Terminate exchange if corrupted "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 12/86] perf/x86/intel: Handle exclusive threadid  correctly on CPU hotplug "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200
    [PATCH for v4.9 LTS 28/86] bpf: don't trigger OOM killer under  pressure with map alloc "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-06-18 00:50 +0200

Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →


#1668452 — [PATCH for v4.9 LTS 70/86] x86/tsc: Add the Intel Denverton Processor to native_calibrate_tsc()

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 70/86] x86/tsc: Add the Intel Denverton Processor to native_calibrate_tsc()
Message-ID<tTuxR-5dy-49@gated-at.bofh.it>
In reply to#1668409
From: Len Brown <len.brown@intel.com>

[ Upstream commit 695085b4bc7603551db0b3da897b8bf9893ca218 ]

The Intel Denverton microserver uses a 25 MHz TSC crystal,
so we can derive its exact [*] TSC frequency
using CPUID and some arithmetic, eg.:

  TSC: 1800 MHz (25000000 Hz * 216 / 3 / 1000000)

[*] 'exact' is only as good as the crystal, which should be +/- 20ppm

Signed-off-by: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/306899f94804aece6d8fa8b4223ede3b48dbb59c.1484287748.git.len.brown@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/x86/kernel/tsc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index eea88fe5d969..6e57edf33d75 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -694,6 +694,7 @@ unsigned long native_calibrate_tsc(void)
 			crystal_khz = 24000;	/* 24.0 MHz */
 			break;
 		case INTEL_FAM6_SKYLAKE_X:
+		case INTEL_FAM6_ATOM_DENVERTON:
 			crystal_khz = 25000;	/* 25.0 MHz */
 			break;
 		case INTEL_FAM6_ATOM_GOLDMONT:
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668453 — [PATCH for v4.9 LTS 37/86] scsi: virtio_scsi: Reject commands when virtqueue is broken

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 37/86] scsi: virtio_scsi: Reject commands when virtqueue is broken
Message-ID<tTuxR-5dy-51@gated-at.bofh.it>
In reply to#1668409
From: Eric Farman <farman@linux.vnet.ibm.com>

[ Upstream commit 773c7220e22d193e5667c352fcbf8d47eefc817f ]

In the case of a graceful set of detaches, where the virtio-scsi-ccw
disk is removed from the guest prior to the controller, the guest
behaves quite normally.  Specifically, the detach gets us into
sd_sync_cache to issue a Synchronize Cache(10) command, which
immediately fails (and is retried a couple of times) because the device
has been removed.  Later, the removal of the controller sees two CRWs
presented, but there's no further indication of the removal from the
guest viewpoint.

 [   17.217458] sd 0:0:0:0: [sda] Synchronizing SCSI cache
 [   17.219257] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
 [   21.449400] crw_info : CRW reports slct=0, oflw=0, chn=1, rsc=3, anc=0, erc=4, rsid=2
 [   21.449406] crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=0, erc=4, rsid=0

However, on s390, the SCSI disks can be removed "by surprise" when an
entire controller (host) is removed and all associated disks are removed
via the loop in scsi_forget_host.  The same call to sd_sync_cache is
made, but because the controller has already been removed, the
Synchronize Cache(10) command is neither issued (and then failed) nor
rejected.

That the I/O isn't returned means the guest cannot have other devices
added nor removed, and other tasks (such as shutdown or reboot) issued
by the guest will not complete either.  The virtio ring has already been
marked as broken (via virtio_break_device in virtio_ccw_remove), but we
still attempt to queue the command only to have it remain there.  The
calling sequence provides a bit of distinction for us:

  virtscsi_queuecommand()
   -> virtscsi_kick_cmd()
    -> virtscsi_add_cmd()
     -> virtqueue_add_sgs()
      -> virtqueue_add()
         if success
           return 0
         elseif vq->broken or vring_mapping_error()
           return -EIO
         else
           return -ENOSPC

A return of ENOSPC is generally a temporary condition, so returning
"host busy" from virtscsi_queuecommand makes sense here, to have it
redriven in a moment or two.  But the EIO return code is more of a
permanent error and so it would be wise to return the I/O itself and
allow the calling thread to finish gracefully.  The result is these four
kernel messages in the guest (the fourth one does not occur prior to
this patch):

 [   22.921562] crw_info : CRW reports slct=0, oflw=0, chn=1, rsc=3, anc=0, erc=4, rsid=2
 [   22.921580] crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=0, erc=4, rsid=0
 [   22.921978] sd 0:0:0:0: [sda] Synchronizing SCSI cache
 [   22.921993] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

I opted to fill in the same response data that is returned from the more
graceful device detach, where the disk device is removed prior to the
controller device.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/scsi/virtio_scsi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index ec91bd07f00a..c680d7641311 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -534,7 +534,9 @@ static int virtscsi_queuecommand(struct virtio_scsi *vscsi,
 {
 	struct Scsi_Host *shost = virtio_scsi_host(vscsi->vdev);
 	struct virtio_scsi_cmd *cmd = scsi_cmd_priv(sc);
+	unsigned long flags;
 	int req_size;
+	int ret;
 
 	BUG_ON(scsi_sg_count(sc) > shost->sg_tablesize);
 
@@ -562,8 +564,15 @@ static int virtscsi_queuecommand(struct virtio_scsi *vscsi,
 		req_size = sizeof(cmd->req.cmd);
 	}
 
-	if (virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd)) != 0)
+	ret = virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd));
+	if (ret == -EIO) {
+		cmd->resp.cmd.response = VIRTIO_SCSI_S_BAD_TARGET;
+		spin_lock_irqsave(&req_vq->vq_lock, flags);
+		virtscsi_complete_cmd(vscsi, cmd);
+		spin_unlock_irqrestore(&req_vq->vq_lock, flags);
+	} else if (ret != 0) {
 		return SCSI_MLQUEUE_HOST_BUSY;
+	}
 	return 0;
 }
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668454 — [PATCH for v4.9 LTS 64/86] drm/radeon/si: load special ucode for certain MC configs

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 64/86] drm/radeon/si: load special ucode for certain MC configs
Message-ID<tTuxR-5dy-53@gated-at.bofh.it>
In reply to#1668409
From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit ef736d394e85b1bf1fd65ba5e5257b85f6c82325 ]

Special MC ucode is required for these memory configurations.

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/radeon/si.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 3333e8a45933..b75d809c292e 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -115,6 +115,8 @@ MODULE_FIRMWARE("radeon/hainan_rlc.bin");
 MODULE_FIRMWARE("radeon/hainan_smc.bin");
 MODULE_FIRMWARE("radeon/hainan_k_smc.bin");
 
+MODULE_FIRMWARE("radeon/si58_mc.bin");
+
 static u32 si_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 sh);
 static void si_pcie_gen3_enable(struct radeon_device *rdev);
 static void si_program_aspm(struct radeon_device *rdev);
@@ -1650,6 +1652,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 	int err;
 	int new_fw = 0;
 	bool new_smc = false;
+	bool si58_fw = false;
 
 	DRM_DEBUG("\n");
 
@@ -1742,6 +1745,10 @@ static int si_init_microcode(struct radeon_device *rdev)
 	default: BUG();
 	}
 
+	/* this memory configuration requires special firmware */
+	if (((RREG32(MC_SEQ_MISC0) & 0xff000000) >> 24) == 0x58)
+		si58_fw = true;
+
 	DRM_INFO("Loading %s Microcode\n", new_chip_name);
 
 	snprintf(fw_name, sizeof(fw_name), "radeon/%s_pfp.bin", new_chip_name);
@@ -1845,7 +1852,10 @@ static int si_init_microcode(struct radeon_device *rdev)
 		}
 	}
 
-	snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc.bin", new_chip_name);
+	if (si58_fw)
+		snprintf(fw_name, sizeof(fw_name), "radeon/si58_mc.bin");
+	else
+		snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc.bin", new_chip_name);
 	err = request_firmware(&rdev->mc_fw, fw_name, rdev->dev);
 	if (err) {
 		snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc2.bin", chip_name);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668455 — [PATCH for v4.9 LTS 58/86] scsi: lpfc: avoid double free of resource identifiers

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 58/86] scsi: lpfc: avoid double free of resource identifiers
Message-ID<tTuxR-5dy-47@gated-at.bofh.it>
In reply to#1668409
From: Roberto Sassu <rsassu@suse.de>

[ Upstream commit cd60be4916ae689387d04b86b6fc15931e4c95ae ]

Set variables initialized in lpfc_sli4_alloc_resource_identifiers() to
NULL if an error occurred. Otherwise, lpfc_sli4_driver_resource_unset()
attempts to free the memory again.

Signed-off-by: Roberto Sassu <rsassu@suse.de>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 49b4c798de18..2d4f4b58dcfa 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -5951,18 +5951,25 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba)
 
  free_vfi_bmask:
 	kfree(phba->sli4_hba.vfi_bmask);
+	phba->sli4_hba.vfi_bmask = NULL;
  free_xri_ids:
 	kfree(phba->sli4_hba.xri_ids);
+	phba->sli4_hba.xri_ids = NULL;
  free_xri_bmask:
 	kfree(phba->sli4_hba.xri_bmask);
+	phba->sli4_hba.xri_bmask = NULL;
  free_vpi_ids:
 	kfree(phba->vpi_ids);
+	phba->vpi_ids = NULL;
  free_vpi_bmask:
 	kfree(phba->vpi_bmask);
+	phba->vpi_bmask = NULL;
  free_rpi_ids:
 	kfree(phba->sli4_hba.rpi_ids);
+	phba->sli4_hba.rpi_ids = NULL;
  free_rpi_bmask:
 	kfree(phba->sli4_hba.rpi_bmask);
+	phba->sli4_hba.rpi_bmask = NULL;
  err_exit:
 	return rc;
 }
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668456 — [PATCH for v4.9 LTS 51/86] drm/etnaviv: trick drm_mm into giving out a low IOVA

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 51/86] drm/etnaviv: trick drm_mm into giving out a low IOVA
Message-ID<tTuxR-5dy-55@gated-at.bofh.it>
In reply to#1668409
From: Lucas Stach <l.stach@pengutronix.de>

[ Upstream commit 3546fb0cdac25a79c89d87020566fab52b92867d ]

After rollover of the IOVA space, we want to get a low IOVA address,
otherwise the the games we play by remembering the last IOVA are
pointless. When we search for a free hole with DRM_MM_SEARCH_DEFAULT,
drm_mm will pop the next entry from the free holes stack, which will
likely be a high IOVA. By using DRM_MM_SEARCH_BELOW we can trick
drm_mm into reversing the search and provide us with a low IOVA.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir van der Laan <laanwj@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
index 169ac96e8f08..fe0e85b41310 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
@@ -116,9 +116,14 @@ static int etnaviv_iommu_find_iova(struct etnaviv_iommu *mmu,
 		struct list_head list;
 		bool found;
 
+		/*
+		 * XXX: The DRM_MM_SEARCH_BELOW is really a hack to trick
+		 * drm_mm into giving out a low IOVA after address space
+		 * rollover. This needs a proper fix.
+		 */
 		ret = drm_mm_insert_node_in_range(&mmu->mm, node,
 			size, 0, mmu->last_iova, ~0UL,
-			DRM_MM_SEARCH_DEFAULT);
+			mmu->last_iova ? DRM_MM_SEARCH_DEFAULT : DRM_MM_SEARCH_BELOW);
 
 		if (ret != -ENOSPC)
 			break;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668457 — [PATCH for v4.9 LTS 62/86] arm64: assembler: make adr_l work in modules under KASLR

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 62/86] arm64: assembler: make adr_l work in modules under KASLR
Message-ID<tTuxR-5dy-57@gated-at.bofh.it>
In reply to#1668409
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

[ Upstream commit 41c066f2c4d436c535616fe182331766c57838f0 ]

When CONFIG_RANDOMIZE_MODULE_REGION_FULL=y, the offset between loaded
modules and the core kernel may exceed 4 GB, putting symbols exported
by the core kernel out of the reach of the ordinary adrp/add instruction
pairs used to generate relative symbol references. So make the adr_l
macro emit a movz/movk sequence instead when executing in module context.

While at it, remove the pointless special case for the stack pointer.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm64/include/asm/assembler.h | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 28bfe6132eb6..851290d2bfe3 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -155,22 +155,25 @@ lr	.req	x30		// link register
 
 /*
  * Pseudo-ops for PC-relative adr/ldr/str <reg>, <symbol> where
- * <symbol> is within the range +/- 4 GB of the PC.
+ * <symbol> is within the range +/- 4 GB of the PC when running
+ * in core kernel context. In module context, a movz/movk sequence
+ * is used, since modules may be loaded far away from the kernel
+ * when KASLR is in effect.
  */
 	/*
 	 * @dst: destination register (64 bit wide)
 	 * @sym: name of the symbol
-	 * @tmp: optional scratch register to be used if <dst> == sp, which
-	 *       is not allowed in an adrp instruction
 	 */
-	.macro	adr_l, dst, sym, tmp=
-	.ifb	\tmp
+	.macro	adr_l, dst, sym
+#ifndef MODULE
 	adrp	\dst, \sym
 	add	\dst, \dst, :lo12:\sym
-	.else
-	adrp	\tmp, \sym
-	add	\dst, \tmp, :lo12:\sym
-	.endif
+#else
+	movz	\dst, #:abs_g3:\sym
+	movk	\dst, #:abs_g2_nc:\sym
+	movk	\dst, #:abs_g1_nc:\sym
+	movk	\dst, #:abs_g0_nc:\sym
+#endif
 	.endm
 
 	/*
@@ -181,6 +184,7 @@ lr	.req	x30		// link register
 	 *       the address
 	 */
 	.macro	ldr_l, dst, sym, tmp=
+#ifndef MODULE
 	.ifb	\tmp
 	adrp	\dst, \sym
 	ldr	\dst, [\dst, :lo12:\sym]
@@ -188,6 +192,15 @@ lr	.req	x30		// link register
 	adrp	\tmp, \sym
 	ldr	\dst, [\tmp, :lo12:\sym]
 	.endif
+#else
+	.ifb	\tmp
+	adr_l	\dst, \sym
+	ldr	\dst, [\dst]
+	.else
+	adr_l	\tmp, \sym
+	ldr	\dst, [\tmp]
+	.endif
+#endif
 	.endm
 
 	/*
@@ -197,8 +210,13 @@ lr	.req	x30		// link register
 	 *       while <src> needs to be preserved.
 	 */
 	.macro	str_l, src, sym, tmp
+#ifndef MODULE
 	adrp	\tmp, \sym
 	str	\src, [\tmp, :lo12:\sym]
+#else
+	adr_l	\tmp, \sym
+	str	\src, [\tmp]
+#endif
 	.endm
 
 	/*
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668458 — [PATCH for v4.9 LTS 69/86] KVM: arm64: Access CNTHCTL_EL2 bit fields correctly on VHE systems

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 69/86] KVM: arm64: Access CNTHCTL_EL2 bit fields correctly on VHE systems
Message-ID<tTuxR-5dy-59@gated-at.bofh.it>
In reply to#1668409
From: Jintack Lim <jintack@cs.columbia.edu>

[ Upstream commit 488f94d7212b00a2ec72fb886b155f1b04c5aa98 ]

Current KVM world switch code is unintentionally setting wrong bits to
CNTHCTL_EL2 when E2H == 1, which may allow guest OS to access physical
timer.  Bit positions of CNTHCTL_EL2 are changing depending on
HCR_EL2.E2H bit.  EL1PCEN and EL1PCTEN are 1st and 0th bits when E2H is
not set, but they are 11th and 10th bits respectively when E2H is set.

In fact, on VHE we only need to set those bits once, not for every world
switch. This is because the host kernel runs in EL2 with HCR_EL2.TGE ==
1, which makes those bits have no effect for the host kernel execution.
So we just set those bits once for guests, and that's it.

Signed-off-by: Jintack Lim <jintack@cs.columbia.edu>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm/include/asm/virt.h   |  5 +++++
 arch/arm/kvm/arm.c            |  3 +++
 arch/arm64/include/asm/virt.h |  9 +++++++++
 include/kvm/arm_arch_timer.h  |  1 +
 virt/kvm/arm/arch_timer.c     | 23 +++++++++++++++++++++++
 virt/kvm/arm/hyp/timer-sr.c   | 33 +++++++++++++++++++++------------
 6 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h
index a2e75b84e2ae..6dae1956c74d 100644
--- a/arch/arm/include/asm/virt.h
+++ b/arch/arm/include/asm/virt.h
@@ -80,6 +80,11 @@ static inline bool is_kernel_in_hyp_mode(void)
 	return false;
 }
 
+static inline bool has_vhe(void)
+{
+	return false;
+}
+
 /* The section containing the hypervisor idmap text */
 extern char __hyp_idmap_text_start[];
 extern char __hyp_idmap_text_end[];
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 19b5f5c1c0ff..60d031642798 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -1093,6 +1093,9 @@ static void cpu_init_hyp_mode(void *dummy)
 	__cpu_init_hyp_mode(pgd_ptr, hyp_stack_ptr, vector_ptr);
 	__cpu_init_stage2();
 
+	if (is_kernel_in_hyp_mode())
+		kvm_timer_init_vhe();
+
 	kvm_arm_init_debug();
 }
 
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index fea10736b11f..439f6b5d31f6 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -47,6 +47,7 @@
 #include <asm/ptrace.h>
 #include <asm/sections.h>
 #include <asm/sysreg.h>
+#include <asm/cpufeature.h>
 
 /*
  * __boot_cpu_mode records what mode CPUs were booted in.
@@ -80,6 +81,14 @@ static inline bool is_kernel_in_hyp_mode(void)
 	return read_sysreg(CurrentEL) == CurrentEL_EL2;
 }
 
+static inline bool has_vhe(void)
+{
+	if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
+		return true;
+
+	return false;
+}
+
 #ifdef CONFIG_ARM64_VHE
 extern void verify_cpu_run_el(void);
 #else
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index dda39d8fa189..2d5490375e0d 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -76,4 +76,5 @@ void kvm_timer_unschedule(struct kvm_vcpu *vcpu);
 
 void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu);
 
+void kvm_timer_init_vhe(void);
 #endif
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 27a1f6341d41..0ebd0dc39cd4 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -24,6 +24,7 @@
 
 #include <clocksource/arm_arch_timer.h>
 #include <asm/arch_timer.h>
+#include <asm/kvm_hyp.h>
 
 #include <kvm/arm_vgic.h>
 #include <kvm/arm_arch_timer.h>
@@ -517,3 +518,25 @@ void kvm_timer_init(struct kvm *kvm)
 {
 	kvm->arch.timer.cntvoff = kvm_phys_timer_read();
 }
+
+/*
+ * On VHE system, we only need to configure trap on physical timer and counter
+ * accesses in EL0 and EL1 once, not for every world switch.
+ * The host kernel runs at EL2 with HCR_EL2.TGE == 1,
+ * and this makes those bits have no effect for the host kernel execution.
+ */
+void kvm_timer_init_vhe(void)
+{
+	/* When HCR_EL2.E2H ==1, EL1PCEN and EL1PCTEN are shifted by 10 */
+	u32 cnthctl_shift = 10;
+	u64 val;
+
+	/*
+	 * Disallow physical timer access for the guest.
+	 * Physical counter access is allowed.
+	 */
+	val = read_sysreg(cnthctl_el2);
+	val &= ~(CNTHCTL_EL1PCEN << cnthctl_shift);
+	val |= (CNTHCTL_EL1PCTEN << cnthctl_shift);
+	write_sysreg(val, cnthctl_el2);
+}
diff --git a/virt/kvm/arm/hyp/timer-sr.c b/virt/kvm/arm/hyp/timer-sr.c
index 798866a8d875..63e28dd18bb0 100644
--- a/virt/kvm/arm/hyp/timer-sr.c
+++ b/virt/kvm/arm/hyp/timer-sr.c
@@ -35,10 +35,16 @@ void __hyp_text __timer_save_state(struct kvm_vcpu *vcpu)
 	/* Disable the virtual timer */
 	write_sysreg_el0(0, cntv_ctl);
 
-	/* Allow physical timer/counter access for the host */
-	val = read_sysreg(cnthctl_el2);
-	val |= CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN;
-	write_sysreg(val, cnthctl_el2);
+	/*
+	 * We don't need to do this for VHE since the host kernel runs in EL2
+	 * with HCR_EL2.TGE ==1, which makes those bits have no impact.
+	 */
+	if (!has_vhe()) {
+		/* Allow physical timer/counter access for the host */
+		val = read_sysreg(cnthctl_el2);
+		val |= CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN;
+		write_sysreg(val, cnthctl_el2);
+	}
 
 	/* Clear cntvoff for the host */
 	write_sysreg(0, cntvoff_el2);
@@ -50,14 +56,17 @@ void __hyp_text __timer_restore_state(struct kvm_vcpu *vcpu)
 	struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
 	u64 val;
 
-	/*
-	 * Disallow physical timer access for the guest
-	 * Physical counter access is allowed
-	 */
-	val = read_sysreg(cnthctl_el2);
-	val &= ~CNTHCTL_EL1PCEN;
-	val |= CNTHCTL_EL1PCTEN;
-	write_sysreg(val, cnthctl_el2);
+	/* Those bits are already configured at boot on VHE-system */
+	if (!has_vhe()) {
+		/*
+		 * Disallow physical timer access for the guest
+		 * Physical counter access is allowed
+		 */
+		val = read_sysreg(cnthctl_el2);
+		val &= ~CNTHCTL_EL1PCEN;
+		val |= CNTHCTL_EL1PCTEN;
+		write_sysreg(val, cnthctl_el2);
+	}
 
 	if (timer->enabled) {
 		write_sysreg(kvm->arch.timer.cntvoff, cntvoff_el2);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668459 — [PATCH for v4.9 LTS 41/86] net: dsa: Check return value of phy_connect_direct()

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 41/86] net: dsa: Check return value of phy_connect_direct()
Message-ID<tTuxR-5dy-61@gated-at.bofh.it>
In reply to#1668409
From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit 4078b76cac68e50ccf1f76a74e7d3d5788aec3fe ]

We need to check the return value of phy_connect_direct() in
dsa_slave_phy_connect() otherwise we may be continuing the
initialization of a slave network device with a PHY that already
attached somewhere else and which will soon be in error because the PHY
device is in error.

The conditions for such an error to occur are that we have a port of our
switch that is not disabled, and has the same port number as a PHY
address (say both 5) that can be probed using the DSA slave MII bus. We
end-up having this slave network device find a PHY at the same address
as our port number, and we try to attach to it.

A slave network (e.g: port 0) has already attached to our PHY device,
and we try to re-attach it with a different network device, but since we
ignore the error we would end-up initializating incorrect device
references by the time the slave network interface is opened.

The code has been (re)organized several times, making it hard to provide
an exact Fixes tag, this is a bugfix nonetheless.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/dsa/slave.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 3ff9d97cf56b..079d76bc204c 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1103,10 +1103,8 @@ static int dsa_slave_phy_connect(struct dsa_slave_priv *p,
 	/* Use already configured phy mode */
 	if (p->phy_interface == PHY_INTERFACE_MODE_NA)
 		p->phy_interface = p->phy->interface;
-	phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
-			   p->phy_interface);
-
-	return 0;
+	return phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
+				  p->phy_interface);
 }
 
 static int dsa_slave_phy_setup(struct dsa_slave_priv *p,
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668460 — [PATCH for v4.9 LTS 63/86] net: thunderx: acpi: fix LMAC initialization

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 63/86] net: thunderx: acpi: fix LMAC initialization
Message-ID<tTuxR-5dy-63@gated-at.bofh.it>
In reply to#1668409
From: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>

[ Upstream commit 7aa4865506a26c607e00bd9794a85785b55ebca7 ]

While probing BGX we requesting appropriate QLM for it's configuration
and get LMAC count by that request. Then, while reading configured
MAC values from SSDT table we need to save them in proper mapping:
  BGX[i]->lmac[j].mac = <MAC value>
to later provide for initialization stuff. In order to fill
such mapping properly we need to add lmac index to be used while
acpi initialization since at this moment bgx->lmac_count already contains
actual value.

Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 679679a4ccb2..e858b1af788d 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -48,8 +48,9 @@ struct lmac {
 struct bgx {
 	u8			bgx_id;
 	struct	lmac		lmac[MAX_LMAC_PER_BGX];
-	int			lmac_count;
+	u8			lmac_count;
 	u8			max_lmac;
+	u8                      acpi_lmac_idx;
 	void __iomem		*reg_base;
 	struct pci_dev		*pdev;
 	bool                    is_dlm;
@@ -1159,13 +1160,13 @@ static acpi_status bgx_acpi_register_phy(acpi_handle handle,
 	if (acpi_bus_get_device(handle, &adev))
 		goto out;
 
-	acpi_get_mac_address(dev, adev, bgx->lmac[bgx->lmac_count].mac);
+	acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac);
 
-	SET_NETDEV_DEV(&bgx->lmac[bgx->lmac_count].netdev, dev);
+	SET_NETDEV_DEV(&bgx->lmac[bgx->acpi_lmac_idx].netdev, dev);
 
-	bgx->lmac[bgx->lmac_count].lmacid = bgx->lmac_count;
+	bgx->lmac[bgx->acpi_lmac_idx].lmacid = bgx->acpi_lmac_idx;
+	bgx->acpi_lmac_idx++; /* move to next LMAC */
 out:
-	bgx->lmac_count++;
 	return AE_OK;
 }
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668461 — [PATCH for v4.9 LTS 75/86] coredump: Ensure proper size of sparse core files

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 75/86] coredump: Ensure proper size of sparse core files
Message-ID<tTuxS-5dy-67@gated-at.bofh.it>
In reply to#1668409
From: Dave Kleikamp <dave.kleikamp@oracle.com>

[ Upstream commit 4d22c75d4c7b5c5f4bd31054f09103ee490878fd ]

If the last section of a core file ends with an unmapped or zero page,
the size of the file does not correspond with the last dump_skip() call.
gdb complains that the file is truncated and can be confusing to users.

After all of the vma sections are written, make sure that the file size
is no smaller than the current file position.

This problem can be demonstrated with gdb's bigcore testcase on the
sparc architecture.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/binfmt_elf.c          |  1 +
 fs/coredump.c            | 18 ++++++++++++++++++
 include/linux/coredump.h |  1 +
 3 files changed, 20 insertions(+)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 2472af2798c7..cfd724f98332 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -2296,6 +2296,7 @@ static int elf_core_dump(struct coredump_params *cprm)
 				goto end_coredump;
 		}
 	}
+	dump_truncate(cprm);
 
 	if (!elf_core_write_extra_data(cprm))
 		goto end_coredump;
diff --git a/fs/coredump.c b/fs/coredump.c
index eb9c92c9b20f..4407e27beca9 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -833,3 +833,21 @@ int dump_align(struct coredump_params *cprm, int align)
 	return mod ? dump_skip(cprm, align - mod) : 1;
 }
 EXPORT_SYMBOL(dump_align);
+
+/*
+ * Ensures that file size is big enough to contain the current file
+ * postion. This prevents gdb from complaining about a truncated file
+ * if the last "write" to the file was dump_skip.
+ */
+void dump_truncate(struct coredump_params *cprm)
+{
+	struct file *file = cprm->file;
+	loff_t offset;
+
+	if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
+		offset = file->f_op->llseek(file, 0, SEEK_CUR);
+		if (i_size_read(file->f_mapping->host) < offset)
+			do_truncate(file->f_path.dentry, offset, 0, file);
+	}
+}
+EXPORT_SYMBOL(dump_truncate);
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index d016a121a8c4..28ffa94aed6b 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -14,6 +14,7 @@ struct coredump_params;
 extern int dump_skip(struct coredump_params *cprm, size_t nr);
 extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
 extern int dump_align(struct coredump_params *cprm, int align);
+extern void dump_truncate(struct coredump_params *cprm);
 #ifdef CONFIG_COREDUMP
 extern void do_coredump(const siginfo_t *siginfo);
 #else
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668462 — [PATCH for v4.9 LTS 71/86] x86/mpx: Use compatible types in comparison to fix sparse error

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 71/86] x86/mpx: Use compatible types in comparison to fix sparse error
Message-ID<tTuxR-5dy-65@gated-at.bofh.it>
In reply to#1668409
From: Tobias Klauser <tklauser@distanz.ch>

[ Upstream commit 453828625731d0ba7218242ef6ec88f59408f368 ]

info->si_addr is of type void __user *, so it should be compared against
something from the same address space.

This fixes the following sparse error:

  arch/x86/mm/mpx.c:296:27: error: incompatible types in comparison expression (different address spaces)

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/x86/mm/mpx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index e4f800999b32..3e7c489e1f55 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -293,7 +293,7 @@ siginfo_t *mpx_generate_siginfo(struct pt_regs *regs)
 	 * We were not able to extract an address from the instruction,
 	 * probably because there was something invalid in it.
 	 */
-	if (info->si_addr == (void *)-1) {
+	if (info->si_addr == (void __user *)-1) {
 		err = -EINVAL;
 		goto err_out;
 	}
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668463 — [PATCH for v4.9 LTS 44/86] mlxsw: spectrum_router: Correctly reallocate adjacency entries

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 44/86] mlxsw: spectrum_router: Correctly reallocate adjacency entries
Message-ID<tTuxS-5dy-69@gated-at.bofh.it>
In reply to#1668409
From: Ido Schimmel <idosch@mellanox.com>

[ Upstream commit a59b7e0246774e28193126fe7fdbbd0ae9c67dcc ]

mlxsw_sp_nexthop_group_mac_update() is called in one of two cases:

1) When the MAC of a nexthop needs to be updated
2) When the size of a nexthop group has changed

In the second case the adjacency entries for the nexthop group need to
be reallocated from the adjacency table. In this case we must write to
the entries the MAC addresses of all the nexthops that should be
offloaded and not only those whose MAC changed. Otherwise, these entries
would be filled with garbage data, resulting in packet loss.

Fixes: a7ff87acd995 ("mlxsw: spectrum_router: Implement next-hop routing")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 690563099313..9e31a3390154 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1178,7 +1178,8 @@ static int mlxsw_sp_nexthop_mac_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
 
 static int
 mlxsw_sp_nexthop_group_mac_update(struct mlxsw_sp *mlxsw_sp,
-				  struct mlxsw_sp_nexthop_group *nh_grp)
+				  struct mlxsw_sp_nexthop_group *nh_grp,
+				  bool reallocate)
 {
 	u32 adj_index = nh_grp->adj_index; /* base */
 	struct mlxsw_sp_nexthop *nh;
@@ -1193,7 +1194,7 @@ mlxsw_sp_nexthop_group_mac_update(struct mlxsw_sp *mlxsw_sp,
 			continue;
 		}
 
-		if (nh->update) {
+		if (nh->update || reallocate) {
 			err = mlxsw_sp_nexthop_mac_update(mlxsw_sp,
 							  adj_index, nh);
 			if (err)
@@ -1254,7 +1255,8 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
 		/* Nothing was added or removed, so no need to reallocate. Just
 		 * update MAC on existing adjacency indexes.
 		 */
-		err = mlxsw_sp_nexthop_group_mac_update(mlxsw_sp, nh_grp);
+		err = mlxsw_sp_nexthop_group_mac_update(mlxsw_sp, nh_grp,
+							false);
 		if (err) {
 			dev_warn(mlxsw_sp->bus_info->dev, "Failed to update neigh MAC in adjacency table.\n");
 			goto set_trap;
@@ -1282,7 +1284,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
 	nh_grp->adj_index_valid = 1;
 	nh_grp->adj_index = adj_index;
 	nh_grp->ecmp_size = ecmp_size;
-	err = mlxsw_sp_nexthop_group_mac_update(mlxsw_sp, nh_grp);
+	err = mlxsw_sp_nexthop_group_mac_update(mlxsw_sp, nh_grp, true);
 	if (err) {
 		dev_warn(mlxsw_sp->bus_info->dev, "Failed to update neigh MAC in adjacency table.\n");
 		goto set_trap;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668464 — [PATCH for v4.9 LTS 45/86] virtio_net: fix PAGE_SIZE > 64k

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 45/86] virtio_net: fix PAGE_SIZE > 64k
Message-ID<tTuxS-5dy-71@gated-at.bofh.it>
In reply to#1668409
From: "Michael S. Tsirkin" <mst@redhat.com>

[ Upstream commit d0fa28f00052391b5df328f502fbbdd4444938b7 ]

I don't have any guests with PAGE_SIZE > 64k but the
code seems to be clearly broken in that case
as PAGE_SIZE / MERGEABLE_BUFFER_ALIGN will need
more than 8 bit and so the code in mergeable_ctx_to_buf_address
does not give us the actual true size.

Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/virtio_net.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7ca99899972e..1568aedddfc9 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -47,8 +47,16 @@ module_param(gso, bool, 0444);
  */
 DECLARE_EWMA(pkt_len, 1, 64)
 
+/* With mergeable buffers we align buffer address and use the low bits to
+ * encode its true size. Buffer size is up to 1 page so we need to align to
+ * square root of page size to ensure we reserve enough bits to encode the true
+ * size.
+ */
+#define MERGEABLE_BUFFER_MIN_ALIGN_SHIFT ((PAGE_SHIFT + 1) / 2)
+
 /* Minimum alignment for mergeable packet buffers. */
-#define MERGEABLE_BUFFER_ALIGN max(L1_CACHE_BYTES, 256)
+#define MERGEABLE_BUFFER_ALIGN max(L1_CACHE_BYTES, \
+				   1 << MERGEABLE_BUFFER_MIN_ALIGN_SHIFT)
 
 #define VIRTNET_DRIVER_VERSION "1.0.0"
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668465 — [PATCH for v4.9 LTS 38/86] iwlwifi: fix kernel crash when unregistering thermal zone

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 38/86] iwlwifi: fix kernel crash when unregistering thermal zone
Message-ID<tTuxS-5dy-75@gated-at.bofh.it>
In reply to#1668409
From: Jens Axboe <axboe@kernel.dk>

[ Upstream commit 92549cdc288f47f3a98cf80ac5890c91f5876a06 ]

A recent firmware change seems to have enabled thermal zones on the
iwlwifi driver. Unfortunately, my device fails when registering the
thermal zone. This doesn't stop the driver from attempting to unregister
the thermal zone at unload time, triggering a NULL pointer deference in
strlen() off the thermal_zone_device_unregister() path.

Don't unregister if name is NULL, for that case we failed registering.
Do the same for the cooling zone.

Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 63a051be832e..bec7d9c46087 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -843,8 +843,10 @@ static void iwl_mvm_thermal_zone_unregister(struct iwl_mvm *mvm)
 		return;
 
 	IWL_DEBUG_TEMP(mvm, "Thermal zone device unregister\n");
-	thermal_zone_device_unregister(mvm->tz_device.tzone);
-	mvm->tz_device.tzone = NULL;
+	if (mvm->tz_device.tzone) {
+		thermal_zone_device_unregister(mvm->tz_device.tzone);
+		mvm->tz_device.tzone = NULL;
+	}
 }
 
 static void iwl_mvm_cooling_device_unregister(struct iwl_mvm *mvm)
@@ -853,8 +855,10 @@ static void iwl_mvm_cooling_device_unregister(struct iwl_mvm *mvm)
 		return;
 
 	IWL_DEBUG_TEMP(mvm, "Cooling device unregister\n");
-	thermal_cooling_device_unregister(mvm->cooling_dev.cdev);
-	mvm->cooling_dev.cdev = NULL;
+	if (mvm->cooling_dev.cdev) {
+		thermal_cooling_device_unregister(mvm->cooling_dev.cdev);
+		mvm->cooling_dev.cdev = NULL;
+	}
 }
 #endif /* CONFIG_THERMAL */
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668466 — [PATCH for v4.9 LTS 34/86] swiotlb-xen: update dev_addr after swapping pages

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 34/86] swiotlb-xen: update dev_addr after swapping pages
Message-ID<tTuxS-5dy-73@gated-at.bofh.it>
In reply to#1668409
From: Stefano Stabellini <sstabellini@kernel.org>

[ Upstream commit f1225ee4c8fcf09afaa199b8b1f0450f38b8cd11 ]

In xen_swiotlb_map_page and xen_swiotlb_map_sg_attrs, if the original
page is not suitable, we swap it for another page from the swiotlb
pool.

In these cases, we don't update the previously calculated dma address
for the page before calling xen_dma_map_page. Thus, we end up calling
xen_dma_map_page passing the wrong dev_addr, resulting in
xen_dma_map_page mistakenly assuming that the page is foreign when it is
local.

Fix the bug by updating dev_addr appropriately.

This change has no effect on x86, because xen_dma_map_page is a stub
there.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Pooya Keshavarzi <Pooya.Keshavarzi@de.bosch.com>
Tested-by: Pooya Keshavarzi <Pooya.Keshavarzi@de.bosch.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/xen/swiotlb-xen.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 8e7a3d646531..679f79f68182 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -409,9 +409,9 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
 	if (map == SWIOTLB_MAP_ERROR)
 		return DMA_ERROR_CODE;
 
+	dev_addr = xen_phys_to_bus(map);
 	xen_dma_map_page(dev, pfn_to_page(map >> PAGE_SHIFT),
 					dev_addr, map & ~PAGE_MASK, size, dir, attrs);
-	dev_addr = xen_phys_to_bus(map);
 
 	/*
 	 * Ensure that the address returned is DMA'ble
@@ -567,13 +567,14 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
 				sg_dma_len(sgl) = 0;
 				return 0;
 			}
+			dev_addr = xen_phys_to_bus(map);
 			xen_dma_map_page(hwdev, pfn_to_page(map >> PAGE_SHIFT),
 						dev_addr,
 						map & ~PAGE_MASK,
 						sg->length,
 						dir,
 						attrs);
-			sg->dma_address = xen_phys_to_bus(map);
+			sg->dma_address = dev_addr;
 		} else {
 			/* we are not interested in the dma_addr returned by
 			 * xen_dma_map_page, only in the potential cache flushes executed
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668467 — [PATCH for v4.9 LTS 68/86] mac80211: initialize SMPS field in HT capabilities

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:40 +0200
Subject[PATCH for v4.9 LTS 68/86] mac80211: initialize SMPS field in HT capabilities
Message-ID<tTuxS-5dy-77@gated-at.bofh.it>
In reply to#1668409
From: Felix Fietkau <nbd@nbd.name>

[ Upstream commit 43071d8fb3b7f589d72663c496a6880fb097533c ]

ibss and mesh modes copy the ht capabilites from the band without
overriding the SMPS state. Unfortunately the default value 0 for the
SMPS field means static SMPS instead of disabled.

This results in HT ibss and mesh setups using only single-stream rates,
even though SMPS is not supposed to be active.

Initialize SMPS to disabled for all bands on ieee80211_hw_register to
ensure that the value is sane where it is not overriden with the real
SMPS state.

Reported-by: Elektra Wagenrad <onelektra@gmx.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[move VHT TODO comment to a better place]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/mac80211/main.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 1075ac24c8c5..2bb6899854d4 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -908,12 +908,17 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 		supp_ht = supp_ht || sband->ht_cap.ht_supported;
 		supp_vht = supp_vht || sband->vht_cap.vht_supported;
 
-		if (sband->ht_cap.ht_supported)
-			local->rx_chains =
-				max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
-				    local->rx_chains);
+		if (!sband->ht_cap.ht_supported)
+			continue;
 
 		/* TODO: consider VHT for RX chains, hopefully it's the same */
+		local->rx_chains =
+			max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
+			    local->rx_chains);
+
+		/* no need to mask, SM_PS_DISABLED has all bits set */
+		sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
+			             IEEE80211_HT_CAP_SM_PS_SHIFT;
 	}
 
 	/* if low-level driver supports AP, we also support VLAN */
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668468 — [PATCH for v4.9 LTS 14/86] KVM: x86: fix fixing of hypercalls

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:50 +0200
Subject[PATCH for v4.9 LTS 14/86] KVM: x86: fix fixing of hypercalls
Message-ID<tTuHv-5ia-1@gated-at.bofh.it>
In reply to#1668409
From: Dmitry Vyukov <dvyukov@google.com>

[ Upstream commit ce2e852ecc9a42e4b8dabb46025cfef63209234a ]

emulator_fix_hypercall() replaces hypercall with vmcall instruction,
but it does not handle GP exception properly when writes the new instruction.
It can return X86EMUL_PROPAGATE_FAULT without setting exception information.
This leads to incorrect emulation and triggers
WARN_ON(ctxt->exception.vector > 0x1f) in x86_emulate_insn()
as discovered by syzkaller fuzzer:

WARNING: CPU: 2 PID: 18646 at arch/x86/kvm/emulate.c:5558
Call Trace:
 warn_slowpath_null+0x2c/0x40 kernel/panic.c:582
 x86_emulate_insn+0x16a5/0x4090 arch/x86/kvm/emulate.c:5572
 x86_emulate_instruction+0x403/0x1cc0 arch/x86/kvm/x86.c:5618
 emulate_instruction arch/x86/include/asm/kvm_host.h:1127 [inline]
 handle_exception+0x594/0xfd0 arch/x86/kvm/vmx.c:5762
 vmx_handle_exit+0x2b7/0x38b0 arch/x86/kvm/vmx.c:8625
 vcpu_enter_guest arch/x86/kvm/x86.c:6888 [inline]
 vcpu_run arch/x86/kvm/x86.c:6947 [inline]

Set exception information when write in emulator_fix_hypercall() fails.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: kvm@vger.kernel.org
Cc: syzkaller@googlegroups.com
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/x86/kvm/x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 62cde4f67c72..ab3f00399cbb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6111,7 +6111,8 @@ static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt)
 
 	kvm_x86_ops->patch_hypercall(vcpu, instruction);
 
-	return emulator_write_emulated(ctxt, rip, instruction, 3, NULL);
+	return emulator_write_emulated(ctxt, rip, instruction, 3,
+		&ctxt->exception);
 }
 
 static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu)
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668469 — [PATCH for v4.9 LTS 24/86] net: ethtool: Initialize buffer when querying device channel settings

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:50 +0200
Subject[PATCH for v4.9 LTS 24/86] net: ethtool: Initialize buffer when querying device channel settings
Message-ID<tTuHv-5ia-3@gated-at.bofh.it>
In reply to#1668409
From: Eran Ben Elisha <eranbe@mellanox.com>

[ Upstream commit 31a86d137219373c3222ca5f4f912e9a4d8065bb ]

Ethtool channels respond struct was uninitialized when querying device
channel boundaries settings. As a result, unreported fields by the driver
hold garbage.  This may cause sending unsupported params to driver.

Fixes: 8bf368620486 ('ethtool: ensure channel counts are within bounds ...')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
CC: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/core/ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 072c1f4998c9..e9989b835a66 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1704,7 +1704,7 @@ static noinline_for_stack int ethtool_get_channels(struct net_device *dev,
 static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
 						   void __user *useraddr)
 {
-	struct ethtool_channels channels, max;
+	struct ethtool_channels channels, max = { .cmd = ETHTOOL_GCHANNELS };
 	u32 max_rx_in_use = 0;
 
 	if (!dev->ethtool_ops->set_channels || !dev->ethtool_ops->get_channels)
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668470 — [PATCH for v4.9 LTS 23/86] powerpc/eeh: Enable IO path on permanent error

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:50 +0200
Subject[PATCH for v4.9 LTS 23/86] powerpc/eeh: Enable IO path on permanent error
Message-ID<tTuHv-5ia-7@gated-at.bofh.it>
In reply to#1668409
From: Gavin Shan <gwshan@linux.vnet.ibm.com>

[ Upstream commit 387bbc974f6adf91aa635090f73434ed10edd915 ]

We give up recovery on permanent error, simply shutdown the affected
devices and remove them. If the devices can't be put into quiet state,
they spew more traffic that is likely to cause another unexpected EEH
error. This was observed on "p8dtu2u" machine:

   0002:00:00.0 PCI bridge: IBM Device 03dc
   0002:01:00.0 Ethernet controller: Intel Corporation \
                Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
   0002:01:00.1 Ethernet controller: Intel Corporation \
                Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
   0002:01:00.2 Ethernet controller: Intel Corporation \
                Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)
   0002:01:00.3 Ethernet controller: Intel Corporation \
                Ethernet Controller X710/X557-AT 10GBASE-T (rev 02)

On P8 PowerNV platform, the IO path is frozen when shutdowning the
devices, meaning the memory registers are inaccessible. It is why
the devices can't be put into quiet state before removing them.
This fixes the issue by enabling IO path prior to putting the devices
into quiet state.

Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/powerpc/kernel/eeh.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index f25731627d7f..e5bfbf62827a 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -298,9 +298,17 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity)
 	 *
 	 * For pHyp, we have to enable IO for log retrieval. Otherwise,
 	 * 0xFF's is always returned from PCI config space.
+	 *
+	 * When the @severity is EEH_LOG_PERM, the PE is going to be
+	 * removed. Prior to that, the drivers for devices included in
+	 * the PE will be closed. The drivers rely on working IO path
+	 * to bring the devices to quiet state. Otherwise, PCI traffic
+	 * from those devices after they are removed is like to cause
+	 * another unexpected EEH error.
 	 */
 	if (!(pe->type & EEH_PE_PHB)) {
-		if (eeh_has_flag(EEH_ENABLE_IO_FOR_LOG))
+		if (eeh_has_flag(EEH_ENABLE_IO_FOR_LOG) ||
+		    severity == EEH_LOG_PERM)
 			eeh_pci_enable(pe, EEH_OPT_THAW_MMIO);
 
 		/*
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1668471 — [PATCH for v4.9 LTS 26/86] xen-netback: protect resource cleaning on XenBus disconnect

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:50 +0200
Subject[PATCH for v4.9 LTS 26/86] xen-netback: protect resource cleaning on XenBus disconnect
Message-ID<tTuHv-5ia-9@gated-at.bofh.it>
In reply to#1668409
From: Igor Druzhinin <igor.druzhinin@citrix.com>

[ Upstream commit f16f1df65f1cf139ff9e9f84661e6573d6bb27fc ]

vif->lock is used to protect statistics gathering agents from using the
queue structure during cleaning.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/xen-netback/interface.c | 6 ++++--
 drivers/net/xen-netback/xenbus.c    | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 74dc2bf71428..b009d7966b46 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -221,18 +221,18 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
 {
 	struct xenvif *vif = netdev_priv(dev);
 	struct xenvif_queue *queue = NULL;
-	unsigned int num_queues = vif->num_queues;
 	unsigned long rx_bytes = 0;
 	unsigned long rx_packets = 0;
 	unsigned long tx_bytes = 0;
 	unsigned long tx_packets = 0;
 	unsigned int index;
 
+	spin_lock(&vif->lock);
 	if (vif->queues == NULL)
 		goto out;
 
 	/* Aggregate tx and rx stats from each queue */
-	for (index = 0; index < num_queues; ++index) {
+	for (index = 0; index < vif->num_queues; ++index) {
 		queue = &vif->queues[index];
 		rx_bytes += queue->stats.rx_bytes;
 		rx_packets += queue->stats.rx_packets;
@@ -241,6 +241,8 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
 	}
 
 out:
+	spin_unlock(&vif->lock);
+
 	vif->dev->stats.rx_bytes = rx_bytes;
 	vif->dev->stats.rx_packets = rx_packets;
 	vif->dev->stats.tx_bytes = tx_bytes;
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index abffdbded5f2..b44f37fff890 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -503,9 +503,11 @@ static void backend_disconnect(struct backend_info *be)
 		for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index)
 			xenvif_deinit_queue(&be->vif->queues[queue_index]);
 
+		spin_lock(&be->vif->lock);
 		vfree(be->vif->queues);
 		be->vif->num_queues = 0;
 		be->vif->queues = NULL;
+		spin_unlock(&be->vif->lock);
 
 		xenvif_disconnect_ctrl(be->vif);
 	}
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →

Back to top | Article view | linux.kernel


csiph-web