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 1 of 5  [1] 2 3 4 5  Next page →


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

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 01/86] sparc64: Handle PIO & MEM non-resumable errors.
Message-ID<tTuo9-58F-5@gated-at.bofh.it>
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

[ Upstream commit 047487241ff59374fded8c477f21453681f5995c ]

User processes trying to access an invalid memory address via PIO will
receive a SIGBUS signal instead of causing a panic.  Memory errors will
receive a SIGKILL since a SIGBUS may result in a coredump which may
attempt to repeat the faulting access.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/sparc/kernel/traps_64.c | 73 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 496fa926e1e0..d44fb806bbd7 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2051,6 +2051,73 @@ void sun4v_resum_overflow(struct pt_regs *regs)
 	atomic_inc(&sun4v_resum_oflow_cnt);
 }
 
+/* Given a set of registers, get the virtual addressi that was being accessed
+ * by the faulting instructions at tpc.
+ */
+static unsigned long sun4v_get_vaddr(struct pt_regs *regs)
+{
+	unsigned int insn;
+
+	if (!copy_from_user(&insn, (void __user *)regs->tpc, 4)) {
+		return compute_effective_address(regs, insn,
+						 (insn >> 25) & 0x1f);
+	}
+	return 0;
+}
+
+/* Attempt to handle non-resumable errors generated from userspace.
+ * Returns true if the signal was handled, false otherwise.
+ */
+bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
+				  struct sun4v_error_entry *ent) {
+
+	unsigned int attrs = ent->err_attrs;
+
+	if (attrs & SUN4V_ERR_ATTRS_MEMORY) {
+		unsigned long addr = ent->err_raddr;
+		siginfo_t info;
+
+		if (addr == ~(u64)0) {
+			/* This seems highly unlikely to ever occur */
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR: Memory error detected in unknown location!\n");
+		} else {
+			unsigned long page_cnt = DIV_ROUND_UP(ent->err_size,
+							      PAGE_SIZE);
+
+			/* Break the unfortunate news. */
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR: Memory failed at %016lX\n",
+				 addr);
+			pr_emerg("SUN4V NON-RECOVERABLE ERROR:   Claiming %lu ages.\n",
+				 page_cnt);
+
+			while (page_cnt-- > 0) {
+				if (pfn_valid(addr >> PAGE_SHIFT))
+					get_page(pfn_to_page(addr >> PAGE_SHIFT));
+				addr += PAGE_SIZE;
+			}
+		}
+		info.si_signo = SIGKILL;
+		info.si_errno = 0;
+		info.si_trapno = 0;
+		force_sig_info(info.si_signo, &info, current);
+
+		return true;
+	}
+	if (attrs & SUN4V_ERR_ATTRS_PIO) {
+		siginfo_t info;
+
+		info.si_signo = SIGBUS;
+		info.si_code = BUS_ADRERR;
+		info.si_addr = (void __user *)sun4v_get_vaddr(regs);
+		force_sig_info(info.si_signo, &info, current);
+
+		return true;
+	}
+
+	/* Default to doing nothing */
+	return false;
+}
+
 /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
  * Log the event, clear the first word of the entry, and die.
  */
@@ -2075,6 +2142,12 @@ void sun4v_nonresum_error(struct pt_regs *regs, unsigned long offset)
 
 	put_cpu();
 
+	if (!(regs->tstate & TSTATE_PRIV) &&
+	    sun4v_nonresum_error_user_handled(regs, &local_copy)) {
+		/* DON'T PANIC: This userspace error was handled. */
+		return;
+	}
+
 #ifdef CONFIG_PCI
 	/* Check for the special PCI poke sequence. */
 	if (pci_poke_in_progress && pci_poke_cpu == cpu) {
-- 
2.11.0

[toc] | [next] | [standalone]


#1668410 — [PATCH for v4.9 LTS 80/86] be2net: don't delete MAC on close on unprivileged BE3 VFs

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 80/86] be2net: don't delete MAC on close on unprivileged BE3 VFs
Message-ID<tTuoa-58F-21@gated-at.bofh.it>
In reply to#1668409
From: Ivan Vecera <cera@cera.cz>

[ Upstream commit 6d928ae590c8d58cfd5cca997d54394de139cbb7 ]

BE3 VFs without FILTMGMT privilege are not allowed to modify its MAC,
VLAN table and UC/MC lists. So don't try to delete MAC on such VFs.

Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 9711ca4510fa..a25d35a1b03d 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3630,7 +3630,11 @@ static void be_rx_qs_destroy(struct be_adapter *adapter)
 
 static void be_disable_if_filters(struct be_adapter *adapter)
 {
-	be_dev_mac_del(adapter, adapter->pmac_id[0]);
+	/* Don't delete MAC on BE3 VFs without FILTMGMT privilege  */
+	if (!BEx_chip(adapter) || !be_virtfn(adapter) ||
+	    check_privilege(adapter, BE_PRIV_FILTMGMT))
+		be_dev_mac_del(adapter, adapter->pmac_id[0]);
+
 	be_clear_uc_list(adapter);
 	be_clear_mc_list(adapter);
 
-- 
2.11.0

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


#1668411 — [PATCH for v4.9 LTS 81/86] be2net: fix MAC addr setting on privileged BE3 VFs

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 81/86] be2net: fix MAC addr setting on privileged BE3 VFs
Message-ID<tTuoa-58F-23@gated-at.bofh.it>
In reply to#1668409
From: Ivan Vecera <cera@cera.cz>

[ Upstream commit 34393529163af7163ef8459808e3cf2af7db7f16 ]

During interface opening MAC address stored in netdev->dev_addr is
programmed in the HW with exception of BE3 VFs where the initial
MAC is programmed by parent PF. This is OK when MAC address is not
changed when an interfaces is down. In this case the requested MAC is
stored to netdev->dev_addr and later is stored into HW during opening.
But this is not done for all BE3 VFs so the NIC HW does not know
anything about this change and all traffic is filtered.

This is the case of bonding if fail_over_mac == 0 where the MACs of
the slaves are changed while they are down.

