4.4.41-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 4.4.41-stable review
This is the start of the stable review cycle for the 4.4.41 release. There are 58 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Jan 8 21:38:49 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.41-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.4.41-rc1
Thomas Petazzoni <[email protected]>
net: mvpp2: fix dma unmapping of TX buffers for fragments
Al Viro <[email protected]>
sg_write()/bsg_write() is not fit to be called under KERNEL_DS
Ben Hutchings <[email protected]>
kconfig/nconf: Fix hang when editing symbol with a long prompt
Andy Grover <[email protected]>
target/user: Fix use-after-free of tcmu_cmds if they are expired
Segher Boessenkool <[email protected]>
powerpc: Convert cmp to cmpd in idle enter sequence
Geoff Levand <[email protected]>
powerpc/ps3: Fix system hang with GCC 5 builds
Al Viro <[email protected]>
nfs_write_end(): fix handling of short copies
Ilya Dryomov <[email protected]>
libceph: verify authorize reply on connect
Alan Stern <[email protected]>
PCI: Check for PME in targeted sleep state
Jingkui Wang <[email protected]>
Input: drv260x - fix input device's parent assignment
Andrey Utkin <[email protected]>
media: solo6x10: fix lockup by avoiding delayed register write
Bart Van Assche <[email protected]>
IB/cma: Fix a race condition in iboe_addr_get_sgid()
Bart Van Assche <[email protected]>
IB/multicast: Check ib_find_pkey() return value
Bart Van Assche <[email protected]>
IPoIB: Avoid reading an uninitialized member variable
Bart Van Assche <[email protected]>
IB/mad: Fix an array index check
Steven Rostedt (Red Hat) <[email protected]>
fgraph: Handle a case where a tracer ignores set_graph_notrace
Marcos Paulo de Souza <[email protected]>
platform/x86: asus-nb-wmi.c: Add X45U quirk
Steven Rostedt (Red Hat) <[email protected]>
ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it
Jim Mattson <[email protected]>
kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
Paul Mackerras <[email protected]>
KVM: PPC: Book3S HV: Don't lose hardware R/C bit updates in H_PROTECT
Paul Mackerras <[email protected]>
KVM: PPC: Book3S HV: Save/restore XER in checkpointed register state
Konstantin Khlebnikov <[email protected]>
md/raid5: limit request size according to implementation limits
Josh Cartwright <[email protected]>
sc16is7xx: Drop bogus use of IRQF_ONESHOT
Gerald Schaefer <[email protected]>
s390/vmlogrdr: fix IUCV buffer allocation
Yves-Alexis Perez <[email protected]>
firmware: fix usermode helper fallback loading
Vineet Gupta <[email protected]>
ARC: mm: arc700: Don't assume 2 colours for aliasing VIPT dcache
Wei Fang <[email protected]>
scsi: avoid a permanent stop of the scsi device's request queue
Steffen Maier <[email protected]>
scsi: zfcp: fix rport unblock race with LUN recovery
Steffen Maier <[email protected]>
scsi: zfcp: do not trace pure benign residual HBA responses at default level
Benjamin Block <[email protected]>
scsi: zfcp: fix use-after-"free" in FC ingress path after TMF
Kashyap Desai <[email protected]>
scsi: megaraid_sas: Do not set MPI2_TYPE_CUDA for JBOD FP path for FW which does not support JBOD sequence map
Kashyap Desai <[email protected]>
scsi: megaraid_sas: For SRIOV enabled firmware, ensure VF driver waits for 30secs before reset
Maciej S. Szmigiero <[email protected]>
vt: fix Scroll Lock LED trigger name
Rabin Vincent <[email protected]>
block: protect iterate_bdevs() against concurrent close
Alexander Usyskin <[email protected]>
mei: request async autosuspend at the end of enumeration
Russell Currey <[email protected]>
drivers/gpu/drm/ast: Fix infinite loop if read fails
Patrik Jakobsson <[email protected]>
drm/gma500: Add compat ioctl
Alex Deucher <[email protected]>
drm/radeon: add additional pci revision to dpm workaround
Michel Dänzer <[email protected]>
drm/radeon: Hide the HW cursor while it's out of bounds
Michel Dänzer <[email protected]>
drm/radeon: Also call cursor_move_locked when the cursor size changes
Ben Skeggs <[email protected]>
drm/nouveau/i2c/gk110b,gm10x: use the correct implementation
Ben Skeggs <[email protected]>
drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutex
Ben Skeggs <[email protected]>
drm/nouveau/ltc: protect clearing of comptags with mutex
Ben Skeggs <[email protected]>
drm/nouveau/bios: require checksum to match for fast acpi shadow method
Ben Skeggs <[email protected]>
drm/nouveau/kms: lvds panel strap moved again on maxwell
Hans de Goede <[email protected]>
ACPI / video: Add force_native quirk for HP Pavilion dv6
Hans de Goede <[email protected]>
ACPI / video: Add force_native quirk for Dell XPS 17 L702X
Ian Abbott <[email protected]>
staging: comedi: ni_mio_common: fix E series ni_ai_insn_read() data
Ian Abbott <[email protected]>
staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
Krzysztof Kozlowski <[email protected]>
thermal: hwmon: Properly report critical temperature in sysfs
Boris Brezillon <[email protected]>
clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk
Thomas Gleixner <[email protected]>
timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion
Linus Walleij <[email protected]>
regulator: stw481x-vmmc: fix ages old enable error
Adrian Hunter <[email protected]>
mmc: sdhci: Fix recovery from tuning timeout
Vittorio Gambaletta (VittGam) <[email protected]>
ath9k: Really fix LED polarity for some Mini PCI AR9220 MB92 cards.
Johannes Berg <[email protected]>
cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts
Larry Finger <[email protected]>
rtlwifi: Fix enter/exit power_save
Larry Finger <[email protected]>
ssb: Fix error routine when fallback SPROM fails
-------------
Diffstat:
Documentation/virtual/kvm/api.txt | 1 + Makefile | 4 +- arch/arc/include/asm/cacheflush.h | 6 +- arch/arc/mm/cache.c | 13 ++-- arch/powerpc/boot/ps3-head.S | 5 -- arch/powerpc/boot/ps3.c | 8 +-- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kernel/idle_power7.S | 2 +- arch/powerpc/kvm/book3s_hv.c | 6 ++ arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 + arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++ arch/x86/entry/entry_32.S | 4 +- arch/x86/kvm/vmx.c | 11 ++-- block/bsg.c | 3 + drivers/acpi/video_detect.c | 20 +++++++ drivers/base/firmware_class.c | 7 ++- drivers/clk/bcm/clk-bcm2835.c | 4 +- drivers/gpu/drm/ast/ast_main.c | 7 ++- drivers/gpu/drm/gma500/psb_drv.c | 3 + drivers/gpu/drm/nouveau/nouveau_bios.c | 3 + drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 4 +- .../gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c | 9 ++- .../gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c | 8 ++- drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h | 1 + drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 7 ++- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c | 1 + drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c | 2 + drivers/gpu/drm/radeon/radeon_cursor.c | 69 +++++++++++++++------- drivers/gpu/drm/radeon/radeon_mode.h | 1 + drivers/gpu/drm/radeon/si_dpm.c | 1 + drivers/infiniband/core/mad.c | 2 +- drivers/infiniband/core/multicast.c | 7 ++- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 7 ++- drivers/input/misc/drv260x.c | 1 - drivers/md/raid5.c | 9 +++ drivers/media/pci/solo6x10/solo6x10.h | 3 + drivers/misc/mei/client.c | 2 +- drivers/mmc/host/sdhci.c | 20 +++++++ drivers/net/ethernet/marvell/mvpp2.c | 59 +++++++++--------- drivers/net/wireless/ath/ath9k/pci.c | 7 ++- 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 ++++++++--- drivers/pci/pci.c | 4 ++ drivers/platform/x86/asus-nb-wmi.c | 9 +++ drivers/regulator/stw481x-vmmc.c | 3 +- drivers/s390/char/vmlogrdr.c | 2 +- drivers/s390/scsi/zfcp_dbf.c | 17 +++++- drivers/s390/scsi/zfcp_dbf.h | 41 ++++++++++++- drivers/s390/scsi/zfcp_erp.c | 61 ++++++++++++++++++- drivers/s390/scsi/zfcp_ext.h | 4 +- drivers/s390/scsi/zfcp_fsf.h | 3 +- drivers/s390/scsi/zfcp_reqlist.h | 30 +++++++++- drivers/s390/scsi/zfcp_scsi.c | 61 +++++++++++++++++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +-- drivers/scsi/scsi_sysfs.c | 4 -- drivers/scsi/sg.c | 3 + drivers/ssb/pci.c | 1 + drivers/staging/comedi/drivers/ni_mio_common.c | 8 +-- drivers/target/target_core_user.c | 2 - drivers/thermal/thermal_hwmon.c | 2 +- drivers/tty/serial/sc16is7xx.c | 2 +- drivers/tty/vt/keyboard.c | 2 +- fs/block_dev.c | 7 ++- fs/nfs/file.c | 2 +- include/net/cfg80211.h | 11 ++++ include/rdma/ib_addr.h | 6 +- kernel/time/timekeeping.c | 4 +- kernel/trace/trace_functions_graph.c | 17 +++++- net/ceph/messenger.c | 13 ++++ net/mac80211/mlme.c | 21 ++++--- net/wireless/core.h | 1 + net/wireless/mlme.c | 12 ++++ net/wireless/sme.c | 14 +++++ scripts/kconfig/nconf.gui.c | 15 +++-- 78 files changed, 606 insertions(+), 188 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/58 ssb: Fix error routine when fallback SPROM fails
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 8052d7245b6089992343c80b38b14dbbd8354651 upstream.
When there is a CRC error in the SPROM read from the device, the code attempts to handle a fallback SPROM. When this also fails, the driver returns zero rather than an error code.
--- drivers/ssb/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/ssb/pci.c +1 -0
@@ -909,6 +909,7 @@ static int ssb_pci_sprom_get(struct ssb_if (err) {ssb_warn ("WARNING: Using fallback SPROM failed (err %d)\n" , err); + goto out_free; }else {ssb_dbg ("Using SPROM revision %d provided by platform\n" , sprom->revision);
Greg Kroah-Hartman
maintainerPATCH 2/58 rtlwifi: Fix enter/exit power_save
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
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.
--- 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(-)
drivers/net/wireless/realtek/rtlwifi/base.c +4 -4
@@ -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; }
drivers/net/wireless/realtek/rtlwifi/core.c +3 -6
@@ -1153,10 +1153,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 ;
@@ -1432,8 +1430,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);
drivers/net/wireless/realtek/rtlwifi/pci.c +5 -9
@@ -664,11 +664,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,
@@ -919,10 +917,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) {
drivers/net/wireless/realtek/rtlwifi/ps.c +28 -8
@@ -414,8 +414,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));
@@ -455,10 +455,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));
@@ -488,7 +487,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)
@@ -681,12 +679,34 @@ void rtl_lps_change_work_callback(structstruct 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,
Greg Kroah-Hartman
maintainerPATCH 3/58 cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit e6f462df9acd2a3295e5d34eb29e2823220cf129 upstream.
When mac80211 abandons an association attempt, it may free all the data structures, but inform cfg80211 and userspace about it only by sending the deauth frame it received, in which case cfg80211 has no link to the BSS struct that was used and will not cfg80211_unhold_bss() it.
Fix this by providing a way to inform cfg80211 of this with the BSS entry passed, so that it can clean up properly, and use this ability in the appropriate places in mac80211.
This isn't ideal: some code is more or less duplicated and tracing is missing. However, it's a fairly small change and it's thus easier to backport - cleanups can come later.
--- include/net/cfg80211.h | 11 +++++++++++ net/mac80211/mlme.c | 21 ++++++++++++--------- net/wireless/core.h | 1 + net/wireless/mlme.c | 12 ++++++++++++ net/wireless/sme.c | 14 ++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-)
include/net/cfg80211.h +11 -0
@@ -4258,6 +4258,17 @@ void cfg80211_rx_assoc_resp(struct net_dvoid cfg80211_assoc_timeout (struct net_device *dev,struct cfg80211_bss *bss);/** +* cfg80211_abandon_assoc - notify cfg80211 of abandoned association attempt +* @dev: network device +* @bss: The BSS entry with which association was abandoned. +* +* Call this whenever - for reasons reported through other API, like deauth RX, +* an association attempt was abandoned. +* This function may sleep. The caller must hold the corresponding wdev's mutex. +*/ +void cfg80211_abandon_assoc (struct net_device *dev,struct cfg80211_bss *bss); + +/** * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame * @dev: network device * @buf: 802.11 frame (header + body)
net/mac80211/mlme.c +12 -9
@@ -2517,7 +2517,7 @@ static void ieee80211_destroy_auth_data( }static void ieee80211_destroy_assoc_data (struct ieee80211_sub_if_data *sdata, -bool assoc) +bool assoc,bool abandon) {struct ieee80211_mgd_assoc_data *assoc_data = sdata->u.mgd.assoc_data;
@@ -2539,6 +2539,9 @@ static void ieee80211_destroy_assoc_datamutex_lock (&sdata->local->mtx);ieee80211_vif_release_channel (sdata);mutex_unlock (&sdata->local->mtx); + +if (abandon) +cfg80211_abandon_assoc (sdata->dev, assoc_data->bss); }kfree (assoc_data);
@@ -2768,7 +2771,7 @@ static void ieee80211_rx_mgmt_deauth(str bssid, reason_code, ieee80211_get_reason_code_string(reason_code)); -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, true);cfg80211_rx_mlme_mgmt (sdata->dev, (u8 *)mgmt, len);return ;
@@ -3173,14 +3176,14 @@ static void ieee80211_rx_mgmt_assoc_respif (status_code !=WLAN_STATUS_SUCCESS ) {sdata_info (sdata,"%pM denied association (code=%d)\n" , mgmt->sa, status_code); -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, false); event.u.mlme.status =MLME_DENIED ; event.u.mlme.reason = status_code;drv_event_callback (sdata->local, sdata, &event); }else {if (!ieee80211_assoc_success (sdata, bss, mgmt, len)) {/* oops -- internal error -- send timeout for now */ -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, false);cfg80211_assoc_timeout (sdata->dev, bss);return ; }
@@ -3193,7 +3196,7 @@ static void ieee80211_rx_mgmt_assoc_resp* recalc after assoc_data is NULL but before associated * is set can cause the interface to go idle */ -ieee80211_destroy_assoc_data (sdata, true); +ieee80211_destroy_assoc_data (sdata, true, false);/* get uapsd queues configuration */ uapsd_queues =0 ;
@@ -3888,7 +3891,7 @@ void ieee80211_sta_work(struct ieee80211 .u.mlme.status = MLME_TIMEOUT, }; -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, false);cfg80211_assoc_timeout (sdata->dev, bss);drv_event_callback (sdata->local, sdata, &event); }
@@ -4029,7 +4032,7 @@ void ieee80211_mgd_quiesce(struct ieee80WLAN_REASON_DEAUTH_LEAVING , false, frame_buf);if (ifmgd->assoc_data) -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, true);if (ifmgd->auth_data)ieee80211_destroy_auth_data (sdata, false); cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
@@ -4905,7 +4908,7 @@ int ieee80211_mgd_deauth(struct ieee8021IEEE80211_STYPE_DEAUTH , req->reason_code, tx, frame_buf); -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, true);ieee80211_report_disconnect (sdata, frame_buf,sizeof (frame_buf), true, req->reason_code);
@@ -4980,7 +4983,7 @@ void ieee80211_mgd_stop(struct ieee80211sdata_lock (sdata);if (ifmgd->assoc_data) {struct cfg80211_bss *bss = ifmgd->assoc_data->bss; -ieee80211_destroy_assoc_data (sdata, false); +ieee80211_destroy_assoc_data (sdata, false, false);cfg80211_assoc_timeout (sdata->dev, bss); }if (ifmgd->auth_data)
net/wireless/core.h +1 -0
@@ -398,6 +398,7 @@ void cfg80211_sme_disassoc(struct wirelevoid cfg80211_sme_deauth (struct wireless_dev *wdev);void cfg80211_sme_auth_timeout (struct wireless_dev *wdev);void cfg80211_sme_assoc_timeout (struct wireless_dev *wdev); +void cfg80211_sme_abandon_assoc (struct wireless_dev *wdev);/* internal helpers */ bool cfg80211_supported_cipher_suite (struct wiphy *wiphy,u32 cipher);
net/wireless/mlme.c +12 -0
@@ -149,6 +149,18 @@ void cfg80211_assoc_timeout(struct net_d }EXPORT_SYMBOL (cfg80211_assoc_timeout); +void cfg80211_abandon_assoc (struct net_device *dev,struct cfg80211_bss *bss) +{ +struct wireless_dev *wdev = dev->ieee80211_ptr; +struct wiphy *wiphy = wdev->wiphy; + +cfg80211_sme_abandon_assoc (wdev); + +cfg80211_unhold_bss (bss_from_pub (bss)); +cfg80211_put_bss (wiphy, bss); +} +EXPORT_SYMBOL (cfg80211_abandon_assoc); +void cfg80211_tx_mlme_mgmt (struct net_device *dev,const u8 *buf,size_t len) {struct wireless_dev *wdev = dev->ieee80211_ptr;
net/wireless/sme.c +14 -0
@@ -39,6 +39,7 @@ struct cfg80211_conn {CFG80211_CONN_ASSOCIATING ,CFG80211_CONN_ASSOC_FAILED ,CFG80211_CONN_DEAUTH , +CFG80211_CONN_ABANDON ,CFG80211_CONN_CONNECTED , } state;u8 bssid[ETH_ALEN ], prev_bssid[ETH_ALEN ];
@@ -204,6 +205,8 @@ static int cfg80211_conn_do_work(structcfg80211_mlme_deauth (rdev, wdev->netdev, params->bssid,NULL ,0 ,WLAN_REASON_DEAUTH_LEAVING , false); +/* fall through */ +case CFG80211_CONN_ABANDON :/* free directly, disconnected event already sent */ cfg80211_sme_free (wdev);return 0 ;
@@ -423,6 +426,17 @@ void cfg80211_sme_assoc_timeout(struct wschedule_work (&rdev->conn_work); } +void cfg80211_sme_abandon_assoc (struct wireless_dev *wdev) +{ +struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy); + +if (!wdev->conn) +return ; + + wdev->conn->state =CFG80211_CONN_ABANDON ; +schedule_work (&rdev->conn_work); +} +static int cfg80211_sme_get_conn_ies (struct wireless_dev *wdev,const u8 *ies,size_t ies_len,const u8 **out_ies,size_t *out_ies_len)
Greg Kroah-Hartman
maintainerPATCH 4/58 ath9k: Really fix LED polarity for some Mini PCI AR9220 MB92 cards.
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vittorio Gambaletta (VittGam) <[email protected]>
commit 79e57dd113d307a6c74773b8aaecf5442068988a upstream.
The active_high LED of my Wistron DNMA-92 is still being recognized as active_low on 4.7.6 mainline. When I was preparing my former commit 0f9edcdd88a9 ("ath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards.") to fix that I must have somehow messed up with testing, because I tested the final version of that patch before sending it, and it was apparently working; but now it is not working on 4.7.6 mainline.
I initially added the PCI_DEVICE_SUB section for 0x0029/0x2096 above the PCI_VDEVICE section for 0x0029; but then I moved the former below the latter after seeing how 0x002A sections were sorted in the file.
This turned out to be wrong: if a generic PCI_VDEVICE entry (that has both subvendor and subdevice IDs set to PCI_ANY_ID) is put before a more specific one (PCI_DEVICE_SUB), then the generic PCI_VDEVICE entry will match first and will be used.
With this patch, 0x0029/0x2096 has finally got active_high LED on 4.7.6.
While I'm at it, let's fix 0x002A too by also moving its generic definition below its specific ones.
--- drivers/net/wireless/ath/ath9k/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/pci.c +5 -2
@@ -27,7 +27,6 @@ static const struct pci_device_id ath_pc { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ - { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ #ifdef CONFIG_ATH9K_PCOEM/* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */
@@ -38,7 +37,7 @@ static const struct pci_device_id ath_pc .driver_data = ATH9K_PCI_LED_ACT_HI },#endif - { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ + { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ #ifdef CONFIG_ATH9K_PCOEM { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
@@ -86,7 +85,11 @@ static const struct pci_device_id ath_pc 0x10CF, /* Fujitsu */ 0x1536), .driver_data = ATH9K_PCI_D3_L1_WAR }, +#endif + { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ + +#ifdef CONFIG_ATH9K_PCOEM /* AR9285 card for Asus */ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 0x002B,
Greg Kroah-Hartman
maintainerPATCH 5/58 mmc: sdhci: Fix recovery from tuning timeout
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
commit 61e53bd0047d58caee0c7170613045bf96de4458 upstream.
Clearing the tuning bits should reset the tuning circuit. However there is more to do. Reset the command and data lines for good measure, and then for eMMC ensure the card is not still trying to process a tuning command by sending a stop command.
Note the JEDEC eMMC specification says the stop command (CMD12) can be used to stop a tuning command (CMD21) whereas the SD specification is silent on the subject with respect to the SD tuning command (CMD19). Considering that CMD12 is not a valid SDIO command, the stop command is sent only when the tuning command is CMD21 i.e. for eMMC. That addresses cases seen so far which have been on eMMC.
Note that this replaces the commit fe5fb2e3b58f ("mmc: sdhci: Reset cmd and data circuits after tuning failure") which is being reverted for v4.9+.
--- drivers/mmc/host/sdhci.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/mmc/host/sdhci.c +20 -0
@@ -2040,7 +2040,27 @@ static int sdhci_execute_tuning(struct m ctrl &= ~SDHCI_CTRL_EXEC_TUNING ;sdhci_writew (host, ctrl,SDHCI_HOST_CONTROL2 ); +sdhci_do_reset (host,SDHCI_RESET_CMD ); +sdhci_do_reset (host,SDHCI_RESET_DATA ); + err = -EIO ; + +if (cmd.opcode !=MMC_SEND_TUNING_BLOCK_HS200 ) + goto out; + +sdhci_writel (host, host->ier,SDHCI_INT_ENABLE ); +sdhci_writel (host, host->ier,SDHCI_SIGNAL_ENABLE ); + +spin_unlock_irqrestore (&host->lock, flags); + +memset (&cmd,0 ,sizeof (cmd)); + cmd.opcode =MMC_STOP_TRANSMISSION ; + cmd.flags =MMC_RSP_SPI_R1B |MMC_RSP_R1B |MMC_CMD_AC ; + cmd.busy_timeout =50 ; +mmc_wait_for_cmd (mmc, &cmd,0 ); + +spin_lock_irqsave (&host->lock, flags); + goto out; }
Greg Kroah-Hartman
maintainerPATCH 6/58 regulator: stw481x-vmmc: fix ages old enable error
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 295070e9aa015abb9b92cccfbb1e43954e938133 upstream.
The regulator has never been properly enabled, it has been dormant all the time. It's strange that MMC was working at all, but it likely worked by the signals going through the levelshifter and reaching the card anyways.
--- drivers/regulator/stw481x-vmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/stw481x-vmmc.c +2 -1
@@ -47,7 +47,8 @@ static struct regulator_desc vmmc_regula .volt_table = stw481x_vmmc_voltages, .enable_time = 200, /* FIXME: look this up */ .enable_reg = STW_CONF1, - .enable_mask = STW_CONF1_PDN_VMMC, + .enable_mask = STW_CONF1_PDN_VMMC | STW_CONF1_MMC_LS_STATUS, + .enable_val = STW_CONF1_PDN_VMMC, .vsel_reg = STW_CONF1, .vsel_mask = STW_CONF1_VMMC_MASK, };
Greg Kroah-Hartman
maintainerPATCH 7/58 timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 9c1645727b8fa90d07256fdfcc45bf831242a3ab upstream.
The clocksource delta to nanoseconds conversion is using signed math, but the delta is unsigned. This makes the conversion space smaller than necessary and in case of a multiplication overflow the conversion can become negative. The conversion is done with scaled math:
s64 nsec_delta = ((s64)clkdelta * clk->mult) >> clk->shift;
Shifting a signed integer right obvioulsy preserves the sign, which has interesting consequences:
- Time jumps backwards
- __iter_div_u64_rem() which is used in one of the calling code pathes will take forever to piecewise calculate the seconds/nanoseconds part.
This has been reported by several people with different scenarios:
David observed that when stopping a VM with a debugger:
"It was essentially the stopped by debugger case. I forget exactly why,
but the guest was being explicitly stopped from outside, it wasn't just scheduling lag. I think it was something in the vicinity of 10 minutes stopped."
When lifting the stop the machine went dead.
The stopped by debugger case is not really interesting, but nevertheless it would be a good thing not to die completely.
But this was also observed on a live system by Liav:
"When the OS is too overloaded, delta will get a high enough value for the
msb of the sum delta * tkr->mult + tkr->xtime_nsec to be set, and so after the shift the nsec variable will gain a value similar to 0xffffffffff000000."
Unfortunately this has been reintroduced recently with commit 6bd58f09e1d8 ("time: Add cycles to nanoseconds translation"). It had been fixed a year ago already in commit 35a4933a8959 ("time: Avoid signed overflow in timekeeping_get_ns()").
Though it's not surprising that the issue has been reintroduced because the function itself and the whole call chain uses s64 for the result and the propagation of it. The change in this recent commit is subtle:
s64 nsec;
- nsec = (d * m + n) >> s: + nsec = d * m + n; + nsec >>= s;
d being type of cycle_t adds another level of obfuscation.
This wouldn't have happened if the previous change to unsigned computation would have made the 'nsec' variable u64 right away and a follow up patch had cleaned up the whole call chain.
There have been patches submitted which basically did a revert of the above patch leaving everything else unchanged as signed. Back to square one. This spawned a admittedly pointless discussion about potential users which rely on the unsigned behaviour until someone pointed out that it had been fixed before. The changelogs of said patches added further confusion as they made finally false claims about the consequences for eventual users which expect signed results.
Despite delta being cycle_t, aka. u64, it's very well possible to hand in a signed negative value and the signed computation will happily return the correct result. But nobody actually sat down and analyzed the code which was added as user after the propably unintended signed conversion.
Though in sensitive code like this it's better to analyze it proper and make sure that nothing relies on this than hunting the subtle wreckage half a year later. After analyzing all call chains it stands that no caller can hand in a negative value (which actually would work due to the s64 cast) and rely on the signed math to do the right thing.
Change the conversion function to unsigned math. The conversion of all call chains is done in a follow up patch.
This solves the starvation issue, which was caused by the negative result, but it does not solve the underlying problem. It merily procrastinates it. When the timekeeper update is deferred long enough that the unsigned multiplication overflows, then time going backwards is observable again.
It does neither solve the issue of clocksources with a small counter width which will wrap around possibly several times and cause random time stamps to be generated. But those are usually not found on systems used for virtualization, so this is likely a non issue.
I took the liberty to claim authorship for this simply because analyzing all callsites and writing the changelog took substantially more time than just making the simple s/s64/u64/ change and ignore the rest.
--- kernel/time/timekeeping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/timekeeping.c +2 -2
@@ -298,10 +298,10 @@ u32 (*arch_gettimeoffset)(void) = defaulstatic inline u32 arch_gettimeoffset (void ) {return 0 ; }#endif -static inline s64 timekeeping_delta_to_ns (struct tk_read_base *tkr, +static inline u64 timekeeping_delta_to_ns (struct tk_read_base *tkr,cycle_t delta) { -s64 nsec; +u64 nsec; nsec = delta * tkr->mult + tkr->xtime_nsec; nsec >>= tkr->shift;
Greg Kroah-Hartman
maintainerPATCH 8/58 clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Brezillon <[email protected]>
commit 68af4fa8f39b542a6cde7ac19518d88e9b3099dc upstream.
bcm2835_pll_divider_off() is resetting the divider field in the A2W reg to zero when disabling the clock.
Make sure we preserve this value by reading the previous a2w_reg value first and ORing the result with A2W_PLL_CHANNEL_DISABLE.
--- drivers/clk/bcm/clk-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/bcm/clk-bcm2835.c +3 -1
@@ -1082,7 +1082,9 @@ static void bcm2835_pll_divider_off(strucprman_write (cprman, data->cm_reg, (cprman_read (cprman, data->cm_reg) & ~data->load_mask) | data->hold_mask); -cprman_write (cprman, data->a2w_reg,A2W_PLL_CHANNEL_DISABLE ); +cprman_write (cprman, data->a2w_reg, +cprman_read (cprman, data->a2w_reg) | +A2W_PLL_CHANNEL_DISABLE );spin_unlock (&cprman->regs_lock); }
Greg Kroah-Hartman
maintainerPATCH 9/58 thermal: hwmon: Properly report critical temperature in sysfs
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit f37fabb8643eaf8e3b613333a72f683770c85eca upstream.
In the critical sysfs entry the thermal hwmon was returning wrong temperature to the user-space. It was reporting the temperature of the first trip point instead of the temperature of critical trip point.
For example:
/sys/class/hwmon/hwmon0/temp1_crit:50000 /sys/class/thermal/thermal_zone0/trip_point_0_temp:50000 /sys/class/thermal/thermal_zone0/trip_point_0_type:active /sys/class/thermal/thermal_zone0/trip_point_3_temp:120000 /sys/class/thermal/thermal_zone0/trip_point_3_type:critical
Since commit e68b16abd91d ("thermal: add hwmon sysfs I/F") the driver have been registering a sysfs entry if get_crit_temp() callback was provided. However when accessed, it was calling get_trip_temp() instead of the get_crit_temp().
--- drivers/thermal/thermal_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_hwmon.c +1 -1
@@ -98,7 +98,7 @@ temp_crit_show(struct device *dev, strucint temperature;int ret; - ret = tz->ops->get_trip_temp (tz,0 , &temperature); + ret = tz->ops->get_crit_temp (tz, &temperature);if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 10/58 staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
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.
--- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/ni_mio_common.c +1 -1
@@ -1929,7 +1929,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 signbits;unsigned int d;
Greg Kroah-Hartman
maintainerPATCH 11/58 staging: comedi: ni_mio_common: fix E series ni_ai_insn_read() data
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 857a661020a2de3a0304edf33ad656abee100891 upstream.
Commit 0557344e2149 ("staging: comedi: ni_mio_common: fix local var for 32-bit read") changed the type of local variable d from unsigned short to unsigned int to fix a bug introduced in
commit 9c340ac934db ("staging: comedi: ni_stc.h: add read/write callbacks to struct ni_private") when reading AI data for NI PCI-6110 and PCI-6111 cards. Unfortunately, other parts of the function rely on the variable being unsigned short when an offset value in local variable signbits is added to d before writing the value to the data array:
d += signbits; data[n] = d;
The signbits variable will be non-zero in bipolar mode, and is used to convert the hardware's 2's complement, 16-bit numbers to Comedi's straight binary sample format (with 0 representing the most negative voltage). This breaks because d is now 32 bits wide instead of 16 bits wide, so after the addition of signbits, data[n] ends up being set to values above 65536 for negative voltages. This affects all supported "E series" cards except PCI-6143 (and PXI-6143). Fix it by ANDing the value written to the data[n] with the mask 0xffff.
--- drivers/staging/comedi/drivers/ni_mio_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/ni_mio_common.c +3 -3
@@ -1972,7 +1972,7 @@ static int ni_ai_insn_read(struct comedireturn -ETIME ; } d += signbits; - data[n] = d; + data[n] = d &0xffff ; } }else if (devpriv->is_6143) {for (n =0 ; n < insn->n; n++) {
@@ -2017,8 +2017,8 @@ static int ni_ai_insn_read(struct comedi data[n] = dl; }else { d =ni_readw (dev,NI_E_AI_FIFO_DATA_REG ); - d += signbits;/* subtle: needs to be short addition */ - data[n] = d; + d += signbits; + data[n] = d &0xffff ; } } }
Greg Kroah-Hartman
maintainerPATCH 12/58 ACPI / video: Add force_native quirk for Dell XPS 17 L702X
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 350fa038c31b056fc509624efb66348ac2c1e3d0 upstream.
The Dell XPS 17 L702X has a non-working acpi_video0 backlight interface and an intel_backlight interface which works fine. Add a force_native quirk for it so that the non-working acpi_video0 interface does not get registered.
Note that there also is an issue with the brightnesskeys on this laptop, they do not generate key-press events in anyway. That is not solved by this patch.
--- drivers/acpi/video_detect.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/acpi/video_detect.c +9 -0
@@ -271,6 +271,15 @@ static const struct dmi_system_id video_ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"), }, }, + { + /* https://bugzilla.redhat.com/show_bug.cgi?id=1123661 */ + .callback = video_detect_force_native, + .ident = "Dell XPS 17 L702X", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), + }, + }, { }, };
Greg Kroah-Hartman
maintainerPATCH 13/58 ACPI / video: Add force_native quirk for HP Pavilion dv6
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 6276e53fa8c06a3a5cf7b95b77b079966de9ad66 upstream.
The HP Pavilion dv6 has a non-working acpi_video0 backlight interface and an intel_backlight interface which works fine. Add a force_native quirk for it so that the non-working acpi_video0 interface does not get registered.
Note that there are quite a few HP Pavilion dv6 variants, some woth ATI and some with NVIDIA hybrid gfx, both seem to need this quirk to have working backlight control. There are also some versions with only Intel integrated gfx, these may not need this quirk, but it should not hurt there.
--- drivers/acpi/video_detect.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/acpi/video_detect.c +11 -0
@@ -280,6 +280,17 @@ static const struct dmi_system_id video_ DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), }, }, + { + /* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */ + /* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */ + .callback = video_detect_force_native, + .ident = "HP Pavilion dv6", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"), + }, + }, + { }, };
Greg Kroah-Hartman
maintainerPATCH 14/58 drm/nouveau/kms: lvds panel strap moved again on maxwell
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit 768e847759d551c96e129e194588dbfb11a1d576 upstream.
--- drivers/gpu/drm/nouveau/nouveau_bios.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nouveau_bios.c +3 -0
@@ -333,6 +333,9 @@ get_fp_strap(struct drm_device *dev, strif (bios->major_version <5 && bios->data[0x48 ] &0x4 )return NVReadVgaCrtc5758 (dev,0 ,0xf ) &0xf ; +if (drm->device.info.family >=NV_DEVICE_INFO_V0_MAXWELL ) +return nvif_rd32 (device,0x001800 ) &0x0000000f ; +else if (drm->device.info.family >=NV_DEVICE_INFO_V0_TESLA )return (nvif_rd32 (device,NV_PEXTDEV_BOOT_0 ) >>24 ) &0xf ;else
Greg Kroah-Hartman
maintainerPATCH 15/58 drm/nouveau/bios: require checksum to match for fast acpi shadow method
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit 5dc7f4aa9d84ea94b54a9bfcef095f0289f1ebda upstream.
--- drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h | 1 + drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 7 +++++-- drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h +1 -0
@@ -12,6 +12,7 @@ struct nvbios_source {bool rw;bool ignore_checksum;bool no_pcir; +bool require_checksum; };int nvbios_extend (struct nvkm_bios *,u32 length);
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +5 -2
@@ -86,9 +86,12 @@ shadow_image(struct nvkm_bios *bios, int nvbios_checksum(&bios->data[image.base], image.size)) {nvkm_debug (subdev,"%08x: checksum failed\n" , image.base); - if (mthd->func->rw) +if (!mthd->func->require_checksum) { +if (mthd->func->rw) + score +=1 ; score +=1 ; - score += 1; + }else +return 0 ; } else { score +=3 ; }
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c +1 -0
@@ -99,6 +99,7 @@ nvbios_acpi_fast = { .init = acpi_init, .read = acpi_read_fast, .rw = false, + .require_checksum = true, }; const struct nvbios_source
Greg Kroah-Hartman
maintainerPATCH 16/58 drm/nouveau/ltc: protect clearing of comptags with mutex
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit f4e65efc88b64c1dbca275d42a188edccedb56c6 upstream.
--- drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c +2 -0
@@ -47,8 +47,10 @@ nvkm_ltc_tags_clear(struct nvkm_ltc *ltcBUG_ON ((first > limit) || (limit >= ltc->num_tags)); +mutex_lock (<c->subdev.mutex); ltc->func->cbc_clear (ltc, first, limit); ltc->func->cbc_wait (ltc); +mutex_unlock (<c->subdev.mutex); }int
Greg Kroah-Hartman
maintainerPATCH 17/58 drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutex
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit b27add13f500469127afdf011dbcc9c649e16e54 upstream.
This avoids an issue that occurs when we're attempting to preempt multiple channels simultaneously. HW seems to ignore preempt requests while it's still processing a previous one, which, well, makes sense.
Fixes random "fifo: SCHED_ERROR 0d []" + GPCCS page faults during parallel piglit runs on (at least) GM107.
--- drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c | 9 ++++++--- drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c +6 -3
@@ -59,6 +59,7 @@ gf100_fifo_gpfifo_engine_fini(struct nvkstruct nvkm_gpuobj *inst = chan->base.inst;int ret =0 ; +mutex_lock (&subdev->mutex);nvkm_wr32 (device,0x002634 , chan->base.chid); if (nvkm_msec(device, 2000, if (nvkm_rd32(device, 0x002634) == chan->base.chid)
@@ -66,10 +67,12 @@ gf100_fifo_gpfifo_engine_fini(struct nvk ) < 0) {nvkm_error (subdev,"channel %d [%s] kick timeout\n" , chan->base.chid, chan->base.object.client->name); - ret = -EBUSY ; -if (suspend) -return ret; + ret = -ETIMEDOUT ; } +mutex_unlock (&subdev->mutex); + +if (ret && suspend) +return ret;if (offset) {nvkm_kmap (inst);
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c +5 -3
@@ -39,7 +39,9 @@ gk104_fifo_gpfifo_kick(struct gk104_fifostruct nvkm_subdev *subdev = &fifo->base.engine.subdev;struct nvkm_device *device = subdev->device;struct nvkm_client *client = chan->base.object.client; +int ret =0 ; +mutex_lock (&subdev->mutex);nvkm_wr32 (device,0x002634 , chan->base.chid); if (nvkm_msec(device, 2000, if (!(nvkm_rd32(device, 0x002634) & 0x00100000))
@@ -47,10 +49,10 @@ gk104_fifo_gpfifo_kick(struct gk104_fifo ) < 0) {nvkm_error (subdev,"channel %d [%s] kick timeout\n" , chan->base.chid, client->name); -return -EBUSY ; + ret = -ETIMEDOUT ; } - -return 0 ; +mutex_unlock (&subdev->mutex); +return ret; } static u32
Greg Kroah-Hartman
maintainerPATCH 18/58 drm/nouveau/i2c/gk110b,gm10x: use the correct implementation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Skeggs <[email protected]>
commit 5b3800a6b763874e4a23702fb9628d3bd3315ce9 upstream.
DPAUX registers moved on Kepler, these chipsets were still using the Fermi implementation for some reason.
This fixes detection of hotplug/sink IRQs on DP connectors.
--- drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +2 -2
@@ -1833,7 +1833,7 @@ nvf1_chipset = { .fb = gk104_fb_new, .fuse = gf100_fuse_new, .gpio = gk104_gpio_new, - .i2c = gf119_i2c_new, + .i2c = gk104_i2c_new, .ibus = gk104_ibus_new, .imem = nv50_instmem_new, .ltc = gk104_ltc_new,
@@ -1941,7 +1941,7 @@ nv117_chipset = { .fb = gm107_fb_new, .fuse = gm107_fuse_new, .gpio = gk104_gpio_new, - .i2c = gf119_i2c_new, + .i2c = gk104_i2c_new, .ibus = gk104_ibus_new, .imem = nv50_instmem_new, .ltc = gm107_ltc_new,
Greg Kroah-Hartman
maintainerPATCH 21/58 drm/radeon: add additional pci revision to dpm workaround
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 8729675c00a8d13cb2094d617d70a4a4da7d83c5 upstream.
New variant.
--- drivers/gpu/drm/radeon/si_dpm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/si_dpm.c +1 -0
@@ -3026,6 +3026,7 @@ static void si_apply_state_adjust_rules( (rdev->pdev->revision == 0x80) || (rdev->pdev->revision == 0x81) || (rdev->pdev->revision == 0x83) || + (rdev->pdev->revision == 0x87) || (rdev->pdev->device == 0x6604) || (rdev->pdev->device == 0x6605)) { max_sclk =75000 ;
Greg Kroah-Hartman
maintainerPATCH 22/58 drm/gma500: Add compat ioctl
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrik Jakobsson <[email protected]>
commit 0a97c81a9717431e6c57ea845b59c3c345edce67 upstream.
Hook up drm_compat_ioctl to support 32-bit userspace on 64-bit kernels. It turns out that N2600 and N2800 comes with 64-bit enabled. We previously assumed there where no such systems out there.
--- drivers/gpu/drm/gma500/psb_drv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/gma500/psb_drv.c +3 -0
@@ -484,6 +484,9 @@ static const struct file_operations psb_ .open = drm_open, .release = drm_release, .unlocked_ioctl = psb_unlocked_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = drm_compat_ioctl, +#endif .mmap = drm_gem_mmap, .poll = drm_poll, .read = drm_read,
Greg Kroah-Hartman
maintainerPATCH 23/58 drivers/gpu/drm/ast: Fix infinite loop if read fails
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell Currey <[email protected]>
commit 298360af3dab45659810fdc51aba0c9f4097e4f6 upstream.
ast_get_dram_info() configures a window in order to access BMC memory. A BMC register can be configured to disallow this, and if so, causes an infinite loop in the ast driver which renders the system unusable.
Fix this by erroring out if an error is detected. On powerpc systems with EEH, this leads to the device being fenced and the system continuing to operate.
--- drivers/gpu/drm/ast/ast_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/ast/ast_main.c +5 -2
@@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_ast_write32 (ast,0x10000 ,0xfc600309 );do { - ; +if (pci_channel_offline (dev->pdev)) +return -EIO ; }while (ast_read32 (ast,0x10000 ) !=0x01 ); data =ast_read32 (ast,0x10004 );
@@ -429,7 +430,9 @@ int ast_driver_load(struct drm_device *dast_detect_chip (dev, &need_post);if (ast->chip !=AST1180 ) { -ast_get_dram_info (dev); + ret =ast_get_dram_info (dev); +if (ret) + goto out_free; ast->vram_size =ast_get_vram_info (dev);DRM_INFO ("dram %d %d %d %08x\n" , ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); }
Greg Kroah-Hartman
maintainerPATCH 24/58 mei: request async autosuspend at the end of enumeration
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Usyskin <[email protected]>
commit d5f8e166c25750adc147b0adf64a62a91653438a upstream.
pm_runtime_autosuspend can take synchronous or asynchronous paths, Because we are calling pm_runtime_mark_last_busy just before this most of the cases it takes the asynchronous way. However, when the FW or driver resets during already running runtime suspend, the call will result in calling to the driver's rpm callback and results in a deadlock on device_lock.
The simplest fix is to replace pm_runtime_autosuspend with asynchronous pm_request_autosuspend.
--- drivers/misc/mei/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/client.c +1 -1
@@ -698,7 +698,7 @@ void mei_host_client_init(struct work_stpm_runtime_mark_last_busy (dev->dev);dev_dbg (dev->dev,"rpm: autosuspend\n" ); -pm_runtime_autosuspend (dev->dev); +pm_request_autosuspend (dev->dev); }/**
Greg Kroah-Hartman
maintainerPATCH 25/58 block: protect iterate_bdevs() against concurrent close
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rabin Vincent <[email protected]>
commit af309226db916e2c6e08d3eba3fa5c34225200c4 upstream.
If a block device is closed while iterate_bdevs() is handling it, the following NULL pointer dereference occurs because bdev->b_disk is NULL in bdev_get_queue(), which is called from blk_get_backing_dev_info() (in turn called by the mapping_cap_writeback_dirty() call in __filemap_fdatawrite_range()):
BUG: unable to handle kernel NULL pointer dereference at 0000000000000508 IP: [<ffffffff81314790>] blk_get_backing_dev_info+0x10/0x20 PGD 9e62067 PUD 9ee8067 PMD 0 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: CPU: 1 PID: 2422 Comm: sync Not tainted 4.5.0-rc7+ #400 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) task: ffff880009f4d700 ti: ffff880009f5c000 task.ti: ffff880009f5c000 RIP: 0010:[<ffffffff81314790>] [<ffffffff81314790>] blk_get_backing_dev_info+0x10/0x20 RSP: 0018:ffff880009f5fe68 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88000ec17a38 RCX: ffffffff81a4e940 RDX: 7fffffffffffffff RSI: 0000000000000000 RDI: ffff88000ec176c0 RBP: ffff880009f5fe68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff88000ec17860 R13: ffffffff811b25c0 R14: ffff88000ec178e0 R15: ffff88000ec17a38 FS: 00007faee505d700(0000) GS:ffff88000fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000508 CR3: 0000000009e8a000 CR4: 00000000000006e0 Stack: ffff880009f5feb8 ffffffff8112e7f5 0000000000000000 7fffffffffffffff 0000000000000000 0000000000000000 7fffffffffffffff 0000000000000001 ffff88000ec178e0 ffff88000ec17860 ffff880009f5fec8 ffffffff8112e81f Call Trace: [<ffffffff8112e7f5>] __filemap_fdatawrite_range+0x85/0x90 [<ffffffff8112e81f>] filemap_fdatawrite+0x1f/0x30 [<ffffffff811b25d6>] fdatawrite_one_bdev+0x16/0x20 [<ffffffff811bc402>] iterate_bdevs+0xf2/0x130 [<ffffffff811b2763>] sys_sync+0x63/0x90 [<ffffffff815d4272>] entry_SYSCALL_64_fastpath+0x12/0x76 Code: 0f 1f 44 00 00 48 8b 87 f0 00 00 00 55 48 89 e5 <48> 8b 80 08 05 00 00 5d RIP [<ffffffff81314790>] blk_get_backing_dev_info+0x10/0x20 RSP <ffff880009f5fe68> CR2: 0000000000000508 ---[ end trace 2487336ceb3de62d ]---
The crash is easily reproducible by running the following command, if an msleep(100) is inserted before the call to func() in iterate_devs():
while :; do head -c1 /dev/nullb0; done > /dev/null & while :; do sync; done
Fix it by holding the bd_mutex across the func() call and only calling func() if the bdev is opened.
--- fs/block_dev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/block_dev.c +6 -1
@@ -1806,6 +1806,7 @@ void iterate_bdevs(void (*func)(struct bspin_lock (&blockdev_superblock->s_inode_list_lock);list_for_each_entry (inode, &blockdev_superblock->s_inodes, i_sb_list) {struct address_space *mapping = inode->i_mapping; +struct block_device *bdev;spin_lock (&inode->i_lock); if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW) ||
@@ -1826,8 +1827,12 @@ void iterate_bdevs(void (*func)(struct b*/ iput (old_inode); old_inode = inode; + bdev =I_BDEV (inode); -func (I_BDEV (inode), arg); +mutex_lock (&bdev->bd_mutex); +if (bdev->bd_openers) +func (bdev, arg); +mutex_unlock (&bdev->bd_mutex);spin_lock (&blockdev_superblock->s_inode_list_lock); }
Greg Kroah-Hartman
maintainerPATCH 26/58 vt: fix Scroll Lock LED trigger name
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej S. Szmigiero <[email protected]>
commit 31b5929d533f5183972cf57a7844b456ed996f3c upstream.
There is a disagreement between drivers/tty/vt/keyboard.c and drivers/input/input-leds.c with regard to what is a Scroll Lock LED trigger name: input calls it "kbd-scrolllock", but vt calls it "kbd-scrollock" (two l's).
This prevents Scroll Lock LED trigger from binding to this LED by default.
Since it is a scroLL Lock LED, this interface was introduced only about a year ago and in an Internet search people seem to reference this trigger only to set it to this LED let's simply rename it to "kbd-scrolllock".
Also, it looks like this was supposed to be changed before this code was
merged: https://lkml.org/lkml/2015/6/9/697 but it was done only on the input side.
--- drivers/tty/vt/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/vt/keyboard.c +1 -1
@@ -982,7 +982,7 @@ static void kbd_led_trigger_activate(str KBD_LED_TRIGGER((_led_bit) + 8, _name)static struct kbd_led_trigger kbd_led_triggers[] = { -KBD_LED_TRIGGER (VC_SCROLLOCK ,"kbd-scrollock" ), +KBD_LED_TRIGGER (VC_SCROLLOCK ,"kbd-scrolllock" ),KBD_LED_TRIGGER (VC_NUMLOCK ,"kbd-numlock" ),KBD_LED_TRIGGER (VC_CAPSLOCK ,"kbd-capslock" ),KBD_LED_TRIGGER (VC_KANALOCK ,"kbd-kanalock" ),
Greg Kroah-Hartman
maintainerPATCH 27/58 scsi: megaraid_sas: For SRIOV enabled firmware, ensure VF driver waits for 30secs before reset
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap Desai <[email protected]>
commit 18e1c7f68a5814442abad849abe6eacbf02ffd7c upstream.
For SRIOV enabled firmware, if there is a OCR(online controller reset) possibility driver set the convert flag to 1, which is not happening if there are outstanding commands even after 180 seconds. As driver does not set convert flag to 1 and still making the OCR to run, VF(Virtual function) driver is directly writing on to the register instead of waiting for 30 seconds. Setting convert flag to 1 will cause VF driver will wait for 30 secs before going for reset.
--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -0
@@ -2648,6 +2648,7 @@ int megasas_wait_for_outstanding_fusion(dev_err (&instance->pdev->dev,"pending commands remain after waiting, " "will reset adapter scsi%d.\n" , instance->host->host_no); + *convert =1 ; retval =1 ; } out:
Greg Kroah-Hartman
maintainerPATCH 28/58 scsi: megaraid_sas: Do not set MPI2_TYPE_CUDA for JBOD FP path for FW which does not support JBOD sequence map
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap Desai <[email protected]>
commit d5573584429254a14708cf8375c47092b5edaf2c upstream.
--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +4 -4
@@ -1856,6 +1856,8 @@ megasas_build_syspd_fusion(struct megasa io_request->DevHandle = pd_sync->seq[pd_index].devHandle; pRAID_Context->regLockFlags |= (MR_RL_FLAGS_SEQ_NUM_ENABLE |MR_RL_FLAGS_GRANT_DESTINATION_CUDA ); + pRAID_Context->Type =MPI2_TYPE_CUDA ; + pRAID_Context->nseg =0x1 ; }else if (fusion->fast_path_io) { pRAID_Context->VirtualDiskTgtId =cpu_to_le16 (device_id); pRAID_Context->configSeqNum =0 ;
@@ -1891,12 +1893,10 @@ megasas_build_syspd_fusion(struct megasa pRAID_Context->timeoutValue =cpu_to_le16 ((os_timeout_value > timeout_limit) ? timeout_limit : os_timeout_value); -if (fusion->adapter_type ==INVADER_SERIES ) { - pRAID_Context->Type =MPI2_TYPE_CUDA ; - pRAID_Context->nseg =0x1 ; +if (fusion->adapter_type ==INVADER_SERIES ) io_request->IoFlags |=cpu_to_le16 (MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH ); - } + cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT );
Greg Kroah-Hartman
maintainerPATCH 29/58 scsi: zfcp: fix use-after-"free" in FC ingress path after TMF
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Block <[email protected]>
commit dac37e15b7d511e026a9313c8c46794c144103cd upstream.
When SCSI EH invokes zFCP's callbacks for eh_device_reset_handler() and eh_target_reset_handler(), it expects us to relent the ownership over the given scsi_cmnd and all other scsi_cmnds within the same scope - LUN or target - when returning with SUCCESS from the callback ('release' them). SCSI EH can then reuse those commands.
We did not follow this rule to release commands upon SUCCESS; and if later a reply arrived for one of those supposed to be released commands, we would still make use of the scsi_cmnd in our ingress tasklet. This will at least result in undefined behavior or a kernel panic because of a wrong kernel pointer dereference.
To fix this, we NULLify all pointers to scsi_cmnds (struct zfcp_fsf_req *)->data in the matching scope if a TMF was successful. This is done under the locks (struct zfcp_adapter *)->abort_lock and (struct zfcp_reqlist *)->lock to prevent the requests from being removed from the request-hashtable, and the ingress tasklet from making use of the scsi_cmnd-pointer in zfcp_fsf_fcp_cmnd_handler().
For cases where a reply arrives during SCSI EH, but before we get a chance to NULLify the pointer - but before we return from the callback -, we assume that the code is protected from races via the CAS operation in blk_complete_request() that is called in scsi_done().
The following stacktrace shows an example for a crash resulting from the previous behavior:
Unable to handle kernel pointer dereference at virtual kernel address fffffee17a672000
Oops: 0038 [#1] SMP
CPU: 2 PID: 0 Comm: swapper/2 Not tainted
task: 00000003f7ff5be0 ti: 00000003f3d38000 task.ti: 00000003f3d38000
Krnl PSW : 0404d00180000000 00000000001156b0 (smp_vcpu_scheduled+0x18/0x40)
R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
Krnl GPRS: 000000200000007e 0000000000000000 fffffee17a671fd8 0000000300000015
ffffffff80000000 00000000005dfde8 07000003f7f80e00 000000004fa4e800
000000036ce8d8f8 000000036ce8d9c0 00000003ece8fe00 ffffffff969c9e93
00000003fffffffd 000000036ce8da10 00000000003bf134 00000003f3b07918
Krnl Code: 00000000001156a2: a7190000 lghi %r1,0
00000000001156a6: a7380015 lhi %r3,21
#00000000001156aa: e32050000008 ag %r2,0(%r5)
>00000000001156b0: 482022b0 lh %r2,688(%r2)
00000000001156b4: ae123000 sigp %r1,%r2,0(%r3)
00000000001156b8: b2220020 ipm %r2
00000000001156bc: 8820001c srl %r2,28
00000000001156c0: c02700000001 xilf %r2,1
Call Trace:
([<0000000000000000>] 0x0)
[<000003ff807bdb8e>] zfcp_fsf_fcp_cmnd_handler+0x3de/0x490 [zfcp]
[<000003ff807be30a>] zfcp_fsf_req_complete+0x252/0x800 [zfcp]
[<000003ff807c0a48>] zfcp_fsf_reqid_check+0xe8/0x190 [zfcp]
[<000003ff807c194e>] zfcp_qdio_int_resp+0x66/0x188 [zfcp]
[<000003ff80440c64>] qdio_kick_handler+0xdc/0x310 [qdio]
[<000003ff804463d0>] __tiqdio_inbound_processing+0xf8/0xcd8 [qdio]
[<0000000000141fd4>] tasklet_action+0x9c/0x170
[<0000000000141550>] __do_softirq+0xe8/0x258
[<000000000010ce0a>] do_softirq+0xba/0xc0
[<000000000014187c>] irq_exit+0xc4/0xe8
[<000000000046b526>] do_IRQ+0x146/0x1d8
[<00000000005d6a3c>] io_return+0x0/0x8
[<00000000005d6422>] vtime_stop_cpu+0x4a/0xa0
([<0000000000000000>] 0x0)
[<0000000000103d8a>] arch_cpu_idle+0xa2/0xb0
[<0000000000197f94>] cpu_startup_entry+0x13c/0x1f8
[<0000000000114782>] smp_start_secondary+0xda/0xe8
[<00000000005d6efe>] restart_int_handler+0x56/0x6c
[<0000000000000000>] 0x0Last Breaking-Event-Address:
[<00000000003bf12e>] arch_spin_lock_wait+0x56/0xb0
--- drivers/s390/scsi/zfcp_dbf.h | 11 +++++++ drivers/s390/scsi/zfcp_reqlist.h | 30 +++++++++++++++++++- drivers/s390/scsi/zfcp_scsi.c | 57 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 95 insertions(+), 3 deletions(-)
drivers/s390/scsi/zfcp_dbf.h +11 -0
@@ -388,4 +388,15 @@ void zfcp_dbf_scsi_devreset(char *tag, s _zfcp_dbf_scsi(tmp_tag, 1, scmnd, NULL); } +/** +* zfcp_dbf_scsi_nullcmnd() - trace NULLify of SCSI command in dev/tgt-reset. +* @scmnd: SCSI command that was NULLified. +* @fsf_req: request that owned @scmnd. +*/ +static inline void zfcp_dbf_scsi_nullcmnd (struct scsi_cmnd *scmnd, +struct zfcp_fsf_req *fsf_req) +{ +_zfcp_dbf_scsi ("scfc__1" ,3 , scmnd, fsf_req); +} +#endif /* ZFCP_DBF_H */
drivers/s390/scsi/zfcp_reqlist.h +29 -1
@@ -4,7 +4,7 @@* Data structure and helper functions for tracking pending FSF * requests. * -* Copyright IBM Corp. 2009 +* Copyright IBM Corp. 2009, 2016 */ #ifndef ZFCP_REQLIST_H
@@ -180,4 +180,32 @@ static inline void zfcp_reqlist_move(str spin_unlock_irqrestore(&rl->lock, flags); } +/** +* zfcp_reqlist_apply_for_all() - apply a function to every request. +* @rl: the requestlist that contains the target requests. +* @f: the function to apply to each request; the first parameter of the +* function will be the target-request; the second parameter is the same +* pointer as given with the argument @data. +* @data: freely chosen argument; passed through to @f as second parameter. +* +* Uses :c:macro:`list_for_each_entry` to iterate over the lists in the hash- +* table (not a 'safe' variant, so don't modify the list). +* +* Holds @rl->lock over the entire request-iteration. +*/ +static inline void +zfcp_reqlist_apply_for_all (struct zfcp_reqlist *rl, +void (*f)(struct zfcp_fsf_req *,void *),void *data) +{ +struct zfcp_fsf_req *req; +unsigned long flags; +unsigned int i; + +spin_lock_irqsave (&rl->lock, flags); +for (i =0 ; i <ZFCP_REQ_LIST_BUCKETS ; i++) +list_for_each_entry (req, &rl->buckets[i], list) +f (req, data); +spin_unlock_irqrestore (&rl->lock, flags); +} +#endif /* ZFCP_REQLIST_H */
drivers/s390/scsi/zfcp_scsi.c +55 -2
76 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 30/58 scsi: zfcp: do not trace pure benign residual HBA responses at default level
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Maier <[email protected]>
commit 56d23ed7adf3974f10e91b643bd230e9c65b5f79 upstream.
Since quite a while, Linux issues enough SCSI commands per scsi_device which successfully return with FCP_RESID_UNDER, FSF_FCP_RSP_AVAILABLE, and SAM_STAT_GOOD. This floods the HBA trace area and we cannot see other and important HBA trace records long enough.
Therefore, do not trace HBA response errors for pure benign residual under counts at the default trace level.
This excludes benign residual under count combined with other validity bits set in FCP_RSP_IU, such as FCP_SNS_LEN_VAL. For all those other cases, we still do want to see both the HBA record and the corresponding SCSI record by default.
--- drivers/s390/scsi/zfcp_dbf.h | 30 ++++++++++++++++++++++++++++-- drivers/s390/scsi/zfcp_fsf.h | 3 ++- 2 files changed, 30 insertions(+), 3 deletions(-)
drivers/s390/scsi/zfcp_dbf.h +28 -2
@@ -2,7 +2,7 @@* zfcp device driver * debug feature declarations * -* Copyright IBM Corp. 2008, 2015 +* Copyright IBM Corp. 2008, 2016 */ #ifndef ZFCP_DBF_H
@@ -283,6 +283,30 @@ struct zfcp_dbf {struct zfcp_dbf_scsi scsi_buf; }; +/** +* zfcp_dbf_hba_fsf_resp_suppress - true if we should not trace by default +* @req: request that has been completed +* +* Returns true if FCP response with only benign residual under count. +*/ +static inline +bool zfcp_dbf_hba_fsf_resp_suppress (struct zfcp_fsf_req *req) +{ +struct fsf_qtcb *qtcb = req->qtcb; +u32 fsf_stat = qtcb->header.fsf_status; +struct fcp_resp *fcp_rsp; +u8 rsp_flags, fr_status; + +if (qtcb->prefix.qtcb_type !=FSF_IO_COMMAND ) +return false;/* not an FCP response */ + fcp_rsp = (struct fcp_resp *)&qtcb->bottom.io.fcp_rsp; + rsp_flags = fcp_rsp->fr_flags; + fr_status = fcp_rsp->fr_status; +return (fsf_stat ==FSF_FCP_RSP_AVAILABLE ) && + (rsp_flags ==FCP_RESID_UNDER ) && + (fr_status ==SAM_STAT_GOOD ); +} +static inline void zfcp_dbf_hba_fsf_resp (char *tag,int level,struct zfcp_fsf_req *req) {
@@ -304,7 +328,9 @@ void zfcp_dbf_hba_fsf_response(struct zfzfcp_dbf_hba_fsf_resp ("fs_perr" ,1 , req); }else if (qtcb->header.fsf_status !=FSF_GOOD ) { -zfcp_dbf_hba_fsf_resp ("fs_ferr" ,1 , req); +zfcp_dbf_hba_fsf_resp ("fs_ferr" , +zfcp_dbf_hba_fsf_resp_suppress (req) + ?5 :1 , req); }else if ((req->fsf_command ==FSF_QTCB_OPEN_PORT_WITH_DID ) || (req->fsf_command ==FSF_QTCB_OPEN_LUN )) {
drivers/s390/scsi/zfcp_fsf.h +2 -1
@@ -3,7 +3,7 @@* * Interface to the FSF support functions. * -* Copyright IBM Corp. 2002, 2015 +* Copyright IBM Corp. 2002, 2016 */ #ifndef FSF_H
@@ -78,6 +78,7 @@#define FSF_APP_TAG_CHECK_FAILURE 0x00000082#define FSF_REF_TAG_CHECK_FAILURE 0x00000083#define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD +#define FSF_FCP_RSP_AVAILABLE 0x000000AF#define FSF_UNKNOWN_COMMAND 0x000000E2#define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3#define FSF_INVALID_COMMAND_OPTION 0x000000E5
Greg Kroah-Hartman
maintainerPATCH 31/58 scsi: zfcp: fix rport unblock race with LUN recovery
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Maier <[email protected]>
commit 6f2ce1c6af37191640ee3ff6e8fc39ea10352f4c upstream.
It is unavoidable that zfcp_scsi_queuecommand() has to finish requests with DID_IMM_RETRY (like fc_remote_port_chkready()) during the time window when zfcp detected an unavailable rport but fc_remote_port_delete(), which is asynchronous via zfcp_scsi_schedule_rport_block(), has not yet blocked the rport.
However, for the case when the rport becomes available again, we should prevent unblocking the rport too early. In contrast to other FCP LLDDs, zfcp has to open each LUN with the FCP channel hardware before it can send I/O to a LUN. So if a port already has LUNs attached and we unblock the rport just after port recovery, recoveries of LUNs behind this port can still be pending which in turn force zfcp_scsi_queuecommand() to unnecessarily finish requests with DID_IMM_RETRY.
This also opens a time window with unblocked rport (until the followup LUN reopen recovery has finished). If a scsi_cmnd timeout occurs during this time window fc_timed_out() cannot work as desired and such command would indeed time out and trigger scsi_eh. This prevents a clean and timely path failover. This should not happen if the path issue can be recovered on FC transport layer such as path issues involving RSCNs.
Fix this by only calling zfcp_scsi_schedule_rport_register(), to asynchronously trigger fc_remote_port_add(), after all LUN recoveries as children of the rport have finished and no new recoveries of equal or higher order were triggered meanwhile. Finished intentionally includes any recovery result no matter if successful or failed (still unblock rport so other successful LUNs work). For simplicity, we check after each finished LUN recovery if there is another LUN recovery pending on the same port and then do nothing. We handle the special case of a successful recovery of a port without LUN children the same way without changing this case's semantics.
For debugging we introduce 2 new trace records written if the rport unblock attempt was aborted due to still unfinished or freshly triggered recovery. The records are only written above the default trace level.
Benjamin noticed the important special case of new recovery that can be triggered between having given up the erp_lock and before calling zfcp_erp_action_cleanup() within zfcp_erp_strategy(). We must avoid the following sequence:
ERP thread rport_work other context ------------------------- -------------- --------------------------------
port is unblocked, rport still blocked,
due to pending/running ERP action,
so ((port->status & ...UNBLOCK) != 0)
and (port->rport == NULL)
unlock ERPzfcp_erp_action_cleanup()
case ZFCP_ERP_ACTION_REOPEN_LUN:zfcp_erp_try_rport_unblock()
((status & ...UNBLOCK) != 0) [OLD!]
zfcp_erp_port_reopen()
lock ERP
zfcp_erp_port_block()
port->status clear ...UNBLOCK
unlock ERP
zfcp_scsi_schedule_rport_block()
port->rport_task = RPORT_DEL
queue_work(rport_work)
zfcp_scsi_rport_work()
(port->rport_task != RPORT_ADD)
port->rport_task = RPORT_NONE
zfcp_scsi_rport_block()
if (!port->rport) return
zfcp_scsi_schedule_rport_register()
port->rport_task = RPORT_ADD
queue_work(rport_work)
zfcp_scsi_rport_work()
(port->rport_task == RPORT_ADD)
port->rport_task = RPORT_NONE
zfcp_scsi_rport_register()
(port->rport == NULL)
rport = fc_remote_port_add()
port->rport = rport;Now the rport was erroneously unblocked while the zfcp_port is blocked. This is another situation we want to avoid due to scsi_eh potential. This state would at least remain until the new recovery from the other context finished successfully, or potentially forever if it failed. In order to close this race, we take the erp_lock inside zfcp_erp_try_rport_unblock() when checking the status of zfcp_port or LUN. With that, the possible corresponding rport state sequences would
be: (unblock[ERP thread],block[other context]) if the ERP thread gets erp_lock first and still sees ((port->status & ...UNBLOCK) != 0), (block[other context],NOP[ERP thread]) if the ERP thread gets erp_lock after the other context has already cleard ...UNBLOCK from port->status.
Since checking fields of struct erp_action is unsafe because they could have been overwritten (re-used for new recovery) meanwhile, we only check status of zfcp_port and LUN since these are only changed under erp_lock elsewhere. Regarding the check of the proper status flags (port or port_forced are similar to the shown adapter recovery):
[zfcp_erp_adapter_shutdown()] zfcp_erp_adapter_reopen()
zfcp_erp_adapter_block()
* clear UNBLOCK ---------------------------------------+
zfcp_scsi_schedule_rports_block() |
write_lock_irqsave(&adapter->erp_lock, flags);-------+ |
zfcp_erp_action_enqueue() | |
zfcp_erp_setup_act() | |
* set ERP_INUSE -----------------------------------|--|--+
write_unlock_irqrestore(&adapter->erp_lock, flags);--+ | |
.context-switch. | |
zfcp_erp_thread() | |
zfcp_erp_strategy() | |
write_lock_irqsave(&adapter->erp_lock, flags);------+ | |
... | | |
zfcp_erp_strategy_check_target() | | |
zfcp_erp_strategy_check_adapter() | | |
zfcp_erp_adapter_unblock() | | |
* set UNBLOCK -----------------------------------|--+ |
zfcp_erp_action_dequeue() | |
* clear ERP_INUSE ---------------------------------|-----+
... | write_unlock_irqrestore(&adapter->erp_lock, flags);-+
Hence, we should check for both UNBLOCK and ERP_INUSE because they are interleaved. Also we need to explicitly check ERP_FAILED for the link down case which currently does not clear the UNBLOCK flag in zfcp_fsf_link_down_info_eval().
--- drivers/s390/scsi/zfcp_dbf.c | 17 +++++++++-- drivers/s390/scsi/zfcp_erp.c | 61 ++++++++++++++++++++++++++++++++++++++++-- drivers/s390/scsi/zfcp_ext.h | 4 ++ drivers/s390/scsi/zfcp_scsi.c | 4 -- 4 files changed, 77 insertions(+), 9 deletions(-)
drivers/s390/scsi/zfcp_dbf.c +14 -3
@@ -289,11 +289,12 @@ void zfcp_dbf_rec_trig(char *tag, struct/** -* zfcp_dbf_rec_run - trace event related to running recovery +* zfcp_dbf_rec_run_lvl - trace event related to running recovery +* @level: trace level to be used for event * @tag: identifier for event * @erp: erp_action running */ -void zfcp_dbf_rec_run (char *tag,struct zfcp_erp_action *erp) +void zfcp_dbf_rec_run_lvl (int level,char *tag,struct zfcp_erp_action *erp) {struct zfcp_dbf *dbf = erp->adapter->dbf;struct zfcp_dbf_rec *rec = &dbf->rec_buf;
@@ -319,11 +320,21 @@ void zfcp_dbf_rec_run(char *tag, structelse rec->u.run.rec_count =atomic_read (&erp->adapter->erp_counter); -debug_event (dbf->rec,1 , rec,sizeof (*rec)); +debug_event (dbf->rec, level, rec,sizeof (*rec));spin_unlock_irqrestore (&dbf->rec_lock, flags); }/** +* zfcp_dbf_rec_run - trace event related to running recovery +* @tag: identifier for event +* @erp: erp_action running +*/ +void zfcp_dbf_rec_run (char *tag,struct zfcp_erp_action *erp) +{ +zfcp_dbf_rec_run_lvl (1 , tag, erp); +} + +/** * zfcp_dbf_rec_run_wka - trace wka port event with info like running recovery * @tag: identifier for event * @wka_port: well known address port
drivers/s390/scsi/zfcp_erp.c +59 -2
85 lines not on this page · raw message
drivers/s390/scsi/zfcp_ext.h +3 -1
@@ -3,7 +3,7 @@* * External function declarations. * -* Copyright IBM Corp. 2002, 2015 +* Copyright IBM Corp. 2002, 2016 */ #ifndef ZFCP_EXT_H
@@ -35,6 +35,8 @@ extern void zfcp_dbf_adapter_unregister(extern void zfcp_dbf_rec_trig (char *,struct zfcp_adapter *,struct zfcp_port *,struct scsi_device *,u8 ,u8 );extern void zfcp_dbf_rec_run (char *,struct zfcp_erp_action *); +extern void zfcp_dbf_rec_run_lvl (int level,char *tag, +struct zfcp_erp_action *erp);extern void zfcp_dbf_rec_run_wka (char *,struct zfcp_fc_wka_port *,u64 );extern void zfcp_dbf_hba_fsf_uss (char *,struct zfcp_fsf_req *);extern void zfcp_dbf_hba_fsf_res (char *,int ,struct zfcp_fsf_req *);
drivers/s390/scsi/zfcp_scsi.c +1 -3
@@ -88,9 +88,7 @@ int zfcp_scsi_queuecommand(struct Scsi_H }if (unlikely (!(status &ZFCP_STATUS_COMMON_UNBLOCKED ))) { -/* This could be either -* open LUN pending: this is temporary, will result in -* open LUN or ERP_FAILED, so retry command +/* This could be * call to rport_delete pending: mimic retry from * fc_remote_port_chkready until rport is BLOCKED */
Greg Kroah-Hartman
maintainerPATCH 32/58 scsi: avoid a permanent stop of the scsi devices request queue
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
commit d2a145252c52792bc59e4767b486b26c430af4bb upstream.
A race between scanning and fc_remote_port_delete() may result in a permanent stop if the device gets blocked before scsi_sysfs_add_sdev() and unblocked after. The reason is that blocking a device sets both the SDEV_BLOCKED state and the QUEUE_FLAG_STOPPED. However, scsi_sysfs_add_sdev() unconditionally sets SDEV_RUNNING which causes the device to be ignored by scsi_target_unblock() and thus never have its QUEUE_FLAG_STOPPED cleared leading to a device which is apparently running but has a stopped queue.
We actually have two places where SDEV_RUNNING is set: once in scsi_add_lun() which respects the blocked flag and once in scsi_sysfs_add_sdev() which doesn't. Since the second set is entirely spurious, simply remove it to fix the problem.
--- drivers/scsi/scsi_sysfs.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/scsi/scsi_sysfs.c +0 -4
@@ -1031,10 +1031,6 @@ int scsi_sysfs_add_sdev(struct scsi_devistruct request_queue *rq = sdev->request_queue;struct scsi_target *starget = sdev->sdev_target; - error =scsi_device_set_state (sdev,SDEV_RUNNING ); -if (error) -return error; - error =scsi_target_add (starget);if (error)return error;
Greg Kroah-Hartman
maintainerPATCH 33/58 ARC: mm: arc700: Dont assume 2 colours for aliasing VIPT dcache
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vineet Gupta <[email protected]>
commit 08fe007968b2b45e831daf74899f79a54d73f773 upstream.
An ARC700 customer reported linux boot crashes when upgrading to bigger L1 dcache (64K from 32K). Turns out they had an aliasing VIPT config and current code only assumed 2 colours, while theirs had 4. So default to 4 colours and complain if there are fewer. Ideally this needs to be a Kconfig option, but heck that's too much of hassle for a single user.
--- arch/arc/include/asm/cacheflush.h | 6 ++++-- arch/arc/mm/cache.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-)
arch/arc/include/asm/cacheflush.h +4 -2
@@ -85,6 +85,10 @@ void flush_anon_page(struct vm_area_stru*/ #define PG_dc_clean PG_arch_1 +#define CACHE_COLORS_NUM 4 +#define CACHE_COLORS_MSK (CACHE_COLORS_NUM - 1) +#define CACHE_COLOR (addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & CACHE_COLORS_MSK) +/* * Simple wrapper over config option * Bootup code ensures that hardware matches kernel configuration
@@ -94,8 +98,6 @@ static inline int cache_is_vipt_aliasingreturn IS_ENABLED (CONFIG_ARC_CACHE_VIPT_ALIASING ); } -#define CACHE_COLOR (addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & 1) -/* * checks if two addresses (after page aligning) index into same cache set */
arch/arc/mm/cache.c +8 -3
@@ -960,11 +960,16 @@ void arc_cache_init(void)/* check for D-Cache aliasing on ARCompact: ARCv2 has PIPT */ if (is_isa_arcompact ()) {int handled =IS_ENABLED (CONFIG_ARC_CACHE_VIPT_ALIASING ); +int num_colors = dc->sz_k/dc->assoc/TO_KB (PAGE_SIZE ); -if (dc->alias && !handled) -panic ("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n" ); -else if (!dc->alias && handled) +if (dc->alias) { +if (!handled) +panic ("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n" ); +if (CACHE_COLORS_NUM != num_colors) +panic ("CACHE_COLORS_NUM not optimized for config\n" ); + }else if (!dc->alias && handled) {panic ("Disable CONFIG_ARC_CACHE_VIPT_ALIASING\n" ); + } } }
Greg Kroah-Hartman
maintainerPATCH 34/58 firmware: fix usermode helper fallback loading
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yves-Alexis Perez <[email protected]>
commit 2e700f8d85975f516ccaad821278c1fe66b2cc98 upstream.
When you use the firmware usermode helper fallback with a timeout value set to a value greater than INT_MAX (2147483647) a cast overflow issue causes the timeout value to go negative and breaks all usermode helper loading. This regression was introduced through commit 68ff2a00dbf5 ("firmware_loader:
handle timeout via wait_for_completion_interruptible_timeout()") on kernel v4.0.
The firmware_class drivers relies on the firmware usermode helper fallback as a mechanism to look for firmware if the direct filesystem search failed only if:
a) You've enabled CONFIG_FW_LOADER_USER_HELPER_FALLBACK (not many distros):
Then all of these callers will rely on the fallback mechanism in case the firmware is not found through an initial direct filesystem lookup:
o request_firmware()
o request_firmware_into_buf()
o request_firmware_nowait()
b) If you've only enabled CONFIG_FW_LOADER_USER_HELPER (most distros):
Then only callers using request_firmware_nowait() with the second argument set to false, this explicitly is requesting the UMH firmware fallback to be relied on in case the first filesystem lookup fails.
Using Coccinelle SmPL grammar we have identified only two drivers explicitly requesting the UMH firmware fallback mechanism:
- drivers/firmware/dell_rbu.c
- drivers/leds/leds-lp55xx-common.c
Since most distributions only enable CONFIG_FW_LOADER_USER_HELPER the biggest impact of this regression are users of the dell_rbu and leds-lp55xx-common device driver which required the UMH to find their respective needed firmwares.
The default timeout for the UMH is set to 60 seconds always, as of commit 68ff2a00dbf5 ("firmware_loader: handle timeout via wait_for_completion_interruptible_timeout()") the timeout was bumped to MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1). Additionally the MAX_JIFFY_OFFSET value was also used if the timeout was configured by a user to 0.
The following works:
echo 2147483647 > /sys/class/firmware/timeout
But both of the following set the timeout to MAX_JIFFY_OFFSET even if we display 0 back to userspace:
echo 2147483648 > /sys/class/firmware/timeout
cat /sys/class/firmware/timeout
0
echo 0> /sys/class/firmware/timeout
cat /sys/class/firmware/timeout
0
A max value of INT_MAX (2147483647) seconds is therefore implicit due to the another cast with simple_strtol().
This fixes the secondary cast (the first one is simple_strtol() but its an issue only by forcing an implicit limit) by re-using the timeout variable and only setting retval in appropriate cases.
Lastly worth noting systemd had ripped out the UMH firmware fallback mechanism from udev since udev 2014 via commit be2ea723b1d023b3d ("udev: remove userspace firmware loading support"), so as of systemd v217.
--- drivers/base/firmware_class.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/base/firmware_class.c +4 -3
@@ -942,13 +942,14 @@ static int _request_firmware_load(struct timeout =MAX_JIFFY_OFFSET ; } - retval =wait_for_completion_interruptible_timeout (&buf->completion, + timeout =wait_for_completion_interruptible_timeout (&buf->completion, timeout); -if (retval == -ERESTARTSYS || !retval) { +if (timeout == -ERESTARTSYS || !timeout) { + retval = timeout;mutex_lock (&fw_lock);fw_load_abort (fw_priv);mutex_unlock (&fw_lock); - }else if (retval >0 ) { + }else if (timeout >0 ) { retval =0 ; }
Greg Kroah-Hartman
maintainerPATCH 35/58 s390/vmlogrdr: fix IUCV buffer allocation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gerald Schaefer <[email protected]>
commit 5457e03de918f7a3e294eb9d26a608ab8a579976 upstream.
The buffer for iucv_message_receive() needs to be below 2 GB. In __iucv_message_receive(), the buffer address is casted to an u32, which would result in either memory corruption or an addressing exception when using addresses >= 2 GB.
Fix this by using GFP_DMA for the buffer allocation.
--- drivers/s390/char/vmlogrdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/vmlogrdr.c +1 -1
@@ -872,7 +872,7 @@ static int __init vmlogrdr_init(void) goto cleanup;for (i=0 ; i <MAXMINOR ; ++i ) { - sys_ser[i].buffer = (char *)get_zeroed_page (GFP_KERNEL ); + sys_ser[i].buffer = (char *)get_zeroed_page (GFP_KERNEL |GFP_DMA );if (!sys_ser[i].buffer) { rc = -ENOMEM ;break ;
Greg Kroah-Hartman
maintainerPATCH 36/58 sc16is7xx: Drop bogus use of IRQF_ONESHOT
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Cartwright <[email protected]>
commit 04da73803c05dc1150ccc31cbf93e8cd56679c09 upstream.
The use of IRQF_ONESHOT when registering an interrupt handler with request_irq() is non-sensical.
Not only that, it also prevents the handler from being threaded when it otherwise should be w/ IRQ_FORCED_THREADING is enabled. This causes the following deadlock observed by Sean Nyekjaer on -rt:
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[..]
rt_spin_lock_slowlock from queue_kthread_work queue_kthread_work from sc16is7xx_irq sc16is7xx_irq [sc16is7xx] from handle_irq_event_percpu handle_irq_event_percpu from handle_irq_event handle_irq_event from handle_level_irq handle_level_irq from generic_handle_irq generic_handle_irq from mxc_gpio_irq_handler mxc_gpio_irq_handler from mx3_gpio_irq_handler mx3_gpio_irq_handler from generic_handle_irq generic_handle_irq from __handle_domain_irq __handle_domain_irq from gic_handle_irq gic_handle_irq from __irq_svc
__irq_svc from rt_spin_unlock
rt_spin_unlock from kthread_worker_fn kthread_worker_fn from kthread
kthread from ret_from_fork
--- drivers/tty/serial/sc16is7xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sc16is7xx.c +1 -1
@@ -1230,7 +1230,7 @@ static int sc16is7xx_probe(struct device/* Setup interrupt */ ret =devm_request_irq (dev, irq, sc16is7xx_irq, -IRQF_ONESHOT | flags,dev_name (dev), s); + flags,dev_name (dev), s);if (!ret)return 0 ;
Greg Kroah-Hartman
maintainerPATCH 37/58 md/raid5: limit request size according to implementation limits
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <[email protected]>
commit e8d7c33232e5fdfa761c3416539bc5b4acd12db5 upstream.
Current implementation employ 16bit counter of active stripes in lower bits of bio->bi_phys_segments. If request is big enough to overflow this counter bio will be completed and freed too early.
Fortunately this not happens in default configuration because several other limits prevent that: stripe_cache_size * nr_disks effectively limits count of active stripes. And small max_sectors_kb at lower disks prevent that during normal read/write operations.
Overflow easily happens in discard if it's enabled by module parameter "devices_handle_discard_safely" and stripe_cache_size is set big enough.
This patch limits requests size with 256Mb - 8Kb to prevent overflows.
--- drivers/md/raid5.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/md/raid5.c +9 -0
@@ -6980,6 +6980,15 @@ static int run(struct mddev *mddev) stripe = (stripe | (stripe-1 )) +1 ; mddev->queue->limits.discard_alignment = stripe; mddev->queue->limits.discard_granularity = stripe; + +/* +* We use 16-bit counter of active stripes in bi_phys_segments +* (minus one for over-loaded initialization) +*/ +blk_queue_max_hw_sectors (mddev->queue,0xfffe *STRIPE_SECTORS ); +blk_queue_max_discard_sectors (mddev->queue, +0xfffe *STRIPE_SECTORS ); +/* * unaligned part of discard request will be ignored, so can't * guarantee discard_zeroes_data
Greg Kroah-Hartman
maintainerPATCH 38/58 KVM: PPC: Book3S HV: Save/restore XER in checkpointed register state
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Mackerras <[email protected]>
commit 0d808df06a44200f52262b6eb72bcb6042f5a7c5 upstream.
When switching from/to a guest that has a transaction in progress, we need to save/restore the checkpointed register state. Although XER is part of the CPU state that gets checkpointed, the code that does this saving and restoring doesn't save/restore XER.
This fixes it by saving and restoring the XER. To allow userspace to read/write the checkpointed XER value, we also add a new ONE_REG specifier.
The visible effect of this bug is that the guest may see its XER value being corrupted when it uses transactions.
--- Documentation/virtual/kvm/api.txt | 1 + arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kvm/book3s_hv.c | 6 ++++++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++++ 6 files changed, 14 insertions(+)
Documentation/virtual/kvm/api.txt +1 -0
@@ -1991,6 +1991,7 @@ registers, find a list below: PPC | KVM_REG_PPC_TM_VSCR | 32 PPC | KVM_REG_PPC_TM_DSCR | 64 PPC | KVM_REG_PPC_TM_TAR | 64 + PPC | KVM_REG_PPC_TM_XER | 64 | | MIPS | KVM_REG_MIPS_R0 | 64 ...
arch/powerpc/include/asm/kvm_host.h +1 -0
@@ -545,6 +545,7 @@ struct kvm_vcpu_arch {u64 tfiar;u32 cr_tm; +u64 xer_tm;u64 lr_tm;u64 ctr_tm;u64 amr_tm;
arch/powerpc/include/uapi/asm/kvm.h +1 -0
@@ -587,6 +587,7 @@ struct kvm_get_htab_header {#define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67)#define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68)#define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69) +#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a)/* PPC64 eXternal Interrupt Controller Specification */ #define KVM_DEV_XICS_GRP_SOURCES 1/* 64-bit source attributes */
arch/powerpc/kernel/asm-offsets.c +1 -0
@@ -584,6 +584,7 @@ int main(void) DEFINE(VCPU_VRS_TM, offsetof(struct kvm_vcpu, arch.vr_tm.vr)); DEFINE(VCPU_VRSAVE_TM, offsetof(struct kvm_vcpu, arch.vrsave_tm)); DEFINE(VCPU_CR_TM, offsetof(struct kvm_vcpu, arch.cr_tm)); + DEFINE(VCPU_XER_TM, offsetof(struct kvm_vcpu, arch.xer_tm)); DEFINE(VCPU_LR_TM, offsetof(struct kvm_vcpu, arch.lr_tm)); DEFINE(VCPU_CTR_TM, offsetof(struct kvm_vcpu, arch.ctr_tm)); DEFINE(VCPU_AMR_TM, offsetof(struct kvm_vcpu, arch.amr_tm));
arch/powerpc/kvm/book3s_hv.c +6 -0
@@ -1186,6 +1186,9 @@ static int kvmppc_get_one_reg_hv(structcase KVM_REG_PPC_TM_CR : *val =get_reg_val (id, vcpu->arch.cr_tm);break ; +case KVM_REG_PPC_TM_XER : + *val =get_reg_val (id, vcpu->arch.xer_tm); +break ;case KVM_REG_PPC_TM_LR : *val =get_reg_val (id, vcpu->arch.lr_tm);break ;
@@ -1393,6 +1396,9 @@ static int kvmppc_set_one_reg_hv(structcase KVM_REG_PPC_TM_CR : vcpu->arch.cr_tm =set_reg_val (id, *val);break ; +case KVM_REG_PPC_TM_XER : + vcpu->arch.xer_tm =set_reg_val (id, *val); +break ;case KVM_REG_PPC_TM_LR : vcpu->arch.lr_tm =set_reg_val (id, *val);break ;
arch/powerpc/kvm/book3s_hv_rmhandlers.S +4 -0
@@ -2514,11 +2514,13 @@ kvmppc_save_tm: mfctr r7 mfspr r8, SPRN_AMR mfspr r10, SPRN_TAR + mfxer r11 std r5, VCPU_LR_TM(r9) stw r6, VCPU_CR_TM(r9) std r7, VCPU_CTR_TM(r9) std r8, VCPU_AMR_TM(r9) std r10, VCPU_TAR_TM(r9) + std r11, VCPU_XER_TM(r9) /* Restore r12 as trap number. */ lwz r12, VCPU_TRAP(r9)
@@ -2611,11 +2613,13 @@ kvmppc_restore_tm: ld r7, VCPU_CTR_TM(r4) ld r8, VCPU_AMR_TM(r4) ld r9, VCPU_TAR_TM(r4) + ld r10, VCPU_XER_TM(r4) mtlr r5 mtcr r6 mtctr r7 mtspr SPRN_AMR, r8 mtspr SPRN_TAR, r9 + mtxer r10 /* * Load up PPR and DSCR values but don't put them in the actual SPRs
Greg Kroah-Hartman
maintainerPATCH 39/58 KVM: PPC: Book3S HV: Dont lose hardware R/C bit updates in H_PROTECT
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Mackerras <[email protected]>
commit f064a0de1579fabded8990bed93971e30deb9ecb upstream.
The hashed page table MMU in POWER processors can update the R (reference) and C (change) bits in a HPTE at any time until the HPTE has been invalidated and the TLB invalidation sequence has completed. In kvmppc_h_protect, which implements the H_PROTECT hypercall, we read the HPTE, modify the second doubleword, invalidate the HPTE in memory, do the TLB invalidation sequence, and then write the modified value of the second doubleword back to memory. In doing so we could overwrite an R/C bit update done by hardware between when we read the HPTE and when the TLB invalidation completed. To fix this we re-read the second doubleword after the TLB invalidation and OR in the (possibly) new values of R and C. We can use an OR since hardware only ever sets R and C, never clears them.
This race was found by code inspection. In principle this bug could cause occasional guest memory corruption under host memory pressure.
--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kvm/book3s_hv_rm_mmu.c +2 -0
@@ -653,6 +653,8 @@ long kvmppc_h_protect(struct kvm_vcpu *v HPTE_V_ABSENT);do_tlbies (kvm, &rb,1 ,global_invalidates (kvm, flags), true); +/* Don't lose R/C bit updates done by hardware */ + r |=be64_to_cpu (hpte[1 ]) & (HPTE_R_R |HPTE_R_C ); hpte[1 ] =cpu_to_be64 (r); } }
Greg Kroah-Hartman
maintainerPATCH 40/58 kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jim Mattson <[email protected]>
commit ef85b67385436ddc1998f45f1d6a210f935b3388 upstream.
When L2 exits to L0 due to "exception or NMI", software exceptions (#BP and #OF) for which L1 has requested an intercept should be handled by L1 rather than L0. Previously, only hardware exceptions were forwarded to L1.
--- arch/x86/kvm/vmx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
arch/x86/kvm/vmx.c +5 -6
@@ -1247,10 +1247,10 @@ static inline bool nested_cpu_has_postedreturn vmcs12->pin_based_vm_exec_control &PIN_BASED_POSTED_INTR ; } -static inline bool is_exception (u32 intr_info) +static inline bool is_nmi (u32 intr_info) {return (intr_info & (INTR_INFO_INTR_TYPE_MASK |INTR_INFO_VALID_MASK )) - == (INTR_TYPE_HARD_EXCEPTION |INTR_INFO_VALID_MASK ); + == (INTR_TYPE_NMI_INTR |INTR_INFO_VALID_MASK ); } static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
@@ -5234,7 +5234,7 @@ static int handle_exception(struct kvm_vif (is_machine_check (intr_info))return handle_machine_check (vcpu); -if ((intr_info &INTR_INFO_INTR_TYPE_MASK ) ==INTR_TYPE_NMI_INTR ) +if (is_nmi (intr_info))return 1 ;/* already handled by vmx_vcpu_run() */ if (is_no_device (intr_info)) {
@@ -7722,7 +7722,7 @@ static bool nested_vmx_exit_handled(struswitch (exit_reason) {case EXIT_REASON_EXCEPTION_NMI : -if (!is_exception (intr_info)) +if (is_nmi (intr_info))return false;else if (is_page_fault (intr_info))return enable_ept;
@@ -8329,8 +8329,7 @@ static void vmx_complete_atomic_exit(strkvm_machine_check ();/* We need to handle NMIs before interrupts are enabled */ -if ((exit_intr_info &INTR_INFO_INTR_TYPE_MASK ) ==INTR_TYPE_NMI_INTR && - (exit_intr_info &INTR_INFO_VALID_MASK )) { +if (is_nmi (exit_intr_info)) {kvm_before_handle_nmi (&vmx->vcpu); asm("int $2" );kvm_after_handle_nmi (&vmx->vcpu);
Greg Kroah-Hartman
maintainerPATCH 41/58 ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Red Hat) <[email protected]>
commit 847fa1a6d3d00f3bdf68ef5fa4a786f644a0dd67 upstream.
With new binutils, gcc may get smart with its optimization and change a jmp from a 5 byte jump to a 2 byte one even though it was jumping to a global function. But that global function existed within a 2 byte radius, and gcc was able to optimize it. Unfortunately, that jump was also being modified when function graph tracing begins. Since ftrace expected that jump to be 5 bytes, but it was only two, it overwrote code after the jump, causing a crash.
This was fixed for x86_64 with commit 8329e818f149, with the same subject as this commit, but nothing was done for x86_32.
--- arch/x86/entry/entry_32.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/entry/entry_32.S +2 -2
@@ -766,8 +766,8 @@ ftrace_graph_call: jmp ftrace_stub #endif -.globl ftrace_stub -ftrace_stub: +/* This is weak to keep gas from relaxing the jumps */ +WEAK(ftrace_stub) ret END(ftrace_caller)
Greg Kroah-Hartman
maintainerPATCH 42/58 platform/x86: asus-nb-wmi.c: Add X45U quirk
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcos Paulo de Souza <[email protected]>
commit e74e259939275a5dd4e0d02845c694f421e249ad upstream.
Without this patch, the Asus X45U wireless card can't be turned on (hard-blocked), but after a suspend/resume it just starts working.
Following this bug report[1], there are other cases like this one, but this Asus is the only model that I can test.
[1] https://ubuntuforums.org/showthread.php?t=2181558
--- drivers/platform/x86/asus-nb-wmi.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +9 -0
@@ -128,6 +128,15 @@ static const struct dmi_system_id asus_q }, { .callback = dmi_matched, + .ident = "ASUSTeK COMPUTER INC. X45U", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_PRODUCT_NAME, "X45U"), + }, + .driver_data = &quirk_asus_wapf4, + }, + { + .callback = dmi_matched, .ident = "ASUSTeK COMPUTER INC. X456UA", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
Greg Kroah-Hartman
maintainerPATCH 43/58 fgraph: Handle a case where a tracer ignores set_graph_notrace
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Red Hat) <[email protected]>
commit 794de08a16cf1fc1bf785dc48f66d36218cf6d88 upstream.
Both the wakeup and irqsoff tracers can use the function graph tracer when the display-graph option is set. The problem is that they ignore the notrace file, and record the entry of functions that would be ignored by the function_graph tracer. This causes the trace->depth to be recorded into the ring buffer. The set_graph_notrace uses a trick by adding a large negative number to the trace->depth when a graph function is to be ignored.
On trace output, the graph function uses the depth to record a stack of functions. But since the depth is negative, it accesses the array with a negative number and causes an out of bounds access that can cause a kernel oops or corrupt data.
Have the print functions handle cases where a tracer still records functions even when they are in set_graph_notrace.
Also add warnings if the depth is below zero before accessing the array.
Note, the function graph logic will still prevent the return of these functions from being recorded, which means that they will be left hanging without a return. For example:
# echo '*spin*' > set_graph_notrace
# echo 1 > options/display-graph
# echo wakeup > current_tracer
# cat trace
[...]
_raw_spin_lock() {
preempt_count_add() {
do_raw_spin_lock() {
update_rq_clock();Where it should look like:
_raw_spin_lock() {
preempt_count_add();
do_raw_spin_lock();
}
update_rq_clock();--- kernel/trace/trace_functions_graph.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
kernel/trace/trace_functions_graph.c +14 -3
@@ -780,6 +780,10 @@ print_graph_entry_leaf(struct trace_iter cpu_data =per_cpu_ptr (data->cpu_data, cpu); +/* If a graph tracer ignored set_graph_notrace */ +if (call->depth <-1 ) + call->depth +=FTRACE_NOTRACE_DEPTH ; +/* * Comments display at + 1 to depth. Since * this is a leaf function, keep the comments
@@ -788,7 +792,8 @@ print_graph_entry_leaf(struct trace_iter cpu_data->depth = call->depth -1 ;/* No need to keep this function around for this depth */ -if (call->depth <FTRACE_RETFUNC_DEPTH ) +if (call->depth <FTRACE_RETFUNC_DEPTH && + !WARN_ON_ONCE (call->depth <0 )) cpu_data->enter_funcs[call->depth] =0 ; }
@@ -818,11 +823,16 @@ print_graph_entry_nested(struct trace_itstruct fgraph_cpu_data *cpu_data;int cpu = iter->cpu; +/* If a graph tracer ignored set_graph_notrace */ +if (call->depth <-1 ) + call->depth +=FTRACE_NOTRACE_DEPTH ; + cpu_data =per_cpu_ptr (data->cpu_data, cpu); cpu_data->depth = call->depth;/* Save this function pointer to see if the exit matches */ -if (call->depth <FTRACE_RETFUNC_DEPTH ) +if (call->depth <FTRACE_RETFUNC_DEPTH && + !WARN_ON_ONCE (call->depth <0 )) cpu_data->enter_funcs[call->depth] = call->func; }
@@ -1052,7 +1062,8 @@ print_graph_return(struct ftrace_graph_r*/ cpu_data->depth = trace->depth -1 ; -if (trace->depth <FTRACE_RETFUNC_DEPTH ) { +if (trace->depth <FTRACE_RETFUNC_DEPTH && + !WARN_ON_ONCE (trace->depth <0 )) {if (cpu_data->enter_funcs[trace->depth] != trace->func) func_match =0 ; cpu_data->enter_funcs[trace->depth] =0 ;
Greg Kroah-Hartman
maintainerPATCH 44/58 IB/mad: Fix an array index check
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 2fe2f378dd45847d2643638c07a7658822087836 upstream.
The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity reports the following:
Overrunning array class->method_table of 80 8-byte elements at element index 127 (byte offset 1016) using index convert_mgmt_class(mad_hdr->mgmt_class) (which evaluates to 127).
--- drivers/infiniband/core/mad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/mad.c +1 -1
@@ -1745,7 +1745,7 @@ find_mad_agent(struct ib_mad_port_privatif (!class) goto out;if (convert_mgmt_class (mad_hdr->mgmt_class) >= -IB_MGMT_MAX_METHODS ) +ARRAY_SIZE (class->method_table)) goto out; method = class->method_table[convert_mgmt_class ( mad_hdr->mgmt_class)];
Greg Kroah-Hartman
maintainerPATCH 45/58 IPoIB: Avoid reading an uninitialized member variable
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 11b642b84e8c43e8597de031678d15c08dd057bc upstream.
This patch avoids that Coverity reports the following:
Using uninitialized value port_attr.state when calling printk
--- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_multicast.c +5 -2
@@ -563,8 +563,11 @@ void ipoib_mcast_join_task(struct work_sif (!test_bit (IPOIB_FLAG_OPER_UP , &priv->flags))return ; -if (ib_query_port (priv->ca, priv->port, &port_attr) || - port_attr.state !=IB_PORT_ACTIVE ) { +if (ib_query_port (priv->ca, priv->port, &port_attr)) { +ipoib_dbg (priv,"ib_query_port() failed\n" ); +return ; + } +if (port_attr.state !=IB_PORT_ACTIVE ) {ipoib_dbg (priv,"port state is not ACTIVE (state = %d) suspending join task\n" , port_attr.state);return ;
Greg Kroah-Hartman
maintainerPATCH 46/58 IB/multicast: Check ib_find_pkey() return value
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit d3a2418ee36a59bc02e9d454723f3175dcf4bfd9 upstream.
This patch avoids that Coverity complains about not checking the ib_find_pkey() return value.
--- drivers/infiniband/core/multicast.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/core/multicast.c +5 -2
@@ -517,8 +517,11 @@ static void join_handler(int status, strprocess_join_error (group, status); else {int mgids_changed, is_mgid0; -ib_find_pkey (group->port->dev->device, group->port->port_num, -be16_to_cpu (rec->pkey), &pkey_index); + +if (ib_find_pkey (group->port->dev->device, + group->port->port_num,be16_to_cpu (rec->pkey), + &pkey_index)) + pkey_index =MCAST_INVALID_PKEY_INDEX ;spin_lock_irq (&group->port->lock); if (group->state == MCAST_BUSY &&
Greg Kroah-Hartman
maintainerPATCH 47/58 IB/cma: Fix a race condition in iboe_addr_get_sgid()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit fba332b079029c2f4f7e84c1c1cd8e3867310c90 upstream.
Code that dereferences the struct net_device ip_ptr member must be protected with an in_dev_get() / in_dev_put() pair. Hence insert calls to these functions.
--- include/rdma/ib_addr.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/rdma/ib_addr.h +4 -2
@@ -197,10 +197,12 @@ static inline void iboe_addr_get_sgid(st dev =dev_get_by_index (&init_net, dev_addr->bound_dev_if);if (dev) { - ip4 = (struct in_device *)dev->ip_ptr; -if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) + ip4 =in_dev_get (dev); +if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) {ipv6_addr_set_v4mapped (ip4->ifa_list->ifa_address, (struct in6_addr *)gid); +in_dev_put (ip4); + }dev_put (dev); } }
Greg Kroah-Hartman
maintainerPATCH 48/58 media: solo6x10: fix lockup by avoiding delayed register write
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Utkin <[email protected]>
commit 5fc4b067ec082c3127e0156f800769b7e0dce078 upstream.
This fixes a lockup at device probing which happens on some solo6010 hardware samples. This is a regression introduced by commit e1ceb25a1569 ("[media] SOLO6x10: remove unneeded register locking and barriers")
The observed lockup happens in solo_set_motion_threshold() called from solo_motion_config().
This extra "flushing" is not fundamentally needed for every write, but apparently the code in driver assumes such behaviour at last in some places.
Actual fix was proposed by Hans Verkuil.
--- drivers/media/pci/solo6x10/solo6x10.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/pci/solo6x10/solo6x10.h +3 -0
@@ -286,7 +286,10 @@ static inline u32 solo_reg_read(struct sstatic inline void solo_reg_write (struct solo_dev *solo_dev,int reg,u32 data) { +u16 val; +writel (data, solo_dev->reg_base + reg); +pci_read_config_word (solo_dev->pdev,PCI_STATUS , &val); }static inline void solo_irq_on (struct solo_dev *dev,u32 mask)
Greg Kroah-Hartman
maintainerPATCH 49/58 Input: drv260x - fix input devices parent assignment
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jingkui Wang <[email protected]>
commit 5a8a6b89c15766446d845671d574a9243b6d8786 upstream.
We were assigning I2C bus controller instead of client as parent device. Besides being logically wrong, it messed up with devm handling of input device. As a result we were leaving input device and event node behind after rmmod-ing the driver, which lead to a kernel oops if one were to access the event node later.
Let's remove the assignment and rely on devm_input_allocate_device() to set it up properly for us.
--- drivers/input/misc/drv260x.c | 1 - 1 file changed, 1 deletion(-)
drivers/input/misc/drv260x.c +0 -1
@@ -592,7 +592,6 @@ static int drv260x_probe(struct i2c_clie } haptics->input_dev->name ="drv260x:haptics" ; - haptics->input_dev->dev.parent = client->dev.parent; haptics->input_dev->close = drv260x_close;input_set_drvdata (haptics->input_dev, haptics);input_set_capability (haptics->input_dev,EV_FF ,FF_RUMBLE );
Greg Kroah-Hartman
maintainerPATCH 50/58 PCI: Check for PME in targeted sleep state
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 6496ebd7edf446fccf8266a1a70ffcb64252593e upstream.
One some systems, the firmware does not allow certain PCI devices to be put in deep D-states. This can cause problems for wakeup signalling, if the device does not support PME# in the deepest allowed suspend state. For example, Pierre reports that on his system, ACPI does not permit his xHCI host controller to go into D3 during runtime suspend -- but D3 is the only state in which the controller can generate PME# signals. As a result, the controller goes into runtime suspend but never wakes up, so it doesn't work properly. USB devices plugged into the controller are never detected.
If the device relies on PME# for wakeup signals but is not capable of generating PME# in the target state, the PCI core should accurately report that it cannot do wakeup from runtime suspend. This patch modifies the pci_dev_run_wake() routine to add this check.
--- drivers/pci/pci.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pci/pci.c +4 -0
@@ -2043,6 +2043,10 @@ bool pci_dev_run_wake(struct pci_dev *deif (!dev->pme_support)return false; +/* PME-capable in principle, but not from the intended sleep state */ +if (!pci_pme_capable (dev,pci_target_state (dev))) +return false; +while (bus->parent) {struct pci_dev *bridge = bus->self;
Greg Kroah-Hartman
maintainerPATCH 51/58 libceph: verify authorize reply on connect
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 5c056fdc5b474329037f2aa18401bd73033e0ce0 upstream.
After sending an authorizer (ceph_x_authorize_a + ceph_x_authorize_b), the client gets back a ceph_x_authorize_reply, which it is supposed to verify to ensure the authenticity and protect against replay attacks. The code for doing this is there (ceph_x_verify_authorizer_reply(), ceph_auth_verify_authorizer_reply() + plumbing), but it is never invoked by the the messenger.
AFAICT this goes back to 2009, when ceph authentication protocols support was added to the kernel client in 4e7a5dcd1bba ("ceph:
negotiate authentication protocol; implement AUTH_NONE protocol").
The second param of ceph_connection_operations::verify_authorizer_reply is unused all the way down. Pass 0 to facilitate backporting, and kill it in the next commit.
--- net/ceph/messenger.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/ceph/messenger.c +13 -0
@@ -2042,6 +2042,19 @@ static int process_connect(struct ceph_cdout ("process_connect on %p tag %d\n" , con, (int )con->in_tag); +if (con->auth_reply_buf) { +/* +* Any connection that defines ->get_authorizer() +* should also define ->verify_authorizer_reply(). +* See get_connect_authorizer(). +*/ + ret = con->ops->verify_authorizer_reply (con,0 ); +if (ret <0 ) { + con->error_msg ="bad authorize reply" ; +return ret; + } + } +switch (con->in_reply.tag) {case CEPH_MSGR_TAG_FEATURES : pr_err("%s%lld %s feature set mismatch,"
Greg Kroah-Hartman
maintainerPATCH 52/58 nfs_write_end(): fix handling of short copies
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit c0cf3ef5e0f47e385920450b245d22bead93e7ad upstream.
What matters when deciding if we should make a page uptodate is not how much we _wanted_ to copy, but how much we actually have copied. As it is, on architectures that do not zero tail on short copy we can leave uninitialized data in page marked uptodate.
--- fs/nfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/file.c +1 -1
@@ -407,7 +407,7 @@ static int nfs_write_end(struct file *fi*/ if (!PageUptodate (page)) {unsigned pglen =nfs_page_length (page); -unsigned end = offset + len; +unsigned end = offset + copied;if (pglen ==0 ) { zero_user_segments(page, 0, offset,
Greg Kroah-Hartman
maintainerPATCH 53/58 powerpc/ps3: Fix system hang with GCC 5 builds
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geoff Levand <[email protected]>
commit 6dff5b67054e17c91bd630bcdda17cfca5aa4215 upstream.
GCC 5 generates different code for this bootwrapper null check that causes the PS3 to hang very early in its bootup. This check is of limited value, so just get rid of it.
--- arch/powerpc/boot/ps3-head.S | 5 ----- arch/powerpc/boot/ps3.c | 8 +------- 2 files changed, 1 insertion(+), 12 deletions(-)
arch/powerpc/boot/ps3-head.S +0 -5
@@ -57,11 +57,6 @@ __system_reset_overlay: bctr 1: - /* Save the value at addr zero for a null pointer write check later. */ - - li r4, 0 - lwz r3, 0(r4) - /* Primary delays then goes to _zimage_start in wrapper. */ or 31, 31, 31 /* db16cyc */
arch/powerpc/boot/ps3.c +1 -7
@@ -119,13 +119,12 @@ void ps3_copy_vectors(void)flush_cache ((void *)0x100 ,512 ); } -void platform_init (unsigned long null_check) +void platform_init (void ) {const u32 heapsize =0x1000000 - (u32 )_end;/* 16MiB */ void *chosen;unsigned long ft_addr;u64 rm_size; -unsigned long val; console_ops.write = ps3_console_write; platform_ops.exit = ps3_exit;
@@ -153,11 +152,6 @@ void platform_init(unsigned long null_chprintf (" flat tree at 0x%lx\n\r" , ft_addr); - val = *(unsigned long *)0 ; - -if (val != null_check) -printf ("null check failed: %lx != %lx\n\r" , val, null_check); - ((kernel_entry_t )0 )(ft_addr,0 ,NULL );ps3_exit ();
Greg Kroah-Hartman
maintainerPATCH 54/58 powerpc: Convert cmp to cmpd in idle enter sequence
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Segher Boessenkool <[email protected]>
commit 80f23935cadb1c654e81951f5a8b7ceae0acc1b4 upstream.
PowerPC's "cmp" instruction has four operands. Normally people write "cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently people forget, and write "cmp" with just three operands.
With older binutils this is silently accepted as if this was "cmpw", while often "cmpd" is wanted. With newer binutils GAS will complain about this for 64-bit code. For 32-bit code it still silently assumes "cmpw" is what is meant.
In this instance the code comes directly from ISA v2.07, including the cmp, but cmpd is correct. Backport to stable so that new toolchains can build old kernels.
--- arch/powerpc/kernel/idle_power7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/idle_power7.S +1 -1
@@ -44,7 +44,7 @@ std r0,0(r1); \ ptesync; \ ld r0,0(r1); \ -1: cmp cr0,r0,r0; \ +1: cmpd cr0,r0,r0; \ bne 1b; \ IDLE_INST; \ b .
Re: [PATCH 4.4 54/58] powerpc: Convert cmp to cmpd in idle enter sequence
Quoted 21 lines · Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Segher Boessenkool <[email protected]>
commit
80f23935cadb1c654e81951f5a8b7ceae0acc1b4upstream.PowerPC's "cmp" instruction has four operands. Normally people write "cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently people forget, and write "cmp" with just three operands.
With older binutils this is silently accepted as if this was "cmpw", while often "cmpd" is wanted. With newer binutils GAS will complain about this for 64-bit code. For 32-bit code it still silently assumes "cmpw" is what is meant.
In this instance the code comes directly from ISA v2.07, including the cmp, but cmpd is correct. Backport to stable so that new toolchains can build old kernels.
Quoted 6 lines
Fixes 948cf67c4726 ("powerpc: Add NAP mode support on Power7 in HV mode")Reviewed-by Vaidyanathan Srinivasan <[email protected]>Signed-off-by Segher Boessenkool <[email protected]>Signed-off-by Michael Ellerman <[email protected]>Signed-off-by Joel Stanley <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
The change from cmp to cmpd is correct. This code will execute in 64-bit mode only and fix applies to stable as described above.
Quoted 19 lines
--- arch/powerpc/kernel/idle_power7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/kernel/idle_power7.S +1
-1@@ -44,7 +44,7 @@ std r0,0(r1); \ ptesync; \ ld r0,0(r1); \ -1: cmp cr0,r0,r0; \ +1: cmpd cr0,r0,r0; \ bne 1b; \ IDLE_INST; \ b .
Greg Kroah-Hartman
maintainerPATCH 55/58 target/user: Fix use-after-free of tcmu_cmds if they are expired
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Grover <[email protected]>
commit d0905ca757bc40bd1ebc261a448a521b064777d7 upstream.
Don't free the cmd in tcmu_check_expired_cmd, it's still referenced by an entry in our cmd_id->cmd idr. If userspace ever resumes processing, tcmu_handle_completions() will use the now-invalid cmd pointer.
Instead, don't free cmd. It will be freed by tcmu_handle_completion() if userspace ever recovers, or tcmu_free_device if not.
--- drivers/target/target_core_user.c | 2 -- 1 file changed, 2 deletions(-)
drivers/target/target_core_user.c +0 -2
@@ -645,8 +645,6 @@ static int tcmu_check_expired_cmd(int idtarget_complete_cmd (cmd->se_cmd,SAM_STAT_CHECK_CONDITION ); cmd->se_cmd =NULL ; -kmem_cache_free (tcmu_cmd_cache, cmd); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 56/58 kconfig/nconf: Fix hang when editing symbol with a long prompt
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 79e51b5c2deea542b3bb8c66e0d502230b017dde upstream.
Currently it is impossible to edit the value of a config symbol with a prompt longer than (terminal width - 2) characters. dialog_inputbox() calculates a negative x-offset for the input window and newwin() fails as this is invalid. It also doesn't check for this failure, so it busy-loops calling wgetch(NULL) which immediately returns -1.
The additions in the offset calculations also don't match the intended size of the window.
Limit the window size and calculate the offset similarly to show_scroll_win().
--- scripts/kconfig/nconf.gui.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
scripts/kconfig/nconf.gui.c +11 -4
@@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window,WINDOW *prompt_win;WINDOW *form_win;PANEL *panel; -int i, x, y; +int i, x, y, lines, columns, win_lines, win_cols;int res =-1 ;int cursor_position =strlen (init);int cursor_form_win;char *result = *resultp; +getmaxyx (stdscr, lines, columns); +if (strlen (init)+1 > *result_len) { *result_len =strlen (init)+1 ; *resultp = result =realloc (result, *result_len);
@@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window,if (title) prompt_width =max (prompt_width,strlen (title)); + win_lines =min (prompt_lines+6 , lines-2 ); + win_cols =min (prompt_width+7 , columns-2 ); + prompt_lines =max (win_lines-6 ,0 ); + prompt_width =max (win_cols-7 ,0 ); +/* place dialog in middle of screen */ - y = (getmaxy (stdscr)-(prompt_lines+4 ))/2 ; - x = (getmaxx (stdscr)-(prompt_width+4 ))/2 ; + y = (lines-win_lines)/2 ; + x = (columns-win_cols)/2 ;strncpy (result, init, *result_len);/* create the windows */ - win =newwin (prompt_lines+6 , prompt_width+7 , y, x); + win =newwin (win_lines, win_cols, y, x); prompt_win =derwin (win, prompt_lines+1 , prompt_width,2 ,2 ); form_win =derwin (win,1 , prompt_width, prompt_lines+3 ,2 );keypad (form_win, TRUE);
Greg Kroah-Hartman
maintainerPATCH 57/58 sg_write()/bsg_write() is not fit to be called under KERNEL_DS
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 128394eff343fc6d2f32172f03e24829539c5835 upstream.
Both damn things interpret userland pointers embedded into the payload; worse, they are actually traversing those. Leaving aside the bad API design, this is very much _not_ safe to call with KERNEL_DS. Bail out early if that happens.
--- block/bsg.c | 3 +++ drivers/scsi/sg.c | 3 +++ 2 files changed, 6 insertions(+)
block/bsg.c +3 -0
@@ -655,6 +655,9 @@ bsg_write(struct file *file, const chardprintk ("%s: write %Zd bytes\n" , bd->name, count); +if (unlikely (segment_eq (get_fs (),KERNEL_DS ))) +return -EINVAL ; +bsg_set_block (bd, file); bytes_written =0 ;
drivers/scsi/sg.c +3 -0
@@ -592,6 +592,9 @@ sg_write(struct file *filp, const char _sg_io_hdr_t *hp;unsigned char cmnd[SG_MAX_CDB_SIZE ]; +if (unlikely (segment_eq (get_fs (),KERNEL_DS ))) +return -EINVAL ; +if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))return -ENXIO ; SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
Greg Kroah-Hartman
maintainerPATCH 58/58 net: mvpp2: fix dma unmapping of TX buffers for fragments
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 8354491c9d5b06709384cea91d13019bf5e61449 upstream.
Since commit 71ce391dfb784 ("net: mvpp2: enable proper per-CPU TX buffers unmapping"), we are not correctly DMA unmapping TX buffers for fragments.
Indeed, the mvpp2_txq_inc_put() function only stores in the txq_cpu->tx_buffs[] array the physical address of the buffer to be DMA-unmapped when skb != NULL. In addition, when DMA-unmapping, we use skb_headlen(skb) to get the size to be unmapped. Both of this works fine for TX descriptors that are associated directly to a SKB, but not the ones that are used for fragments, with a NULL pointer as skb:
- We have a NULL physical address when calling DMA unmap
- skb_headlen(skb) crashes because skb is NULL
This causes random crashes when fragments are used.
To solve this problem, we need to:
- Store the physical address of the buffer to be unmapped unconditionally, regardless of whether it is tied to a SKB or not.
- Store the length of the buffer to be unmapped, which requires a new field.
Instead of adding a third array to store the length of the buffer to be unmapped, and as suggested by David Miller, this commit refactors the tx_buffs[] and tx_skb[] arrays of 'struct mvpp2_txq_pcpu' into a separate structure 'mvpp2_txq_pcpu_buf', to which a 'size' field is added. Therefore, instead of having three arrays to allocate/free, we have a single one, which also improve data locality, reducing the impact on the CPU cache.
--- drivers/net/ethernet/marvell/mvpp2.c | 59 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 29 deletions(-)
drivers/net/ethernet/marvell/mvpp2.c +30 -29
@@ -772,6 +772,17 @@ struct mvpp2_rx_desc {u32 reserved8; }; +struct mvpp2_txq_pcpu_buf { +/* Transmitted SKB */ +struct sk_buff *skb; + +/* Physical address of transmitted buffer */ +dma_addr_t phys; + +/* Size transmitted */ +size_t size; +}; +/* Per-CPU Tx queue control */ struct mvpp2_txq_pcpu {int cpu;
@@ -787,11 +798,8 @@ struct mvpp2_txq_pcpu {/* Number of Tx DMA descriptors reserved for each CPU */ int reserved_num; -/* Array of transmitted skb */ -struct sk_buff **tx_skb; - -/* Array of transmitted buffers' physical addresses */ -dma_addr_t *tx_buffs; +/* Infos about transmitted buffers */ +struct mvpp2_txq_pcpu_buf *buffs;/* Index of last TX DMA descriptor that was inserted */ int txq_put_index;
@@ -981,10 +989,11 @@ static void mvpp2_txq_inc_put(struct mvpstruct sk_buff *skb, struct mvpp2_tx_desc *tx_desc) { - txq_pcpu->tx_skb[txq_pcpu->txq_put_index] = skb; -if (skb) - txq_pcpu->tx_buffs[txq_pcpu->txq_put_index] = - tx_desc->buf_phys_addr; + struct mvpp2_txq_pcpu_buf *tx_buf = + txq_pcpu->buffs + txq_pcpu->txq_put_index; + tx_buf->skb = skb; + tx_buf->size = tx_desc->data_size; + tx_buf->phys = tx_desc->buf_phys_addr; txq_pcpu->txq_put_index++;if (txq_pcpu->txq_put_index == txq_pcpu->size) txq_pcpu->txq_put_index =0 ;
@@ -4403,17 +4412,16 @@ static void mvpp2_txq_bufs_free(struct mint i;for (i =0 ; i < num; i++) { -dma_addr_t buf_phys_addr = - txq_pcpu->tx_buffs[txq_pcpu->txq_get_index]; -struct sk_buff *skb = txq_pcpu->tx_skb[txq_pcpu->txq_get_index]; +struct mvpp2_txq_pcpu_buf *tx_buf = + txq_pcpu->buffs + txq_pcpu->txq_get_index;mvpp2_txq_inc_get (txq_pcpu); -dma_unmap_single (port->dev->dev.parent, buf_phys_addr, -skb_headlen (skb),DMA_TO_DEVICE ); -if (!skb) +dma_unmap_single (port->dev->dev.parent, tx_buf->phys, + tx_buf->size,DMA_TO_DEVICE ); +if (!tx_buf->skb)continue ; -dev_kfree_skb_any (skb); +dev_kfree_skb_any (tx_buf->skb); } }
@@ -4664,15 +4672,10 @@ static int mvpp2_txq_init(struct mvpp2_pfor_each_present_cpu (cpu) { txq_pcpu =per_cpu_ptr (txq->pcpu, cpu); txq_pcpu->size = txq->size; - txq_pcpu->tx_skb =kmalloc (txq_pcpu->size * -sizeof (*txq_pcpu->tx_skb), -GFP_KERNEL ); -if (!txq_pcpu->tx_skb) - goto error; - - txq_pcpu->tx_buffs =kmalloc (txq_pcpu->size * -sizeof (dma_addr_t),GFP_KERNEL ); -if (!txq_pcpu->tx_buffs) + txq_pcpu->buffs =kmalloc (txq_pcpu->size * +sizeof (struct mvpp2_txq_pcpu_buf ), +GFP_KERNEL ); +if (!txq_pcpu->buffs) goto error; txq_pcpu->count =0 ;
@@ -4686,8 +4689,7 @@ static int mvpp2_txq_init(struct mvpp2_p error:for_each_present_cpu (cpu) { txq_pcpu =per_cpu_ptr (txq->pcpu, cpu); -kfree (txq_pcpu->tx_skb); -kfree (txq_pcpu->tx_buffs); +kfree (txq_pcpu->buffs); } dma_free_coherent(port->dev->dev.parent,
@@ -4706,8 +4708,7 @@ static void mvpp2_txq_deinit(struct mvppfor_each_present_cpu (cpu) { txq_pcpu =per_cpu_ptr (txq->pcpu, cpu); -kfree (txq_pcpu->tx_skb); -kfree (txq_pcpu->tx_buffs); +kfree (txq_pcpu->buffs); }if (txq->descs)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.41 release. There are 58 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Jan 8 21:38:49 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.41-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) [email protected]
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.41 release. There are 58 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Jan 8 21:38:49 UTC 2017. Anything received after that time might be too late.
Build results:
total: 150 pass: 150 fail: 0 Qemu test results: total: 115 pass: 115 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter