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


Groups > linux.kernel > #1553201 > unrolled thread

[PATCH 4.9 000/116] 4.9.2-stable review

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-01-06 23:00 +0100
Last post2017-01-07 17:20 +0100
Articles 20 on this page of 108 — 9 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.9 000/116] 4.9.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:00 +0100
    [PATCH 4.9 022/116] docs: sphinx-extensions: make rstFlatTable work with docutils 0.13 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:00 +0100
    [PATCH 4.9 029/116] ACPI / video: Add force_native quirk for HP Pavilion dv6 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:00 +0100
    [PATCH 4.9 049/116] drm/amdgpu: fix init save/restore list in gfx_v8.0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:00 +0100
    [PATCH 4.9 002/116] ath10k: fix soft lockup during firmware crash/hw-restart Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:00 +0100
    [PATCH 4.9 078/116] platform/x86: asus-nb-wmi.c: Add X45U quirk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 053/116] block: protect iterate_bdevs() against concurrent close Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 040/116] drm/nouveau/i2c/gk110b,gm10x: use the correct implementation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 076/116] vsock/virtio: fix src/dst cid format Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 084/116] IB/rxe: Fix a memory leak in rxe_qp_cleanup() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 039/116] drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 110/116] net: mvpp2: fix dma unmapping of TX buffers for fragments Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 050/116] drivers/gpu/drm/ast: Fix infinite loop if read fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 103/116] powerpc/ps3: Fix system hang with GCC 5 builds Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 099/116] pNFS: Clear NFS_LAYOUT_RETURN_REQUESTED when invalidating the layout stateid Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 081/116] IB/mad: Fix an array index check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 080/116] fgraph: Handle a case where a tracer ignores set_graph_notrace Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 090/116] [media] v4l: tvp5150: Add missing break in set control handler Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 051/116] mei: request async autosuspend at the end of enumeration Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 097/116] pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 096/116] nfs_write_end(): fix handling of short copies Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 077/116] ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 089/116] [media] media: solo6x10: fix lockup by avoiding delayed register write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 107/116] target/user: Fix use-after-free of tcmu_cmds if they are expired Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 072/116] KVM: PPC: Book3S HV: Save/restore XER in checkpointed register state Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 037/116] drm/nouveau/bios: require checksum to match for fast acpi shadow method Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 108/116] kconfig/nconf: Fix hang when editing symbol with a long prompt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 098/116] pNFS: Dont clear the layout stateid if a layout return is outstanding Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 070/116] md/raid5: limit request size according to implementation limits Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 109/116] sg_write()/bsg_write() is not fit to be called under KERNEL_DS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:10 +0100
    [PATCH 4.9 116/116] drm/i915: Fix setting of boost freq tunable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:20 +0100
    [PATCH 4.9 101/116] SUNRPC: fix refcounting problems with auth_gss messages. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 074/116] kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 105/116] of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 102/116] powerpc/64e: Convert cmpi to cmpwi in head_64.S Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 079/116] x86/smpboot: Make logical package management more robust Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 115/116] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 069/116] sc16is7xx: Drop bogus use of IRQF_ONESHOT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 104/116] powerpc/boot: Request no dynamic linker for boot wrapper Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 106/116] libnvdimm, pfn: fix align attribute Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 071/116] scsi: aacraid: remove wildcard for series 9 controllers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 075/116] fsnotify: Fix possible use-after-free in inode iteration on umount Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 100/116] pNFS: Fix a deadlock between read resends and layoutreturn Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:30 +0100
    [PATCH 4.9 082/116] IPoIB: Avoid reading an uninitialized member variable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 068/116] latent_entropy: fix ARM build error on earlier gcc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 073/116] KVM: PPC: Book3S HV: Dont lose hardware R/C bit updates in H_PROTECT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 091/116] Input: drv260x - fix input devices parent assignment Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 088/116] [media] s5p-mfc: fix failure path of s5p_mfc_alloc_memdev() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 093/116] i40iw: Use correct src address in memcpy to rdma stats counters Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 035/116] drm/nouveau/gr: fallback to legacy paths during firmware lookup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 086/116] [media] mn88472: fix chip id check on probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 087/116] [media] mn88473: fix chip id check on probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 095/116] libceph: verify authorize reply on connect Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 067/116] arm64: KVM: pmu: Reset PMSELR_EL0.SEL to a sane value before entering the guest Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 038/116] drm/nouveau/ltc: protect clearing of comptags with mutex Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 092/116] bad_inode: add missing i_op initializers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 036/116] drm/nouveau/kms: lvds panel strap moved again on maxwell Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 085/116] IB/cma: Fix a race condition in iboe_addr_get_sgid() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 094/116] PCI: Check for PME in targeted sleep state Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 031/116] drm/amdgpu: add additional pci revision to dpm workaround Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 083/116] IB/multicast: Check ib_find_pkey() return value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:40 +0100
    [PATCH 4.9 066/116] s390/kexec: use node 0 when re-adding crash kernel memory Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 060/116] scsi: zfcp: do not trace pure benign residual HBA responses at default level Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 063/116] ARC: mm: arc700: Dont assume 2 colours for aliasing VIPT dcache Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 048/116] drm/amdgpu: fix enable_cp_power_gating in gfx_v8.0. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 059/116] scsi: zfcp: fix use-after-"free" in FC ingress path after TMF Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 054/116] vt: fix Scroll Lock LED trigger name Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 052/116] mei: me: add lewisburg device ids Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 064/116] firmware: fix usermode helper fallback loading Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 009/116] ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 065/116] s390/vmlogrdr: fix IUCV buffer allocation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 034/116] drm/amd/amdgpu: enable GUI idle INT after enabling CGCG Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 055/116] stm class: Fix device leak in open error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 062/116] scsi: avoid a permanent stop of the scsi devices request queue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 058/116] iscsi-target: Return error if unable to add network portal Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 057/116] scsi: megaraid_sas: Do not set MPI2_TYPE_CUDA for JBOD FP path for FW which does not support JBOD sequence map Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 061/116] scsi: zfcp: fix rport unblock race with LUN recovery Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 046/116] drm/gma500: Add compat ioctl Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 056/116] scsi: megaraid_sas: For SRIOV enabled firmware, ensure VF driver waits for 30secs before reset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 008/116] cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 005/116] perf annotate: Dont throw error for zero length symbols Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-06 23:50 +0100
    [PATCH 4.9 026/116] staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 011/116] ath9k: do not return early to fix rcu unlocking Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 019/116] arm64: tegra: Add VDD_GPU regulator to Jetson TX1 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 012/116] Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 030/116] drm/amdgpu/si: load the proper firmware on 0x87 oland boards Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 025/116] staging: lustre: ldlm: pl_recalc time handling is wrong Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 023/116] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 024/116] staging/lustre/osc: Revert erroneous list_for_each_entry_safe use Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
    [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:00 +0100
      Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Dmitry Osipenko <digetx@gmail.com> - 2017-01-10 18:50 +0100
        Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-10 21:50 +0100
          Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save lkml@pengaru.com - 2017-01-10 22:30 +0100
            Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Willy Tarreau <w@1wt.eu> - 2017-01-10 23:00 +0100
              Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-12 08:40 +0100
                Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Dmitry Osipenko <digetx@gmail.com> - 2017-01-12 09:50 +0100
                Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Kalle Valo <kvalo@codeaurora.org> - 2017-01-13 07:50 +0100
                  Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-13 12:00 +0100
          Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Larry Finger <Larry.Finger@lwfinger.net> - 2017-01-11 03:00 +0100
        Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Larry Finger <Larry.Finger@lwfinger.net> - 2017-01-11 03:00 +0100
          Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save Dmitry Osipenko <digetx@gmail.com> - 2017-01-12 09:50 +0100
    Re: [PATCH 4.9 000/116] 4.9.2-stable review Shuah Khan <shuah.kh@samsung.com> - 2017-01-07 03:10 +0100
      Re: [PATCH 4.9 000/116] 4.9.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 14:20 +0100
    Re: [PATCH 4.9 000/116] 4.9.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 14:30 +0100
      Re: [PATCH 4.9 000/116] 4.9.2-stable review Kevin Hilman <khilman@baylibre.com> - 2017-01-09 19:20 +0100
        Re: [PATCH 4.9 000/116] 4.9.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-10 11:20 +0100
    Re: [PATCH 4.9 000/116] 4.9.2-stable review Guenter Roeck <linux@roeck-us.net> - 2017-01-07 17:10 +0100
      Re: [PATCH 4.9 000/116] 4.9.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 17:20 +0100

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


#1553420 — [PATCH 4.9 005/116] perf annotate: Dont throw error for zero length symbols

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-06 23:50 +0100
Subject[PATCH 4.9 005/116] perf annotate: Dont throw error for zero length symbols
Message-ID<sWLuH-4T-79@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

commit edee44be59190bf22d5c6e521f3852b7ff16862f upstream.

'perf report --tui' exits with error when it finds a sample of zero
length symbol (i.e. addr == sym->start == sym->end). Actually these are
valid samples. Don't exit TUI and show report with such symbols.

Reported-and-Tested-by: Anton Blanchard <anton@samba.org>
Link: https://lkml.org/lkml/2016/10/8/189
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chris Riyder <chris.ryder@arm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1479804050-5028-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 tools/perf/util/annotate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(st
 
 	pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
 
-	if (addr < sym->start || addr >= sym->end) {
+	if ((addr < sym->start || addr >= sym->end) &&
+	    (addr != sym->end || sym->start != sym->end)) {
 		pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n",
 		       __func__, __LINE__, sym->name, sym->start, addr, sym->end);
 		return -ERANGE;

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


#1553425 — [PATCH 4.9 026/116] staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 026/116] staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
Message-ID<sWLEl-9g-9@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit 655c4d442d1213b617926cc6d54e2a9a793fb46b upstream.

For NI M Series cards, the Comedi `insn_read` handler for the AI
subdevice is broken due to ANDing the value read from the AI FIFO data
register with an incorrect mask.  The incorrect mask clears all but the
most significant bit of the sample data.  It should preserve all the
sample data bits.  Correct it.

Fixes: 817144ae7fda ("staging: comedi: ni_mio_common: remove unnecessary use of 'board->adbits'")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/drivers/ni_mio_common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -1832,7 +1832,7 @@ static int ni_ai_insn_read(struct comedi
 			   unsigned int *data)
 {
 	struct ni_private *devpriv = dev->private;
-	unsigned int mask = (s->maxdata + 1) >> 1;
+	unsigned int mask = s->maxdata;
 	int i, n;
 	unsigned int signbits;
 	unsigned int d;

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


#1553433 — [PATCH 4.9 011/116] ath9k: do not return early to fix rcu unlocking

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 011/116] ath9k: do not return early to fix rcu unlocking
Message-ID<sWLEl-9g-31@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>

commit d1f1c0e289e1bc46cd6873ba6dd6c627f459e7fa upstream.

Starting with commit d94a461d7a7d ("ath9k: use ieee80211_tx_status_noskb
where possible") the driver uses rcu_read_lock() && rcu_read_unlock(), yet on
returning early in ath_tx_edma_tasklet() the unlock is missing leading to stalls
and suspicious RCU usage:

 ===============================
 [ INFO: suspicious RCU usage. ]
 4.9.0-rc8 #11 Not tainted
 -------------------------------
 kernel/rcu/tree.c:705 Illegal idle entry in RCU read-side critical section.!

 other info that might help us debug this:

 RCU used illegally from idle CPU!
 rcu_scheduler_active = 1, debug_locks = 0
 RCU used illegally from extended quiescent state!
 1 lock held by swapper/7/0:
 #0:
  (
 rcu_read_lock
 ){......}
 , at:
 [<ffffffffa06ed110>] ath_tx_edma_tasklet+0x0/0x450 [ath9k]

 stack backtrace:
 CPU: 7 PID: 0 Comm: swapper/7 Not tainted 4.9.0-rc8 #11
 Hardware name: Acer Aspire V3-571G/VA50_HC_CR, BIOS V2.21 12/16/2013
  ffff88025efc3f38 ffffffff8132b1e5 ffff88017ede4540 0000000000000001
  ffff88025efc3f68 ffffffff810a25f7 ffff88025efcee60 ffff88017edebdd8
  ffff88025eeb5400 0000000000000091 ffff88025efc3f88 ffffffff810c3cd4
 Call Trace:
  <IRQ>
  [<ffffffff8132b1e5>] dump_stack+0x68/0x93
  [<ffffffff810a25f7>] lockdep_rcu_suspicious+0xd7/0x110
  [<ffffffff810c3cd4>] rcu_eqs_enter_common.constprop.85+0x154/0x200
  [<ffffffff810c5a54>] rcu_irq_exit+0x44/0xa0
  [<ffffffff81058631>] irq_exit+0x61/0xd0
  [<ffffffff81018d25>] do_IRQ+0x65/0x110
  [<ffffffff81672189>] common_interrupt+0x89/0x89
  <EOI>
  [<ffffffff814ffe11>] ? cpuidle_enter_state+0x151/0x200
  [<ffffffff814ffee2>] cpuidle_enter+0x12/0x20
  [<ffffffff8109a6ae>] call_cpuidle+0x1e/0x40
  [<ffffffff8109a8f6>] cpu_startup_entry+0x146/0x220
  [<ffffffff810336f8>] start_secondary+0x148/0x170

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Fixes: d94a461d7a7d ("ath9k: use ieee80211_tx_status_noskb where possible")
Acked-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Gabriel Craciunescu <nix.or.die@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/xmit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2787,7 +2787,7 @@ void ath_tx_edma_tasklet(struct ath_soft
 		fifo_list = &txq->txq_fifo[txq->txq_tailidx];
 		if (list_empty(fifo_list)) {
 			ath_txq_unlock(sc, txq);
-			return;
+			break;
 		}
 
 		bf = list_first_entry(fifo_list, struct ath_buf, list);

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


#1553434 — [PATCH 4.9 019/116] arm64: tegra: Add VDD_GPU regulator to Jetson TX1

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 019/116] arm64: tegra: Add VDD_GPU regulator to Jetson TX1
Message-ID<sWLEl-9g-33@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Courbot <acourbot@nvidia.com>

commit 5e6b9a89afceadb1ee45472098f7d20af260335c upstream.

Add the VDD_GPU regulator (a GPIO-enabled PWM regulator) to the Jetson
TX1 board. This addition allows the GPU to be used provided the
bootloader properly enabled the GPU node.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
[as pointed out by Thierry on IRC, nobody has reported a bug
 in the field, but using a new bootloader with a .dtb that
 has the incorrect data, it will crash on boot]
Fixes: 336f79c7b6d7 ("arm64: tegra: Add NVIDIA Jetson TX1 Developer Kit support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

--- a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi
@@ -21,6 +21,10 @@
 		reg = <0x0 0x80000000 0x1 0x0>;
 	};
 
+	gpu@57000000 {
+		vdd-supply = <&vdd_gpu>;
+	};
+
 	/* debug port */
 	serial@70006000 {
 		status = "okay";
@@ -291,4 +295,18 @@
 			clock-frequency = <32768>;
 		};
 	};
+
+	regulators {
+		vdd_gpu: regulator@100 {
+			compatible = "pwm-regulator";
+			reg = <100>;
+			pwms = <&pwm 1 4880>;
+			regulator-name = "VDD_GPU";
+			regulator-min-microvolt = <710000>;
+			regulator-max-microvolt = <1320000>;
+			enable-gpios = <&pmic 6 GPIO_ACTIVE_HIGH>;
+			regulator-ramp-delay = <80>;
+			regulator-enable-ramp-delay = <1000>;
+		};
+	};
 };

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


#1553440 — [PATCH 4.9 012/116] Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure"

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 012/116] Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure"
Message-ID<sWLEm-9g-45@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <adrian.hunter@intel.com>

commit 2ca71c27eeaeddae38efe24a84b20e22708a3d1d upstream.

This reverts commit fe5fb2e3b58f ("mmc: sdhci: Reset cmd and data circuits
after tuning failure").

A better fix is available, and it will be applied to older stable releases,
so get this out of the way by reverting it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci.c |    4 ----
 1 file changed, 4 deletions(-)

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2086,10 +2086,6 @@ static int sdhci_execute_tuning(struct m
 
 		if (!host->tuning_done) {
 			pr_info(DRIVER_NAME ": Timeout waiting for Buffer Read Ready interrupt during tuning procedure, falling back to fixed sampling clock\n");
-
-			sdhci_do_reset(host, SDHCI_RESET_CMD);
-			sdhci_do_reset(host, SDHCI_RESET_DATA);
-
 			ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
 			ctrl &= ~SDHCI_CTRL_TUNED_CLK;
 			ctrl &= ~SDHCI_CTRL_EXEC_TUNING;

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


#1553441 — [PATCH 4.9 030/116] drm/amdgpu/si: load the proper firmware on 0x87 oland boards

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 030/116] drm/amdgpu/si: load the proper firmware on 0x87 oland boards
Message-ID<sWLEm-9g-47@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

commit 5a23f2720589ec4757bc62183902d2518f02026e upstream.

New variant.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -7713,6 +7713,7 @@ static int si_dpm_init_microcode(struct
 		    (adev->pdev->revision == 0x80) ||
 		    (adev->pdev->revision == 0x81) ||
 		    (adev->pdev->revision == 0x83) ||
+		    (adev->pdev->revision == 0x87) ||
 		    (adev->pdev->device == 0x6604) ||
 		    (adev->pdev->device == 0x6605))
 			chip_name = "oland_k";

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


#1553443 — [PATCH 4.9 025/116] staging: lustre: ldlm: pl_recalc time handling is wrong

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 025/116] staging: lustre: ldlm: pl_recalc time handling is wrong
Message-ID<sWLEm-9g-57@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit b8cb86fd95bb461c3496e1f4b4083b198c963a9c upstream.

James Simmons reports:
> The ldlm_pool field pl_recalc_time is set to the current
> monotonic clock value but the interval period is calculated
> with the wall clock. This means the interval period will
> always be far larger than the pl_recalc_period, which is
> just a small interval time period. The correct thing to
> do is to use monotomic clock current value instead of the
> wall clocks value when calculating recalc_interval_sec.

This broke when I converted the 32-bit get_seconds() into
ktime_get_{real_,}seconds() inconsistently. Either
one of those two would have worked, but mixing them
does not.

Staying with the original intention of the patch, this
changes the ktime_get_seconds() calls into ktime_get_real_seconds(),
using real time instead of mononic time.

Fixes: 8f83409cf238 ("staging/lustre: use 64-bit time for pl_recalc")
Reported-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -356,10 +356,10 @@ static int ldlm_pool_recalc(struct ldlm_
 	u32 recalc_interval_sec;
 	int count;
 
-	recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
+	recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
 	if (recalc_interval_sec > 0) {
 		spin_lock(&pl->pl_lock);
-		recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
+		recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
 
 		if (recalc_interval_sec > 0) {
 			/*
@@ -382,7 +382,7 @@ static int ldlm_pool_recalc(struct ldlm_
 				    count);
 	}
 
-	recalc_interval_sec = pl->pl_recalc_time - ktime_get_seconds() +
+	recalc_interval_sec = pl->pl_recalc_time - ktime_get_real_seconds() +
 			      pl->pl_recalc_period;
 	if (recalc_interval_sec <= 0) {
 		/* DEBUG: should be re-removed after LU-4536 is fixed */
@@ -657,7 +657,7 @@ int ldlm_pool_init(struct ldlm_pool *pl,
 
 	spin_lock_init(&pl->pl_lock);
 	atomic_set(&pl->pl_granted, 0);
-	pl->pl_recalc_time = ktime_get_seconds();
+	pl->pl_recalc_time = ktime_get_real_seconds();
 	atomic_set(&pl->pl_lock_volume_factor, 1);
 
 	atomic_set(&pl->pl_grant_rate, 0);

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


#1553450 — [PATCH 4.9 023/116] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 023/116] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()
Message-ID<sWLEm-9g-67@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vitaly Kuznetsov <vkuznets@redhat.com>

commit abd1026da4a7700a8db370947f75cd17b6ae6f76 upstream.

"kernel BUG at drivers/hv/channel_mgmt.c:350!" is observed when hv_vmbus
module is unloaded. BUG_ON() was introduced in commit 85d9aa705184
("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()") as
vmbus_free_channels() codepath was apparently forgotten.

Fixes: 85d9aa705184 ("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()")

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hv/channel_mgmt.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -389,6 +389,7 @@ void vmbus_free_channels(void)
 {
 	struct vmbus_channel *channel, *tmp;
 
+	mutex_lock(&vmbus_connection.channel_mutex);
 	list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list,
 		listentry) {
 		/* hv_process_channel_removal() needs this */
@@ -396,6 +397,7 @@ void vmbus_free_channels(void)
 
 		vmbus_device_unregister(channel->device_obj);
 	}
+	mutex_unlock(&vmbus_connection.channel_mutex);
 }
 
 /*

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


#1553451 — [PATCH 4.9 024/116] staging/lustre/osc: Revert erroneous list_for_each_entry_safe use

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 024/116] staging/lustre/osc: Revert erroneous list_for_each_entry_safe use
Message-ID<sWLEm-9g-69@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oleg Drokin <green@linuxhacker.ru>

commit cd15dd6ef4ea11df87f717b8b1b83aaa738ec8af upstream.

I have been having a lot of unexplainable crashes in osc_lru_shrink
lately that I could not see a good explanation for and then I found
this patch that slip under the radar somehow that incorrectly
converted while loop for lru list iteration into
list_for_each_entry_safe totally ignoring that in the body of
the loop we drop spinlocks guarding this list and move list entries
around.
Not sure why it was not showing up right away, perhaps some of the
more recent LRU changes committed caused some extra pressure on this
code that finally highlighted the breakage.

Reverts: 8adddc36b1fc ("staging: lustre: osc: Use list_for_each_entry_safe")
CC: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/lustre/lustre/osc/osc_page.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -542,7 +542,6 @@ long osc_lru_shrink(const struct lu_env
 	struct cl_object *clobj = NULL;
 	struct cl_page **pvec;
 	struct osc_page *opg;
-	struct osc_page *temp;
 	int maxscan = 0;
 	long count = 0;
 	int index = 0;
@@ -569,13 +568,15 @@ long osc_lru_shrink(const struct lu_env
 
 	spin_lock(&cli->cl_lru_list_lock);
 	maxscan = min(target << 1, atomic_long_read(&cli->cl_lru_in_list));
-	list_for_each_entry_safe(opg, temp, &cli->cl_lru_list, ops_lru) {
+	while (!list_empty(&cli->cl_lru_list)) {
 		struct cl_page *page;
 		bool will_free = false;
 
 		if (--maxscan < 0)
 			break;
 
+		opg = list_entry(cli->cl_lru_list.next, struct osc_page,
+				 ops_lru);
 		page = opg->ops_cl.cpl_page;
 		if (lru_page_busy(cli, page)) {
 			list_move_tail(&opg->ops_lru, &cli->cl_lru_list);

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


#1553454 — [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-07 00:00 +0100
Subject[PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sWLEn-9g-73@gated-at.bofh.it>
In reply to#1553201
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

commit ba9f93f82abafe2552eac942ebb11c2df4f8dd7f upstream.

In commit a5ffbe0a1993 ("rtlwifi: Fix scheduling while atomic bug") and
commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter()
to use work queue"), an error was introduced in the power-save routines
due to the fact that leaving PS was delayed by the use of a work queue.

This problem is fixed by detecting if the enter or leave routines are
in interrupt mode. If so, the workqueue is used to place the request.
If in normal mode, the enter or leave routines are called directly.

Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
Reported-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/realtek/rtlwifi/base.c |    8 +++---
 drivers/net/wireless/realtek/rtlwifi/core.c |    9 ++-----
 drivers/net/wireless/realtek/rtlwifi/pci.c  |   14 +++-------
 drivers/net/wireless/realtek/rtlwifi/ps.c   |   36 +++++++++++++++++++++-------
 4 files changed, 40 insertions(+), 27 deletions(-)

--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
 
 static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
 {
+	struct ieee80211_hw *hw = rtlpriv->hw;
+
 	rtlpriv->ra.is_special_data = true;
 	if (rtlpriv->cfg->ops->get_btc_status())
 		rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
 					rtlpriv, 1);
-	rtlpriv->enter_ps = false;
-	schedule_work(&rtlpriv->works.lps_change_work);
+	rtl_lps_leave(hw);
 	ppsc->last_delaylps_stamp_jiffies = jiffies;
 }
 
@@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_
 
 		if (is_tx) {
 			rtlpriv->ra.is_special_data = true;
-			rtlpriv->enter_ps = false;
-			schedule_work(&rtlpriv->works.lps_change_work);
+			rtl_lps_leave(hw);
 			ppsc->last_delaylps_stamp_jiffies = jiffies;
 		}
 
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1150,10 +1150,8 @@ static void rtl_op_bss_info_changed(stru
 		} else {
 			mstatus = RT_MEDIA_DISCONNECT;
 
-			if (mac->link_state == MAC80211_LINKED) {
-				rtlpriv->enter_ps = false;
-				schedule_work(&rtlpriv->works.lps_change_work);
-			}
+			if (mac->link_state == MAC80211_LINKED)
+				rtl_lps_leave(hw);
 			if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE)
 				rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
 			mac->link_state = MAC80211_NOLINK;
@@ -1431,8 +1429,7 @@ static void rtl_op_sw_scan_start(struct
 	}
 
 	if (mac->link_state == MAC80211_LINKED) {
-		rtlpriv->enter_ps = false;
-		schedule_work(&rtlpriv->works.lps_change_work);
+		rtl_lps_leave(hw);
 		mac->link_state = MAC80211_LINKED_SCANNING;
 	} else {
 		rtl_ips_nic_on(hw);
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -663,11 +663,9 @@ tx_status_ok:
 	}
 
 	if (((rtlpriv->link_info.num_rx_inperiod +
-		rtlpriv->link_info.num_tx_inperiod) > 8) ||
-		(rtlpriv->link_info.num_rx_inperiod > 2)) {
-		rtlpriv->enter_ps = false;
-		schedule_work(&rtlpriv->works.lps_change_work);
-	}
+	      rtlpriv->link_info.num_tx_inperiod) > 8) ||
+	      (rtlpriv->link_info.num_rx_inperiod > 2))
+		rtl_lps_leave(hw);
 }
 
 static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
@@ -918,10 +916,8 @@ new_trx_end:
 		}
 		if (((rtlpriv->link_info.num_rx_inperiod +
 		      rtlpriv->link_info.num_tx_inperiod) > 8) ||
-		      (rtlpriv->link_info.num_rx_inperiod > 2)) {
-			rtlpriv->enter_ps = false;
-			schedule_work(&rtlpriv->works.lps_change_work);
-		}
+		      (rtlpriv->link_info.num_rx_inperiod > 2))
+			rtl_lps_leave(hw);
 		skb = new_skb;
 no_new:
 		if (rtlpriv->use_new_trx_flow) {
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -407,8 +407,8 @@ void rtl_lps_set_psmode(struct ieee80211
 	}
 }
 
-/*Enter the leisure power save mode.*/
-void rtl_lps_enter(struct ieee80211_hw *hw)
+/* Interrupt safe routine to enter the leisure power save mode.*/
+static void rtl_lps_enter_core(struct ieee80211_hw *hw)
 {
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
@@ -444,10 +444,9 @@ void rtl_lps_enter(struct ieee80211_hw *
 
 	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
 }
-EXPORT_SYMBOL(rtl_lps_enter);
 
-/*Leave the leisure power save mode.*/
-void rtl_lps_leave(struct ieee80211_hw *hw)
+/* Interrupt safe routine to leave the leisure power save mode.*/
+static void rtl_lps_leave_core(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
@@ -477,7 +476,6 @@ void rtl_lps_leave(struct ieee80211_hw *
 	}
 	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
 }
-EXPORT_SYMBOL(rtl_lps_leave);
 
 /* For sw LPS*/
 void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
@@ -670,12 +668,34 @@ void rtl_lps_change_work_callback(struct
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 
 	if (rtlpriv->enter_ps)
-		rtl_lps_enter(hw);
+		rtl_lps_enter_core(hw);
 	else
-		rtl_lps_leave(hw);
+		rtl_lps_leave_core(hw);
 }
 EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
 
+void rtl_lps_enter(struct ieee80211_hw *hw)
+{
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
+
+	if (!in_interrupt())
+		return rtl_lps_enter_core(hw);
+	rtlpriv->enter_ps = true;
+	schedule_work(&rtlpriv->works.lps_change_work);
+}
+EXPORT_SYMBOL_GPL(rtl_lps_enter);
+
+void rtl_lps_leave(struct ieee80211_hw *hw)
+{
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
+
+	if (!in_interrupt())
+		return rtl_lps_leave_core(hw);
+	rtlpriv->enter_ps = false;
+	schedule_work(&rtlpriv->works.lps_change_work);
+}
+EXPORT_SYMBOL_GPL(rtl_lps_leave);
+
 void rtl_swlps_wq_callback(void *data)
 {
 	struct rtl_works *rtlworks = container_of_dwork_rtl(data,

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


#1555765 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromDmitry Osipenko <digetx@gmail.com>
Date2017-01-10 18:50 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sY8Iy-4hr-19@gated-at.bofh.it>
In reply to#1553454
Hello, this patch causes a kernel panic with the rtl8192cu driver.

<6>[   20.847025] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
<1>[   21.699551] BUG: unable to handle kernel NULL pointer dereference at
0000000000000048
<1>[   21.699626] IP: [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
<4>[   21.699681] PGD 20cf47067
<4>[   21.699702] PUD 20cf42067
<4>[   21.699725] PMD 0
<4>[   21.699732]
<4>[   21.699759] Oops: 0000 [#1] PREEMPT SMP
<4>[   21.699794] Modules linked in: rtl8192cu rtl_usb rtl8192c_common rtlwifi
snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec
snd_hwdep snd_hda_core dm_mod thermal
<4>[   21.699985] CPU: 0 PID: 2656 Comm: ntpdate Not tainted 4.9.2 #1
<4>[   21.700036] Hardware name: Gigabyte Technology Co., Ltd. To be filled by
O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
<4>[   21.700118] task: ffff9ce2509ca4c0 task.stack: ffffa41003eac000
<4>[   21.700168] RIP: 0010:[<ffffffffc037de33>]  [<ffffffffc037de33>]
rtl_lps_leave+0x13/0x40 [rtlwifi]
<4>[   21.700250] RSP: 0018:ffffa41003eaf520  EFLAGS: 00010206
<4>[   21.700296] RAX: 0000000080000802 RBX: ffff9ce251371420 RCX: ffff9ce254ff4640
<4>[   21.700356] RDX: 0000000000000806 RSI: ffff9ce25137afb8 RDI: 0000000000000000
<4>[   21.700416] RBP: ffff9ce25137afb8 R08: ffffffffc0382d00 R09: ffff9ce254e38c31
<4>[   21.700475] R10: 0000000000000000 R11: ffff9ce251370700 R12: 0000000000000000
<4>[   21.700535] R13: 0000000000000000 R14: ffff9ce251371420 R15: ffff9ce254e38c00
<4>[   21.700595] FS:  00007f22f6da8700(0000) GS:ffff9ce25f200000(0000)
knlGS:0000000000000000
<4>[   21.700662] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4>[   21.700711] CR2: 0000000000000048 CR3: 000000020cf65000 CR4: 00000000001406f0
<4>[   21.700770] Stack:
<4>[   21.700790]  ffffffffc0375088 0000000000000008 ffff9ce251370700
0000000000000001
<4>[   21.700867]  ffffffffc03751c7 0100000000000000 ffffa41003eaf618
ffff9ce252b5a800
<4>[   21.700944]  0000000000000000 ffff9ce251371420 0000000000000000
ffff9ce254e38c00
<4>[   21.701021] Call Trace:
<4>[   21.701048]  [<ffffffffc0375088>] ? setup_arp_tx.isra.20+0x48/0x60 [rtlwifi]
<4>[   21.701110]  [<ffffffffc03751c7>] ? rtl_is_special_data+0x127/0x210 [rtlwifi]
<4>[   21.701171]  [<ffffffffc037e8c7>] ? rtl_get_rate+0x97/0x210 [rtlwifi]
<4>[   21.701228]  [<ffffffff9a87deb6>] ? rate_control_get_rate+0xb6/0x140
<4>[   21.701283]  [<ffffffff9a88cf30>] ? ieee80211_tx_h_rate_ctrl+0x1e0/0x3f0
<4>[   21.701340]  [<ffffffff9a88fcc2>] ? invoke_tx_handlers_early+0x222/0x5a0
<4>[   21.701397]  [<ffffffff9a89186e>] ? ieee80211_tx+0x6e/0x130
<4>[   21.701446]  [<ffffffff9a892661>] ? __ieee80211_subif_start_xmit+0x4d1/0x9d0
<4>[   21.701506]  [<ffffffff9a741874>] ? nf_conntrack_tuple_taken+0x1c4/0x1d0
<4>[   21.701565]  [<ffffffff9a749779>] ? get_unique_tuple+0xe9/0x510
<4>[   21.701617]  [<ffffffff9a892b6c>] ? ieee80211_subif_start_xmit+0xc/0x10
<4>[   21.701675]  [<ffffffff9a6e606a>] ? dev_hard_start_xmit+0x9a/0x210
<4>[   21.701729]  [<ffffffff9a708a46>] ? sch_direct_xmit+0xd6/0x1a0
<4>[   21.701780]  [<ffffffff9a6e66d2>] ? __dev_queue_xmit+0x422/0x620
<4>[   21.701832]  [<ffffffff9a79859f>] ? arp_xmit+0x9f/0xb0
<4>[   21.701878]  [<ffffffff9a798220>] ? arp_create+0x250/0x250
<4>[   21.701926]  [<ffffffff9a7986ee>] ? arp_solicit+0xee/0x240
<4>[   21.701974]  [<ffffffff9a1335cd>] ? mod_timer+0x1ad/0x360
<4>[   21.702022]  [<ffffffff9a6edf12>] ? neigh_probe+0x42/0x60
<4>[   21.702071]  [<ffffffff9a6ef2f2>] ? __neigh_event_send+0x1e2/0x230
<4>[   21.702124]  [<ffffffff9a6ef520>] ? neigh_resolve_output+0x120/0x1b0
<4>[   21.702179]  [<ffffffff9a76ac37>] ? ip_finish_output2+0x127/0x300
<4>[   21.702231]  [<ffffffff9a76c524>] ? ip_output+0x64/0x100
<4>[   21.702277]  [<ffffffff9a76b9b0>] ?
__ip_flush_pending_frames.isra.46+0x80/0x80
<4>[   21.702339]  [<ffffffff9a76ceb5>] ? ip_send_skb+0x15/0x40
<4>[   21.702386]  [<ffffffff9a79308f>] ? udp_send_skb+0x15f/0x240
<4>[   21.702436]  [<ffffffff9a7944e6>] ? udp_sendmsg+0x2b6/0x840
<4>[   21.702485]  [<ffffffff9a0e10ba>] ? __local_bh_enable_ip+0x8a/0x90
<4>[   21.702538]  [<ffffffff9a76ac4a>] ? ip_finish_output2+0x13a/0x300
<4>[   21.702592]  [<ffffffff9a1fda33>] ? rw_copy_check_uvector+0x53/0x110
<4>[   21.702648]  [<ffffffff9a382b37>] ? import_iovec+0x27/0xc0
<4>[   21.702698]  [<ffffffff9a6c8d01>] ? ___sys_sendmsg+0x111/0x2a0
<4>[   21.702749]  [<ffffffff9a20fa50>] ? poll_select_copy_remaining+0x130/0x130
<4>[   21.702808]  [<ffffffff9a7944f5>] ? udp_sendmsg+0x2c5/0x840
<4>[   21.702857]  [<ffffffff9a79b2b1>] ? __ip_dev_find+0x111/0x130
<4>[   21.702908]  [<ffffffff9a764885>] ? __ip_route_output_key_hash+0x2c5/0x870
<4>[   21.702968]  [<ffffffff9a6c94e9>] ? __sys_sendmmsg+0x89/0x160
<4>[   21.703018]  [<ffffffff9a6c8490>] ? SYSC_connect+0x50/0xa0
<4>[   21.703066]  [<ffffffff9a6c626a>] ? sock_alloc_file+0x9a/0x110
<4>[   21.703119]  [<ffffffff9a6c95ce>] ? SyS_sendmmsg+0xe/0x20
<4>[   21.703166]  [<ffffffff9a8c8837>] ? entry_SYSCALL_64_fastpath+0x1a/0xa9
<4>[   21.703222] Code: 05 e9 32 ff ff ff e9 2d fe ff ff 0f 1f 00 66 2e 0f 1f 84
00 00 00 00 00 0f 1f 44 00 00 65 8b 05 24 f4 c8 3f a9 00 ff 1f 00 74 23 <48> 8b
57 48 bf 40 00 00 00 48 8b 35 3d ba b7 da c6 82 ad a2 00
<1>[   21.709488] RIP  [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
<4>[   21.712533]  RSP <ffffa41003eaf520>
<4>[   21.715589] CR2: 0000000000000048
<4>[   21.735721] ---[ end trace f6ce402401b0b86a ]---

> 4.9-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Larry Finger <Larry.Finger@lwfinger.net>
> 
> commit ba9f93f82abafe2552eac942ebb11c2df4f8dd7f upstream.
> 
> In commit a5ffbe0a1993 ("rtlwifi: Fix scheduling while atomic bug") and
> commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter()
> to use work queue"), an error was introduced in the power-save routines
> due to the fact that leaving PS was delayed by the use of a work queue.
> 
> This problem is fixed by detecting if the enter or leave routines are
> in interrupt mode. If so, the workqueue is used to place the request.
> If in normal mode, the enter or leave routines are called directly.
> 
> Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
> Reported-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>  drivers/net/wireless/realtek/rtlwifi/base.c |    8 +++---
>  drivers/net/wireless/realtek/rtlwifi/core.c |    9 ++-----
>  drivers/net/wireless/realtek/rtlwifi/pci.c  |   14 +++-------
>  drivers/net/wireless/realtek/rtlwifi/ps.c   |   36 +++++++++++++++++++++-------
>  4 files changed, 40 insertions(+), 27 deletions(-)
> 
> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> @@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
>  
>  static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
>  {
> +	struct ieee80211_hw *hw = rtlpriv->hw;
> +
>  	rtlpriv->ra.is_special_data = true;
>  	if (rtlpriv->cfg->ops->get_btc_status())
>  		rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
>  					rtlpriv, 1);
> -	rtlpriv->enter_ps = false;
> -	schedule_work(&rtlpriv->works.lps_change_work);
> +	rtl_lps_leave(hw);
>  	ppsc->last_delaylps_stamp_jiffies = jiffies;
>  }
>  
> @@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_
>  
>  		if (is_tx) {
>  			rtlpriv->ra.is_special_data = true;
> -			rtlpriv->enter_ps = false;
> -			schedule_work(&rtlpriv->works.lps_change_work);
> +			rtl_lps_leave(hw);
>  			ppsc->last_delaylps_stamp_jiffies = jiffies;
>  		}
>  
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -1150,10 +1150,8 @@ static void rtl_op_bss_info_changed(stru
>  		} else {
>  			mstatus = RT_MEDIA_DISCONNECT;
>  
> -			if (mac->link_state == MAC80211_LINKED) {
> -				rtlpriv->enter_ps = false;
> -				schedule_work(&rtlpriv->works.lps_change_work);
> -			}
> +			if (mac->link_state == MAC80211_LINKED)
> +				rtl_lps_leave(hw);
>  			if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE)
>  				rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
>  			mac->link_state = MAC80211_NOLINK;
> @@ -1431,8 +1429,7 @@ static void rtl_op_sw_scan_start(struct
>  	}
>  
>  	if (mac->link_state == MAC80211_LINKED) {
> -		rtlpriv->enter_ps = false;
> -		schedule_work(&rtlpriv->works.lps_change_work);
> +		rtl_lps_leave(hw);
>  		mac->link_state = MAC80211_LINKED_SCANNING;
>  	} else {
>  		rtl_ips_nic_on(hw);
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -663,11 +663,9 @@ tx_status_ok:
>  	}
>  
>  	if (((rtlpriv->link_info.num_rx_inperiod +
> -		rtlpriv->link_info.num_tx_inperiod) > 8) ||
> -		(rtlpriv->link_info.num_rx_inperiod > 2)) {
> -		rtlpriv->enter_ps = false;
> -		schedule_work(&rtlpriv->works.lps_change_work);
> -	}
> +	      rtlpriv->link_info.num_tx_inperiod) > 8) ||
> +	      (rtlpriv->link_info.num_rx_inperiod > 2))
> +		rtl_lps_leave(hw);
>  }
>  
>  static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
> @@ -918,10 +916,8 @@ new_trx_end:
>  		}
>  		if (((rtlpriv->link_info.num_rx_inperiod +
>  		      rtlpriv->link_info.num_tx_inperiod) > 8) ||
> -		      (rtlpriv->link_info.num_rx_inperiod > 2)) {
> -			rtlpriv->enter_ps = false;
> -			schedule_work(&rtlpriv->works.lps_change_work);
> -		}
> +		      (rtlpriv->link_info.num_rx_inperiod > 2))
> +			rtl_lps_leave(hw);
>  		skb = new_skb;
>  no_new:
>  		if (rtlpriv->use_new_trx_flow) {
> --- a/drivers/net/wireless/realtek/rtlwifi/ps.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
> @@ -407,8 +407,8 @@ void rtl_lps_set_psmode(struct ieee80211
>  	}
>  }
>  
> -/*Enter the leisure power save mode.*/
> -void rtl_lps_enter(struct ieee80211_hw *hw)
> +/* Interrupt safe routine to enter the leisure power save mode.*/
> +static void rtl_lps_enter_core(struct ieee80211_hw *hw)
>  {
>  	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
>  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
> @@ -444,10 +444,9 @@ void rtl_lps_enter(struct ieee80211_hw *
>  
>  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
>  }
> -EXPORT_SYMBOL(rtl_lps_enter);
>  
> -/*Leave the leisure power save mode.*/
> -void rtl_lps_leave(struct ieee80211_hw *hw)
> +/* Interrupt safe routine to leave the leisure power save mode.*/
> +static void rtl_lps_leave_core(struct ieee80211_hw *hw)
>  {
>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
> @@ -477,7 +476,6 @@ void rtl_lps_leave(struct ieee80211_hw *
>  	}
>  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
>  }
> -EXPORT_SYMBOL(rtl_lps_leave);
>  
>  /* For sw LPS*/
>  void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
> @@ -670,12 +668,34 @@ void rtl_lps_change_work_callback(struct
>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>  
>  	if (rtlpriv->enter_ps)
> -		rtl_lps_enter(hw);
> +		rtl_lps_enter_core(hw);
>  	else
> -		rtl_lps_leave(hw);
> +		rtl_lps_leave_core(hw);
>  }
>  EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
>  
> +void rtl_lps_enter(struct ieee80211_hw *hw)
> +{
> +	struct rtl_priv *rtlpriv = rtl_priv(hw);
> +
> +	if (!in_interrupt())
> +		return rtl_lps_enter_core(hw);
> +	rtlpriv->enter_ps = true;
> +	schedule_work(&rtlpriv->works.lps_change_work);
> +}
> +EXPORT_SYMBOL_GPL(rtl_lps_enter);
> +
> +void rtl_lps_leave(struct ieee80211_hw *hw)
> +{
> +	struct rtl_priv *rtlpriv = rtl_priv(hw);
> +
> +	if (!in_interrupt())
> +		return rtl_lps_leave_core(hw);
> +	rtlpriv->enter_ps = false;
> +	schedule_work(&rtlpriv->works.lps_change_work);
> +}
> +EXPORT_SYMBOL_GPL(rtl_lps_leave);
> +
>  void rtl_swlps_wq_callback(void *data)
>  {
>  	struct rtl_works *rtlworks = container_of_dwork_rtl(data,
> 
> 


-- 
Dmitry

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


#1555910 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-10 21:50 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYbwK-5Yo-13@gated-at.bofh.it>
In reply to#1555765
On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
> Hello, this patch causes a kernel panic with the rtl8192cu driver.

Ick, not good!  Does this cause a problem in Linus's tree as well?

thanks,

greg k-h

> 
> <6>[   20.847025] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> <1>[   21.699551] BUG: unable to handle kernel NULL pointer dereference at
> 0000000000000048
> <1>[   21.699626] IP: [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.699681] PGD 20cf47067
> <4>[   21.699702] PUD 20cf42067
> <4>[   21.699725] PMD 0
> <4>[   21.699732]
> <4>[   21.699759] Oops: 0000 [#1] PREEMPT SMP
> <4>[   21.699794] Modules linked in: rtl8192cu rtl_usb rtl8192c_common rtlwifi
> snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec
> snd_hwdep snd_hda_core dm_mod thermal
> <4>[   21.699985] CPU: 0 PID: 2656 Comm: ntpdate Not tainted 4.9.2 #1
> <4>[   21.700036] Hardware name: Gigabyte Technology Co., Ltd. To be filled by
> O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
> <4>[   21.700118] task: ffff9ce2509ca4c0 task.stack: ffffa41003eac000
> <4>[   21.700168] RIP: 0010:[<ffffffffc037de33>]  [<ffffffffc037de33>]
> rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.700250] RSP: 0018:ffffa41003eaf520  EFLAGS: 00010206
> <4>[   21.700296] RAX: 0000000080000802 RBX: ffff9ce251371420 RCX: ffff9ce254ff4640
> <4>[   21.700356] RDX: 0000000000000806 RSI: ffff9ce25137afb8 RDI: 0000000000000000
> <4>[   21.700416] RBP: ffff9ce25137afb8 R08: ffffffffc0382d00 R09: ffff9ce254e38c31
> <4>[   21.700475] R10: 0000000000000000 R11: ffff9ce251370700 R12: 0000000000000000
> <4>[   21.700535] R13: 0000000000000000 R14: ffff9ce251371420 R15: ffff9ce254e38c00
> <4>[   21.700595] FS:  00007f22f6da8700(0000) GS:ffff9ce25f200000(0000)
> knlGS:0000000000000000
> <4>[   21.700662] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> <4>[   21.700711] CR2: 0000000000000048 CR3: 000000020cf65000 CR4: 00000000001406f0
> <4>[   21.700770] Stack:
> <4>[   21.700790]  ffffffffc0375088 0000000000000008 ffff9ce251370700
> 0000000000000001
> <4>[   21.700867]  ffffffffc03751c7 0100000000000000 ffffa41003eaf618
> ffff9ce252b5a800
> <4>[   21.700944]  0000000000000000 ffff9ce251371420 0000000000000000
> ffff9ce254e38c00
> <4>[   21.701021] Call Trace:
> <4>[   21.701048]  [<ffffffffc0375088>] ? setup_arp_tx.isra.20+0x48/0x60 [rtlwifi]
> <4>[   21.701110]  [<ffffffffc03751c7>] ? rtl_is_special_data+0x127/0x210 [rtlwifi]
> <4>[   21.701171]  [<ffffffffc037e8c7>] ? rtl_get_rate+0x97/0x210 [rtlwifi]
> <4>[   21.701228]  [<ffffffff9a87deb6>] ? rate_control_get_rate+0xb6/0x140
> <4>[   21.701283]  [<ffffffff9a88cf30>] ? ieee80211_tx_h_rate_ctrl+0x1e0/0x3f0
> <4>[   21.701340]  [<ffffffff9a88fcc2>] ? invoke_tx_handlers_early+0x222/0x5a0
> <4>[   21.701397]  [<ffffffff9a89186e>] ? ieee80211_tx+0x6e/0x130
> <4>[   21.701446]  [<ffffffff9a892661>] ? __ieee80211_subif_start_xmit+0x4d1/0x9d0
> <4>[   21.701506]  [<ffffffff9a741874>] ? nf_conntrack_tuple_taken+0x1c4/0x1d0
> <4>[   21.701565]  [<ffffffff9a749779>] ? get_unique_tuple+0xe9/0x510
> <4>[   21.701617]  [<ffffffff9a892b6c>] ? ieee80211_subif_start_xmit+0xc/0x10
> <4>[   21.701675]  [<ffffffff9a6e606a>] ? dev_hard_start_xmit+0x9a/0x210
> <4>[   21.701729]  [<ffffffff9a708a46>] ? sch_direct_xmit+0xd6/0x1a0
> <4>[   21.701780]  [<ffffffff9a6e66d2>] ? __dev_queue_xmit+0x422/0x620
> <4>[   21.701832]  [<ffffffff9a79859f>] ? arp_xmit+0x9f/0xb0
> <4>[   21.701878]  [<ffffffff9a798220>] ? arp_create+0x250/0x250
> <4>[   21.701926]  [<ffffffff9a7986ee>] ? arp_solicit+0xee/0x240
> <4>[   21.701974]  [<ffffffff9a1335cd>] ? mod_timer+0x1ad/0x360
> <4>[   21.702022]  [<ffffffff9a6edf12>] ? neigh_probe+0x42/0x60
> <4>[   21.702071]  [<ffffffff9a6ef2f2>] ? __neigh_event_send+0x1e2/0x230
> <4>[   21.702124]  [<ffffffff9a6ef520>] ? neigh_resolve_output+0x120/0x1b0
> <4>[   21.702179]  [<ffffffff9a76ac37>] ? ip_finish_output2+0x127/0x300
> <4>[   21.702231]  [<ffffffff9a76c524>] ? ip_output+0x64/0x100
> <4>[   21.702277]  [<ffffffff9a76b9b0>] ?
> __ip_flush_pending_frames.isra.46+0x80/0x80
> <4>[   21.702339]  [<ffffffff9a76ceb5>] ? ip_send_skb+0x15/0x40
> <4>[   21.702386]  [<ffffffff9a79308f>] ? udp_send_skb+0x15f/0x240
> <4>[   21.702436]  [<ffffffff9a7944e6>] ? udp_sendmsg+0x2b6/0x840
> <4>[   21.702485]  [<ffffffff9a0e10ba>] ? __local_bh_enable_ip+0x8a/0x90
> <4>[   21.702538]  [<ffffffff9a76ac4a>] ? ip_finish_output2+0x13a/0x300
> <4>[   21.702592]  [<ffffffff9a1fda33>] ? rw_copy_check_uvector+0x53/0x110
> <4>[   21.702648]  [<ffffffff9a382b37>] ? import_iovec+0x27/0xc0
> <4>[   21.702698]  [<ffffffff9a6c8d01>] ? ___sys_sendmsg+0x111/0x2a0
> <4>[   21.702749]  [<ffffffff9a20fa50>] ? poll_select_copy_remaining+0x130/0x130
> <4>[   21.702808]  [<ffffffff9a7944f5>] ? udp_sendmsg+0x2c5/0x840
> <4>[   21.702857]  [<ffffffff9a79b2b1>] ? __ip_dev_find+0x111/0x130
> <4>[   21.702908]  [<ffffffff9a764885>] ? __ip_route_output_key_hash+0x2c5/0x870
> <4>[   21.702968]  [<ffffffff9a6c94e9>] ? __sys_sendmmsg+0x89/0x160
> <4>[   21.703018]  [<ffffffff9a6c8490>] ? SYSC_connect+0x50/0xa0
> <4>[   21.703066]  [<ffffffff9a6c626a>] ? sock_alloc_file+0x9a/0x110
> <4>[   21.703119]  [<ffffffff9a6c95ce>] ? SyS_sendmmsg+0xe/0x20
> <4>[   21.703166]  [<ffffffff9a8c8837>] ? entry_SYSCALL_64_fastpath+0x1a/0xa9
> <4>[   21.703222] Code: 05 e9 32 ff ff ff e9 2d fe ff ff 0f 1f 00 66 2e 0f 1f 84
> 00 00 00 00 00 0f 1f 44 00 00 65 8b 05 24 f4 c8 3f a9 00 ff 1f 00 74 23 <48> 8b
> 57 48 bf 40 00 00 00 48 8b 35 3d ba b7 da c6 82 ad a2 00
> <1>[   21.709488] RIP  [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.712533]  RSP <ffffa41003eaf520>
> <4>[   21.715589] CR2: 0000000000000048
> <4>[   21.735721] ---[ end trace f6ce402401b0b86a ]---
> 
> > 4.9-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Larry Finger <Larry.Finger@lwfinger.net>
> > 
> > commit ba9f93f82abafe2552eac942ebb11c2df4f8dd7f upstream.
> > 
> > In commit a5ffbe0a1993 ("rtlwifi: Fix scheduling while atomic bug") and
> > commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter()
> > to use work queue"), an error was introduced in the power-save routines
> > due to the fact that leaving PS was delayed by the use of a work queue.
> > 
> > This problem is fixed by detecting if the enter or leave routines are
> > in interrupt mode. If so, the workqueue is used to place the request.
> > If in normal mode, the enter or leave routines are called directly.
> > 
> > Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
> > Reported-by: Ping-Ke Shih <pkshih@realtek.com>
> > Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > ---
> >  drivers/net/wireless/realtek/rtlwifi/base.c |    8 +++---
> >  drivers/net/wireless/realtek/rtlwifi/core.c |    9 ++-----
> >  drivers/net/wireless/realtek/rtlwifi/pci.c  |   14 +++-------
> >  drivers/net/wireless/realtek/rtlwifi/ps.c   |   36 +++++++++++++++++++++-------
> >  4 files changed, 40 insertions(+), 27 deletions(-)
> > 
> > --- a/drivers/net/wireless/realtek/rtlwifi/base.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> > @@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
> >  
> >  static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
> >  {
> > +	struct ieee80211_hw *hw = rtlpriv->hw;
> > +
> >  	rtlpriv->ra.is_special_data = true;
> >  	if (rtlpriv->cfg->ops->get_btc_status())
> >  		rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
> >  					rtlpriv, 1);
> > -	rtlpriv->enter_ps = false;
> > -	schedule_work(&rtlpriv->works.lps_change_work);
> > +	rtl_lps_leave(hw);
> >  	ppsc->last_delaylps_stamp_jiffies = jiffies;
> >  }
> >  
> > @@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_
> >  
> >  		if (is_tx) {
> >  			rtlpriv->ra.is_special_data = true;
> > -			rtlpriv->enter_ps = false;
> > -			schedule_work(&rtlpriv->works.lps_change_work);
> > +			rtl_lps_leave(hw);
> >  			ppsc->last_delaylps_stamp_jiffies = jiffies;
> >  		}
> >  
> > --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> > @@ -1150,10 +1150,8 @@ static void rtl_op_bss_info_changed(stru
> >  		} else {
> >  			mstatus = RT_MEDIA_DISCONNECT;
> >  
> > -			if (mac->link_state == MAC80211_LINKED) {
> > -				rtlpriv->enter_ps = false;
> > -				schedule_work(&rtlpriv->works.lps_change_work);
> > -			}
> > +			if (mac->link_state == MAC80211_LINKED)
> > +				rtl_lps_leave(hw);
> >  			if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE)
> >  				rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
> >  			mac->link_state = MAC80211_NOLINK;
> > @@ -1431,8 +1429,7 @@ static void rtl_op_sw_scan_start(struct
> >  	}
> >  
> >  	if (mac->link_state == MAC80211_LINKED) {
> > -		rtlpriv->enter_ps = false;
> > -		schedule_work(&rtlpriv->works.lps_change_work);
> > +		rtl_lps_leave(hw);
> >  		mac->link_state = MAC80211_LINKED_SCANNING;
> >  	} else {
> >  		rtl_ips_nic_on(hw);
> > --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> > @@ -663,11 +663,9 @@ tx_status_ok:
> >  	}
> >  
> >  	if (((rtlpriv->link_info.num_rx_inperiod +
> > -		rtlpriv->link_info.num_tx_inperiod) > 8) ||
> > -		(rtlpriv->link_info.num_rx_inperiod > 2)) {
> > -		rtlpriv->enter_ps = false;
> > -		schedule_work(&rtlpriv->works.lps_change_work);
> > -	}
> > +	      rtlpriv->link_info.num_tx_inperiod) > 8) ||
> > +	      (rtlpriv->link_info.num_rx_inperiod > 2))
> > +		rtl_lps_leave(hw);
> >  }
> >  
> >  static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
> > @@ -918,10 +916,8 @@ new_trx_end:
> >  		}
> >  		if (((rtlpriv->link_info.num_rx_inperiod +
> >  		      rtlpriv->link_info.num_tx_inperiod) > 8) ||
> > -		      (rtlpriv->link_info.num_rx_inperiod > 2)) {
> > -			rtlpriv->enter_ps = false;
> > -			schedule_work(&rtlpriv->works.lps_change_work);
> > -		}
> > +		      (rtlpriv->link_info.num_rx_inperiod > 2))
> > +			rtl_lps_leave(hw);
> >  		skb = new_skb;
> >  no_new:
> >  		if (rtlpriv->use_new_trx_flow) {
> > --- a/drivers/net/wireless/realtek/rtlwifi/ps.c
> > +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
> > @@ -407,8 +407,8 @@ void rtl_lps_set_psmode(struct ieee80211
> >  	}
> >  }
> >  
> > -/*Enter the leisure power save mode.*/
> > -void rtl_lps_enter(struct ieee80211_hw *hw)
> > +/* Interrupt safe routine to enter the leisure power save mode.*/
> > +static void rtl_lps_enter_core(struct ieee80211_hw *hw)
> >  {
> >  	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
> >  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
> > @@ -444,10 +444,9 @@ void rtl_lps_enter(struct ieee80211_hw *
> >  
> >  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
> >  }
> > -EXPORT_SYMBOL(rtl_lps_enter);
> >  
> > -/*Leave the leisure power save mode.*/
> > -void rtl_lps_leave(struct ieee80211_hw *hw)
> > +/* Interrupt safe routine to leave the leisure power save mode.*/
> > +static void rtl_lps_leave_core(struct ieee80211_hw *hw)
> >  {
> >  	struct rtl_priv *rtlpriv = rtl_priv(hw);
> >  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
> > @@ -477,7 +476,6 @@ void rtl_lps_leave(struct ieee80211_hw *
> >  	}
> >  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
> >  }
> > -EXPORT_SYMBOL(rtl_lps_leave);
> >  
> >  /* For sw LPS*/
> >  void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
> > @@ -670,12 +668,34 @@ void rtl_lps_change_work_callback(struct
> >  	struct rtl_priv *rtlpriv = rtl_priv(hw);
> >  
> >  	if (rtlpriv->enter_ps)
> > -		rtl_lps_enter(hw);
> > +		rtl_lps_enter_core(hw);
> >  	else
> > -		rtl_lps_leave(hw);
> > +		rtl_lps_leave_core(hw);
> >  }
> >  EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
> >  
> > +void rtl_lps_enter(struct ieee80211_hw *hw)
> > +{
> > +	struct rtl_priv *rtlpriv = rtl_priv(hw);
> > +
> > +	if (!in_interrupt())
> > +		return rtl_lps_enter_core(hw);
> > +	rtlpriv->enter_ps = true;
> > +	schedule_work(&rtlpriv->works.lps_change_work);
> > +}
> > +EXPORT_SYMBOL_GPL(rtl_lps_enter);
> > +
> > +void rtl_lps_leave(struct ieee80211_hw *hw)
> > +{
> > +	struct rtl_priv *rtlpriv = rtl_priv(hw);
> > +
> > +	if (!in_interrupt())
> > +		return rtl_lps_leave_core(hw);
> > +	rtlpriv->enter_ps = false;
> > +	schedule_work(&rtlpriv->works.lps_change_work);
> > +}
> > +EXPORT_SYMBOL_GPL(rtl_lps_leave);
> > +
> >  void rtl_swlps_wq_callback(void *data)
> >  {
> >  	struct rtl_works *rtlworks = container_of_dwork_rtl(data,
> > 
> > 
> 
> 
> -- 
> Dmitry

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


#1555922 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

Fromlkml@pengaru.com
Date2017-01-10 22:30 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYc9s-6qU-21@gated-at.bofh.it>
In reply to#1555910
On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
> > Hello, this patch causes a kernel panic with the rtl8192cu driver.
> 
> Ick, not good!  Does this cause a problem in Linus's tree as well?
> 

http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html

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


#1555961 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromWilly Tarreau <w@1wt.eu>
Date2017-01-10 23:00 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYcCu-6CS-37@gated-at.bofh.it>
In reply to#1555922
On Tue, Jan 10, 2017 at 03:23:27PM -0600, lkml@pengaru.com wrote:
> On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
> > On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
> > > Hello, this patch causes a kernel panic with the rtl8192cu driver.
> > 
> > Ick, not good!  Does this cause a problem in Linus's tree as well?
> > 
> 
> http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html

OK the pending patch is here and not yet upstream :

    http://marc.info/?l=linux-wireless&m=148234081512703&w=2

It fixes ba9f93f82aba (patch 3/116) so better postpone it until
the patch above gets merged.

Willy

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


#1557147 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-12 08:40 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYI9k-1aH-15@gated-at.bofh.it>
In reply to#1555961
On Tue, Jan 10, 2017 at 10:51:56PM +0100, Willy Tarreau wrote:
> On Tue, Jan 10, 2017 at 03:23:27PM -0600, lkml@pengaru.com wrote:
> > On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
> > > On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
> > > > Hello, this patch causes a kernel panic with the rtl8192cu driver.
> > > 
> > > Ick, not good!  Does this cause a problem in Linus's tree as well?
> > > 
> > 
> > http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html
> 
> OK the pending patch is here and not yet upstream :
> 
>     http://marc.info/?l=linux-wireless&m=148234081512703&w=2
> 
> It fixes ba9f93f82aba (patch 3/116) so better postpone it until
> the patch above gets merged.

Yes, I've reverted this now and will wait for this fixup to hit Linus's
tree.  Larry, can you remind me to include the original patch in the
stable tree when this fixup is merged?

thanks,

greg k-h

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


#1557202 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromDmitry Osipenko <digetx@gmail.com>
Date2017-01-12 09:50 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYJf4-1MG-17@gated-at.bofh.it>
In reply to#1557147
On 12.01.2017 10:32, Greg Kroah-Hartman wrote:
> On Tue, Jan 10, 2017 at 10:51:56PM +0100, Willy Tarreau wrote:
>> On Tue, Jan 10, 2017 at 03:23:27PM -0600, lkml@pengaru.com wrote:
>>> On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
>>>> On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
>>>>> Hello, this patch causes a kernel panic with the rtl8192cu driver.
>>>>
>>>> Ick, not good!  Does this cause a problem in Linus's tree as well?
>>>>
>>>
>>> http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html
>>
>> OK the pending patch is here and not yet upstream :
>>
>>     http://marc.info/?l=linux-wireless&m=148234081512703&w=2
>>
>> It fixes ba9f93f82aba (patch 3/116) so better postpone it until
>> the patch above gets merged.
> 
> Yes, I've reverted this now and will wait for this fixup to hit Linus's
> tree.  Larry, can you remind me to include the original patch in the
> stable tree when this fixup is merged?
> 

Thanks a lot for taking an action.

-- 
Dmitry

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


#1558061 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromKalle Valo <kvalo@codeaurora.org>
Date2017-01-13 07:50 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sZ3Qt-5Z6-7@gated-at.bofh.it>
In reply to#1557147
Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> On Tue, Jan 10, 2017 at 10:51:56PM +0100, Willy Tarreau wrote:
>> On Tue, Jan 10, 2017 at 03:23:27PM -0600, lkml@pengaru.com wrote:
>> > On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
>> > > On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
>> > > > Hello, this patch causes a kernel panic with the rtl8192cu driver.
>> > > 
>> > > Ick, not good!  Does this cause a problem in Linus's tree as well?
>> > > 
>> > 
>> > http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html
>> 
>> OK the pending patch is here and not yet upstream :
>> 
>>     http://marc.info/?l=linux-wireless&m=148234081512703&w=2
>> 
>> It fixes ba9f93f82aba (patch 3/116) so better postpone it until
>> the patch above gets merged.
>
> Yes, I've reverted this now and will wait for this fixup to hit Linus's
> tree.  Larry, can you remind me to include the original patch in the
> stable tree when this fixup is merged?

Linus pulled it now:

commit 60f59ce0278557f7896d5158ae6d12a4855a72cc
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Wed Dec 21 11:18:55 2016 -0600

    rtlwifi: rtl_usb: Fix missing entry in USB driver's private data
    
    These drivers need to be able to reference "struct ieee80211_hw"
    from
    the driver's private data, and vice versa. The USB driver failed to
    store the address of ieee80211_hw in the private data. Although this
    bug has been present for a long time, it was not exposed until
    commit ba9f93f82aba ("rtlwifi: Fix enter/exit power_save").
    
    Fixes: ba9f93f82aba ("rtlwifi: Fix enter/exit power_save")
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

-- 
Kalle Valo

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


#1558212 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-13 12:00 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sZ7Kv-8gB-15@gated-at.bofh.it>
In reply to#1558061
On Fri, Jan 13, 2017 at 08:42:03AM +0200, Kalle Valo wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Tue, Jan 10, 2017 at 10:51:56PM +0100, Willy Tarreau wrote:
> >> On Tue, Jan 10, 2017 at 03:23:27PM -0600, lkml@pengaru.com wrote:
> >> > On Tue, Jan 10, 2017 at 09:40:24PM +0100, Greg Kroah-Hartman wrote:
> >> > > On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
> >> > > > Hello, this patch causes a kernel panic with the rtl8192cu driver.
> >> > > 
> >> > > Ick, not good!  Does this cause a problem in Linus's tree as well?
> >> > > 
> >> > 
> >> > http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00228.html
> >> 
> >> OK the pending patch is here and not yet upstream :
> >> 
> >>     http://marc.info/?l=linux-wireless&m=148234081512703&w=2
> >> 
> >> It fixes ba9f93f82aba (patch 3/116) so better postpone it until
> >> the patch above gets merged.
> >
> > Yes, I've reverted this now and will wait for this fixup to hit Linus's
> > tree.  Larry, can you remind me to include the original patch in the
> > stable tree when this fixup is merged?
> 
> Linus pulled it now:
> 
> commit 60f59ce0278557f7896d5158ae6d12a4855a72cc
> Author: Larry Finger <Larry.Finger@lwfinger.net>
> Date:   Wed Dec 21 11:18:55 2016 -0600
> 
>     rtlwifi: rtl_usb: Fix missing entry in USB driver's private data
>     
>     These drivers need to be able to reference "struct ieee80211_hw"
>     from
>     the driver's private data, and vice versa. The USB driver failed to
>     store the address of ieee80211_hw in the private data. Although this
>     bug has been present for a long time, it was not exposed until
>     commit ba9f93f82aba ("rtlwifi: Fix enter/exit power_save").
>     
>     Fixes: ba9f93f82aba ("rtlwifi: Fix enter/exit power_save")
>     Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>     Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Thanks will queue these two up now.

greg k-h

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


#1556152 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromLarry Finger <Larry.Finger@lwfinger.net>
Date2017-01-11 03:00 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYgmJ-wR-19@gated-at.bofh.it>
In reply to#1555910
On 01/10/2017 02:40 PM, Greg Kroah-Hartman wrote:
> On Tue, Jan 10, 2017 at 08:40:28PM +0300, Dmitry Osipenko wrote:
>> Hello, this patch causes a kernel panic with the rtl8192cu driver.
>
> Ick, not good!  Does this cause a problem in Linus's tree as well?

Yes, but he is aware that the pacth exists and has asked the wireless maintainer 
about it. It went to DaveM today.

Larry

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


#1556149 — Re: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save

FromLarry Finger <Larry.Finger@lwfinger.net>
Date2017-01-11 03:00 +0100
SubjectRe: [PATCH 4.9 003/116] rtlwifi: Fix enter/exit power_save
Message-ID<sYgmJ-wR-9@gated-at.bofh.it>
In reply to#1555765
On 01/10/2017 11:40 AM, Dmitry Osipenko wrote:
> Hello, this patch causes a kernel panic with the rtl8192cu driver.
>
> <6>[   20.847025] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> <1>[   21.699551] BUG: unable to handle kernel NULL pointer dereference at
> 0000000000000048
> <1>[   21.699626] IP: [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.699681] PGD 20cf47067
> <4>[   21.699702] PUD 20cf42067
> <4>[   21.699725] PMD 0
> <4>[   21.699732]
> <4>[   21.699759] Oops: 0000 [#1] PREEMPT SMP
> <4>[   21.699794] Modules linked in: rtl8192cu rtl_usb rtl8192c_common rtlwifi
> snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec
> snd_hwdep snd_hda_core dm_mod thermal
> <4>[   21.699985] CPU: 0 PID: 2656 Comm: ntpdate Not tainted 4.9.2 #1
> <4>[   21.700036] Hardware name: Gigabyte Technology Co., Ltd. To be filled by
> O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
> <4>[   21.700118] task: ffff9ce2509ca4c0 task.stack: ffffa41003eac000
> <4>[   21.700168] RIP: 0010:[<ffffffffc037de33>]  [<ffffffffc037de33>]
> rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.700250] RSP: 0018:ffffa41003eaf520  EFLAGS: 00010206
> <4>[   21.700296] RAX: 0000000080000802 RBX: ffff9ce251371420 RCX: ffff9ce254ff4640
> <4>[   21.700356] RDX: 0000000000000806 RSI: ffff9ce25137afb8 RDI: 0000000000000000
> <4>[   21.700416] RBP: ffff9ce25137afb8 R08: ffffffffc0382d00 R09: ffff9ce254e38c31
> <4>[   21.700475] R10: 0000000000000000 R11: ffff9ce251370700 R12: 0000000000000000
> <4>[   21.700535] R13: 0000000000000000 R14: ffff9ce251371420 R15: ffff9ce254e38c00
> <4>[   21.700595] FS:  00007f22f6da8700(0000) GS:ffff9ce25f200000(0000)
> knlGS:0000000000000000
> <4>[   21.700662] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> <4>[   21.700711] CR2: 0000000000000048 CR3: 000000020cf65000 CR4: 00000000001406f0
> <4>[   21.700770] Stack:
> <4>[   21.700790]  ffffffffc0375088 0000000000000008 ffff9ce251370700
> 0000000000000001
> <4>[   21.700867]  ffffffffc03751c7 0100000000000000 ffffa41003eaf618
> ffff9ce252b5a800
> <4>[   21.700944]  0000000000000000 ffff9ce251371420 0000000000000000
> ffff9ce254e38c00
> <4>[   21.701021] Call Trace:
> <4>[   21.701048]  [<ffffffffc0375088>] ? setup_arp_tx.isra.20+0x48/0x60 [rtlwifi]
> <4>[   21.701110]  [<ffffffffc03751c7>] ? rtl_is_special_data+0x127/0x210 [rtlwifi]
> <4>[   21.701171]  [<ffffffffc037e8c7>] ? rtl_get_rate+0x97/0x210 [rtlwifi]
> <4>[   21.701228]  [<ffffffff9a87deb6>] ? rate_control_get_rate+0xb6/0x140
> <4>[   21.701283]  [<ffffffff9a88cf30>] ? ieee80211_tx_h_rate_ctrl+0x1e0/0x3f0
> <4>[   21.701340]  [<ffffffff9a88fcc2>] ? invoke_tx_handlers_early+0x222/0x5a0
> <4>[   21.701397]  [<ffffffff9a89186e>] ? ieee80211_tx+0x6e/0x130
> <4>[   21.701446]  [<ffffffff9a892661>] ? __ieee80211_subif_start_xmit+0x4d1/0x9d0
> <4>[   21.701506]  [<ffffffff9a741874>] ? nf_conntrack_tuple_taken+0x1c4/0x1d0
> <4>[   21.701565]  [<ffffffff9a749779>] ? get_unique_tuple+0xe9/0x510
> <4>[   21.701617]  [<ffffffff9a892b6c>] ? ieee80211_subif_start_xmit+0xc/0x10
> <4>[   21.701675]  [<ffffffff9a6e606a>] ? dev_hard_start_xmit+0x9a/0x210
> <4>[   21.701729]  [<ffffffff9a708a46>] ? sch_direct_xmit+0xd6/0x1a0
> <4>[   21.701780]  [<ffffffff9a6e66d2>] ? __dev_queue_xmit+0x422/0x620
> <4>[   21.701832]  [<ffffffff9a79859f>] ? arp_xmit+0x9f/0xb0
> <4>[   21.701878]  [<ffffffff9a798220>] ? arp_create+0x250/0x250
> <4>[   21.701926]  [<ffffffff9a7986ee>] ? arp_solicit+0xee/0x240
> <4>[   21.701974]  [<ffffffff9a1335cd>] ? mod_timer+0x1ad/0x360
> <4>[   21.702022]  [<ffffffff9a6edf12>] ? neigh_probe+0x42/0x60
> <4>[   21.702071]  [<ffffffff9a6ef2f2>] ? __neigh_event_send+0x1e2/0x230
> <4>[   21.702124]  [<ffffffff9a6ef520>] ? neigh_resolve_output+0x120/0x1b0
> <4>[   21.702179]  [<ffffffff9a76ac37>] ? ip_finish_output2+0x127/0x300
> <4>[   21.702231]  [<ffffffff9a76c524>] ? ip_output+0x64/0x100
> <4>[   21.702277]  [<ffffffff9a76b9b0>] ?
> __ip_flush_pending_frames.isra.46+0x80/0x80
> <4>[   21.702339]  [<ffffffff9a76ceb5>] ? ip_send_skb+0x15/0x40
> <4>[   21.702386]  [<ffffffff9a79308f>] ? udp_send_skb+0x15f/0x240
> <4>[   21.702436]  [<ffffffff9a7944e6>] ? udp_sendmsg+0x2b6/0x840
> <4>[   21.702485]  [<ffffffff9a0e10ba>] ? __local_bh_enable_ip+0x8a/0x90
> <4>[   21.702538]  [<ffffffff9a76ac4a>] ? ip_finish_output2+0x13a/0x300
> <4>[   21.702592]  [<ffffffff9a1fda33>] ? rw_copy_check_uvector+0x53/0x110
> <4>[   21.702648]  [<ffffffff9a382b37>] ? import_iovec+0x27/0xc0
> <4>[   21.702698]  [<ffffffff9a6c8d01>] ? ___sys_sendmsg+0x111/0x2a0
> <4>[   21.702749]  [<ffffffff9a20fa50>] ? poll_select_copy_remaining+0x130/0x130
> <4>[   21.702808]  [<ffffffff9a7944f5>] ? udp_sendmsg+0x2c5/0x840
> <4>[   21.702857]  [<ffffffff9a79b2b1>] ? __ip_dev_find+0x111/0x130
> <4>[   21.702908]  [<ffffffff9a764885>] ? __ip_route_output_key_hash+0x2c5/0x870
> <4>[   21.702968]  [<ffffffff9a6c94e9>] ? __sys_sendmmsg+0x89/0x160
> <4>[   21.703018]  [<ffffffff9a6c8490>] ? SYSC_connect+0x50/0xa0
> <4>[   21.703066]  [<ffffffff9a6c626a>] ? sock_alloc_file+0x9a/0x110
> <4>[   21.703119]  [<ffffffff9a6c95ce>] ? SyS_sendmmsg+0xe/0x20
> <4>[   21.703166]  [<ffffffff9a8c8837>] ? entry_SYSCALL_64_fastpath+0x1a/0xa9
> <4>[   21.703222] Code: 05 e9 32 ff ff ff e9 2d fe ff ff 0f 1f 00 66 2e 0f 1f 84
> 00 00 00 00 00 0f 1f 44 00 00 65 8b 05 24 f4 c8 3f a9 00 ff 1f 00 74 23 <48> 8b
> 57 48 bf 40 00 00 00 48 8b 35 3d ba b7 da c6 82 ad a2 00
> <1>[   21.709488] RIP  [<ffffffffc037de33>] rtl_lps_leave+0x13/0x40 [rtlwifi]
> <4>[   21.712533]  RSP <ffffa41003eaf520>
> <4>[   21.715589] CR2: 0000000000000048
> <4>[   21.735721] ---[ end trace f6ce402401b0b86a ]---
>
>> 4.9-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Larry Finger <Larry.Finger@lwfinger.net>
>>
>> commit ba9f93f82abafe2552eac942ebb11c2df4f8dd7f upstream.
>>
>> In commit a5ffbe0a1993 ("rtlwifi: Fix scheduling while atomic bug") and
>> commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter()
>> to use work queue"), an error was introduced in the power-save routines
>> due to the fact that leaving PS was delayed by the use of a work queue.
>>
>> This problem is fixed by detecting if the enter or leave routines are
>> in interrupt mode. If so, the workqueue is used to place the request.
>> If in normal mode, the enter or leave routines are called directly.
>>
>> Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
>> Reported-by: Ping-Ke Shih <pkshih@realtek.com>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>
>> ---
>>  drivers/net/wireless/realtek/rtlwifi/base.c |    8 +++---
>>  drivers/net/wireless/realtek/rtlwifi/core.c |    9 ++-----
>>  drivers/net/wireless/realtek/rtlwifi/pci.c  |   14 +++-------
>>  drivers/net/wireless/realtek/rtlwifi/ps.c   |   36 +++++++++++++++++++++-------
>>  4 files changed, 40 insertions(+), 27 deletions(-)
>>
>> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
>> @@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
>>
>>  static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
>>  {
>> +	struct ieee80211_hw *hw = rtlpriv->hw;
>> +
>>  	rtlpriv->ra.is_special_data = true;
>>  	if (rtlpriv->cfg->ops->get_btc_status())
>>  		rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
>>  					rtlpriv, 1);
>> -	rtlpriv->enter_ps = false;
>> -	schedule_work(&rtlpriv->works.lps_change_work);
>> +	rtl_lps_leave(hw);
>>  	ppsc->last_delaylps_stamp_jiffies = jiffies;
>>  }
>>
>> @@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_
>>
>>  		if (is_tx) {
>>  			rtlpriv->ra.is_special_data = true;
>> -			rtlpriv->enter_ps = false;
>> -			schedule_work(&rtlpriv->works.lps_change_work);
>> +			rtl_lps_leave(hw);
>>  			ppsc->last_delaylps_stamp_jiffies = jiffies;
>>  		}
>>
>> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
>> @@ -1150,10 +1150,8 @@ static void rtl_op_bss_info_changed(stru
>>  		} else {
>>  			mstatus = RT_MEDIA_DISCONNECT;
>>
>> -			if (mac->link_state == MAC80211_LINKED) {
>> -				rtlpriv->enter_ps = false;
>> -				schedule_work(&rtlpriv->works.lps_change_work);
>> -			}
>> +			if (mac->link_state == MAC80211_LINKED)
>> +				rtl_lps_leave(hw);
>>  			if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE)
>>  				rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
>>  			mac->link_state = MAC80211_NOLINK;
>> @@ -1431,8 +1429,7 @@ static void rtl_op_sw_scan_start(struct
>>  	}
>>
>>  	if (mac->link_state == MAC80211_LINKED) {
>> -		rtlpriv->enter_ps = false;
>> -		schedule_work(&rtlpriv->works.lps_change_work);
>> +		rtl_lps_leave(hw);
>>  		mac->link_state = MAC80211_LINKED_SCANNING;
>>  	} else {
>>  		rtl_ips_nic_on(hw);
>> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
>> @@ -663,11 +663,9 @@ tx_status_ok:
>>  	}
>>
>>  	if (((rtlpriv->link_info.num_rx_inperiod +
>> -		rtlpriv->link_info.num_tx_inperiod) > 8) ||
>> -		(rtlpriv->link_info.num_rx_inperiod > 2)) {
>> -		rtlpriv->enter_ps = false;
>> -		schedule_work(&rtlpriv->works.lps_change_work);
>> -	}
>> +	      rtlpriv->link_info.num_tx_inperiod) > 8) ||
>> +	      (rtlpriv->link_info.num_rx_inperiod > 2))
>> +		rtl_lps_leave(hw);
>>  }
>>
>>  static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
>> @@ -918,10 +916,8 @@ new_trx_end:
>>  		}
>>  		if (((rtlpriv->link_info.num_rx_inperiod +
>>  		      rtlpriv->link_info.num_tx_inperiod) > 8) ||
>> -		      (rtlpriv->link_info.num_rx_inperiod > 2)) {
>> -			rtlpriv->enter_ps = false;
>> -			schedule_work(&rtlpriv->works.lps_change_work);
>> -		}
>> +		      (rtlpriv->link_info.num_rx_inperiod > 2))
>> +			rtl_lps_leave(hw);
>>  		skb = new_skb;
>>  no_new:
>>  		if (rtlpriv->use_new_trx_flow) {
>> --- a/drivers/net/wireless/realtek/rtlwifi/ps.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
>> @@ -407,8 +407,8 @@ void rtl_lps_set_psmode(struct ieee80211
>>  	}
>>  }
>>
>> -/*Enter the leisure power save mode.*/
>> -void rtl_lps_enter(struct ieee80211_hw *hw)
>> +/* Interrupt safe routine to enter the leisure power save mode.*/
>> +static void rtl_lps_enter_core(struct ieee80211_hw *hw)
>>  {
>>  	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
>>  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
>> @@ -444,10 +444,9 @@ void rtl_lps_enter(struct ieee80211_hw *
>>
>>  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
>>  }
>> -EXPORT_SYMBOL(rtl_lps_enter);
>>
>> -/*Leave the leisure power save mode.*/
>> -void rtl_lps_leave(struct ieee80211_hw *hw)
>> +/* Interrupt safe routine to leave the leisure power save mode.*/
>> +static void rtl_lps_leave_core(struct ieee80211_hw *hw)
>>  {
>>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>>  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
>> @@ -477,7 +476,6 @@ void rtl_lps_leave(struct ieee80211_hw *
>>  	}
>>  	spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
>>  }
>> -EXPORT_SYMBOL(rtl_lps_leave);
>>
>>  /* For sw LPS*/
>>  void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
>> @@ -670,12 +668,34 @@ void rtl_lps_change_work_callback(struct
>>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>>
>>  	if (rtlpriv->enter_ps)
>> -		rtl_lps_enter(hw);
>> +		rtl_lps_enter_core(hw);
>>  	else
>> -		rtl_lps_leave(hw);
>> +		rtl_lps_leave_core(hw);
>>  }
>>  EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
>>
>> +void rtl_lps_enter(struct ieee80211_hw *hw)
>> +{
>> +	struct rtl_priv *rtlpriv = rtl_priv(hw);
>> +
>> +	if (!in_interrupt())
>> +		return rtl_lps_enter_core(hw);
>> +	rtlpriv->enter_ps = true;
>> +	schedule_work(&rtlpriv->works.lps_change_work);
>> +}
>> +EXPORT_SYMBOL_GPL(rtl_lps_enter);
>> +
>> +void rtl_lps_leave(struct ieee80211_hw *hw)
>> +{
>> +	struct rtl_priv *rtlpriv = rtl_priv(hw);
>> +
>> +	if (!in_interrupt())
>> +		return rtl_lps_leave_core(hw);
>> +	rtlpriv->enter_ps = false;
>> +	schedule_work(&rtlpriv->works.lps_change_work);
>> +}
>> +EXPORT_SYMBOL_GPL(rtl_lps_leave);
>> +
>>  void rtl_swlps_wq_callback(void *data)
>>  {
>>  	struct rtl_works *rtlworks = container_of_dwork_rtl(data,

The fix is being merged into mainline. The reference is 
http://marc.info/?l=linux-wireless&m=148234081512703&w=2.

Larry

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


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

Back to top | Article view | linux.kernel


csiph-web