The be2net behavior is too restrictive because if a BE3 VF has
the FILTMGMT privilege then it is able to modify its MAC without
any restriction.

To solve the described problem the driver should take care about these
privileged BE3 VFs so the MAC is programmed during opening. And by
contrast unpriviled BE3 VFs should not be allowed to change its MAC
in any case.

Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index a25d35a1b03d..b3c9cbef766e 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -319,6 +319,13 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
 	if (ether_addr_equal(addr->sa_data, adapter->dev_mac))
 		return 0;
 
+	/* BE3 VFs without FILTMGMT privilege are not allowed to set its MAC
+	 * address
+	 */
+	if (BEx_chip(adapter) && be_virtfn(adapter) &&
+	    !check_privilege(adapter, BE_PRIV_FILTMGMT))
+		return -EPERM;
+
 	/* if device is not running, copy MAC to netdev->dev_addr */
 	if (!netif_running(netdev))
 		goto done;
@@ -3787,8 +3794,9 @@ static int be_enable_if_filters(struct be_adapter *adapter)
 	if (status)
 		return status;
 
-	/* For BE3 VFs, the PF programs the initial MAC address */
-	if (!(BEx_chip(adapter) && be_virtfn(adapter))) {
+	/* Don't add MAC on BE3 VFs without FILTMGMT privilege */
+	if (!BEx_chip(adapter) || !be_virtfn(adapter) ||
+	    check_privilege(adapter, BE_PRIV_FILTMGMT)) {
 		status = be_dev_mac_add(adapter, adapter->netdev->dev_addr);
 		if (status)
 			return status;
-- 
2.11.0

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


#1668412 — [PATCH for v4.9 LTS 85/86] perf probe: Fix to probe on gcc generated functions in modules

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 85/86] perf probe: Fix to probe on gcc generated functions in modules
Message-ID<tTuoa-58F-25@gated-at.bofh.it>
In reply to#1668409
From: Masami Hiramatsu <mhiramat@kernel.org>

[ Upstream commit 613f050d68a8ed3c0b18b9568698908ef7bbc1f7 ]

Fix to probe on gcc generated functions on modules. Since
probing on a module is based on its symbol name, it should
be adjusted on actual symbols.

E.g. without this fix, perf probe shows probe definition
on non-exist symbol as below.

  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -F in_range*
  in_range.isra.12
  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
  p:probe/in_range nf_nat:in_range+0

With this fix, perf probe correctly shows a probe on
gcc-generated symbol.

  $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
  p:probe/in_range nf_nat:in_range.isra.12+0

This also fixes same problem on online module as below.

  $ perf probe -m i915 -D assert_plane
  p:probe/assert_plane i915:assert_plane.constprop.134+0

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/148411450673.9978.14905987549651656075.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 tools/perf/util/probe-event.c  | 45 +++++++++++++++++++++++++++---------------
 tools/perf/util/probe-finder.c |  7 +++++--
 tools/perf/util/probe-finder.h |  3 +++
 3 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index d281ae2b54e8..1d9c02bc00f1 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -645,18 +645,31 @@ static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
 	return ret;
 }
 
-static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
-					    int ntevs, const char *module)
+static int
+post_process_module_probe_trace_events(struct probe_trace_event *tevs,
+				       int ntevs, const char *module,
+				       struct debuginfo *dinfo)
 {
+	Dwarf_Addr text_offs = 0;
 	int i, ret = 0;
 	char *mod_name = NULL;
+	struct map *map;
 
 	if (!module)
 		return 0;
 
-	mod_name = find_module_name(module);
+	map = get_target_map(module, false);
+	if (!map || debuginfo__get_text_offset(dinfo, &text_offs, true) < 0) {
+		pr_warning("Failed to get ELF symbols for %s\n", module);
+		return -EINVAL;
+	}
 
+	mod_name = find_module_name(module);
 	for (i = 0; i < ntevs; i++) {
+		ret = post_process_probe_trace_point(&tevs[i].point,
+						map, (unsigned long)text_offs);
+		if (ret < 0)
+			break;
 		tevs[i].point.module =
 			strdup(mod_name ? mod_name : module);
 		if (!tevs[i].point.module) {
@@ -666,6 +679,8 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
 	}
 
 	free(mod_name);
+	map__put(map);
+
 	return ret;
 }
 
@@ -722,7 +737,7 @@ arch__post_process_probe_trace_events(struct perf_probe_event *pev __maybe_unuse
 static int post_process_probe_trace_events(struct perf_probe_event *pev,
 					   struct probe_trace_event *tevs,
 					   int ntevs, const char *module,
-					   bool uprobe)
+					   bool uprobe, struct debuginfo *dinfo)
 {
 	int ret;
 
@@ -730,7 +745,8 @@ static int post_process_probe_trace_events(struct perf_probe_event *pev,
 		ret = add_exec_to_probe_trace_events(tevs, ntevs, module);
 	else if (module)
 		/* Currently ref_reloc_sym based probe is not for drivers */
-		ret = add_module_to_probe_trace_events(tevs, ntevs, module);
+		ret = post_process_module_probe_trace_events(tevs, ntevs,
+							     module, dinfo);
 	else
 		ret = post_process_kernel_probe_trace_events(tevs, ntevs);
 
@@ -774,30 +790,27 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 		}
 	}
 
-	debuginfo__delete(dinfo);
-
 	if (ntevs > 0) {	/* Succeeded to find trace events */
 		pr_debug("Found %d probe_trace_events.\n", ntevs);
 		ret = post_process_probe_trace_events(pev, *tevs, ntevs,
-						pev->target, pev->uprobes);
+					pev->target, pev->uprobes, dinfo);
 		if (ret < 0 || ret == ntevs) {
+			pr_debug("Post processing failed or all events are skipped. (%d)\n", ret);
 			clear_probe_trace_events(*tevs, ntevs);
 			zfree(tevs);
+			ntevs = 0;
 		}
-		if (ret != ntevs)
-			return ret < 0 ? ret : ntevs;
-		ntevs = 0;
-		/* Fall through */
 	}
 
+	debuginfo__delete(dinfo);
+
 	if (ntevs == 0)	{	/* No error but failed to find probe point. */
 		pr_warning("Probe point '%s' not found.\n",
 			   synthesize_perf_probe_point(&pev->point));
 		return -ENOENT;
-	}
-	/* Error path : ntevs < 0 */
-	pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
-	if (ntevs < 0) {
+	} else if (ntevs < 0) {
+		/* Error path : ntevs < 0 */
+		pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
 		if (ntevs == -EBADF)
 			pr_warning("Warning: No dwarf info found in the vmlinux - "
 				"please rebuild kernel with CONFIG_DEBUG_INFO=y.\n");
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 0278fe1a4cc6..0d9d6e0803b8 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1501,7 +1501,8 @@ int debuginfo__find_available_vars_at(struct debuginfo *dbg,
 }
 
 /* For the kernel module, we need a special code to get a DIE */
-static int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs)
+int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
+				bool adjust_offset)
 {
 	int n, i;
 	Elf32_Word shndx;
@@ -1530,6 +1531,8 @@ static int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs)
 			if (!shdr)
 				return -ENOENT;
 			*offs = shdr->sh_addr;
+			if (adjust_offset)
+				*offs -= shdr->sh_offset;
 		}
 	}
 	return 0;
@@ -1545,7 +1548,7 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
 	int baseline = 0, lineno = 0, ret = 0;
 
 	/* We always need to relocate the address for aranges */
-	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
+	if (debuginfo__get_text_offset(dbg, &baseaddr, false) == 0)
 		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index f1d8558f498e..2956c5198652 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -46,6 +46,9 @@ int debuginfo__find_trace_events(struct debuginfo *dbg,
 int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
 				struct perf_probe_point *ppt);
 
+int debuginfo__get_text_offset(struct debuginfo *dbg, Dwarf_Addr *offs,
+			       bool adjust_offset);
+
 /* Find a line range */
 int debuginfo__find_line_range(struct debuginfo *dbg, struct line_range *lr);
 
-- 
2.11.0

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


#1668414 — [PATCH for v4.9 LTS 03/86] net: ethtool: add support for 2500BaseT and 5000BaseT link modes

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 03/86] net: ethtool: add support for 2500BaseT and 5000BaseT link modes
Message-ID<tTuoa-58F-29@gated-at.bofh.it>
In reply to#1668409
From: Pavel Belous <pavel.s.belous@gmail.com>

[ Upstream commit 94842b4fc4d6b1691cfc86c6f5251f299d27f4ba ]

This patch introduce support for 2500BaseT and 5000BaseT link modes.
These modes are included in the new IEEE 802.3bz standard.

Signed-off-by: Pavel Belous <pavel.s.belous@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 include/uapi/linux/ethtool.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 8e547231c1b7..5c22e8cab24b 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1368,6 +1368,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_10000baseLR_Full_BIT	= 44,
 	ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT	= 45,
 	ETHTOOL_LINK_MODE_10000baseER_Full_BIT	= 46,
+	ETHTOOL_LINK_MODE_2500baseT_Full_BIT	= 47,
+	ETHTOOL_LINK_MODE_5000baseT_Full_BIT	= 48,
 
 
 	/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
@@ -1377,7 +1379,7 @@ enum ethtool_link_mode_bit_indices {
 	 */
 
 	__ETHTOOL_LINK_MODE_LAST
-	  = ETHTOOL_LINK_MODE_10000baseER_Full_BIT,
+	  = ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
 };
 
 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name)	\
-- 
2.11.0

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


#1668416 — [PATCH for v4.9 LTS 59/86] usb: gadget: composite: Fix function used to free memory

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 59/86] usb: gadget: composite: Fix function used to free memory
Message-ID<tTuob-58F-31@gated-at.bofh.it>
In reply to#1668409
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 990758c53eafe5a220a780ed12e7b4d51b3df032 ]

'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request()' so
'usb_ep_free_request()' should be used to free it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/gadget/composite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index c3c5b87b35b3..baa7cdcc0ebc 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2147,7 +2147,7 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev,
 	cdev->os_desc_req->buf = kmalloc(4096, GFP_KERNEL);
 	if (!cdev->os_desc_req->buf) {
 		ret = -ENOMEM;
-		kfree(cdev->os_desc_req);
+		usb_ep_free_request(ep0, cdev->os_desc_req);
 		goto end;
 	}
 	cdev->os_desc_req->context = cdev;
-- 
2.11.0

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


#1668417 — [PATCH for v4.9 LTS 79/86] be2net: fix status check in be_cmd_pmac_add()

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 79/86] be2net: fix status check in be_cmd_pmac_add()
Message-ID<tTuob-58F-35@gated-at.bofh.it>
In reply to#1668409
From: Ivan Vecera <cera@cera.cz>

[ Upstream commit fe68d8bfe59c561664aa87d827aa4b320eb08895 ]

Return value from be_mcc_notify_wait() contains a base completion status
together with an additional status. The base_status() macro need to be
used to access base status.

Fixes: e3a7ae2 be2net: Changing MAC Address of a VF was broken
Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 0e74529a4209..30e855004c57 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1118,7 +1118,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
 err:
 	mutex_unlock(&adapter->mcc_lock);
 
-	 if (status == MCC_STATUS_UNAUTHORIZED_REQUEST)
+	 if (base_status(status) == MCC_STATUS_UNAUTHORIZED_REQUEST)
 		status = -EPERM;
 
 	return status;
-- 
2.11.0

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


#1668418 — [PATCH for v4.9 LTS 50/86] Documentation: devicetree: change the mediatek ethernet compatible string

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 50/86] Documentation: devicetree: change the mediatek ethernet compatible string
Message-ID<tTuob-58F-39@gated-at.bofh.it>
In reply to#1668409
From: John Crispin <john@phrozen.org>

[ Upstream commit 61976fff20f92aceecc3670f6168bfc57a79e047 ]

When the binding was defined, I was not aware that mt2701 was an earlier
version of the SoC. For sake of consistency, the ethernet driver should
use mt2701 inside the compat string as this is the earliest SoC with the
ethernet core.

The ethernet driver is currently of no real use until we finish and
upstream the DSA driver. There are no users of this binding yet. It should
be safe to fix this now before it is too late and we need to provide
backward compatibility for the mt7623-eth compat string.

Reported-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: John Crispin <john@phrozen.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index c010fafc66a8..c7194e87d5f4 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -7,7 +7,7 @@ have dual GMAC each represented by a child node..
 * Ethernet controller node
 
 Required properties:
-- compatible: Should be "mediatek,mt7623-eth"
+- compatible: Should be "mediatek,mt2701-eth"
 - reg: Address and length of the register set for the device
 - interrupts: Should contain the three frame engines interrupts in numeric
 	order. These are fe_int0, fe_int1 and fe_int2.
-- 
2.11.0

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


#1668419 — [PATCH for v4.9 LTS 82/86] perf probe: Fix to show correct locations for events on modules

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 82/86] perf probe: Fix to show correct locations for events on modules
Message-ID<tTuob-58F-37@gated-at.bofh.it>
In reply to#1668409
From: Masami Hiramatsu <mhiramat@kernel.org>

[ Upstream commit d2d4edbebe07ddb77980656abe7b9bc7a9e0cdf7 ]

Fix to show correct locations for events on modules by relocating given
address instead of retrying after failure.

This happens when the module text size is big enough, bigger than
sh_addr, because the original code retries with given address + sh_addr
if it failed to find CU DIE at the given address.

Any address smaller than sh_addr always fails and it retries with the
correct address, but addresses bigger than sh_addr will get a CU DIE
which is on the given address (not adjusted by sh_addr).

In my environment(x86-64), the sh_addr of ".text" section is 0x10030.
Since i915 is a huge kernel module, we can see this issue as below.

  $ grep "[Tt] .*\[i915\]" /proc/kallsyms | sort | head -n1
  ffffffffc0270000 t i915_switcheroo_can_switch	[i915]

ffffffffc0270000 + 0x10030 = ffffffffc0280030, so we'll check
symbols cross this boundary.

  $ grep "[Tt] .*\[i915\]" /proc/kallsyms | grep -B1 ^ffffffffc028\
  | head -n 2
  ffffffffc027ff80 t haswell_init_clock_gating	[i915]
  ffffffffc0280110 t valleyview_init_clock_gating	[i915]

So setup probes on both function and see what happen.

  $ sudo ./perf probe -m i915 -a haswell_init_clock_gating \
        -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

  	perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  $ sudo ./perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on i915_vga_set_decode:4@gpu/drm/i915/i915_drv.c in i915)

As you can see, haswell_init_clock_gating is correctly shown,
but valleyview_init_clock_gating is not.

With this patch, both events are shown correctly.

  $ sudo ./perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)

Committer notes:

In my case:

  # perf probe -m i915 -a haswell_init_clock_gating -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

	  perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  # perf probe -l
    probe:haswell_init_clock_gating (on i915_getparam+432@gpu/drm/i915/i915_drv.c in i915)
    probe:valleyview_init_clock_gating (on __i915_printk+240@gpu/drm/i915/i915_drv.c in i915)
  #

  # readelf -SW /lib/modules/4.9.0+/build/vmlinux | egrep -w '.text|Name'
   [Nr] Name   Type      Address          Off    Size   ES Flg Lk Inf Al
   [ 1] .text  PROGBITS  ffffffff81000000 200000 822fd3 00  AX  0   0 4096
  #

  So both are b0rked, now with the fix:

  # perf probe -m i915 -a haswell_init_clock_gating -a valleyview_init_clock_gating
  Added new events:
    probe:haswell_init_clock_gating (on haswell_init_clock_gating in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating in i915)

  You can now use it in all perf tools, such as:

	perf record -e probe:valleyview_init_clock_gating -aR sleep 1

  # perf probe -l
    probe:haswell_init_clock_gating (on haswell_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
    probe:valleyview_init_clock_gating (on valleyview_init_clock_gating@gpu/drm/i915/intel_pm.c in i915)
  #

Both looks correct.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/148411436777.9978.1440275861947194930.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 tools/perf/util/probe-finder.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index df4debe564da..0278fe1a4cc6 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1543,16 +1543,12 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
 	Dwarf_Addr _addr = 0, baseaddr = 0;
 	const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp;
 	int baseline = 0, lineno = 0, ret = 0;
-	bool reloc = false;
 
-retry:
+	/* We always need to relocate the address for aranges */
+	if (debuginfo__get_text_offset(dbg, &baseaddr) == 0)
+		addr += baseaddr;
 	/* Find cu die */
 	if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
-		if (!reloc && debuginfo__get_text_offset(dbg, &baseaddr) == 0) {
-			addr += baseaddr;
-			reloc = true;
-			goto retry;
-		}
 		pr_warning("Failed to find debug information for address %lx\n",
 			   addr);
 		ret = -EINVAL;
-- 
2.11.0

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


#1668420 — [PATCH for v4.9 LTS 84/86] tipc: allocate user memory with GFP_KERNEL flag

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 84/86] tipc: allocate user memory with GFP_KERNEL flag
Message-ID<tTuob-58F-43@gated-at.bofh.it>
In reply to#1668409
From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>

[ Upstream commit 57d5f64d83ab5b5a5118b1597386dd76eaf4340d ]

Until now, we allocate memory always with GFP_ATOMIC flag.
When the system is under memory pressure and a user tries to send,
the send fails due to low memory. However, the user application
can wait for free memory if we allocate it using GFP_KERNEL flag.

In this commit, we use allocate memory with GFP_KERNEL for all user
allocation.

Reported-by: Rune Torgersen <runet@innovsys.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/tipc/discover.c   |  4 ++--
 net/tipc/link.c       |  2 +-
 net/tipc/msg.c        | 16 ++++++++--------
 net/tipc/msg.h        |  2 +-
 net/tipc/name_distr.c |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 6b109a808d4c..02462d67d191 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -169,7 +169,7 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb,
 
 	/* Send response, if necessary */
 	if (respond && (mtyp == DSC_REQ_MSG)) {
-		rskb = tipc_buf_acquire(MAX_H_SIZE);
+		rskb = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC);
 		if (!rskb)
 			return;
 		tipc_disc_init_msg(net, rskb, DSC_RESP_MSG, bearer);
@@ -278,7 +278,7 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b,
 	req = kmalloc(sizeof(*req), GFP_ATOMIC);
 	if (!req)
 		return -ENOMEM;
-	req->buf = tipc_buf_acquire(MAX_H_SIZE);
+	req->buf = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC);
 	if (!req->buf) {
 		kfree(req);
 		return -ENOMEM;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index bda89bf9f4ff..4e8647aef01c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1395,7 +1395,7 @@ void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl,
 			msg_set_seqno(hdr, seqno++);
 		pktlen = msg_size(hdr);
 		msg_set_size(&tnlhdr, pktlen + INT_H_SIZE);
-		tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE);
+		tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE, GFP_ATOMIC);
 		if (!tnlskb) {
 			pr_warn("%sunable to send packet\n", link_co_err);
 			return;
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 17201aa8423d..a53fbe120f35 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -58,12 +58,12 @@ static unsigned int align(unsigned int i)
  * NOTE: Headroom is reserved to allow prepending of a data link header.
  *       There may also be unrequested tailroom present at the buffer's end.
  */
-struct sk_buff *tipc_buf_acquire(u32 size)
+struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp)
 {
 	struct sk_buff *skb;
 	unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u;
 
-	skb = alloc_skb_fclone(buf_size, GFP_ATOMIC);
+	skb = alloc_skb_fclone(buf_size, gfp);
 	if (skb) {
 		skb_reserve(skb, BUF_HEADROOM);
 		skb_put(skb, size);
@@ -95,7 +95,7 @@ struct sk_buff *tipc_msg_create(uint user, uint type,
 	struct tipc_msg *msg;
 	struct sk_buff *buf;
 
-	buf = tipc_buf_acquire(hdr_sz + data_sz);
+	buf = tipc_buf_acquire(hdr_sz + data_sz, GFP_ATOMIC);
 	if (unlikely(!buf))
 		return NULL;
 
@@ -261,7 +261,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
 
 	/* No fragmentation needed? */
 	if (likely(msz <= pktmax)) {
-		skb = tipc_buf_acquire(msz);
+		skb = tipc_buf_acquire(msz, GFP_KERNEL);
 		if (unlikely(!skb))
 			return -ENOMEM;
 		skb_orphan(skb);
@@ -282,7 +282,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
 	msg_set_importance(&pkthdr, msg_importance(mhdr));
 
 	/* Prepare first fragment */
-	skb = tipc_buf_acquire(pktmax);
+	skb = tipc_buf_acquire(pktmax, GFP_KERNEL);
 	if (!skb)
 		return -ENOMEM;
 	skb_orphan(skb);
@@ -313,7 +313,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
 			pktsz = drem + INT_H_SIZE;
 		else
 			pktsz = pktmax;
-		skb = tipc_buf_acquire(pktsz);
+		skb = tipc_buf_acquire(pktsz, GFP_KERNEL);
 		if (!skb) {
 			rc = -ENOMEM;
 			goto error;
@@ -448,7 +448,7 @@ bool tipc_msg_make_bundle(struct sk_buff **skb,  struct tipc_msg *msg,
 	if (msz > (max / 2))
 		return false;
 
-	_skb = tipc_buf_acquire(max);
+	_skb = tipc_buf_acquire(max, GFP_ATOMIC);
 	if (!_skb)
 		return false;
 
@@ -496,7 +496,7 @@ bool tipc_msg_reverse(u32 own_node,  struct sk_buff **skb, int err)
 
 	/* Never return SHORT header; expand by replacing buffer if necessary */
 	if (msg_short(hdr)) {
-		*skb = tipc_buf_acquire(BASIC_H_SIZE + dlen);
+		*skb = tipc_buf_acquire(BASIC_H_SIZE + dlen, GFP_ATOMIC);
 		if (!*skb)
 			goto exit;
 		memcpy((*skb)->data + BASIC_H_SIZE, msg_data(hdr), dlen);
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 50a739860d37..6c0455caf302 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -820,7 +820,7 @@ static inline bool msg_is_reset(struct tipc_msg *hdr)
 	return (msg_user(hdr) == LINK_PROTOCOL) && (msg_type(hdr) == RESET_MSG);
 }
 
-struct sk_buff *tipc_buf_acquire(u32 size);
+struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp);
 bool tipc_msg_validate(struct sk_buff *skb);
 bool tipc_msg_reverse(u32 own_addr, struct sk_buff **skb, int err);
 void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type,
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index c1cfd92de17a..23f8899e0f8c 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -69,7 +69,7 @@ static struct sk_buff *named_prepare_buf(struct net *net, u32 type, u32 size,
 					 u32 dest)
 {
 	struct tipc_net *tn = net_generic(net, tipc_net_id);
-	struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size);
+	struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size, GFP_ATOMIC);
 	struct tipc_msg *msg;
 
 	if (buf != NULL) {
-- 
2.11.0

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


#1668421 — [PATCH for v4.9 LTS 22/86] net: phy: dp83848: add DP83620 PHY support

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 22/86] net: phy: dp83848: add DP83620 PHY support
Message-ID<tTuob-58F-41@gated-at.bofh.it>
In reply to#1668409
From: "Alvaro G. M" <alvaro.gamez@hazent.com>

[ Upstream commit 93b43fd137cd8865adf9978ab9870a344365d3af ]

This PHY with fiber support is register compatible with DP83848,
so add support for it.

Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/phy/dp83848.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c
index 800b39f06279..a10d0e7fc5f7 100644
--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -17,6 +17,7 @@
 #include <linux/phy.h>
 
 #define TI_DP83848C_PHY_ID		0x20005ca0
+#define TI_DP83620_PHY_ID		0x20005ce0
 #define NS_DP83848C_PHY_ID		0x20005c90
 #define TLK10X_PHY_ID			0x2000a210
 #define TI_DP83822_PHY_ID		0x2000a240
@@ -77,6 +78,7 @@ static int dp83848_config_intr(struct phy_device *phydev)
 static struct mdio_device_id __maybe_unused dp83848_tbl[] = {
 	{ TI_DP83848C_PHY_ID, 0xfffffff0 },
 	{ NS_DP83848C_PHY_ID, 0xfffffff0 },
+	{ TI_DP83620_PHY_ID, 0xfffffff0 },
 	{ TLK10X_PHY_ID, 0xfffffff0 },
 	{ TI_DP83822_PHY_ID, 0xfffffff0 },
 	{ }
@@ -106,6 +108,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 static struct phy_driver dp83848_driver[] = {
 	DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY"),
+	DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(TI_DP83822_PHY_ID, "TI DP83822 10/100 Mbps PHY"),
 };
-- 
2.11.0

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


#1668422 — [PATCH for v4.9 LTS 10/86] ARM64: dts: meson-gx: Add firmware reserved memory zones

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 10/86] ARM64: dts: meson-gx: Add firmware reserved memory zones
Message-ID<tTuob-58F-47@gated-at.bofh.it>
In reply to#1668409
From: Neil Armstrong <narmstrong@baylibre.com>

[ Upstream commit bba8e3f42736cf7f974968a818e53b128286ad1d ]

The Amlogic Meson GXBB/GXL/GXM secure monitor uses part of the memory space,
this patch adds these reserved zones.

Without such reserved memory zones, running the following stress command :
$ stress-ng --vm 16 --vm-bytes 128M --timeout 10s
multiple times:

Could lead to the following kernel crashes :
[   46.937975] Bad mode in Error handler detected on CPU1, code 0xbf000000 -- SError
...
[   47.058536] Internal error: Attempting to execute userspace memory: 8600000f [#3] PREEMPT SMP
...
Instead of the OOM killer.

Fixes: 4f24eda8401f ("ARM64: dts: Prepare configs for Amlogic Meson GXBaby")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
[khilman: added Fixes tag, added _reserved and unit addresses]
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index 0737056b369f..88849fe7aa66 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -55,6 +55,24 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* 16 MiB reserved for Hardware ROM Firmware */
+		hwrom_reserved: hwrom@0 {
+			reg = <0x0 0x0 0x0 0x1000000>;
+			no-map;
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		secmon_reserved: secmon@10000000 {
+			reg = <0x0 0x10000000 0x0 0x200000>;
+			no-map;
+		};
+	};
+
 	cpus {
 		#address-cells = <0x2>;
 		#size-cells = <0x0>;
-- 
2.11.0

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


#1668423 — [PATCH for v4.9 LTS 60/86] usb: dwc3: exynos fix axius clock error path to do cleanup

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 60/86] usb: dwc3: exynos fix axius clock error path to do cleanup
Message-ID<tTuob-58F-45@gated-at.bofh.it>
In reply to#1668409
From: Shuah Khan <shuahkh@osg.samsung.com>

[ Upstream commit 8ae584d1951f241efd45499f8774fd7066f22823 ]

Axius clock error path returns without disabling clock and suspend clock.
Fix it to disable them before returning error.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/dwc3/dwc3-exynos.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 2f1fb7e7aa54..9eba51b92f72 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -148,7 +148,8 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
 		exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk");
 		if (IS_ERR(exynos->axius_clk)) {
 			dev_err(dev, "no AXI UpScaler clk specified\n");
-			return -ENODEV;
+			ret = -ENODEV;
+			goto axius_clk_err;
 		}
 		clk_prepare_enable(exynos->axius_clk);
 	} else {
@@ -206,6 +207,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
 	regulator_disable(exynos->vdd33);
 err2:
 	clk_disable_unprepare(exynos->axius_clk);
+axius_clk_err:
 	clk_disable_unprepare(exynos->susp_clk);
 	clk_disable_unprepare(exynos->clk);
 	return ret;
-- 
2.11.0

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


#1668424 — [PATCH for v4.9 LTS 20/86] drm/amdgpu: fix program vce instance logic error.

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 20/86] drm/amdgpu: fix program vce instance logic error.
Message-ID<tTuob-58F-49@gated-at.bofh.it>
In reply to#1668409
From: Rex Zhu <Rex.Zhu@amd.com>

[ Upstream commit 50a1ebc70a2803deb7811fc73fb55d70e353bc34 ]

need to clear bit31-29 in GRBM_GFX_INDEX,
then the program can be valid.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index 6feed726e299..50f0cf2788b7 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -43,9 +43,13 @@
 
 #define GRBM_GFX_INDEX__VCE_INSTANCE__SHIFT	0x04
 #define GRBM_GFX_INDEX__VCE_INSTANCE_MASK	0x10
+#define GRBM_GFX_INDEX__VCE_ALL_PIPE		0x07
+
 #define mmVCE_LMI_VCPU_CACHE_40BIT_BAR0	0x8616
 #define mmVCE_LMI_VCPU_CACHE_40BIT_BAR1	0x8617
 #define mmVCE_LMI_VCPU_CACHE_40BIT_BAR2	0x8618
+#define mmGRBM_GFX_INDEX_DEFAULT 0xE0000000
+
 #define VCE_STATUS_VCPU_REPORT_FW_LOADED_MASK	0x02
 
 #define VCE_V3_0_FW_SIZE	(384 * 1024)
@@ -54,6 +58,9 @@
 
 #define FW_52_8_3	((52 << 24) | (8 << 16) | (3 << 8))
 
+#define GET_VCE_INSTANCE(i)  ((i) << GRBM_GFX_INDEX__VCE_INSTANCE__SHIFT \
+					| GRBM_GFX_INDEX__VCE_ALL_PIPE)
+
 static void vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx);
 static void vce_v3_0_set_ring_funcs(struct amdgpu_device *adev);
 static void vce_v3_0_set_irq_funcs(struct amdgpu_device *adev);
@@ -249,7 +256,7 @@ static int vce_v3_0_start(struct amdgpu_device *adev)
 		if (adev->vce.harvest_config & (1 << idx))
 			continue;
 
-		WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, idx);
+		WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx));
 		vce_v3_0_mc_resume(adev, idx);
 		WREG32_FIELD(VCE_STATUS, JOB_BUSY, 1);
 
@@ -273,7 +280,7 @@ static int vce_v3_0_start(struct amdgpu_device *adev)
 		}
 	}
 
-	WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
+	WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
 	return 0;
@@ -288,7 +295,7 @@ static int vce_v3_0_stop(struct amdgpu_device *adev)
 		if (adev->vce.harvest_config & (1 << idx))
 			continue;
 
-		WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, idx);
+		WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx));
 
 		if (adev->asic_type >= CHIP_STONEY)
 			WREG32_P(mmVCE_VCPU_CNTL, 0, ~0x200001);
@@ -306,7 +313,7 @@ static int vce_v3_0_stop(struct amdgpu_device *adev)
 			vce_v3_0_set_vce_sw_clock_gating(adev, false);
 	}
 
-	WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
+	WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
 	return 0;
@@ -586,17 +593,17 @@ static bool vce_v3_0_check_soft_reset(void *handle)
 	 * VCE team suggest use bit 3--bit 6 for busy status check
 	 */
 	mutex_lock(&adev->grbm_idx_mutex);
-	WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
+	WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0));
 	if (RREG32(mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
 		srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
 		srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
 	}
-	WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0x10);
+	WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1));
 	if (RREG32(mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
 		srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
 		srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
 	}
-	WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
+	WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0));
 	mutex_unlock(&adev->grbm_idx_mutex);
 
 	if (srbm_soft_reset) {
@@ -734,7 +741,7 @@ static int vce_v3_0_set_clockgating_state(void *handle,
 		if (adev->vce.harvest_config & (1 << i))
 			continue;
 
-		WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, i);
+		WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(i));
 
 		if (enable) {
 			/* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */
@@ -753,7 +760,7 @@ static int vce_v3_0_set_clockgating_state(void *handle,
 		vce_v3_0_set_vce_sw_clock_gating(adev, enable);
 	}
 
-	WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
+	WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
 	return 0;
-- 
2.11.0

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


#1668425 — [PATCH for v4.9 LTS 76/86] swiotlb: ensure that page-sized mappings are page-aligned

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 76/86] swiotlb: ensure that page-sized mappings are page-aligned
Message-ID<tTuob-58F-51@gated-at.bofh.it>
In reply to#1668409
From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>

[ Upstream commit 602d9858f07c72eab64f5f00e2fae55f9902cfbe ]

Some drivers do depend on page mappings to be page aligned.

Swiotlb already enforces such alignment for mappings greater than page,
extend that to page-sized mappings as well.

Without this fix, nvme hits BUG() in nvme_setup_prps(), because that routine
assumes page-aligned mappings.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 lib/swiotlb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index ad1d2962d129..b7812df04437 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -456,11 +456,11 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
 		    : 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
 
 	/*
-	 * For mappings greater than a page, we limit the stride (and
-	 * hence alignment) to a page size.
+	 * For mappings greater than or equal to a page, we limit the stride
+	 * (and hence alignment) to a page size.
 	 */
 	nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
-	if (size > PAGE_SIZE)
+	if (size >= PAGE_SIZE)
 		stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
 	else
 		stride = 1;
-- 
2.11.0

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


#1668426 — [PATCH for v4.9 LTS 32/86] Btrfs: fix truncate down when no_holes feature is enabled

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 32/86] Btrfs: fix truncate down when no_holes feature is enabled
Message-ID<tTuob-58F-53@gated-at.bofh.it>
In reply to#1668409
From: Liu Bo <bo.li.liu@oracle.com>

[ Upstream commit 91298eec05cd8d4e828cf7ee5d4a6334f70cf69a ]

For such a file mapping,

[0-4k][hole][8k-12k]

In NO_HOLES mode, we don't have the [hole] extent any more.
Commit c1aa45759e90 ("Btrfs: fix shrinking truncate when the no_holes feature is enabled")
 fixed disk isize not being updated in NO_HOLES mode when data is not flushed.

However, even if data has been flushed, we can still have trouble
in updating disk isize since we updated disk isize to 'start' of
the last evicted extent.

Reviewed-by: Chris Mason <clm@fb.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/btrfs/inode.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cada3f977baf..a2a014b19f18 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4480,8 +4480,19 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
 		if (found_type > min_type) {
 			del_item = 1;
 		} else {
-			if (item_end < new_size)
+			if (item_end < new_size) {
+				/*
+				 * With NO_HOLES mode, for the following mapping
+				 *
+				 * [0-4k][hole][8k-12k]
+				 *
+				 * if truncating isize down to 6k, it ends up
+				 * isize being 8k.
+				 */
+				if (btrfs_fs_incompat(root->fs_info, NO_HOLES))
+					last_size = new_size;
 				break;
+			}
 			if (found_key.offset >= new_size)
 				del_item = 1;
 			else
-- 
2.11.0

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


#1668427 — [PATCH for v4.9 LTS 83/86] net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 83/86] net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types
Message-ID<tTuoc-58F-57@gated-at.bofh.it>
In reply to#1668409
From: "Karicheri, Muralidharan" <m-karicheri2@ti.com>

[ Upstream commit 34c55cf2fc75f8bf6ba87df321038c064cf2d426 ]

Currently dp83867 driver returns error if phy interface type
PHY_INTERFACE_MODE_RGMII_RXID is used to set the rx only internal
delay. Similarly issue happens for PHY_INTERFACE_MODE_RGMII_TXID.
Fix this by checking also the interface type if a particular delay
value is missing in the phy dt bindings. Also update the DT document
accordingly.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 Documentation/devicetree/bindings/net/ti,dp83867.txt | 6 ++++--
 drivers/net/phy/dp83867.c                            | 8 ++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt
index 5d21141a68b5..75bcaa355880 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.txt
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt
@@ -3,9 +3,11 @@
 Required properties:
 	- reg - The ID number for the phy, usually a small integer
 	- ti,rx-internal-delay - RGMII Receive Clock Delay - see dt-bindings/net/ti-dp83867.h
-		for applicable values
+		for applicable values. Required only if interface type is
+		PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_RXID
 	- ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h
-		for applicable values
+		for applicable values. Required only if interface type is
+		PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_TXID
 	- ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h
 		for applicable values
 
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 91177a4a32ad..4cad95552cf1 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -113,12 +113,16 @@ static int dp83867_of_init(struct phy_device *phydev)
 
 	ret = of_property_read_u32(of_node, "ti,rx-internal-delay",
 				   &dp83867->rx_id_delay);
-	if (ret)
+	if (ret &&
+	    (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+	     phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
 		return ret;
 
 	ret = of_property_read_u32(of_node, "ti,tx-internal-delay",
 				   &dp83867->tx_id_delay);
-	if (ret)
+	if (ret &&
+	    (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+	     phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID))
 		return ret;
 
 	return of_property_read_u32(of_node, "ti,fifo-depth",
-- 
2.11.0

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


#1668428 — [PATCH for v4.9 LTS 54/86] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 54/86] net: phy: marvell: fix Marvell 88E1512 used in SGMII mode
Message-ID<tTuoc-58F-59@gated-at.bofh.it>
In reply to#1668409
From: Russell King <rmk+kernel@armlinux.org.uk>

[ Upstream commit a13c06525ab9ff442924e67df9393a5efa914c56 ]

When an Marvell 88E1512 PHY is connected to a nic in SGMII mode, the
fiber page is used for the SGMII host-side connection.  The PHY driver
notices that SUPPORTED_FIBRE is set, so it tries reading the fiber page
for the link status, and ends up reading the MAC-side status instead of
the outgoing (copper) link.  This leads to incorrect results reported
via ethtool.

If the PHY is connected via SGMII to the host, ignore the fiber page.
However, continue to allow the existing power management code to
suspend and resume the fiber page.

Fixes: 6cfb3bcc0641 ("Marvell phy: check link status in case of fiber link.")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/phy/marvell.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index d6a541bde331..d17173214a70 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1202,7 +1202,8 @@ static int marvell_read_status(struct phy_device *phydev)
 	int err;
 
 	/* Check the fiber mode first */
-	if (phydev->supported & SUPPORTED_FIBRE) {
+	if (phydev->supported & SUPPORTED_FIBRE &&
+	    phydev->interface != PHY_INTERFACE_MODE_SGMII) {
 		err = phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_M1111_FIBER);
 		if (err < 0)
 			goto error;
-- 
2.11.0

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


#1668429 — [PATCH for v4.9 LTS 52/86] perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 52/86] perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code
Message-ID<tTuob-58F-55@gated-at.bofh.it>
In reply to#1668409
From: Prarit Bhargava <prarit@redhat.com>

[ Upstream commit 6d6daa20945f3f598e56e18d1f926c08754f5801 ]

hswep_uncore_cpu_init() uses a hardcoded physical package id 0 for the boot
cpu. This works as long as the boot CPU is actually on the physical package
0, which is normaly the case after power on / reboot.

But it fails with a NULL pointer dereference when a kdump kernel is started
on a secondary socket which has a different physical package id because the
locigal package translation for physical package 0 does not exist.

Use the logical package id of the boot cpu instead of hard coded 0.

[ tglx: Rewrote changelog once more ]

Fixes: cf6d445f6897 ("perf/x86/uncore: Track packages, not per CPU data")
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Harish Chegondi <harish.chegondi@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1483628965-2890-1-git-send-email-prarit@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/x86/events/intel/uncore_snbep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 272427700d48..afe8024e9e95 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -2686,7 +2686,7 @@ static struct intel_uncore_type *hswep_msr_uncores[] = {
 
 void hswep_uncore_cpu_init(void)
 {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = boot_cpu_data.logical_proc_id;
 
 	if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
-- 
2.11.0

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


#1668430 — [PATCH for v4.9 LTS 65/86] drm/amd/powerplay: fix vce cg logic error on CZ/St.

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-06-18 00:30 +0200
Subject[PATCH for v4.9 LTS 65/86] drm/amd/powerplay: fix vce cg logic error on CZ/St.
Message-ID<tTuoc-58F-61@gated-at.bofh.it>
In reply to#1668409
From: Rex Zhu <Rex.Zhu@amd.com>

[ Upstream commit 3731d12dce83d47b357753ffc450ce03f1b49688 ]

can fix Bug 191281: vce ib test failed.

when vce idle, set vce clock gate, so the clock
in vce domain will be disabled.
when need to encode, disable vce clock gate,
enable the clocks to vce engine.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
index 2028980f1ed4..5b261c1dcc9f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
@@ -200,7 +200,7 @@ int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
 				cgs_set_clockgating_state(
 							hwmgr->device,
 							AMD_IP_BLOCK_TYPE_VCE,
-							AMD_CG_STATE_UNGATE);
+							AMD_CG_STATE_GATE);
 				cgs_set_powergating_state(
 							hwmgr->device,
 							AMD_IP_BLOCK_TYPE_VCE,
@@ -218,7 +218,7 @@ int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
 				cgs_set_clockgating_state(
 							hwmgr->device,
 							AMD_IP_BLOCK_TYPE_VCE,
-							AMD_PG_STATE_GATE);
+							AMD_PG_STATE_UNGATE);
 				cz_dpm_update_vce_dpm(hwmgr);
 				cz_enable_disable_vce_dpm(hwmgr, true);
 				return 0;
-- 
2.11.0

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


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

Back to top | Article view | linux.kernel


csiph-web