3.12.35-stable review
Subsystems (4)
cover 3.12.35-stable review
This is the start of the stable review cycle for the 3.12.35 release. There are 66 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 Wed Dec 10 16:07:07 CET 2014. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.35-rc1.xz
and the diffstat can be found below.
thanks,
js
===============
Aaro Koskinen (2):
MIPS: oprofile: Fix backtrace on 64-bit kernel
MIPS: Loongson: Make platform serial setup always built-in.
Alex Deucher (1):
drm/radeon: fix endian swapping in vbios fetch for tdp table
Alexander Gordeev (1):
PCI/MSI: Return msix_capability_init() failure if populate_msi_sysfs()
fails
Alexey Khoroshilov (1):
can: esd_usb2: fix memory leak on disconnect
Andy Lutomirski (4):
x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C x86_64, traps: Stop using IST for #SS
x86_64, traps: Rework bad_iret
uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
Bart Van Assche (1):
srp-target: Retry when QP creation fails with ENOMEM
Ben Sagal (1):
Input: synaptics - adjust min/max on Thinkpad E540
Benjamin Herrenschmidt (5):
PCI/MSI: Add device flag indicating that 64-bit MSIs don't work of/base: Fix PowerPC address parsing hack powerpc/pseries: Honor the generic "no_64bit_msi" flag gpu/radeon: Set flag to indicate broken 64-bit MSI powerpc/powernv: Honor the generic "no_64bit_msi" flag
Benjamin Tissoires (1):
Input: synaptics - fix resolution for manually provided min/max
Charles Keepax (1):
ASoC: wm_adsp: Avoid attempt to free buffers that might still be in
use
Chris Moore (1):
IB/isert: Adjust CQ size to HW limits
Christian Sünkenberg (1):
scsi: add Intel Multi-Flex to scsi scan blacklist
Christoph Hellwig (1):
nfsd: correctly define v4.2 support attributes
Cong Wang (1):
batman: fix a bogus warning from batadv_is_on_batman_iface()
Cristina Ciocan (1):
iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask
Dave Hansen (1):
x86: Require exact match for 'noxsave' command line option
Dmitry Eremin-Solenikov (1):
ARM: 8216/1: xscale: correct auxiliary register in suspend/resume
Fabio Estevam (1):
ASoC: sgtl5000: Fix SMALL_POP bit definition
Greg Kroah-Hartman (1):
Input: xpad - use proper endpoint type
Gu Zheng (1):
aio: fix uncorrent dirty pages accouting when truncating AIO ring
buffer
Hans de Goede (8):
Input: serio - add firmware_id sysfs attribute
Input: i8042 - add firmware_id support
Input: Add INPUT_PROP_TOPBUTTONPAD device property
Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
Input: synaptics - add a matches_pnp_id helper function
Input: synaptics - change min/max quirk table to pnp-id matching
Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531)
usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000
Jane Zhou (1):
net/ping: handle protocol mismatching scenario
Jeff Layton (1):
locks: eliminate BUG() call when there's an unexpected lock on file
close
Johan Hovold (3):
USB: ssu100: fix overrun-error reporting
USB: keyspan: fix overrun-error reporting
USB: keyspan: fix tty line-status reporting
Jurgen Kramer (1):
ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon
devices
Kees Cook (1):
x86, mm: Set NX across entire PMD at boot
Kuninori Morimoto (2):
ASoC: rsnd: remove unsupported PAUSE flag
ASoC: fsi: remove unsupported PAUSE flag
Larry Finger (1):
staging: r8188eu: Add new device ID for DLink GO-USB-N150
Laurent Dufour (1):
powerpc/pseries: Fix endiannes issue in RTAS call from xmon
Lu Baolu (1):
usb: xhci: rework root port wake bits if controller isn't allowed to
wakeup
Mathias Nyman (1):
USB: xhci: don't start a halted endpoint before its new dequeue is set
Maurizio Lombardi (1):
bnx2fc: do not add shared skbs to the fcoe_rx_list
Maxime Ripard (1):
clockevent: sun4i: Fix race condition in the probe code
Miaoqing Pan (1):
ath9k: Fix RTC_DERIVED_CLK usage
Nicholas Bellinger (1):
vhost-scsi: Take configfs group dependency during
VHOST_SCSI_SET_ENDPOINT
Or Gerlitz (1):
ib_isert: Add max_send_sge=2 minimum for control PDU responses
Preston Fick (1):
USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick
Roland Dreier (1):
target: Don't call TFO->write_pending if data_length == 0
Sagi Grimberg (1):
iser-target: Handle DEVICE_REMOVAL event on network portal listener
correctly
Stanislaw Gruszka (1):
rt2x00: do not align payload on modern H/W
Takashi Iwai (2):
Input: synaptics - add min/max quirk for Lenovo T440s
ASoC: dpcm: Fix race between FE/BE updates and trigger
Thomas Körper (1):
can: dev: avoid calling kfree_skb() from interrupt context
Thomas Petazzoni (1):
ARM: 8222/1: mvebu: enable strex backoff delay
Thor Thayer (1):
spi: dw: Fix dynamic speed change.
Trond Myklebust (1):
nfsd: Fix slot wake up race in the nfsv4.1 callback code
Troy Clark (1):
usb: serial: ftdi_sio: add PIDs for Matrix Orbital products
Vladimir Murzin (1):
ARM: 8226/1: cacheflush: get rid of restarting block
arch/arm/include/asm/thread_info.h | 11 -- arch/arm/kernel/traps.c | 31 +--- arch/arm/mm/proc-v7.S | 2 - arch/arm/mm/proc-xscale.S | 4 +- arch/mips/loongson/common/Makefile | 3 +- arch/mips/oprofile/backtrace.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +- arch/powerpc/platforms/powernv/pci.c | 4 +- arch/powerpc/platforms/pseries/msi.c | 2 +- arch/powerpc/xmon/xmon.c | 6 +- arch/x86/include/asm/page_32_types.h | 1 - arch/x86/include/asm/page_64_types.h | 11 +- arch/x86/include/asm/thread_info.h | 2 +- arch/x86/kernel/cpu/common.c | 2 + arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/entry_64.S | 81 +++-------- arch/x86/kernel/traps.c | 71 +++++++--- arch/x86/mm/init_64.c | 11 +- drivers/clocksource/sun4i_timer.c | 10 +- drivers/gpu/drm/radeon/r600_dpm.c | 2 +- drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 ++ drivers/infiniband/ulp/isert/ib_isert.c | 44 ++++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++ drivers/input/joystick/xpad.c | 16 ++- drivers/input/mouse/synaptics.c | 212 +++++++++++++--------------- drivers/input/serio/i8042-x86ia64io.h | 15 ++ drivers/input/serio/i8042.c | 6 + drivers/input/serio/serio.c | 13 ++ drivers/net/can/dev.c | 2 +- drivers/net/can/usb/esd_usb2.c | 1 + drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 ++ drivers/net/wireless/ath/ath9k/hw.c | 13 -- drivers/net/wireless/rt2x00/rt2x00queue.c | 50 ++----- drivers/of/address.c | 19 ++- drivers/pci/msi.c | 37 ++++- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 + drivers/scsi/scsi_devinfo.c | 1 + drivers/spi/spi-dw.c | 6 +- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 + drivers/target/target_core_transport.c | 2 +- drivers/usb/core/quirks.c | 3 + drivers/usb/host/xhci-pci.c | 2 +- drivers/usb/host/xhci-plat.c | 10 +- drivers/usb/host/xhci-ring.c | 3 +- drivers/usb/host/xhci.c | 42 +++++- drivers/usb/host/xhci.h | 2 +- drivers/usb/serial/cp210x.c | 1 + drivers/usb/serial/ftdi_sio.c | 33 +++++ drivers/usb/serial/ftdi_sio_ids.h | 39 ++++- drivers/usb/serial/keyspan.c | 97 ++++++++----- drivers/usb/serial/ssu100.c | 11 +- drivers/vhost/scsi.c | 24 ++++ fs/aio.c | 21 ++- fs/locks.c | 24 +++- fs/nfsd/nfs4callback.c | 8 +- fs/nfsd/nfsd.h | 9 +- include/linux/iio/events.h | 2 +- include/linux/pci.h | 1 + include/linux/serio.h | 1 + include/sound/soc-dpcm.h | 2 + include/uapi/linux/input.h | 1 + kernel/events/uprobes.c | 1 - net/batman-adv/hard-interface.c | 2 +- net/ipv4/ping.c | 2 + sound/soc/codecs/sgtl5000.c | 3 +- sound/soc/codecs/sgtl5000.h | 2 +- sound/soc/codecs/wm_adsp.c | 1 + sound/soc/sh/fsi.c | 3 +- sound/soc/sh/rcar/core.c | 3 +- sound/soc/soc-pcm.c | 72 +++++++--- sound/usb/quirks.c | 14 ++ 71 files changed, 731 insertions(+), 444 deletions(-)
Signature · 1 line
2.1.3
PATCH 1/66 Input: serio - add firmware_id sysfs attribute
From: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0456c66f4e905e1ca839318219c770988b47975c upstream.
serio devices exposed via platform firmware interfaces such as ACPI may provide additional identifying information of use to userspace.
We don't associate the serio devices with the firmware device (we don't set it as parent), so there's no way for userspace to make use of this information.
We cannot change the parent for serio devices instantiated though a firmware interface as that would break suspend / resume ordering.
Therefore this patch adds a new firmware_id sysfs attribute so that userspace can get a string from there with any additional identifying information the firmware interface may provide.
--- drivers/input/serio/serio.c | 13 +++++++++++++ include/linux/serio.h | 1 + 2 files changed, 14 insertions(+)
drivers/input/serio/serio.c +13 -0
@@ -474,11 +474,19 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute *return retval; } +static ssize_t firmware_id_show (struct device *dev,struct device_attribute *attr,char *buf) +{ +struct serio *serio =to_serio_port (dev); + +return sprintf (buf,"%s\n" , serio->firmware_id); +} +static struct device_attribute serio_device_attrs[] = {__ATTR (description,S_IRUGO , serio_show_description,NULL ),__ATTR (modalias,S_IRUGO , serio_show_modalias,NULL ),__ATTR (drvctl,S_IWUSR ,NULL , serio_rebind_driver),__ATTR (bind_mode,S_IWUSR |S_IRUGO , serio_show_bind_mode, serio_set_bind_mode), +__ATTR (firmware_id,S_IRUGO , firmware_id_show,NULL ), __ATTR_NULL };
@@ -912,9 +920,14 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)SERIO_ADD_UEVENT_VAR ("SERIO_PROTO=%02x" , serio->id.proto);SERIO_ADD_UEVENT_VAR ("SERIO_ID=%02x" , serio->id.id);SERIO_ADD_UEVENT_VAR ("SERIO_EXTRA=%02x" , serio->id.extra); +SERIO_ADD_UEVENT_VAR ("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X" , serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); +if (serio->firmware_id[0 ]) +SERIO_ADD_UEVENT_VAR ("SERIO_FIRMWARE_ID=%s" , + serio->firmware_id); +return 0 ; }#undef SERIO_ADD_UEVENT_VAR
include/linux/serio.h +1 -0
@@ -23,6 +23,7 @@ struct serio {char name[32 ];char phys[32 ]; +char firmware_id[128 ];bool manual_bind;
Signature · 1 line
2.1.3
PATCH 2/66 Input: i8042 - add firmware_id support
From: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a7c5868c3482127cb308c779b8a6460a3353c17f upstream.
Fill in the new serio firmware_id sysfs attribute for pnp instantiated 8042 serio ports.
--- drivers/input/serio/i8042-x86ia64io.h | 15 +++++++++++++++ drivers/input/serio/i8042.c | 6 ++++++ 2 files changed, 21 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +15 -0
@@ -746,6 +746,17 @@ static int i8042_pnp_aux_irq;static char i8042_pnp_kbd_name[32 ];static char i8042_pnp_aux_name[32 ]; +static void i8042_pnp_id_to_string (struct pnp_id *id,char *dst,int dst_size) +{ +strlcpy (dst,"PNP:" , dst_size); + +while (id) { +strlcat (dst," " , dst_size); +strlcat (dst, id->id, dst_size); + id = id->next; + } +} +static int i8042_pnp_kbd_probe (struct pnp_dev *dev,const struct pnp_device_id *did) {if (pnp_port_valid (dev,0 ) &&pnp_port_len (dev,0 ) ==1 )
@@ -762,6 +773,8 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *strlcat (i8042_pnp_kbd_name,":" ,sizeof (i8042_pnp_kbd_name));strlcat (i8042_pnp_kbd_name,pnp_dev_name (dev),sizeof (i8042_pnp_kbd_name)); } +i8042_pnp_id_to_string (dev->id, i8042_kbd_firmware_id, +sizeof (i8042_kbd_firmware_id));/* Keyboard ports are always supposed to be wakeup-enabled */ device_set_wakeup_enable (&dev->dev, true);
@@ -786,6 +799,8 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *strlcat (i8042_pnp_aux_name,":" ,sizeof (i8042_pnp_aux_name));strlcat (i8042_pnp_aux_name,pnp_dev_name (dev),sizeof (i8042_pnp_aux_name)); } +i8042_pnp_id_to_string (dev->id, i8042_aux_firmware_id, +sizeof (i8042_aux_firmware_id)); i8042_pnp_aux_devices++;return 0 ;
drivers/input/serio/i8042.c +6 -0
@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");#endif static bool i8042_bypass_aux_irq_test; +static char i8042_kbd_firmware_id[128 ]; +static char i8042_aux_firmware_id[128 ];#include "i8042.h"
@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port(void) serio->dev.parent = &i8042_platform_device->dev;strlcpy (serio->name,"i8042 KBD port" ,sizeof (serio->name));strlcpy (serio->phys,I8042_KBD_PHYS_DESC ,sizeof (serio->phys)); +strlcpy (serio->firmware_id, i8042_kbd_firmware_id, +sizeof (serio->firmware_id)); port->serio = serio; port->irq =I8042_KBD_IRQ ;
@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port(int idx)if (idx <0 ) {strlcpy (serio->name,"i8042 AUX port" ,sizeof (serio->name));strlcpy (serio->phys,I8042_AUX_PHYS_DESC ,sizeof (serio->phys)); +strlcpy (serio->firmware_id, i8042_aux_firmware_id, +sizeof (serio->firmware_id)); serio->close = i8042_port_close; }else {snprintf (serio->name,sizeof (serio->name),"i8042 AUX%d port" , idx);
Signature · 1 line
2.1.3
PATCH 3/66 Input: Add INPUT_PROP_TOPBUTTONPAD device property
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f37c013409bb78ebb958821aa10d069e707cabac upstream.
On some newer laptops with a trackpoint the physical buttons for the trackpoint have been removed to allow for a larger touchpad. On these laptops the buttonpad has clearly marked areas on the top which are to be used as trackpad buttons.
Users of the event device-node need to know about this, so that they can properly interpret BTN_LEFT events as being a left / right / middle click depending on where on the button pad the clicking finger is.
This commits adds a INPUT_PROP_TOPBUTTONPAD device property which drivers for such buttonpads will use to signal to the user that this buttonpad not only has the normal bottom button area, but also a top button area.
--- include/uapi/linux/input.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input.h +1 -0
@@ -164,6 +164,7 @@ struct input_keymap_entry {#define INPUT_PROP_DIRECT 0x01/* direct input devices */ #define INPUT_PROP_BUTTONPAD 0x02/* has button(s) under pad */ #define INPUT_PROP_SEMI_MT 0x03/* touch rectangle only */ +#define INPUT_PROP_TOPBUTTONPAD 0x04/* softbuttons at top of pad */ #define INPUT_PROP_MAX 0x1f#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
Signature · 1 line
2.1.3
PATCH 4/66 Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 43e19888b1fe2a3e8a5543030c5b286cde38b3f5 upstream.
Check PNP ID of the PS/2 AUX port and report INPUT_PROP_TOPBUTTONPAD property for for touchpads with top button areas.
--- drivers/input/mouse/synaptics.c | 55 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-)
drivers/input/mouse/synaptics.c +53 -2
@@ -117,6 +117,44 @@ void synaptics_reset(struct psmouse *psmouse) }#ifdef CONFIG_MOUSE_PS2_SYNAPTICS +/* This list has been kindly provided by Synaptics. */ +static const char *const topbuttonpad_pnp_ids[] = { +"LEN0017" , +"LEN0018" , +"LEN0019" , +"LEN0023" , +"LEN002A" , +"LEN002B" , +"LEN002C" , +"LEN002D" , +"LEN002E" , +"LEN0033" ,/* Helix */ +"LEN0034" ,/* T431s, T540, X1 Carbon 2nd */ +"LEN0035" ,/* X240 */ +"LEN0036" ,/* T440 */ +"LEN0037" , +"LEN0038" , +"LEN0041" , +"LEN0042" ,/* Yoga */ +"LEN0045" , +"LEN0046" , +"LEN0047" , +"LEN0048" , +"LEN0049" , +"LEN2000" , +"LEN2001" , +"LEN2002" , +"LEN2003" , +"LEN2004" ,/* L440 */ +"LEN2005" , +"LEN2006" , +"LEN2007" , +"LEN2008" , +"LEN2009" , +"LEN200A" , +"LEN200B" , +NULL +};/***************************************************************************** * Synaptics communications functions
@@ -1291,8 +1329,10 @@ static void set_abs_position_params(struct input_dev *dev,input_abs_set_res (dev, y_code, priv->y_res); } -static void set_input_params (struct input_dev *dev,struct synaptics_data *priv) +static void set_input_params (struct psmouse *psmouse, +struct synaptics_data *priv) { +struct input_dev *dev = psmouse->dev;int i;/* Things that apply to both modes */
@@ -1361,6 +1401,17 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)if (SYN_CAP_CLICKPAD (priv->ext_cap_0c)) {__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +/* See if this buttonpad has a top button area */ +if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) { +for (i =0 ; topbuttonpad_pnp_ids[i]; i++) { +if (strstr (psmouse->ps2dev.serio->firmware_id, + topbuttonpad_pnp_ids[i])) { +__set_bit (INPUT_PROP_TOPBUTTONPAD , + dev->propbit); +break ; + } + } + }/* Clickpads report only left button */ __clear_bit (BTN_RIGHT , dev->keybit);__clear_bit (BTN_MIDDLE , dev->keybit);
@@ -1687,7 +1738,7 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) priv->capabilities, priv->ext_cap, priv->ext_cap_0c, priv->board_id, priv->firmware_id); -set_input_params (psmouse->dev, priv); +set_input_params (psmouse, priv);/* * Encode touchpad model so that it can be used to set
Signature · 1 line
2.1.3
PATCH 5/66 Input: synaptics - add a matches_pnp_id helper function
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e2f611029b370bb7a04236215ad4b36aa8cb98cd upstream.
This is a preparation patch for simplifying the min/max quirk table.
--- drivers/input/mouse/synaptics.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/input/mouse/synaptics.c +14 -11
@@ -156,6 +156,18 @@ static const char * const topbuttonpad_pnp_ids[] = { NULL }; +static bool matches_pnp_id (struct psmouse *psmouse,const char *const ids[]) +{ +int i; + +if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) +for (i =0 ; ids[i]; i++) +if (strstr (psmouse->ps2dev.serio->firmware_id, ids[i])) +return true; + +return false; +} +/***************************************************************************** * Synaptics communications functions ****************************************************************************/
@@ -1401,17 +1413,8 @@ static void set_input_params(struct psmouse *psmouse,if (SYN_CAP_CLICKPAD (priv->ext_cap_0c)) {__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); -/* See if this buttonpad has a top button area */ -if (!strncmp (psmouse->ps2dev.serio->firmware_id,"PNP:" ,4 )) { -for (i =0 ; topbuttonpad_pnp_ids[i]; i++) { -if (strstr (psmouse->ps2dev.serio->firmware_id, - topbuttonpad_pnp_ids[i])) { -__set_bit (INPUT_PROP_TOPBUTTONPAD , - dev->propbit); -break ; - } - } - } +if (matches_pnp_id (psmouse, topbuttonpad_pnp_ids)) +__set_bit (INPUT_PROP_TOPBUTTONPAD , dev->propbit);/* Clickpads report only left button */ __clear_bit (BTN_RIGHT , dev->keybit);__clear_bit (BTN_MIDDLE , dev->keybit);
Signature · 1 line
2.1.3
PATCH 6/66 Input: synaptics - change min/max quirk table to pnp-id matching
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0f68f39c393bc06ac5ccc8794f0e2ed841e41c3e upstream.
Most of the affected models share pnp-ids for the touchpad. So switching to pnp-ids give us 2 advantages:
1) It shrinks the quirk list
2) It will lower the new quirk addition frequency, ie the recently added W540 quirk would not have been necessary since it uses the same LEN0034 pnp ids as other models already added before it
As an added bonus it actually puts the quirk on the actual psmouse, rather then on the machine, which is technically more correct.
--- drivers/input/mouse/synaptics.c | 149 ++++++++++------------------------------ 1 file changed, 36 insertions(+), 113 deletions(-)
drivers/input/mouse/synaptics.c +36 -113
@@ -117,6 +117,31 @@ void synaptics_reset(struct psmouse *psmouse) }#ifdef CONFIG_MOUSE_PS2_SYNAPTICS +struct min_max_quirk { +const char *const *pnp_ids; +int x_min, x_max, y_min, y_max; +}; + +static const struct min_max_quirk min_max_pnpid_table[] = { + { + (const char *const []){"LEN0033" ,NULL }, +1024 ,5052 ,2258 ,4832 + }, + { + (const char *const []){"LEN0035" ,"LEN0042" ,NULL }, +1232 ,5710 ,1156 ,4696 + }, + { + (const char *const []){"LEN0034" ,"LEN0036" ,"LEN2004" ,NULL }, +1024 ,5112 ,2024 ,4832 + }, + { + (const char *const []){"LEN2001" ,NULL }, +1024 ,5022 ,2508 ,4832 + }, + { } +}; +/* This list has been kindly provided by Synaptics. */ static const char *const topbuttonpad_pnp_ids[] = { "LEN0017",
@@ -129,7 +154,7 @@ static const char * const topbuttonpad_pnp_ids[] = {"LEN002D" ,"LEN002E" ,"LEN0033" ,/* Helix */ -"LEN0034" ,/* T431s, T540, X1 Carbon 2nd */ +"LEN0034" ,/* T431s, L440, L540, T540, W540, X1 Carbon 2nd */ "LEN0035" ,/* X240 */ "LEN0036" ,/* T440 */ "LEN0037",
@@ -142,7 +167,7 @@ static const char * const topbuttonpad_pnp_ids[] = {"LEN0048" ,"LEN0049" ,"LEN2000" , -"LEN2001" , +"LEN2001" ,/* Edge E431 */ "LEN2002" ,"LEN2003" , "LEN2004", /* L440 */
@@ -316,20 +341,20 @@ static int synaptics_identify(struct psmouse *psmouse)* Resolution is left zero if touchpad does not support the query */ -static const int *quirk_min_max; -static int synaptics_resolution (struct psmouse *psmouse) {struct synaptics_data *priv = psmouse->private;unsigned char resp[3 ]; +int i; -if (quirk_min_max) { - priv->x_min = quirk_min_max[0 ]; - priv->x_max = quirk_min_max[1 ]; - priv->y_min = quirk_min_max[2 ]; - priv->y_max = quirk_min_max[3 ]; -return 0 ; - } +for (i =0 ; min_max_pnpid_table[i].pnp_ids; i++) +if (matches_pnp_id (psmouse, min_max_pnpid_table[i].pnp_ids)) { + priv->x_min = min_max_pnpid_table[i].x_min; + priv->x_max = min_max_pnpid_table[i].x_max; + priv->y_min = min_max_pnpid_table[i].y_min; + priv->y_max = min_max_pnpid_table[i].y_max; +return 0 ; + }if (SYN_ID_MAJOR (priv->identity) <4 )return 0 ;
@@ -1586,112 +1611,10 @@ static const struct dmi_system_id olpc_dmi_table[] __initconst = { { } }; -static const struct dmi_system_id min_max_dmi_table[]__initconst = { -#if defined(CONFIG_DMI) - { -/* Lenovo ThinkPad Helix */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad Helix" ), - }, - .driver_data = (int []){1024 ,5052 ,2258 ,4832 }, - }, - { -/* Lenovo ThinkPad X240 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad X240" ), - }, - .driver_data = (int []){1232 ,5710 ,1156 ,4696 }, - }, - { -/* Lenovo ThinkPad Edge E431 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad Edge E431" ), - }, - .driver_data = (int []){1024 ,5022 ,2508 ,4832 }, - }, - { -/* Lenovo ThinkPad T431s */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T431" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad T440s */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T440" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad L440 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad L440" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad T540p */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad L540 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad L540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo ThinkPad W540 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad W540" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, - { -/* Lenovo Yoga S1 */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_EXACT_MATCH (DMI_PRODUCT_VERSION , -"ThinkPad S1 Yoga" ), - }, - .driver_data = (int []){1232 ,5710 ,1156 ,4696 }, - }, - { -/* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), -DMI_MATCH (DMI_PRODUCT_VERSION , -"ThinkPad X1 Carbon 2nd" ), - }, - .driver_data = (int []){1024 ,5112 ,2024 ,4832 }, - }, -#endif - { } -}; -void __init synaptics_module_init (void ) { -const struct dmi_system_id *min_max_dmi; - impaired_toshiba_kbc =dmi_check_system (toshiba_dmi_table); broken_olpc_ec =dmi_check_system (olpc_dmi_table); - - min_max_dmi =dmi_first_match (min_max_dmi_table); -if (min_max_dmi) - quirk_min_max = min_max_dmi->driver_data; }static int __synaptics_init (struct psmouse *psmouse,bool absolute_mode)
Signature · 1 line
2.1.3
PATCH 7/66 Input: synaptics - fix resolution for manually provided min/max
In reply to Jiri SlabyFrom: Benjamin Tissoires <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d49cb7aeebb974713f9f7ab2991352d3050b095b upstream.
commit 421e08c41fda fixed the reported min/max for the X and Y axis, but unfortunately, it broke the resolution of those same axis.
On the t540p, the resolution is the same regarding X and Y. It is not a problem for xf86-input-synaptics because this driver is only interested in the ratio between X and Y.
Unfortunately, xf86-input-cmt uses directly the resolution, and having a null resolution leads to some divide by 0 errors, which are translated by -infinity in the resulting coordinates.
--- drivers/input/mouse/synaptics.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/input/mouse/synaptics.c +10 -9
@@ -347,15 +347,6 @@ static int synaptics_resolution(struct psmouse *psmouse)unsigned char resp[3 ];int i; -for (i =0 ; min_max_pnpid_table[i].pnp_ids; i++) -if (matches_pnp_id (psmouse, min_max_pnpid_table[i].pnp_ids)) { - priv->x_min = min_max_pnpid_table[i].x_min; - priv->x_max = min_max_pnpid_table[i].x_max; - priv->y_min = min_max_pnpid_table[i].y_min; - priv->y_max = min_max_pnpid_table[i].y_max; -return 0 ; - } -if (SYN_ID_MAJOR (priv->identity) <4 )return 0 ;
@@ -366,6 +357,16 @@ static int synaptics_resolution(struct psmouse *psmouse) } } +for (i =0 ; min_max_pnpid_table[i].pnp_ids; i++) { +if (matches_pnp_id (psmouse, min_max_pnpid_table[i].pnp_ids)) { + priv->x_min = min_max_pnpid_table[i].x_min; + priv->x_max = min_max_pnpid_table[i].x_max; + priv->y_min = min_max_pnpid_table[i].y_min; + priv->y_max = min_max_pnpid_table[i].y_max; +return 0 ; + } + } +if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=5 &&SYN_CAP_MAX_DIMENSIONS (priv->ext_cap_0c)) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_MAX_COORDS , resp)) {
Signature · 1 line
2.1.3
PATCH 8/66 Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531)
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e76aed9da7189eeb41b9856552ce5721181e8e8d upstream.
https://bugzilla.redhat.com/show_bug.cgi?id=1114768
--- drivers/input/mouse/synaptics.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/mouse/synaptics.c +3 -2
@@ -132,7 +132,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = {1232 ,5710 ,1156 ,4696 }, { - (const char *const []){"LEN0034" ,"LEN0036" ,"LEN2004" ,NULL }, + (const char *const []){"LEN0034" ,"LEN0036" ,"LEN2002" , +"LEN2004" ,NULL },1024 ,5112 ,2024 ,4832 }, {
@@ -168,7 +169,7 @@ static const char * const topbuttonpad_pnp_ids[] = {"LEN0049" ,"LEN2000" ,"LEN2001" ,/* Edge E431 */ -"LEN2002" , +"LEN2002" ,/* Edge E531 */ "LEN2003" ,"LEN2004" ,/* L440 */ "LEN2005",
Signature · 1 line
2.1.3
PATCH 9/66 Input: synaptics - add min/max quirk for Lenovo T440s
In reply to Jiri SlabyFrom: Takashi Iwai <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e4742b1e786ca386e88e6cfb2801e14e15e365cd upstream.
The new Lenovo T440s laptop has a different PnP ID "LEN0039", and it needs the similar min/max quirk to make its clickpad working.
--- drivers/input/mouse/synaptics.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/mouse/synaptics.c +3 -2
@@ -132,8 +132,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = {1232 ,5710 ,1156 ,4696 }, { - (const char *const []){"LEN0034" ,"LEN0036" ,"LEN2002" , -"LEN2004" ,NULL }, + (const char *const []){"LEN0034" ,"LEN0036" ,"LEN0039" , +"LEN2002" ,"LEN2004" ,NULL },1024 ,5112 ,2024 ,4832 }, {
@@ -160,6 +160,7 @@ static const char * const topbuttonpad_pnp_ids[] = {"LEN0036" ,/* T440 */ "LEN0037" ,"LEN0038" , +"LEN0039" ,/* T440s */ "LEN0041" ,"LEN0042" ,/* Yoga */ "LEN0045",
Signature · 1 line
2.1.3
PATCH 10/66 PCI/MSI: Return msix_capability_init() failure if populate_msi_sysfs() fails
In reply to Jiri SlabyFrom: Alexander Gordeev <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2adc7907bac2c72535894732c4b41f9210f9e577 upstream.
If populate_msi_sysfs() function failed msix_capability_init() must return the error code, but it returns the success instead. This update fixes the described misbehaviour.
--- drivers/pci/msi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/pci/msi.c +5 -6
@@ -719,7 +719,7 @@ static int msix_capability_init(struct pci_dev *dev, ret =arch_setup_msi_irqs (dev, nvec,PCI_CAP_ID_MSIX );if (ret) - goto error; + goto out_avail;/* * Some devices require MSI-X to be enabled before we can touch the
@@ -732,10 +732,8 @@ static int msix_capability_init(struct pci_dev *dev,msix_program_entries (dev, entries); ret =populate_msi_sysfs (dev); -if (ret) { - ret =0 ; - goto error; - } +if (ret) + goto out_free;/* Set MSI-X enabled bits and unmask the function */ pci_intx_for_msi (dev,0 );
@@ -746,7 +744,7 @@ static int msix_capability_init(struct pci_dev *dev,return 0 ; -error: +out_avail:if (ret <0 ) {/* * If we had some success, report the number of irqs
@@ -763,6 +761,7 @@ error: ret = avail; } +out_free:free_msi_irqs (dev);return ret;
Signature · 1 line
2.1.3
PATCH 11/66 MIPS: oprofile: Fix backtrace on 64-bit kernel
In reply to Jiri SlabyFrom: Aaro Koskinen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit bbaf113a481b6ce32444c125807ad3618643ce57 upstream.
Fix incorrect cast that always results in wrong address for the new frame on 64-bit kernels.
Patchwork: https://patchwork.linux-mips.org/patch/8110/
--- arch/mips/oprofile/backtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/oprofile/backtrace.c +1 -1
@@ -92,7 +92,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame,/* This marks the end of the previous function, which means we overran. */ break ; - stack_size = (unsigned ) stack_adjustment; + stack_size = (unsigned long ) stack_adjustment; }else if (is_ra_save_ins (&ip)) {int ra_slot = ip.i_format.simmediate;if (ra_slot <0 )
Signature · 1 line
2.1.3
PATCH 12/66 MIPS: Loongson: Make platform serial setup always built-in.
In reply to Jiri SlabyFrom: Aaro Koskinen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 26927f76499849e095714452b8a4e09350f6a3b9 upstream.
If SERIAL_8250 is compiled as a module, the platform specific setup for Loongson will be a module too, and it will not work very well. At least on Loongson 3 it will trigger a build failure, since loongson_sysconf is not exported to modules.
Fix by making the platform specific serial code always built-in.
Patchwork: https://patchwork.linux-mips.org/patch/8533/
--- arch/mips/loongson/common/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/loongson/common/Makefile +2 -1
@@ -11,7 +11,8 @@ obj-$(CONFIG_PCI) += pci.o # Serial port support # obj-$(CONFIG_EARLY_PRINTK) += early_printk.o -obj-$(CONFIG_SERIAL_8250) += serial.o +loongson-serial-$(CONFIG_SERIAL_8250) := serial.o +obj-y += $(loongson-serial-m) $(loongson-serial-y) obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
Signature · 1 line
2.1.3
PATCH 13/66 x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.
There's nothing special enough about the espfix64 double fault fixup to justify writing it in assembly. Move it to C.
This also fixes a bug: if the double fault came from an IST stack, the old asm code would return to a partially uninitialized stack frame.
--- arch/x86/kernel/entry_64.S | 34 ++-------------------------------- arch/x86/kernel/traps.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 32 deletions(-)
arch/x86/kernel/entry_64.S +2 -32
@@ -1053,6 +1053,7 @@ ENTRY(native_iret) jnz native_irq_return_ldt #endif +.global native_irq_return_iret native_irq_return_iret: iretq _ASM_EXTABLE(native_irq_return_iret, bad_iret)
@@ -1149,37 +1150,6 @@ ENTRY(retint_kernel) CFI_ENDPROC END(common_interrupt) - /* - * If IRET takes a fault on the espfix stack, then we - * end up promoting it to a doublefault. In that case, - * modify the stack to make it look like we just entered - * the #GP handler from user space, similar to bad_iret. - */ -#ifdef CONFIG_X86_ESPFIX64 - ALIGN -__do_double_fault: - XCPT_FRAME 1 RDI+8 - movq RSP(%rdi),%rax /* Trap on the espfix stack? */ - sarq $PGDIR_SHIFT,%rax - cmpl $ESPFIX_PGD_ENTRY,%eax - jne do_double_fault /* No, just deliver the fault */ - cmpl $__KERNEL_CS,CS(%rdi) - jne do_double_fault - movq RIP(%rdi),%rax - cmpq $native_irq_return_iret,%rax - jne do_double_fault /* This shouldn't happen... */ - movq PER_CPU_VAR(kernel_stack),%rax - subq $(6*8-KERNEL_STACK_OFFSET),%rax /* Reset to original stack */ - movq %rax,RSP(%rdi) - movq $0,(%rax) /* Missing (lost) #GP error code */ - movq $general_protection,RIP(%rdi) - retq - CFI_ENDPROC -END(__do_double_fault) -#else -# define __do_double_fault do_double_fault -#endif - /* * End of kprobes section */
@@ -1370,7 +1340,7 @@ zeroentry overflow do_overflow zeroentry bounds do_bounds zeroentry invalid_op do_invalid_op zeroentry device_not_available do_device_not_available -paranoiderrorentry double_fault __do_double_fault +paranoiderrorentry double_fault do_double_fault zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun errorentry invalid_TSS do_invalid_TSS errorentry segment_not_present do_segment_not_present
arch/x86/kernel/traps.c +24 -0
@@ -248,6 +248,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)static const char str[] ="double fault" ;struct task_struct *tsk = current; +#ifdef CONFIG_X86_ESPFIX64 +extern unsigned char native_irq_return_iret[]; + +/* +* If IRET takes a non-IST fault on the espfix64 stack, then we +* end up promoting it to a doublefault. In that case, modify +* the stack to make it look like we just entered the #GP +* handler from user space, similar to bad_iret. +*/ +if (((long )regs->sp >>PGDIR_SHIFT ) ==ESPFIX_PGD_ENTRY && + regs->cs == __KERNEL_CS && + regs->ip == (unsigned long )native_irq_return_iret) + { +struct pt_regs *normal_regs =task_pt_regs (current); + +/* Fake a #GP(0) from userspace. */ +memmove (&normal_regs->ip, (void *)regs->sp,5 *8 ); + normal_regs->orig_ax =0 ;/* Missing (lost) #GP error code */ + regs->ip = (unsigned long )general_protection; + regs->sp = (unsigned long )&normal_regs->orig_ax; +return ; + } +#endif +exception_enter ();/* Return not checked because double check cannot be ignored */ notify_die (DIE_TRAP , str, regs, error_code,X86_TRAP_DF ,SIGSEGV );
Signature · 1 line
2.1.3
PATCH 14/66 x86_64, traps: Stop using IST for #SS
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6f442be2fb22be02cafa606f1769fa1e6f894441 upstream.
On a 32-bit kernel, this has no effect, since there are no IST stacks.
On a 64-bit kernel, #SS can only happen in user code, on a failed iret to user space, a canonical violation on access via RSP or RBP, or a genuine stack segment violation in 32-bit kernel code. The first two cases don't need IST, and the latter two cases are unlikely fatal bugs, and promoting them to double faults would be fine.
This fixes a bug in which the espfix64 code mishandles a stack segment violation.
This saves 4k of memory per CPU and a tiny bit of code.
--- arch/x86/include/asm/page_32_types.h | 1 - arch/x86/include/asm/page_64_types.h | 11 +++++------ arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/entry_64.S | 2 +- arch/x86/kernel/traps.c | 18 +----------------- 5 files changed, 7 insertions(+), 26 deletions(-)
arch/x86/include/asm/page_32_types.h +0 -1
@@ -20,7 +20,6 @@#define THREAD_SIZE_ORDER 1#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) -#define STACKFAULT_STACK 0#define DOUBLEFAULT_STACK 1#define NMI_STACK 0#define DEBUG_STACK 0
arch/x86/include/asm/page_64_types.h +5 -6
@@ -14,12 +14,11 @@#define IRQ_STACK_ORDER 2#define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER) -#define STACKFAULT_STACK 1 -#define DOUBLEFAULT_STACK 2 -#define NMI_STACK 3 -#define DEBUG_STACK 4 -#define MCE_STACK 5 -#define N_EXCEPTION_STACKS 5/* hw limit: 7 */ +#define DOUBLEFAULT_STACK 1 +#define NMI_STACK 2 +#define DEBUG_STACK 3 +#define MCE_STACK 4 +#define N_EXCEPTION_STACKS 4/* hw limit: 7 */ #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
arch/x86/kernel/dumpstack_64.c +0 -1
@@ -24,7 +24,6 @@ static char x86_stack_ids[][8] = { [ DEBUG_STACK-1 ] = "#DB", [ NMI_STACK-1 ] = "NMI", [ DOUBLEFAULT_STACK-1 ] = "#DF", - [ STACKFAULT_STACK-1 ] = "#SS", [ MCE_STACK-1 ] = "#MC", #if DEBUG_STKSZ > EXCEPTION_STKSZ [ N_EXCEPTION_STACKS ...
arch/x86/kernel/entry_64.S +1 -1
@@ -1510,7 +1510,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \ paranoidzeroentry_ist debug do_debug DEBUG_STACK paranoidzeroentry_ist int3 do_int3 DEBUG_STACK -paranoiderrorentry stack_segment do_stack_segment +errorentry stack_segment do_stack_segment #ifdef CONFIG_XEN zeroentry xen_debug do_debug zeroentry xen_int3 do_int3
arch/x86/kernel/traps.c +1 -17
@@ -221,28 +221,12 @@ DO_ERROR(X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun) DO_ERROR(X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS) DO_ERROR(X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present) -#ifdef CONFIG_X86_32 DO_ERROR(X86_TRAP_SS, SIGBUS, "stack segment", stack_segment) -#endif DO_ERROR_INFO(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) #ifdef CONFIG_X86_64 /* Runs on IST stack */ -dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code) -{ -enum ctx_state prev_state; - - prev_state =exception_enter (); -if (notify_die (DIE_TRAP ,"stack segment" , regs, error_code, -X86_TRAP_SS ,SIGBUS ) !=NOTIFY_STOP ) { -preempt_conditional_sti (regs); -do_trap (X86_TRAP_SS ,SIGBUS ,"stack segment" , regs, error_code,NULL ); -preempt_conditional_cli (regs); - } -exception_exit (prev_state); -} - dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) { static const char str[] = "double fault";
@@ -776,7 +760,7 @@ void __init trap_init(void)set_intr_gate (X86_TRAP_OLD_MF , &coprocessor_segment_overrun);set_intr_gate (X86_TRAP_TS , &invalid_TSS);set_intr_gate (X86_TRAP_NP , &segment_not_present); -set_intr_gate_ist (X86_TRAP_SS , &stack_segment,STACKFAULT_STACK ); +set_intr_gate (X86_TRAP_SS , stack_segment);set_intr_gate (X86_TRAP_GP , &general_protection);set_intr_gate (X86_TRAP_SPURIOUS , &spurious_interrupt_bug);set_intr_gate (X86_TRAP_MF , &coprocessor_error);
Signature · 1 line
2.1.3
Re: [PATCH 3.12 14/66] x86_64, traps: Stop using IST for #SS
Quoted 126 lines · Jiri Slaby
From: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit
6f442be2fb22be02cafa606f1769fa1e6f894441upstream.On a 32-bit kernel, this has no effect, since there are no IST stacks.
On a 64-bit kernel, #SS can only happen in user code, on a failed iret to user space, a canonical violation on access via RSP or RBP, or a genuine stack segment violation in 32-bit kernel code. The first two cases don't need IST, and the latter two cases are unlikely fatal bugs, and promoting them to double faults would be fine.
This fixes a bug in which the espfix64 code mishandles a stack segment violation.
This saves 4k of memory per CPU and a tiny bit of code.
Signed-off-by Andy Lutomirski <[email protected]>Reviewed-by Thomas Gleixner <[email protected]>Signed-off-by Linus Torvalds <[email protected]>Signed-off-by Jiri Slaby <[email protected]>--- arch/x86/include/asm/page_32_types.h | 1 - arch/x86/include/asm/page_64_types.h | 11 +++++------ arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/entry_64.S | 2 +- arch/x86/kernel/traps.c | 18 +----------------- 5 files changed, 7 insertions(+), 26 deletions(-)arch/x86/include/asm/page_32_types.h +0
-1@@ -20,7 +20,6 @@#define THREAD_SIZE_ORDER 1#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) -#define STACKFAULT_STACK 0#define DOUBLEFAULT_STACK 1#define NMI_STACK 0#define DEBUG_STACK 0arch/x86/include/asm/page_64_types.h +5
-6@@ -14,12 +14,11 @@#define IRQ_STACK_ORDER 2#define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER) -#define STACKFAULT_STACK 1 -#define DOUBLEFAULT_STACK 2 -#define NMI_STACK 3 -#define DEBUG_STACK 4 -#define MCE_STACK 5 -#define N_EXCEPTION_STACKS 5/* hw limit: 7 */ +#define DOUBLEFAULT_STACK 1 +#define NMI_STACK 2 +#define DEBUG_STACK 3 +#define MCE_STACK 4 +#define N_EXCEPTION_STACKS 4/* hw limit: 7 */ #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))arch/x86/kernel/dumpstack_64.c +0
-1@@ -24,7 +24,6 @@ static char x86_stack_ids[][8] = { [ DEBUG_STACK-1 ] = "#DB", [ NMI_STACK-1 ] = "NMI", [ DOUBLEFAULT_STACK-1 ] = "#DF", - [ STACKFAULT_STACK-1 ] = "#SS", [ MCE_STACK-1 ] = "#MC", #if DEBUG_STKSZ > EXCEPTION_STKSZ [ N_EXCEPTION_STACKS ...arch/x86/kernel/entry_64.S +1
-1@@ -1510,7 +1510,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \ paranoidzeroentry_ist debug do_debug DEBUG_STACK paranoidzeroentry_ist int3 do_int3 DEBUG_STACK -paranoiderrorentry stack_segment do_stack_segment +errorentry stack_segment do_stack_segment #ifdef CONFIG_XEN zeroentry xen_debug do_debug zeroentry xen_int3 do_int3arch/x86/kernel/traps.c +0
-16@@ -221,28 +221,12 @@ DO_ERROR(X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun) DO_ERROR(X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS) DO_ERROR(X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present) -#ifdef CONFIG_X86_32 DO_ERROR(X86_TRAP_SS, SIGBUS, "stack segment", stack_segment) -#endif DO_ERROR_INFO(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) #ifdef CONFIG_X86_64 /* Runs on IST stack */ -dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code) -{ -enum ctx_state prev_state; - - prev_state =exception_enter (); -if (notify_die (DIE_TRAP ,"stack segment" , regs, error_code, -X86_TRAP_SS ,SIGBUS ) !=NOTIFY_STOP ) { -preempt_conditional_sti (regs); -do_trap (X86_TRAP_SS ,SIGBUS ,"stack segment" , regs, error_code,NULL ); -preempt_conditional_cli (regs); - } -exception_exit (prev_state); -} - dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) { static const char str[] = "double fault";
arch/x86/kernel/traps.c void __init trap_init(void) · line 763
Quoted 5 lines
arch/x86/kernel/traps.c +1
-1@@ -776,7 +760,7 @@ void __init trap_init(void)set_intr_gate (X86_TRAP_OLD_MF , &coprocessor_segment_overrun);set_intr_gate (X86_TRAP_TS , &invalid_TSS);set_intr_gate (X86_TRAP_NP , &segment_not_present); -set_intr_gate_ist (X86_TRAP_SS , &stack_segment,STACKFAULT_STACK ); +set_intr_gate (X86_TRAP_SS , stack_segment);
I guess this should say "&stack_segment" in order for it to be consistent with the rest of the set_intr_gate() calls here.
Fortunately, this is not an issue as function designators are automatically promoted to function pointers, as the identical asm shows:
.loc 1 792 0
movq $stack_segment, %rsi #,
movl $12, %edi #,
call set_intr_gate #
.loc 1 792 0
movq $stack_segment, %rsi #,
movl $12, %edi #,
call set_intr_gate #
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--PATCH 15/66 x86_64, traps: Rework bad_iret
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b645af2d5905c4e32399005b867987919cbfc3ae upstream.
It's possible for iretq to userspace to fail. This can happen because of a bad CS, SS, or RIP.
Historically, we've handled it by fixing up an exception from iretq to land at bad_iret, which pretends that the failed iret frame was really the hardware part of #GP(0) from userspace. To make this work, there's an extra fixup to fudge the gs base into a usable state.
This is suboptimal because it loses the original exception. It's also buggy because there's no guarantee that we were on the kernel stack to begin with. For example, if the failing iret happened on return from an NMI, then we'll end up executing general_protection on the NMI stack. This is bad for several reasons, the most immediate of which is that general_protection, as a non-paranoid idtentry, will try to deliver signals and/or schedule from the wrong stack.
This patch throws out bad_iret entirely. As a replacement, it augments the existing swapgs fudge into a full-blown iret fixup, mostly written in C. It's should be clearer and more correct.
--- arch/x86/kernel/entry_64.S | 45 +++++++++++++++++++-------------------------- arch/x86/kernel/traps.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 26 deletions(-)
arch/x86/kernel/entry_64.S +19 -26
@@ -1055,8 +1055,13 @@ ENTRY(native_iret) .global native_irq_return_iret native_irq_return_iret: + /* + * This may fault. Non-paranoid faults on return to userspace are + * handled by fixup_bad_iret. These include #SS, #GP, and #NP. + * Double-faults due to espfix64 are handled in do_double_fault. + * Other faults here are fatal. + */ iretq - _ASM_EXTABLE(native_irq_return_iret, bad_iret) #ifdef CONFIG_X86_ESPFIX64 native_irq_return_ldt:
@@ -1084,25 +1089,6 @@ native_irq_return_ldt: jmp native_irq_return_iret #endif - .section .fixup,"ax" -bad_iret: - /* - * The iret traps when the %cs or %ss being restored is bogus. - * We've lost the original trap vector and error code. - * #GPF is the most likely one to get for an invalid selector. - * So pretend we completed the iret and took the #GPF in user mode. - * - * We are now running with the kernel GS after exception recovery. - * But error_entry expects us to have user GS to match the user %cs, - * so swap back. - */ - pushq $0 - - SWAPGS - jmp general_protection - - .previous - /* edi: workmask, edx: work */ retint_careful: CFI_RESTORE_STATE
@@ -1620,16 +1606,15 @@ error_sti: /* * There are two places in the kernel that can potentially fault with - * usergs. Handle them here. The exception handlers after iret run with - * kernel gs again, so don't set the user space flag. B stepping K8s - * sometimes report an truncated RIP for IRET exceptions returning to - * compat mode. Check for these here too. + * usergs. Handle them here. B stepping K8s sometimes report a + * truncated RIP for IRET exceptions returning to compat mode. Check + * for these here too. */ error_kernelspace: incl %ebx leaq native_irq_return_iret(%rip),%rcx cmpq %rcx,RIP+8(%rsp) - je error_swapgs + je error_bad_iret movl %ecx,%eax /* zero extend */ cmpq %rax,RIP+8(%rsp) je bstep_iret
@@ -1640,7 +1625,15 @@ error_kernelspace: bstep_iret: /* Fix truncated RIP */ movq %rcx,RIP+8(%rsp) - jmp error_swapgs + /* fall through */ + +error_bad_iret: + SWAPGS + mov %rsp,%rdi + call fixup_bad_iret + mov %rax,%rsp + decl %ebx /* Return to usergs */ + jmp error_sti CFI_ENDPROC END(error_entry)
arch/x86/kernel/traps.c +29 -0
@@ -388,6 +388,35 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) *regs = *eregs;return regs; } + +struct bad_iret_stack { +void *error_entry_ret; +struct pt_regs regs; +}; + +asmlinkage __visible +struct bad_iret_stack *fixup_bad_iret (struct bad_iret_stack *s) +{ +/* +* This is called from entry_64.S early in handling a fault +* caused by a bad iret to user mode. To handle the fault +* correctly, we want move our stack frame to task_pt_regs +* and we want to pretend that the exception came from the +* iret target. +*/ +struct bad_iret_stack *new_stack = +container_of (task_pt_regs (current), + struct bad_iret_stack, regs); + +/* Copy the IRET target to the new stack. */ +memmove (&new_stack->regs.ip, (void *)s->regs.sp,5 *8 ); + +/* Copy the remainder of the stack from the current stack. */ + memmove(new_stack, s, offsetof(struct bad_iret_stack, regs.ip)); + +BUG_ON (!user_mode_vm (&new_stack->regs)); +return new_stack; +}#endif /*
Signature · 1 line
2.1.3
PATCH 16/66 x86: Require exact match for 'noxsave' command line option
In reply to Jiri SlabyFrom: Dave Hansen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2cd3949f702692cf4c5d05b463f19cd706a92dd3 upstream.
We have some very similarly named command-line options:
arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup); arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup); arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);
__setup() is designed to match options that take arguments, like "foo=bar" where you would have:
__setup("foo", x86_foo_func...);The problem is that "noxsave" actually _matches_ "noxsaves" in the same way that "foo" matches "foo=bar". If you boot an old kernel that does not know about "noxsaves" with "noxsaves" on the command line, it will interpret the argument as "noxsave", which is not what you want at all.
This makes the "noxsave" handler only return success when it finds an *exact* match.
[ tglx: We really need to make __setup() more robust. ]
--- arch/x86/kernel/cpu/common.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/common.c +2 -0
@@ -144,6 +144,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);static int __init x86_xsave_setup (char *s) { +if (strlen (s)) +return 0 ;setup_clear_cpu_cap (X86_FEATURE_XSAVE );setup_clear_cpu_cap (X86_FEATURE_XSAVEOPT );setup_clear_cpu_cap (X86_FEATURE_AVX );
Signature · 1 line
2.1.3
PATCH 17/66 x86, mm: Set NX across entire PMD at boot
In reply to Jiri SlabyFrom: Kees Cook <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 45e2a9d4701d8c624d4a4bcdd1084eae31e92f58 upstream.
When setting up permissions on kernel memory at boot, the end of the PMD that was split from bss remained executable. It should be NX like the rest. This performs a PMD alignment instead of a PAGE alignment to get the correct span of memory.
Before:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte 0xffffffff82200000-0xffffffff82c00000 10M RW PSE GLB NX pmd 0xffffffff82c00000-0xffffffff82df5000 2004K RW GLB NX pte 0xffffffff82df5000-0xffffffff82e00000 44K RW GLB x pte
0xffffffff82e00000-0xffffffffc0000000 978M pmd
After:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte
0xffffffff82200000-0xffffffff82e00000 12M RW PSE GLB NX pmd
0xffffffff82e00000-0xffffffffc0000000 978M pmd
[ tglx: Changed it to roundup(_brk_end, PMD_SIZE) and added a comment.
We really should unmap the reminder along with the holes caused by init,initdata etc. but thats a different issue ]
--- arch/x86/mm/init_64.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/mm/init_64.c +10 -1
@@ -1110,7 +1110,7 @@ void mark_rodata_ro(void)unsigned long end = (unsigned long ) &__end_rodata_hpage_align;unsigned long text_end =PFN_ALIGN (&__stop___ex_table);unsigned long rodata_end =PFN_ALIGN (&__end_rodata); -unsigned long all_end =PFN_ALIGN (&_end); +unsigned long all_end;printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n" , (end - start) >>10 );
@@ -1121,7 +1121,16 @@ void mark_rodata_ro(void)/* * The rodata/data/bss/brk section (but not the kernel text!) * should also be not-executable. +* +* We align all_end to PMD_SIZE because the existing mapping +* is a full PMD. If we would align _brk_end to PAGE_SIZE we +* split the PMD and the reminder between _brk_end and the end +* of the PMD will remain mapped executable. +* +* Any PMD which was setup after the one which covers _brk_end +* has been zapped already via cleanup_highmem(). */ + all_end =roundup ((unsigned long )_brk_end,PMD_SIZE );set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT );rodata_test ();
Signature · 1 line
2.1.3
PATCH 18/66 uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
In reply to Jiri SlabyFrom: Andy Lutomirski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 82975bc6a6df743b9a01810fb32cb65d0ec5d60b upstream.
x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set but not on non-paranoid returns. I suspect that this is a mistake and that the code only works because int3 is paranoid.
Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a workaround for the x86 bug. With that bug fixed, we can remove _TIF_NOTIFY_RESUME from the uprobes code.
--- arch/x86/include/asm/thread_info.h | 2 +- kernel/events/uprobes.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
arch/x86/include/asm/thread_info.h +1 -1
@@ -145,7 +145,7 @@ struct thread_info {/* Only used for 64 bit */ #define _TIF_DO_NOTIFY_MASK \ (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \ - _TIF_USER_RETURN_NOTIFY) + _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)/* flags to check in __switch_to() */ #define _TIF_WORK_CTXSW \
kernel/events/uprobes.c +0 -1
@@ -1511,7 +1511,6 @@ bool uprobe_deny_signal(void)if (__fatal_signal_pending (t) ||arch_uprobe_xol_was_trapped (t)) { utask->state =UTASK_SSTEP_TRAPPED ;set_tsk_thread_flag (t,TIF_UPROBE ); -set_tsk_thread_flag (t,TIF_NOTIFY_RESUME ); } }
Signature · 1 line
2.1.3
PATCH 19/66 PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
In reply to Jiri SlabyFrom: Benjamin Herrenschmidt <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f144d1496b47e7450f41b767d0d91c724c2198bc upstream.
This can be set by quirks/drivers to be used by the architecture code that assigns the MSI addresses.
We additionally add verification in the core MSI code that the values assigned by the architecture do satisfy the limitation in order to fail gracefully if they don't (ie. the arch hasn't been updated to deal with that quirk yet).
--- drivers/pci/msi.c | 26 ++++++++++++++++++++++++++ include/linux/pci.h | 1 + 2 files changed, 27 insertions(+)
drivers/pci/msi.c +26 -0
@@ -553,6 +553,20 @@ out_unroll:return ret; } +static int msi_verify_entries (struct pci_dev *dev) +{ +struct msi_desc *entry; + +list_for_each_entry (entry, &dev->msi_list, list) { +if (!dev->no_64bit_msi || !entry->msg.address_hi) +continue ; +dev_err (&dev->dev,"Device has broken 64-bit MSI but arch" +" tried to assign one above 4G\n" ); +return -EIO ; + } +return 0 ; +} +/** * msi_capability_init - configure device's MSI capability structure * @dev: pointer to the pci_dev data structure of MSI device function
@@ -606,6 +620,13 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)return ret; } + ret =msi_verify_entries (dev); +if (ret) { +msi_mask_irq (entry, mask, ~mask); +free_msi_irqs (dev); +return ret; + } + ret =populate_msi_sysfs (dev);if (ret) {msi_mask_irq (entry, mask, ~mask);
@@ -721,6 +742,11 @@ static int msix_capability_init(struct pci_dev *dev,if (ret) goto out_avail; +/* Check if all MSI entries honor device restrictions */ + ret =msi_verify_entries (dev); +if (ret) + goto out_free; +/* * Some devices require MSI-X to be enabled before we can touch the * MSI-X registers. We need to mask all the vectors to prevent
include/linux/pci.h +1 -0
@@ -323,6 +323,7 @@ struct pci_dev { unsigned int is_added:1; unsigned int is_busmaster:1; /* device is busmaster */ unsigned int no_msi:1; /* device may not use msi */ + unsigned int no_64bit_msi:1; /* device may only use 32-bit MSIs */ unsigned int block_cfg_access:1; /* config space access is blocked */ unsigned int broken_parity_status:1; /* Device generates false positive parity */ unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
Signature · 1 line
2.1.3
PATCH 20/66 clockevent: sun4i: Fix race condition in the probe code
In reply to Jiri SlabyFrom: Maxime Ripard <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6bab4a8a1888729f17f4923cc5867e4674f66333 upstream.
The interrupts were activated and the handler registered before the clockevent was registered in the probe function.
The interrupt handler, however, was making the assumption that the clockevent device was registered.
That could cause a null pointer dereference if the timer interrupt was firing during this narrow window.
Fix that by moving the clockevent registration before the interrupt is enabled.
--- drivers/clocksource/sun4i_timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/clocksource/sun4i_timer.c +5 -5
@@ -177,6 +177,11 @@ static void __init sun4i_timer_init(struct device_node *node)writel (TIMER_CTL_CLK_SRC (TIMER_CTL_CLK_SRC_OSC24M ), timer_base +TIMER_CTL_REG (0 )); + sun4i_clockevent.cpumask =cpumask_of (0 ); + +clockevents_config_and_register (&sun4i_clockevent, rate,0x1 , +0xffffffff ); + ret =setup_irq (irq, &sun4i_timer_irq);if (ret)pr_warn ("failed to setup irq %d\n" , irq);
@@ -184,11 +189,6 @@ static void __init sun4i_timer_init(struct device_node *node)/* Enable timer0 interrupt */ val =readl (timer_base +TIMER_IRQ_EN_REG );writel (val |TIMER_IRQ_EN (0 ), timer_base +TIMER_IRQ_EN_REG ); - - sun4i_clockevent.cpumask =cpumask_of (0 ); - -clockevents_config_and_register (&sun4i_clockevent, rate,0x1 , -0xffffffff ); }CLOCKSOURCE_OF_DECLARE (sun4i,"allwinner,sun4i-timer" , sun4i_timer_init);
Signature · 1 line
2.1.3
PATCH 21/66 IB/isert: Adjust CQ size to HW limits
In reply to Jiri SlabyFrom: Chris Moore <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b1a5ad006b34ded9dc7ec64988deba1b3ecad367 upstream.
isert has an issue of trying to create a CQ with more CQEs than are supported by the hardware, that currently results in failures during isert_device creation during first session login.
This is the isert version of the patch that Minh Tran submitted for iser, and is simple a workaround required to function with existing ocrdma hardware.
--- drivers/infiniband/ulp/isert/ib_isert.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +6 -2
@@ -219,12 +219,16 @@ isert_create_device_ib_res(struct isert_device *device)struct isert_cq_desc *cq_desc;struct ib_device_attr *dev_attr;int ret =0 , i, j; +int max_rx_cqe, max_tx_cqe; dev_attr = &device->dev_attr; ret =isert_query_device (ib_dev, dev_attr);if (ret)return ret; + max_rx_cqe =min (ISER_MAX_RX_CQ_LEN , dev_attr->max_cqe); + max_tx_cqe =min (ISER_MAX_TX_CQ_LEN , dev_attr->max_cqe); +/* asign function handlers */ if (dev_attr->device_cap_flags &IB_DEVICE_MEM_MGT_EXTENSIONS ) { device->use_frwr =1 ;
@@ -266,7 +270,7 @@ isert_create_device_ib_res(struct isert_device *device) isert_cq_rx_callback, isert_cq_event_callback, (void *)&cq_desc[i], - ISER_MAX_RX_CQ_LEN, i); + max_rx_cqe, i);if (IS_ERR (device->dev_rx_cq[i])) { ret =PTR_ERR (device->dev_rx_cq[i]); device->dev_rx_cq[i] =NULL ;
@@ -278,7 +282,7 @@ isert_create_device_ib_res(struct isert_device *device) isert_cq_tx_callback, isert_cq_event_callback, (void *)&cq_desc[i], - ISER_MAX_TX_CQ_LEN, i); + max_tx_cqe, i);if (IS_ERR (device->dev_tx_cq[i])) { ret =PTR_ERR (device->dev_tx_cq[i]); device->dev_tx_cq[i] =NULL ;
Signature · 1 line
2.1.3
PATCH 22/66 ib_isert: Add max_send_sge=2 minimum for control PDU responses
In reply to Jiri SlabyFrom: Or Gerlitz <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f57915cfa5b2b14c1cffa2e83c034f55e3f0e70d upstream.
This patch adds a max_send_sge=2 minimum in isert_conn_setup_qp() to ensure outgoing control PDU responses with tx_desc->num_sge=2 are able to function correctly.
This addresses a bug with RDMA hardware using dev_attr.max_sge=3, that in the original code with the ConnectX-2 work-around would result in isert_conn->max_sge=1 being negotiated.
Originally reported by Chris with ocrdma driver.
--- drivers/infiniband/ulp/isert/ib_isert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +5 -2
@@ -111,9 +111,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) attr.cap.max_recv_wr =ISERT_QP_MAX_RECV_DTOS ;/* * FIXME: Use devattr.max_sge - 2 for max_send_sge as -* work-around for RDMA_READ.. +* work-around for RDMA_READs with ConnectX-2. +* +* Also, still make sure to have at least two SGEs for +* outgoing control PDU responses. */ - attr.cap.max_send_sge = device->dev_attr.max_sge -2 ; + attr.cap.max_send_sge =max (2 , device->dev_attr.max_sge -2 ); isert_conn->max_sge = attr.cap.max_send_sge; attr.cap.max_recv_sge =1 ;
Signature · 1 line
2.1.3
PATCH 23/66 ASoC: rsnd: remove unsupported PAUSE flag
In reply to Jiri SlabyFrom: Kuninori Morimoto <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 706c66213e5e623e23f521b1acbd8171af7a3549 upstream.
R-Car sound doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info
--- sound/soc/sh/rcar/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +1 -2
@@ -662,8 +662,7 @@ static void rsnd_dai_remove(struct platform_device *pdev,static struct snd_pcm_hardware rsnd_pcm_hardware = { .info =SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_MMAP | -SNDRV_PCM_INFO_MMAP_VALID | -SNDRV_PCM_INFO_PAUSE , +SNDRV_PCM_INFO_MMAP_VALID , .formats =RSND_FMTS , .rates =RSND_RATES , .rate_min =8000 ,
Signature · 1 line
2.1.3
PATCH 24/66 ASoC: fsi: remove unsupported PAUSE flag
In reply to Jiri SlabyFrom: Kuninori Morimoto <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c1b9b9b1ad2df6144ca3fbe6989f7bd9ea5c5562 upstream.
FSI doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info
--- sound/soc/sh/fsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/sh/fsi.c +1 -2
@@ -1775,8 +1775,7 @@ static const struct snd_soc_dai_ops fsi_dai_ops = {static struct snd_pcm_hardware fsi_pcm_hardware = { .info =SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_MMAP | -SNDRV_PCM_INFO_MMAP_VALID | -SNDRV_PCM_INFO_PAUSE , +SNDRV_PCM_INFO_MMAP_VALID , .formats =FSI_FMTS , .rates =FSI_RATES , .rate_min =8000 ,
Signature · 1 line
2.1.3
PATCH 25/66 ASoC: sgtl5000: Fix SMALL_POP bit definition
In reply to Jiri SlabyFrom: Fabio Estevam <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c251ea7bd7a04f1f2575467e0de76e803cf59149 upstream.
On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound to happen 5 seconds after the end of a playback.
The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not bit 1.
Fix the definition accordingly and enable the bit as intended per the code comment.
After applying this change, no loud 'click' sound is heard after playback
--- sound/soc/codecs/sgtl5000.c | 3 +-- sound/soc/codecs/sgtl5000.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
sound/soc/codecs/sgtl5000.c +1 -2
@@ -1398,8 +1398,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)/* enable small pop, introduce 400ms delay in turning off */ snd_soc_update_bits (codec,SGTL5000_CHIP_REF_CTRL , -SGTL5000_SMALL_POP , -SGTL5000_SMALL_POP ); +SGTL5000_SMALL_POP ,1 );/* disable short cut detector */ snd_soc_write (codec,SGTL5000_CHIP_SHORT_CTRL ,0 );
sound/soc/codecs/sgtl5000.h +1 -1
@@ -275,7 +275,7 @@#define SGTL5000_BIAS_CTRL_MASK 0x000e#define SGTL5000_BIAS_CTRL_SHIFT 1#define SGTL5000_BIAS_CTRL_WIDTH 3 -#define SGTL5000_SMALL_POP 0x0001 +#define SGTL5000_SMALL_POP 0/* * SGTL5000_CHIP_MIC_CTRL
Signature · 1 line
2.1.3
PATCH 26/66 ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use
In reply to Jiri SlabyFrom: Charles Keepax <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 9da7a5a9fdeeb76b2243f6b473363a7e6147ab6f upstream.
We should not free any buffers associated with writing out coefficients to the DSP until all the async writes have completed. This patch updates the out of memory path when allocating a new buffer to include a call to regmap_async_complete.
--- sound/soc/codecs/wm_adsp.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/wm_adsp.c +1 -0
@@ -1341,6 +1341,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp) file, blocks, pos - firmware->size); out_fw: +regmap_async_complete (regmap);release_firmware (firmware);wm_adsp_buf_free (&buf_list); out:
Signature · 1 line
2.1.3
PATCH 27/66 ASoC: dpcm: Fix race between FE/BE updates and trigger
In reply to Jiri SlabyFrom: Takashi Iwai <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ea9d0d771fcd32cd56070819749477d511ec9117 upstream.
DPCM can update the FE/BE connection states totally asynchronously from the FE's PCM state. Most of FE/BE state changes are protected by mutex, so that they won't race, but there are still some actions that are uncovered. For example, suppose to switch a BE while a FE's stream is running. This would call soc_dpcm_runtime_update(), which sets FE's runtime_update flag, then sets up and starts BEs, and clears FE's runtime_update flag again.
When a device emits XRUN during this operation, the PCM core triggers snd_pcm_stop(XRUN). Since the trigger action is an atomic ops, this isn't blocked by the mutex, thus it kicks off DPCM's trigger action. It eventually updates and clears FE's runtime_update flag while soc_dpcm_runtime_update() is running concurrently, and it results in confusion.
Usually, for avoiding such a race, we take a lock. There is a PCM stream lock for that purpose. However, as already mentioned, the trigger action is atomic, and we can't take the lock for the whole soc_dpcm_runtime_update() or other operations that include the lengthy jobs like hw_params or prepare.
This patch provides an alternative solution. This adds a way to defer the conflicting trigger callback to be executed at the end of FE/BE state changes. For doing it, two things are introduced:
- Each runtime_update state change of FEs is protected via PCM stream lock.
- The FE's trigger callback checks the runtime_update flag. If it's not set, the trigger action is executed there. If set, mark the pending trigger action and returns immediately.
- At the exit of runtime_update state change, it checks whether the pending trigger is present. If yes, it executes the trigger action at this point.
--- include/sound/soc-dpcm.h | 2 ++ sound/soc/soc-pcm.c | 72 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 58 insertions(+), 16 deletions(-)
include/sound/soc-dpcm.h +2 -0
@@ -101,6 +101,8 @@ struct snd_soc_dpcm_runtime {/* state and update */ enum snd_soc_dpcm_update runtime_update;enum snd_soc_dpcm_state state; + +int trigger_pending;/* trigger cmd + 1 if pending, 0 if not */ };/* can this BE stop and free */
sound/soc/soc-pcm.c +56 -16
173 lines not on this page · raw message
Signature · 1 line
2.1.3
PATCH 28/66 ath9k: Fix RTC_DERIVED_CLK usage
In reply to Jiri SlabyFrom: Miaoqing Pan <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4e6ce4dc7ce71d0886908d55129d5d6482a27ff9 upstream.
Based on the reference clock, which could be 25MHz or 40MHz, AR_RTC_DERIVED_CLK is programmed differently for AR9340 and AR9550. But, when a chip reset is done, processing the initvals sets the register back to the default value.
Fix this by moving the code in ath9k_hw_init_pll() to ar9003_hw_override_ini(). Also, do this override for AR9531.
js: remove AR_SREV_9531 test as 9531 support is not in 3.12 yet
--- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 +++++++++++++ drivers/net/wireless/ath/ath9k/hw.c | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_phy.c +13 -0
@@ -648,6 +648,19 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)else ah->enabled_cals &= ~TX_CL_CAL ; } + +if (AR_SREV_9340 (ah) ||AR_SREV_9550 (ah)) { +if (ah->is_clk_25mhz) { +REG_WRITE (ah,AR_RTC_DERIVED_CLK ,0x17c <<1 ); +REG_WRITE (ah,AR_SLP32_MODE ,0x0010f3d7 ); +REG_WRITE (ah,AR_SLP32_INC ,0x0001e7ae ); + }else { +REG_WRITE (ah,AR_RTC_DERIVED_CLK ,0x261 <<1 ); +REG_WRITE (ah,AR_SLP32_MODE ,0x0010f400 ); +REG_WRITE (ah,AR_SLP32_INC ,0x0001e800 ); + } +udelay (100 ); + } } static void ar9003_hw_prog_ini(struct ath_hw *ah,
drivers/net/wireless/ath/ath9k/hw.c +0 -13
@@ -916,19 +916,6 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,udelay (RTC_PLL_SETTLE_DELAY );REG_WRITE (ah,AR_RTC_SLEEP_CLK ,AR_RTC_FORCE_DERIVED_CLK ); - -if (AR_SREV_9340 (ah) ||AR_SREV_9550 (ah)) { -if (ah->is_clk_25mhz) { -REG_WRITE (ah,AR_RTC_DERIVED_CLK ,0x17c <<1 ); -REG_WRITE (ah,AR_SLP32_MODE ,0x0010f3d7 ); -REG_WRITE (ah,AR_SLP32_INC ,0x0001e7ae ); - }else { -REG_WRITE (ah,AR_RTC_DERIVED_CLK ,0x261 <<1 ); -REG_WRITE (ah,AR_SLP32_MODE ,0x0010f400 ); -REG_WRITE (ah,AR_SLP32_INC ,0x0001e800 ); - } -udelay (100 ); - } } static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
Signature · 1 line
2.1.3
PATCH 29/66 of/base: Fix PowerPC address parsing hack
In reply to Jiri SlabyFrom: Benjamin Herrenschmidt <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 746c9e9f92dde2789908e51a354ba90a1962a2eb upstream.
We have a historical hack that treats missing ranges properties as the equivalent of an empty one. This is needed for ancient PowerMac "bad" device-trees, and shouldn't be enabled for any other PowerPC platform, otherwise we get some nasty layout of devices in sysfs or even duplication when a set of otherwise identically named devices is created multiple times under a different parent node with no ranges property.
This fix is needed for the PowerNV i2c busses to be exposed properly and will fix a number of other embedded cases.
--- drivers/of/address.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/of/address.c +16 -3
@@ -401,6 +401,21 @@ static struct of_bus *of_match_bus(struct device_node *np)return NULL ; } +static int of_empty_ranges_quirk (void ) +{ +if (IS_ENABLED (CONFIG_PPC )) { +/* To save cycles, we cache the result */ +static int quirk_state =-1 ; + +if (quirk_state <0 ) + quirk_state = +of_machine_is_compatible ("Power Macintosh" ) || +of_machine_is_compatible ("MacRISC" ); +return quirk_state; + } +return false; +} +static int of_translate_one (struct device_node *parent,struct of_bus *bus,struct of_bus *pbus,__be32 *addr,int na,int ns,int pna,const char *rprop)
@@ -426,12 +441,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,* This code is only enabled on powerpc. --gcl */ ranges =of_get_property (parent, rprop, &rlen); -#if !defined(CONFIG_PPC ) -if (ranges ==NULL ) { +if (ranges ==NULL && !of_empty_ranges_quirk ()) {pr_err ("OF: no ranges; cannot translate\n" );return 1 ; } -#endif /* !defined(CONFIG_PPC) */ if (ranges ==NULL || rlen ==0 ) { offset =of_read_number (addr, na);memset (addr,0 , pna *4 );
Signature · 1 line
2.1.3
PATCH 30/66 powerpc/pseries: Honor the generic "no_64bit_msi" flag
In reply to Jiri SlabyFrom: Benjamin Herrenschmidt <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 415072a041bf50dbd6d56934ffc0cbbe14c97be8 upstream.
Instead of the arch specific quirk which we are deprecating
--- arch/powerpc/platforms/pseries/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/msi.c +1 -1
@@ -426,7 +426,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)*/ again:if (type ==PCI_CAP_ID_MSI ) { -if (pdn->force_32bit_msi) { +if (pdev->no_64bit_msi) { rc =rtas_change_msi (pdn,RTAS_CHANGE_32MSI_FN , nvec);if (rc <0 ) {/*
Signature · 1 line
2.1.3
PATCH 31/66 powerpc/pseries: Fix endiannes issue in RTAS call from xmon
In reply to Jiri SlabyFrom: Laurent Dufour <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3b8a3c01096925a824ed3272601082289d9c23a5 upstream.
On pseries system (LPAR) xmon failed to enter when running in LE mode, system is hunging. Inititating xmon will lead to such an output on the console:
SysRq : Entering xmon
cpu 0x15: Vector: 0 at [c0000003f39ffb10]
pc: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
lr: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
sp: c0000003f39ffc70
msr: 8000000000009033
current = 0xc0000003fafa7180
paca = 0xc000000007d75e80 softe: 0 irq_happened: 0x01
pid = 14617, comm = bash
Bad kernel stack pointer fafb4b0 at eca7cc4
cpu 0x15: Vector: 300 (Data Access) at [c000000007f07d40]
pc: 000000000eca7cc4
lr: 000000000eca7c44
sp: fafb4b0
msr: 8000000000001000
dar: 10000000
dsisr: 42000000
current = 0xc0000003fafa7180
paca = 0xc000000007d75e80 softe: 0 irq_happened: 0x01
pid = 14617, comm = bashcpu 0x15: Exception 300 (Data Access) in xmon, returning to main loop
xmon: WARNING: bad recursive fault on cpu 0x15
The root cause is that xmon is calling RTAS to turn off the surveillance when entering xmon, and RTAS is requiring big endian parameters.
This patch is byte swapping the RTAS arguments when running in LE mode.
--- arch/powerpc/xmon/xmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/xmon/xmon.c +3 -3
@@ -288,10 +288,10 @@ static inline void disable_surveillance(void) args.token =rtas_token ("set-indicator" );if (args.token ==RTAS_UNKNOWN_SERVICE )return ; - args.nargs =3 ; - args.nret =1 ; + args.nargs =cpu_to_be32 (3 ); + args.nret =cpu_to_be32 (1 ); args.rets = &args.args[3 ]; - args.args[0 ] =SURVEILLANCE_TOKEN ; + args.args[0 ] =cpu_to_be32 (SURVEILLANCE_TOKEN ); args.args[1 ] =0 ; args.args[2 ] =0 ;enter_rtas (__pa (&args));
Signature · 1 line
2.1.3
PATCH 32/66 iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask
In reply to Jiri SlabyFrom: Cristina Ciocan <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ccf54555da9a5e91e454b909ca6a5303c7d6b910 upstream.
The direction field is set on 7 bits, thus we need to AND it with 0111 111 mask in order to retrieve it, that is 0x7F, not 0xCF as it is now.
--- include/linux/iio/events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/events.h +1 -1
@@ -90,7 +90,7 @@ enum iio_event_direction {#define IIO_EVENT_CODE_EXTRACT_TYPE (mask) ((mask >> 56) & 0xFF) -#define IIO_EVENT_CODE_EXTRACT_DIR (mask) ((mask >> 48) & 0xCF) +#define IIO_EVENT_CODE_EXTRACT_DIR (mask) ((mask >> 48) & 0x7F)#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE (mask) ((mask >> 32) & 0xFF)
Signature · 1 line
2.1.3
PATCH 33/66 staging: r8188eu: Add new device ID for DLink GO-USB-N150
In reply to Jiri SlabyFrom: Larry Finger <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6d4556fc0309608f760f1d329df56d77fdd0c31a upstream.
The DLink GO-USB-N150 with revision B1 uses this driver.
--- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 -0
@@ -57,6 +57,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = { {USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */ {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */ {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */ + {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */ {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */ {} /* Terminating entry */ };
Signature · 1 line
2.1.3
PATCH 34/66 USB: ssu100: fix overrun-error reporting
In reply to Jiri SlabyFrom: Johan Hovold <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 75bcbf29c284dd0154c3e895a0bd1ef0e796160e upstream.
Fix reporting of overrun errors, which should only be reported once using the inserted null character.
--- drivers/usb/serial/ssu100.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/usb/serial/ssu100.c +3 -8
@@ -495,10 +495,9 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,if (*tty_flag ==TTY_NORMAL ) *tty_flag =TTY_FRAME ; } -if (lsr &UART_LSR_OE ){ +if (lsr &UART_LSR_OE ) { port->icount.overrun++; -if (*tty_flag ==TTY_NORMAL ) - *tty_flag =TTY_OVERRUN ; +tty_insert_flip_char (&port->port,0 ,TTY_OVERRUN ); } }
@@ -516,12 +515,8 @@ static void ssu100_process_read_urb(struct urb *urb)if ((len >=4 ) && (packet[0 ] ==0x1b ) && (packet[1 ] ==0x1b ) && ((packet[2 ] ==0x00 ) || (packet[2 ] ==0x01 ))) { -if (packet[2 ] ==0x00 ) { +if (packet[2 ] ==0x00 )ssu100_update_lsr (port, packet[3 ], &flag); -if (flag ==TTY_OVERRUN ) -tty_insert_flip_char (&port->port,0 , -TTY_OVERRUN ); - }if (packet[2 ] ==0x01 )ssu100_update_msr (port, packet[3 ]);
Signature · 1 line
2.1.3
PATCH 35/66 USB: keyspan: fix overrun-error reporting
In reply to Jiri SlabyFrom: Johan Hovold <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 855515a6d3731242d85850a206f2ec084c917338 upstream.
Fix reporting of overrun errors, which are not associated with a character. Instead insert a null character and report only once.
--- drivers/usb/serial/keyspan.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/usb/serial/keyspan.c +11 -10
@@ -312,12 +312,13 @@ static void usa26_indat_callback(struct urb *urb)if ((data[0 ] &0x80 ) ==0 ) {/* no errors on individual bytes, only possible overrun err */ -if (data[0 ] &RXERROR_OVERRUN ) - err =TTY_OVERRUN ; -else - err =0 ; +if (data[0 ] &RXERROR_OVERRUN ) { +tty_insert_flip_char (&port->port,0 , +TTY_OVERRUN ); + }for (i =1 ; i < urb->actual_length ; ++i) -tty_insert_flip_char (&port->port, data[i], err); +tty_insert_flip_char (&port->port, data[i], +TTY_NORMAL ); }else {/* some bytes had errors, every byte has status */ dev_dbg (&port->dev,"%s - RX error!!!!\n" , __func__);
@@ -791,13 +792,13 @@ static void usa90_indat_callback(struct urb *urb)if ((data[0 ] &0x80 ) ==0 ) {/* no errors on individual bytes, only possible overrun err*/ -if (data[0 ] &RXERROR_OVERRUN ) - err =TTY_OVERRUN ; -else - err =0 ; +if (data[0 ] &RXERROR_OVERRUN ) { +tty_insert_flip_char (&port->port,0 , +TTY_OVERRUN ); + }for (i =1 ; i < urb->actual_length ; ++i)tty_insert_flip_char (&port->port, - data[i], err); + data[i],TTY_NORMAL ); }else {/* some bytes had errors, every byte has status */ dev_dbg (&port->dev,"%s - RX error!!!!\n" , __func__);
Signature · 1 line
2.1.3
PATCH 36/66 USB: keyspan: fix tty line-status reporting
In reply to Jiri SlabyFrom: Johan Hovold <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5d1678a33c731b56e245e888fdae5e88efce0997 upstream.
Fix handling of TTY error flags, which are not bitmasks and must specifically not be ORed together as this prevents the line discipline from recognising them.
Also insert null characters when reporting overrun errors as these are not associated with the received character.
--- drivers/usb/serial/keyspan.c | 76 ++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 28 deletions(-)
drivers/usb/serial/keyspan.c +48 -28
@@ -323,14 +323,19 @@ static void usa26_indat_callback(struct urb *urb)/* some bytes had errors, every byte has status */ dev_dbg (&port->dev,"%s - RX error!!!!\n" , __func__);for (i =0 ; i +1 < urb->actual_length; i +=2 ) { -int stat = data[i], flag =0 ; -if (stat &RXERROR_OVERRUN ) - flag |=TTY_OVERRUN ; -if (stat &RXERROR_FRAMING ) - flag |=TTY_FRAME ; -if (stat &RXERROR_PARITY ) - flag |=TTY_PARITY ; +int stat = data[i]; +int flag =TTY_NORMAL ; + +if (stat &RXERROR_OVERRUN ) { +tty_insert_flip_char (&port->port,0 , +TTY_OVERRUN ); + }/* XXX should handle break (0x10) */ +if (stat &RXERROR_PARITY ) + flag =TTY_PARITY ; +else if (stat &RXERROR_FRAMING ) + flag =TTY_FRAME ; +tty_insert_flip_char (&port->port, data[i+1 ], flag); }
@@ -668,14 +673,19 @@ static void usa49_indat_callback(struct urb *urb) }else {/* some bytes had errors, every byte has status */ for (i =0 ; i +1 < urb->actual_length; i +=2 ) { -int stat = data[i], flag =0 ; -if (stat &RXERROR_OVERRUN ) - flag |=TTY_OVERRUN ; -if (stat &RXERROR_FRAMING ) - flag |=TTY_FRAME ; -if (stat &RXERROR_PARITY ) - flag |=TTY_PARITY ; +int stat = data[i]; +int flag =TTY_NORMAL ; + +if (stat &RXERROR_OVERRUN ) { +tty_insert_flip_char (&port->port,0 , +TTY_OVERRUN ); + }/* XXX should handle break (0x10) */ +if (stat &RXERROR_PARITY ) + flag =TTY_PARITY ; +else if (stat &RXERROR_FRAMING ) + flag =TTY_FRAME ; +tty_insert_flip_char (&port->port, data[i+1 ], flag); }
@@ -732,15 +742,19 @@ static void usa49wg_indat_callback(struct urb *urb)*/ for (x =0 ; x +1 < len && i +1 < urb->actual_length; x +=2 ) { -int stat = data[i], flag =0 ; +int stat = data[i]; +int flag =TTY_NORMAL ; -if (stat &RXERROR_OVERRUN ) - flag |=TTY_OVERRUN ; -if (stat &RXERROR_FRAMING ) - flag |=TTY_FRAME ; -if (stat &RXERROR_PARITY ) - flag |=TTY_PARITY ; +if (stat &RXERROR_OVERRUN ) { +tty_insert_flip_char (&port->port,0 , +TTY_OVERRUN ); + }/* XXX should handle break (0x10) */ +if (stat &RXERROR_PARITY ) + flag =TTY_PARITY ; +else if (stat &RXERROR_FRAMING ) + flag =TTY_FRAME ; +tty_insert_flip_char (&port->port, data[i+1 ], flag); i +=2 ;
@@ -803,14 +817,20 @@ static void usa90_indat_callback(struct urb *urb)/* some bytes had errors, every byte has status */ dev_dbg (&port->dev,"%s - RX error!!!!\n" , __func__);for (i =0 ; i +1 < urb->actual_length; i +=2 ) { -int stat = data[i], flag =0 ; -if (stat &RXERROR_OVERRUN ) - flag |=TTY_OVERRUN ; -if (stat &RXERROR_FRAMING ) - flag |=TTY_FRAME ; -if (stat &RXERROR_PARITY ) - flag |=TTY_PARITY ; +int stat = data[i]; +int flag =TTY_NORMAL ; + +if (stat &RXERROR_OVERRUN ) { +tty_insert_flip_char ( + &port->port,0 , +TTY_OVERRUN ); + }/* XXX should handle break (0x10) */ +if (stat &RXERROR_PARITY ) + flag =TTY_PARITY ; +else if (stat &RXERROR_FRAMING ) + flag =TTY_FRAME ; +tty_insert_flip_char (&port->port, data[i+1 ], flag); }
Signature · 1 line
2.1.3
PATCH 37/66 USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick
In reply to Jiri SlabyFrom: Preston Fick <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ffcfe30ebd8dd703d0fc4324ffe56ea21f5479f4 upstream.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ + { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
Signature · 1 line
2.1.3
PATCH 38/66 usb: serial: ftdi_sio: add PIDs for Matrix Orbital products
In reply to Jiri SlabyFrom: Troy Clark <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 204ec6e07ea7aff863df0f7c53301f9cbbfbb9d3 upstream.
Add PIDs for new Matrix Orbital GTT series products.
--- drivers/usb/serial/ftdi_sio.c | 33 +++++++++++++++++++++++++++++++++ drivers/usb/serial/ftdi_sio_ids.h | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 4 deletions(-)
drivers/usb/serial/ftdi_sio.c +33 -0
@@ -484,6 +484,39 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
drivers/usb/serial/ftdi_sio_ids.h +35 -4
@@ -926,8 +926,8 @@#define BAYER_CONTOUR_CABLE_PID 0x6001/* -* The following are the values for the Matrix Orbital FTDI Range -* Anything in this range will use an FT232RL. +* Matrix Orbital Intelligent USB displays. +* http://www.matrixorbital.com */ #define MTXORB_VID 0x1B3D#define MTXORB_FTDI_RANGE_0100_PID 0x0100
@@ -1186,8 +1186,39 @@#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF - - +#define MTXORB_FTDI_RANGE_4701_PID 0x4701 +#define MTXORB_FTDI_RANGE_9300_PID 0x9300 +#define MTXORB_FTDI_RANGE_9301_PID 0x9301 +#define MTXORB_FTDI_RANGE_9302_PID 0x9302 +#define MTXORB_FTDI_RANGE_9303_PID 0x9303 +#define MTXORB_FTDI_RANGE_9304_PID 0x9304 +#define MTXORB_FTDI_RANGE_9305_PID 0x9305 +#define MTXORB_FTDI_RANGE_9306_PID 0x9306 +#define MTXORB_FTDI_RANGE_9307_PID 0x9307 +#define MTXORB_FTDI_RANGE_9308_PID 0x9308 +#define MTXORB_FTDI_RANGE_9309_PID 0x9309 +#define MTXORB_FTDI_RANGE_930A_PID 0x930A +#define MTXORB_FTDI_RANGE_930B_PID 0x930B +#define MTXORB_FTDI_RANGE_930C_PID 0x930C +#define MTXORB_FTDI_RANGE_930D_PID 0x930D +#define MTXORB_FTDI_RANGE_930E_PID 0x930E +#define MTXORB_FTDI_RANGE_930F_PID 0x930F +#define MTXORB_FTDI_RANGE_9310_PID 0x9310 +#define MTXORB_FTDI_RANGE_9311_PID 0x9311 +#define MTXORB_FTDI_RANGE_9312_PID 0x9312 +#define MTXORB_FTDI_RANGE_9313_PID 0x9313 +#define MTXORB_FTDI_RANGE_9314_PID 0x9314 +#define MTXORB_FTDI_RANGE_9315_PID 0x9315 +#define MTXORB_FTDI_RANGE_9316_PID 0x9316 +#define MTXORB_FTDI_RANGE_9317_PID 0x9317 +#define MTXORB_FTDI_RANGE_9318_PID 0x9318 +#define MTXORB_FTDI_RANGE_9319_PID 0x9319 +#define MTXORB_FTDI_RANGE_931A_PID 0x931A +#define MTXORB_FTDI_RANGE_931B_PID 0x931B +#define MTXORB_FTDI_RANGE_931C_PID 0x931C +#define MTXORB_FTDI_RANGE_931D_PID 0x931D +#define MTXORB_FTDI_RANGE_931E_PID 0x931E +#define MTXORB_FTDI_RANGE_931F_PID 0x931F/* * The Mobility Lab (TML)
Signature · 1 line
2.1.3
PATCH 39/66 usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000
In reply to Jiri SlabyFrom: Hans de Goede <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 263e80b43559a6103e178a9176938ce171b23872 upstream.
This wireless mouse receiver needs a reset-resume quirk to properly come out of reset.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -43,6 +43,9 @@ static const struct usb_device_id usb_quirk_list[] = {/* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Microsoft Wireless Laser Mouse 6000 Receiver */ + { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Microsoft LifeCam-VX700 v2.0 */ { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
Signature · 1 line
2.1.3
PATCH 40/66 USB: xhci: don't start a halted endpoint before its new dequeue is set
In reply to Jiri SlabyFrom: Mathias Nyman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c3492dbfa1050debf23a5b5cd2bc7514c5b37896 upstream.
A halted endpoint ring must first be reset, then move the ring dequeue pointer past the problematic TRB. If we start the ring too early after reset, but before moving the dequeue pointer we will end up executing the same problematic TRB again.
As we always issue a set transfer dequeue command after a reset endpoint command we can skip starting endpoint rings at reset endpoint command completion.
Without this fix we end up trying to handle the same faulty TD for contol endpoints. causing timeout, and failing testusb ctrl_out write tests.
--- drivers/usb/host/xhci-ring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/host/xhci-ring.c +1 -2
@@ -1206,9 +1206,8 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci, false);xhci_ring_cmd_db (xhci); }else { -/* Clear our internal halted state and restart the ring(s) */ +/* Clear our internal halted state */ xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED ; -ring_doorbell_for_active_rings (xhci, slot_id, ep_index); } }
Signature · 1 line
2.1.3
PATCH 41/66 usb: xhci: rework root port wake bits if controller isn't allowed to wakeup
In reply to Jiri SlabyFrom: Lu Baolu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a1377e5397ab321e21b793ec8cd2b6f12bd3c718 upstream.
When system is being suspended, if host device is not allowed to do wakeup, xhci_suspend() needs to clear all root port wake on bits. Otherwise, some platforms may generate spurious wakeup, even if PCI PME# is disabled.
The initial commit ff8cbf250b44 ("xhci: clear root port wake on bits"), which also got into stable, turned out to not work correctly and had to be reverted, and is now rewritten.
--- drivers/usb/host/xhci-pci.c | 2 +- drivers/usb/host/xhci-plat.c | 10 +++++++++- drivers/usb/host/xhci.c | 42 +++++++++++++++++++++++++++++++++++++++++- drivers/usb/host/xhci.h | 2 +- 4 files changed, 52 insertions(+), 4 deletions(-)
drivers/usb/host/xhci-pci.c +1 -1
@@ -283,7 +283,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)if (xhci_compliance_mode_recovery_timer_quirk_check ()) pdev->no_d3cold = true; -return xhci_suspend (xhci); +return xhci_suspend (xhci, do_wakeup); }static int xhci_pci_resume (struct usb_hcd *hcd,bool hibernated)
drivers/usb/host/xhci-plat.c +9 -1
@@ -203,7 +203,15 @@ static int xhci_plat_suspend(struct device *dev)struct usb_hcd *hcd =dev_get_drvdata (dev);struct xhci_hcd *xhci =hcd_to_xhci (hcd); -return xhci_suspend (xhci); +/* +* xhci_suspend() needs `do_wakeup` to know whether host is allowed +* to do wakeup during suspend. Since xhci_plat_suspend is currently +* only designed for system suspend, device_may_wakeup() is enough +* to dertermine whether host is allowed to do wakeup. Need to +* reconsider this when xhci_plat_suspend enlarges its scope, e.g., +* also applies to runtime suspend. +*/ +return xhci_suspend (xhci,device_may_wakeup (dev)); }static int xhci_plat_resume (struct device *dev)
drivers/usb/host/xhci.c +41 -1
66 lines not on this page · raw message
drivers/usb/host/xhci.h +1 -1
@@ -1767,7 +1767,7 @@ void xhci_shutdown(struct usb_hcd *hcd);int xhci_gen_setup (struct usb_hcd *hcd,xhci_get_quirks_t get_quirks);#ifdef CONFIG_PM -int xhci_suspend (struct xhci_hcd *xhci); +int xhci_suspend (struct xhci_hcd *xhci,bool do_wakeup);int xhci_resume (struct xhci_hcd *xhci,bool hibernated);#else #define xhci_suspend NULL
Signature · 1 line
2.1.3
PATCH 42/66 can: esd_usb2: fix memory leak on disconnect
In reply to Jiri SlabyFrom: Alexey Khoroshilov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit efbd50d2f62fc1f69a3dcd153e63ba28cc8eb27f upstream.
It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds the missing deallocation.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/net/can/usb/esd_usb2.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/can/usb/esd_usb2.c +1 -0
@@ -1142,6 +1142,7 @@ static void esd_usb2_disconnect(struct usb_interface *intf) } }unlink_all_urbs (dev); +kfree (dev); } }
Signature · 1 line
2.1.3
PATCH 43/66 ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices
In reply to Jiri SlabyFrom: Jurgen Kramer <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6e84a8d7ac3ba246ef44e313e92bc16a1da1b04a upstream.
This patch adds a USB control message delay quirk for a few specific Marantz/Denon devices. Without the delay the DACs will not work properly and produces the following type of messages:
Nov 15 10:09:21 orwell kernel: [ 91.342880] usb 3-13: clock source 41 is not valid, cannot use Nov 15 10:09:21 orwell kernel: [ 91.343775] usb 3-13: clock source 41 is not valid, cannot use
There are likely other Marantz/Denon devices using the same USB module which exhibit the same problems. But as this cannot be verified I limited the patch to the devices I could test.
The following two devices are covered by this path:
- Marantz SA-14S1
- Marantz HD-DAC1
--- sound/usb/quirks.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
sound/usb/quirks.c +14 -0
@@ -1127,6 +1127,20 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,if ((le16_to_cpu (dev->descriptor.idVendor) ==0x23ba ) && (requesttype &USB_TYPE_MASK ) ==USB_TYPE_CLASS )mdelay (20 ); + +/* Marantz/Denon devices with USB DAC functionality need a delay +* after each class compliant request +*/ +if ((le16_to_cpu (dev->descriptor.idVendor) ==0x154e ) && + (requesttype &USB_TYPE_MASK ) ==USB_TYPE_CLASS ) { + +switch (le16_to_cpu (dev->descriptor.idProduct)) { +case 0x3005 :/* Marantz HD-DAC1 */ +case 0x3006 :/* Marantz SA-14S1 */ +mdelay (20 ); +break ; + } + } }/*
Signature · 1 line
2.1.3
PATCH 44/66 aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer
In reply to Jiri SlabyFrom: Gu Zheng <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.
https://bugzilla.kernel.org/show_bug.cgi?id=86831
Markus reported that when shutting down mysqld (with AIO support, on a ext3 formatted Harddrive) leads to a negative number of dirty pages (underrun to the counter). The negative number results in a drastic reduction of the write performance because the page cache is not used, because the kernel thinks it is still 2 ^ 32 dirty pages open.
Add a warn trace in __dec_zone_state will catch this easily:
static inline void __dec_zone_state(struct zone *zone, enum
zone_stat_item item)
{
atomic_long_dec(&zone->vm_stat[item]);
+ WARN_ON_ONCE(item == NR_FILE_DIRTY &&
atomic_long_read(&zone->vm_stat[item]) < 0);
atomic_long_dec(&vm_stat[item]);
}[ 21.341632] ------------[ cut here ]------------ [ 21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242 cancel_dirty_page+0x164/0x224() [ 21.355296] Modules linked in: wutbox_cp sata_mv [ 21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80 [ 21.366793] Workqueue: events free_ioctx [ 21.370760] [<c0016a64>] (unwind_backtrace) from [<c0012f88>] (show_stack+0x20/0x24) [ 21.378562] [<c0012f88>] (show_stack) from [<c03f8ccc>] (dump_stack+0x24/0x28) [ 21.385840] [<c03f8ccc>] (dump_stack) from [<c0023ae4>] (warn_slowpath_common+0x84/0x9c) [ 21.393976] [<c0023ae4>] (warn_slowpath_common) from [<c0023bb8>] (warn_slowpath_null+0x2c/0x34) [ 21.402800] [<c0023bb8>] (warn_slowpath_null) from [<c00c0688>] (cancel_dirty_page+0x164/0x224) [ 21.411524] [<c00c0688>] (cancel_dirty_page) from [<c00c080c>] (truncate_inode_page+0x8c/0x158) [ 21.420272] [<c00c080c>] (truncate_inode_page) from [<c00c0a94>] (truncate_inode_pages_range+0x11c/0x53c) [ 21.429890] [<c00c0a94>] (truncate_inode_pages_range) from [<c00c0f6c>] (truncate_pagecache+0x88/0xac) [ 21.439252] [<c00c0f6c>] (truncate_pagecache) from [<c00c0fec>] (truncate_setsize+0x5c/0x74) [ 21.447731] [<c00c0fec>] (truncate_setsize) from [<c013b3a8>] (put_aio_ring_file.isra.14+0x34/0x90) [ 21.456826] [<c013b3a8>] (put_aio_ring_file.isra.14) from [<c013b424>] (aio_free_ring+0x20/0xcc) [ 21.465660] [<c013b424>] (aio_free_ring) from [<c013b4f4>] (free_ioctx+0x24/0x44) [ 21.473190] [<c013b4f4>] (free_ioctx) from [<c003d8d8>] (process_one_work+0x134/0x47c) [ 21.481132] [<c003d8d8>] (process_one_work) from [<c003e988>] (worker_thread+0x130/0x414) [ 21.489350] [<c003e988>] (worker_thread) from [<c00448ac>] (kthread+0xd4/0xec) [ 21.496621] [<c00448ac>] (kthread) from [<c000ec18>] (ret_from_fork+0x14/0x20) [ 21.503884] ---[ end trace 79c4bf42c038c9a1 ]---
The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty (bypasses the VFS dirty pages increment) when init, and aio fs uses *default_backing_dev_info* as the backing dev, which does not disable the dirty pages accounting capability.
So truncating aio ring file will contribute to accounting dirty pages (VFS dirty pages decrement), then error occurs.
The original goal is keeping these pages in memory (can not be reclaimed or swapped) in life-time via marking it dirty. But thinking more, we have already pinned pages via elevating the page's refcount, which can already achieve the goal, so the SetPageDirty seems unnecessary.
In order to fix the issue, using the __set_page_dirty_no_writeback instead of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).
With the above change, the dirty pages accounting can work well. But as we known, aio fs is an anonymous one, which should never cause any real write-back, we can ignore the dirty pages (write back) accounting by disabling the dirty pages (write back) accounting capability. So we introduce an aio private backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to replace the default one.
--- fs/aio.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
fs/aio.c +14 -7
@@ -164,6 +164,15 @@ static struct vfsmount *aio_mnt;static const struct file_operations aio_ring_fops;static const struct address_space_operations aio_ctx_aops; +/* Backing dev info for aio fs. +* -no dirty page accounting or writeback happens +*/ +static struct backing_dev_info aio_fs_backing_dev_info = { + .name ="aiofs" , + .state =0 , + .capabilities =BDI_CAP_NO_ACCT_AND_WRITEBACK |BDI_CAP_MAP_COPY , +}; +static struct file *aio_private_file (struct kioctx *ctx,loff_t nr_pages) {struct qstr this =QSTR_INIT ("[aio]" ,5 );
@@ -175,6 +184,7 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) inode->i_mapping->a_ops = &aio_ctx_aops; inode->i_mapping->private_data = ctx; + inode->i_mapping->backing_dev_info = &aio_fs_backing_dev_info; inode->i_size =PAGE_SIZE * nr_pages; path.dentry =d_alloc_pseudo (aio_mnt->mnt_sb, &this);
@@ -220,6 +230,9 @@ static int __init aio_setup(void)if (IS_ERR (aio_mnt))panic ("Failed to create aio fs mount." ); +if (bdi_init (&aio_fs_backing_dev_info)) +panic ("Failed to init aio fs backing dev info." ); + kiocb_cachep =KMEM_CACHE (kiocb,SLAB_HWCACHE_ALIGN |SLAB_PANIC ); kioctx_cachep =KMEM_CACHE (kioctx,SLAB_HWCACHE_ALIGN |SLAB_PANIC );
@@ -281,11 +294,6 @@ static const struct file_operations aio_ring_fops = { .mmap = aio_ring_mmap, }; -static int aio_set_page_dirty (struct page *page) -{ -return 0 ; -} -#if IS_ENABLED (CONFIG_MIGRATION )static int aio_migratepage (struct address_space *mapping,struct page *new,struct page *old,enum migrate_mode mode)
@@ -357,7 +365,7 @@ out:#endif static const struct address_space_operations aio_ctx_aops = { - .set_page_dirty = aio_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, #if IS_ENABLED(CONFIG_MIGRATION) .migratepage = aio_migratepage, #endif
@@ -412,7 +420,6 @@ static int aio_setup_ring(struct kioctx *ctx)pr_debug ("pid(%d) page[%d]->count=%d\n" , current->pid, i,page_count (page));SetPageUptodate (page); -SetPageDirty (page);unlock_page (page); ctx->ring_pages[i] = page;
Signature · 1 line
2.1.3
PATCH 45/66 ARM: 8216/1: xscale: correct auxiliary register in suspend/resume
In reply to Jiri SlabyFrom: Dmitry Eremin-Solenikov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ef59a20ba375aeb97b3150a118318884743452a8 upstream.
According to the manuals I have, XScale auxiliary register should be reached with opc_2 = 1 instead of crn = 1. cpu_xscale_proc_init correctly uses c1, c0, 1 arguments, but cpu_xscale_do_suspend and cpu_xscale_do_resume use c1, c1, 0. Correct suspend/resume functions to also use c1, c0, 1.
The issue was primarily noticed thanks to qemu reporing "unsupported instruction" on the pxa suspend path. Confirmed in PXA210/250 and PXA255 XScale Core manuals and in PXA270 and PXA320 Developers Guides.
Harware tested by me on tosa (pxa255). Robert confirmed on pxa270 board.
--- arch/arm/mm/proc-xscale.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mm/proc-xscale.S +2 -2
@@ -535,7 +535,7 @@ ENTRY(cpu_xscale_do_suspend) mrc p15, 0, r5, c15, c1, 0 @ CP access reg mrc p15, 0, r6, c13, c0, 0 @ PID mrc p15, 0, r7, c3, c0, 0 @ domain ID - mrc p15, 0, r8, c1, c1, 0 @ auxiliary control reg + mrc p15, 0, r8, c1, c0, 1 @ auxiliary control reg mrc p15, 0, r9, c1, c0, 0 @ control reg bic r4, r4, #2 @ clear frequency change bit stmia r0, {r4 - r9} @ store cp regs
@@ -552,7 +552,7 @@ ENTRY(cpu_xscale_do_resume) mcr p15, 0, r6, c13, c0, 0 @ PID mcr p15, 0, r7, c3, c0, 0 @ domain ID mcr p15, 0, r1, c2, c0, 0 @ translation table base addr - mcr p15, 0, r8, c1, c1, 0 @ auxiliary control reg + mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg mov r0, r9 @ control register b cpu_resume_mmu ENDPROC(cpu_xscale_do_resume)
Signature · 1 line
2.1.3
PATCH 46/66 ARM: 8222/1: mvebu: enable strex backoff delay
In reply to Jiri SlabyFrom: Thomas Petazzoni <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 995ab5189d1d7264e79e665dfa032a19b3ac646e upstream.
Under extremely rare conditions, in an MPCore node consisting of at least 3 CPUs, two CPUs trying to perform a STREX to data on the same shared cache line can enter a livelock situation.
This patch enables the HW mechanism that overcomes the bug. This fixes the incorrect setup of the STREX backoff delay bit due to a wrong description in the specification.
Note that enabling the STREX backoff delay mechanism is done by leaving the bit *cleared*, while the bit was currently being set by the proc-v7.S code.
[Thomas: adapt to latest mainline, slightly reword the commit log, add stable markers.]
--- arch/arm/mm/proc-v7.S | 2 -- 1 file changed, 2 deletions(-)
arch/arm/mm/proc-v7.S +0 -2
@@ -204,7 +204,6 @@ __v7_pj4b_setup: /* Auxiliary Debug Modes Control 1 Register */ #define PJ4B_STATIC_BP (1 << 2) /* Enable Static BP */ #define PJ4B_INTER_PARITY (1 << 8) /* Disable Internal Parity Handling */ -#define PJ4B_BCK_OFF_STREX (1 << 5) /* Enable the back off of STREX instr */ #define PJ4B_CLEAN_LINE (1 << 16) /* Disable data transfer for clean line */ /* Auxiliary Debug Modes Control 2 Register */
@@ -227,7 +226,6 @@ __v7_pj4b_setup: /* Auxiliary Debug Modes Control 1 Register */ mrc p15, 1, r0, c15, c1, 1 orr r0, r0, #PJ4B_CLEAN_LINE - orr r0, r0, #PJ4B_BCK_OFF_STREX orr r0, r0, #PJ4B_INTER_PARITY bic r0, r0, #PJ4B_STATIC_BP mcr p15, 1, r0, c15, c1, 1
Signature · 1 line
2.1.3
PATCH 47/66 ARM: 8226/1: cacheflush: get rid of restarting block
In reply to Jiri SlabyFrom: Vladimir Murzin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3f4aa45ceea5789a4aade536acc27f2e0d3da5e1 upstream.
We cannot restart cacheflush safely if a process provides user-defined signal handler and signal is pending. In this case -EINTR is returned and it is expected that process re-invokes syscall. However, there are a few problems with that:
* looks like nobody bothers checking return value from cacheflush
* but if it did, we don't provide the restart address for that, so the process has to use the same range again
* ...and again, what might lead to looping forever
So, remove cacheflush restarting code and terminate cache flushing as early as fatal signal is pending.
--- arch/arm/include/asm/thread_info.h | 11 ----------- arch/arm/kernel/traps.c | 31 ++----------------------------- 2 files changed, 2 insertions(+), 40 deletions(-)
arch/arm/include/asm/thread_info.h +0 -11
@@ -43,16 +43,6 @@ struct cpu_context_save {__u32 extra[2 ];/* Xscale 'acc' register, etc */ }; -struct arm_restart_block { -union { -/* For user cache flushing */ -struct { -unsigned long start; -unsigned long end; - } cache; - }; -}; -/* * low level task data that entry.S needs immediate access to. * __switch_to() assumes cpu_context follows immediately after cpu_domain.
@@ -78,7 +68,6 @@ struct thread_info {unsigned long thumbee_state;/* ThumbEE Handler Base register */ #endif struct restart_block restart_block; -struct arm_restart_block arm_restart_block; };#define INIT_THREAD_INFO (tsk) \
arch/arm/kernel/traps.c +2 -29
@@ -503,8 +503,6 @@ static int bad_syscall(int n, struct pt_regs *regs)return regs->ARM_r0; } -static long do_cache_op_restart (struct restart_block *); -static inline int __do_cache_op (unsigned long start,unsigned long end) {
@@ -513,24 +511,8 @@ __do_cache_op(unsigned long start, unsigned long end) do { unsigned long chunk = min(PAGE_SIZE, end - start); - if (signal_pending(current)) { - struct thread_info *ti = current_thread_info(); - - ti->restart_block = (struct restart_block) { - .fn = do_cache_op_restart, - }; - - ti->arm_restart_block = (struct arm_restart_block) { - { - .cache = { - .start = start, - .end = end, - }, - }, - }; - - return -ERESTART_RESTARTBLOCK; - } + if (fatal_signal_pending(current)) + return 0; ret = flush_cache_user_range(start, start + chunk); if (ret)
@@ -543,15 +525,6 @@ __do_cache_op(unsigned long start, unsigned long end)return 0 ; } -static long do_cache_op_restart (struct restart_block *unused) -{ -struct arm_restart_block *restart_block; - - restart_block = ¤t_thread_info ()->arm_restart_block; -return __do_cache_op (restart_block->cache.start, - restart_block->cache.end); -} -static inline int do_cache_op (unsigned long start,unsigned long end,int flags) {
Signature · 1 line
2.1.3
PATCH 48/66 Input: synaptics - adjust min/max on Thinkpad E540
In reply to Jiri SlabyFrom: Ben Sagal <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit bce4f9e764c36bc35dd5c9cf9e057c09f422397d upstream.
The LEN2006 Synaptics touchpad (as found in Thinkpad E540) returns wrong min max values.
touchpad-edge-detector output:
Quoted 4 lines
Touchpad SynPS/2 Synaptics TouchPad on
/dev/input/event6Move one finger around the touchpad to detect the actual edges
Kernel says: x [1472..5674], y [1408..4684]
Touchpad sends: x [1264..5675], y [1171..4688]
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88211
--- drivers/input/mouse/synaptics.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/input/mouse/synaptics.c +4 -0
@@ -140,6 +140,10 @@ static const struct min_max_quirk min_max_pnpid_table[] = { (const char * const []){"LEN2001", NULL}, 1024, 5022, 2508, 4832 }, + { + (const char *const []){"LEN2006" ,NULL }, +1264 ,5675 ,1171 ,4688 + }, { } };
Signature · 1 line
2.1.3
PATCH 49/66 Input: xpad - use proper endpoint type
In reply to Jiri SlabyFrom: Greg Kroah-Hartman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a1f9a4072655843fc03186acbad65990cc05dd2d upstream.
The xpad wireless endpoint is not a bulk endpoint on my devices, but rather an interrupt one, so the USB core complains when it is submitted. I'm guessing that the author really did mean that this should be an interrupt urb, but as there are a zillion different xpad devices out there, let's cover out bases and handle both bulk and interrupt endpoints just as easily.
--- drivers/input/joystick/xpad.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/input/joystick/xpad.c +13 -3
@@ -1039,9 +1039,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id } ep_irq_in = &intf->cur_altsetting->endpoint[1 ].desc; -usb_fill_bulk_urb (xpad->bulk_out, udev, -usb_sndbulkpipe (udev, ep_irq_in->bEndpointAddress), - xpad->bdata,XPAD_PKT_LEN , xpad_bulk_out, xpad); +if (usb_endpoint_is_bulk_out (ep_irq_in)) { +usb_fill_bulk_urb (xpad->bulk_out, udev, +usb_sndbulkpipe (udev, + ep_irq_in->bEndpointAddress), + xpad->bdata,XPAD_PKT_LEN , + xpad_bulk_out, xpad); + }else { +usb_fill_int_urb (xpad->bulk_out, udev, +usb_sndintpipe (udev, + ep_irq_in->bEndpointAddress), + xpad->bdata,XPAD_PKT_LEN , + xpad_bulk_out, xpad,0 ); + }/* * Submit the int URB immediately rather than waiting for open
Signature · 1 line
2.1.3
PATCH 50/66 srp-target: Retry when QP creation fails with ENOMEM
In reply to Jiri SlabyFrom: Bart Van Assche <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ab477c1ff5e0a744c072404bf7db51bfe1f05b6e upstream.
It is not guaranteed to that srp_sq_size is supported by the HCA. So if we failed to create the QP with ENOMEM, try with a smaller srp_sq_size. Keep it up until we hit MIN_SRPT_SQ_SIZE, then fail the connection.
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/infiniband/ulp/srpt/ib_srpt.c +8 -0
@@ -2101,6 +2101,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)if (!qp_init) goto out; +retry: ch->cq =ib_create_cq (sdev->device, srpt_completion,NULL , ch, ch->rq_size + srp_sq_size,0 );if (IS_ERR (ch->cq)) {
@@ -2124,6 +2125,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) ch->qp =ib_create_qp (sdev->pd, qp_init);if (IS_ERR (ch->qp)) { ret =PTR_ERR (ch->qp); +if (ret == -ENOMEM ) { + srp_sq_size /=2 ; +if (srp_sq_size >=MIN_SRPT_SQ_SIZE ) { +ib_destroy_cq (ch->cq); + goto retry; + } + }printk (KERN_ERR "failed to create_qp ret= %d\n" , ret); goto err_destroy_cq; }
Signature · 1 line
2.1.3
PATCH 51/66 target: Don't call TFO->write_pending if data_length == 0
In reply to Jiri SlabyFrom: Roland Dreier <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 885e7b0e181c14e4d0ddd26c688bad2b84c1ada9 upstream.
If an initiator sends a zero-length command (e.g. TEST UNIT READY) but sets the transfer direction in the transport layer to indicate a data-out phase, we still shouldn't try to transfer data. At best it's a NOP, and depending on the transport, we might crash on an uninitialized sg list.
--- drivers/target/target_core_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_transport.c +1 -1
@@ -2231,7 +2231,7 @@ transport_generic_new_cmd(struct se_cmd *cmd)* and let it call back once the write buffers are ready. */ target_add_to_state_list (cmd); -if (cmd->data_direction !=DMA_TO_DEVICE ) { +if (cmd->data_direction !=DMA_TO_DEVICE || cmd->data_length ==0 ) {target_execute_cmd (cmd);return 0 ; }
Signature · 1 line
2.1.3
PATCH 52/66 iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly
In reply to Jiri SlabyFrom: Sagi Grimberg <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3b726ae2de02a406cc91903f80132daee37b6f1b upstream.
In this case the cm_id->context is the isert_np, and the cm_id->qp is NULL, so use that to distinct the cases.
Since we don't expect any other events on this cm_id we can just return -1 for explicit termination of the cm_id by the cma layer.
--- drivers/infiniband/ulp/isert/ib_isert.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +19 -10
@@ -708,14 +708,25 @@ wake_up:complete (&isert_conn->conn_wait); } -static void +static int isert_disconnected_handler (struct rdma_cm_id *cma_id,bool disconnect) { -struct isert_conn *isert_conn = (struct isert_conn *)cma_id->context; +struct isert_conn *isert_conn; + +if (!cma_id->qp) { +struct isert_np *isert_np = cma_id->context; + + isert_np->np_cm_id =NULL ; +return -1 ; + } + + isert_conn = (struct isert_conn *)cma_id->context; isert_conn->disconnect = disconnect;INIT_WORK (&isert_conn->conn_logout_work, isert_disconnect_work);schedule_work (&isert_conn->conn_logout_work); + +return 0 ; } static int
@@ -730,6 +741,9 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)switch (event->event) {case RDMA_CM_EVENT_CONNECT_REQUEST : ret =isert_connect_request (cma_id, event); +if (ret) +pr_err ("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n" , + event->event, ret);break ;case RDMA_CM_EVENT_ESTABLISHED :isert_connected_handler (cma_id);
@@ -739,7 +753,7 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)case RDMA_CM_EVENT_DEVICE_REMOVAL :/* FALLTHRU */ disconnect = true;case RDMA_CM_EVENT_TIMEWAIT_EXIT :/* FALLTHRU */ -isert_disconnected_handler (cma_id, disconnect); + ret =isert_disconnected_handler (cma_id, disconnect);break ;case RDMA_CM_EVENT_CONNECT_ERROR :default :
@@ -747,12 +761,6 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)break ; } -if (ret !=0 ) { -pr_err ("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n" , - event->event, ret); -dump_stack (); - } -return ret; }
@@ -2683,7 +2691,8 @@ isert_free_np(struct iscsi_np *np) {struct isert_np *isert_np = (struct isert_np *)np->np_context; -rdma_destroy_id (isert_np->np_cm_id); +if (isert_np->np_cm_id) +rdma_destroy_id (isert_np->np_cm_id); np->np_context =NULL ;kfree (isert_np);
Signature · 1 line
2.1.3
PATCH 53/66 spi: dw: Fix dynamic speed change.
In reply to Jiri SlabyFrom: Thor Thayer <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0a8727e69778683495058852f783eeda141a754e upstream.
An IOCTL call that calls spi_setup() and then dw_spi_setup() will overwrite the persisted last transfer speed. On each transfer, the SPI speed is compared to the last transfer speed to determine if the clock divider registers need to be updated (did the speed change?). This bug was observed with the spidev driver using spi-config to update the max transfer speed.
This fix: Don't overwrite the persisted last transaction clock speed when updating the SPI parameters in dw_spi_setup(). On the next transaction, the new speed won't match the persisted last speed and the hardware registers will be updated.
On initialization, the persisted last transaction clock speed will be 0 but will be updated after the first SPI transaction.
Move zeroed clock divider check into clock change test because chip->clk_div is zero on startup and would cause a divide-by-zero error. The calculation was wrong as well (can't support odd #).
--- drivers/spi/spi-dw.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/spi/spi-dw.c +1 -5
@@ -394,9 +394,6 @@ static void pump_transfers(unsigned long data) chip = dws->cur_chip; spi = message->spi; -if (unlikely (!chip->clk_div)) - chip->clk_div = dws->max_freq / chip->speed_hz; -if (message->state ==ERROR_STATE ) { message->status = -EIO ; goto early_exit;
@@ -438,7 +435,7 @@ static void pump_transfers(unsigned long data)if (transfer->speed_hz) { speed = chip->speed_hz; -if (transfer->speed_hz != speed) { +if ((transfer->speed_hz != speed) || (!chip->clk_div)) { speed = transfer->speed_hz;if (speed > dws->max_freq) { printk(KERN_ERR "MRST SPI0: unsupported"
@@ -658,7 +655,6 @@ static int dw_spi_setup(struct spi_device *spi)dev_err (&spi->dev,"No max speed HZ parameter\n" );return -EINVAL ; } - chip->speed_hz = spi->max_speed_hz; chip->tmode =0 ;/* Tx & Rx */ /* Default SPI mode is SCPOL = 0, SCPH = 0 */
Signature · 1 line
2.1.3
PATCH 54/66 vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT
In reply to Jiri SlabyFrom: Nicholas Bellinger <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ab8edab132829b26dd13db6caca3c242cce35dc1 upstream.
This patch addresses a bug where individual vhost-scsi configfs endpoint groups can be removed from below while active exports to QEMU userspace still exist, resulting in an OOPs.
It adds a configfs_depend_item() in vhost_scsi_set_endpoint() to obtain an explicit dependency on se_tpg->tpg_group in order to prevent individual vhost-scsi WWPN endpoints from being released via normal configfs methods while an QEMU ioctl reference still exists.
Also, add matching configfs_undepend_item() in vhost_scsi_clear_endpoint() to release the dependency, once QEMU's reference to the individual group at /sys/kernel/config/target/vhost/$WWPN/$TPGT is released.
(Fix up vhost_scsi_clear_endpoint() error path - DanC)
--- drivers/vhost/scsi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/vhost/scsi.c +24 -0
@@ -1194,6 +1194,7 @@ static int vhost_scsi_set_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { + struct se_portal_group *se_tpg;struct tcm_vhost_tport *tv_tport;struct tcm_vhost_tpg *tpg;struct tcm_vhost_tpg **vs_tpg;
@@ -1241,6 +1242,21 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs, ret = -EEXIST ; goto out; } +/* +* In order to ensure individual vhost-scsi configfs +* groups cannot be removed while in use by vhost ioctl, +* go ahead and take an explicit se_tpg->tpg_group.cg_item +* dependency now. +*/ + se_tpg = &tpg->se_tpg; + ret =configfs_depend_item (se_tpg->se_tpg_tfo->tf_subsys, + &se_tpg->tpg_group.cg_item); +if (ret) { +pr_warn ("configfs_depend_item() failed: %d\n" , ret); +kfree (vs_tpg); +mutex_unlock (&tpg->tv_tpg_mutex); + goto out; + } tpg->tv_tpg_vhost_count++; tpg->vhost_scsi = vs; vs_tpg[tpg->tport_tpgt] = tpg;
@@ -1283,6 +1299,7 @@ static int vhost_scsi_clear_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { + struct se_portal_group *se_tpg;struct tcm_vhost_tport *tv_tport;struct tcm_vhost_tpg *tpg;struct vhost_virtqueue *vq;
@@ -1331,6 +1348,13 @@ vhost_scsi_clear_endpoint(struct vhost_scsi *vs, vs->vs_tpg[target] =NULL ; match = true;mutex_unlock (&tpg->tv_tpg_mutex); +/* +* Release se_tpg->tpg_group.cg_item configfs dependency now +* to allow vhost-scsi WWPN se_tpg->tpg_group shutdown to occur. +*/ + se_tpg = &tpg->se_tpg; +configfs_undepend_item (se_tpg->se_tpg_tfo->tf_subsys, + &se_tpg->tpg_group.cg_item); }if (match) {for (i =0 ; i <VHOST_SCSI_MAX_VQ ; i++) {
Signature · 1 line
2.1.3
PATCH 55/66 scsi: add Intel Multi-Flex to scsi scan blacklist
In reply to Jiri SlabyFrom: Christian Sünkenberg <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1899045510ff109980d9cc34e330fd8ca3631871 upstream.
Intel Multi-Flex LUNs choke on REPORT SUPPORTED OPERATION CODES resulting in sd_mod hanging for several minutes on startup. The issue was introduced with WRITE SAME discovery heuristics.
--- drivers/scsi/scsi_devinfo.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/scsi_devinfo.c +1 -0
@@ -202,6 +202,7 @@ static struct { {"IOMEGA", "Io20S *F", NULL, BLIST_KEY}, {"INSITE", "Floptical F*8I", NULL, BLIST_KEY}, {"INSITE", "I325VM", NULL, BLIST_KEY}, + {"Intel", "Multi-Flex", NULL, BLIST_NO_RSOC}, {"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, {"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN}, {"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
Signature · 1 line
2.1.3
PATCH 56/66 can: dev: avoid calling kfree_skb() from interrupt context
In reply to Jiri SlabyFrom: Thomas Körper <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5247a589c24022ab34e780039cc8000c48f2035e upstream.
ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX Error) interrupt, which triggers the folloing warning:
[ 1153.360705] ------------[ cut here ]------------ [ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0() [ 1153.360772] Call Trace: [ 1153.360778] [<c167906f>] dump_stack+0x41/0x52 [ 1153.360782] [<c105bb7e>] warn_slowpath_common+0x7e/0xa0 [ 1153.360784] [<c158b909>] ? skb_release_head_state+0xb9/0xd0 [ 1153.360786] [<c158b909>] ? skb_release_head_state+0xb9/0xd0 [ 1153.360788] [<c105bc42>] warn_slowpath_null+0x22/0x30 [ 1153.360791] [<c158b909>] skb_release_head_state+0xb9/0xd0 [ 1153.360793] [<c158be90>] skb_release_all+0x10/0x30 [ 1153.360795] [<c158bf06>] kfree_skb+0x36/0x80 [ 1153.360799] [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev] [ 1153.360802] [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev] [ 1153.360805] [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402] [ 1153.360809] [<c10a75b5>] handle_irq_event_percpu+0x35/0x180 [ 1153.360811] [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180 [ 1153.360813] [<c10a7731>] handle_irq_event+0x31/0x50 [ 1153.360816] [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120 [ 1153.360818] [<c10a9c10>] ? handle_edge_irq+0x110/0x110 [ 1153.360822] [<c1011b61>] handle_irq+0x71/0x90 [ 1153.360823] <IRQ> [<c168152c>] do_IRQ+0x3c/0xd0 [ 1153.360829] [<c1680b6c>] common_interrupt+0x2c/0x34 [ 1153.360834] [<c107d277>] ? finish_task_switch+0x47/0xf0 [ 1153.360836] [<c167c27b>] __schedule+0x35b/0x7e0 [ 1153.360839] [<c10a5334>] ? console_unlock+0x2c4/0x4d0 [ 1153.360842] [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890 [ 1153.360845] [<c10707b6>] ? process_one_work+0x196/0x370 [ 1153.360847] [<c167c723>] schedule+0x23/0x60 [ 1153.360849] [<c1070de1>] worker_thread+0x161/0x460 [ 1153.360852] [<c1090fcf>] ? __wake_up_locked+0x1f/0x30 [ 1153.360854] [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0 [ 1153.360856] [<c1074f01>] kthread+0xa1/0xc0 [ 1153.360859] [<c1680401>] ret_from_kernel_thread+0x21/0x30 [ 1153.360861] [<c1074e60>] ? kthread_create_on_node+0x110/0x110 [ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]---
This patch replaces the kfree_skb() by dev_kfree_skb_any().
--- drivers/net/can/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/dev.c +1 -1
@@ -385,7 +385,7 @@ void can_free_echo_skb(struct net_device *dev, unsigned int idx)BUG_ON (idx >= priv->echo_skb_max);if (priv->echo_skb[idx]) { -kfree_skb (priv->echo_skb[idx]); +dev_kfree_skb_any (priv->echo_skb[idx]); priv->echo_skb[idx] =NULL ; } }
Signature · 1 line
2.1.3
PATCH 57/66 rt2x00: do not align payload on modern H/W
In reply to Jiri SlabyFrom: Stanislaw Gruszka <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cfd9167af14eb4ec21517a32911d460083ee3d59 upstream.
RT2800 and newer hardware require padding between header and payload if header length is not multiple of 4.
For historical reasons we also align payload to to 4 bytes boundary, but such alignment is not needed on modern H/W.
Patch fixes skb_under_panic problems reported from time to time:
https://bugzilla.kernel.org/show_bug.cgi?id=84911
https://bugzilla.kernel.org/show_bug.cgi?id=72471
http://marc.info/?l=linux-wireless&m=139108549530402&w=2
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591
Panic happened because we eat 4 bytes of skb headroom on each (re)transmission when sending frame without the payload and the header length not being multiple of 4 (i.e. QoS header has 26 bytes). On such case because paylad_aling=2 is bigger than header_align=0 we increase header_align by 4 bytes. To prevent that we could change the check to:
if (payload_length && payload_align > header_align) header_align += 4;
but not aligning payload at all is more effective and alignment is not really needed by H/W (that has been tested on OpenWrt project for few years now).
Originally-From: Helmut Schaa <[email protected]>
--- drivers/net/wireless/rt2x00/rt2x00queue.c | 50 ++++++++----------------------- 1 file changed, 12 insertions(+), 38 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +12 -38
@@ -160,55 +160,29 @@ void rt2x00queue_align_frame(struct sk_buff *skb)skb_trim (skb, frame_length); } -void rt2x00queue_insert_l2pad (struct sk_buff *skb,unsigned int header_length) +/* +* H/W needs L2 padding between the header and the paylod if header size +* is not 4 bytes aligned. +*/ +void rt2x00queue_insert_l2pad (struct sk_buff *skb,unsigned int hdr_len) { -unsigned int payload_length = skb->len - header_length; -unsigned int header_align =ALIGN_SIZE (skb,0 ); -unsigned int payload_align =ALIGN_SIZE (skb, header_length); -unsigned int l2pad = payload_length ?L2PAD_SIZE (header_length) :0 ; +unsigned int l2pad = (skb->len > hdr_len) ?L2PAD_SIZE (hdr_len) :0 ; -/* -* Adjust the header alignment if the payload needs to be moved more -* than the header. -*/ -if (payload_align > header_align) - header_align +=4 ; - -/* There is nothing to do if no alignment is needed */ -if (!header_align) +if (!l2pad)return ; -/* Reserve the amount of space needed in front of the frame */ -skb_push (skb, header_align); - -/* -* Move the header. -*/ -memmove (skb->data, skb->data + header_align, header_length); - -/* Move the payload, if present and if required */ -if (payload_length && payload_align) -memmove (skb->data + header_length + l2pad, - skb->data + header_length + l2pad + payload_align, - payload_length); - -/* Trim the skb to the correct size */ -skb_trim (skb, header_length + l2pad + payload_length); +skb_push (skb, l2pad); +memmove (skb->data, skb->data + l2pad, hdr_len); } -void rt2x00queue_remove_l2pad (struct sk_buff *skb,unsigned int header_length) +void rt2x00queue_remove_l2pad (struct sk_buff *skb,unsigned int hdr_len) { -/* -* L2 padding is only present if the skb contains more than just the -* IEEE 802.11 header. -*/ -unsigned int l2pad = (skb->len > header_length) ? -L2PAD_SIZE (header_length) :0 ; +unsigned int l2pad = (skb->len > hdr_len) ?L2PAD_SIZE (hdr_len) :0 ;if (!l2pad)return ; -memmove (skb->data + l2pad, skb->data, header_length); +memmove (skb->data + l2pad, skb->data, hdr_len);skb_pull (skb, l2pad); }
Signature · 1 line
2.1.3
PATCH 58/66 nfsd: correctly define v4.2 support attributes
In reply to Jiri SlabyFrom: Christoph Hellwig <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6d0ba0432a5e10bc714ba9c5adc460e726e5fbb4 upstream.
Even when security labels are disabled we support at least the same attributes as v4.1.
--- fs/nfsd/nfsd.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
fs/nfsd/nfsd.h +6 -3
@@ -328,12 +328,15 @@ void nfsd_lockd_shutdown(void); (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT)#ifdef CONFIG_NFSD_V4_SECURITY_LABEL -#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \ - (NFSD4_1_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SECURITY_LABEL) +#define NFSD4_2_SECURITY_ATTRS FATTR4_WORD2_SECURITY_LABEL#else -#define NFSD4_2_SUPPORTED_ATTRS_WORD2 0 +#define NFSD4_2_SECURITY_ATTRS 0#endif +#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \ + (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \ + NFSD4_2_SECURITY_ATTRS) +static inline u32 nfsd_suppattrs0 (u32 minorversion) { return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
Signature · 1 line
2.1.3
PATCH 59/66 nfsd: Fix slot wake up race in the nfsv4.1 callback code
In reply to Jiri SlabyFrom: Trond Myklebust <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.
The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no locking in order to guarantee atomicity, and so allows for races of the form.
Task 1 Task 2
====== ======
if (test_and_set_bit(0) != 0) {
clear_bit(0)
rpc_wake_up_next(queue)
rpc_sleep_on(queue)
return false;
}This patch breaks the race condition by adding a retest of the bit after the call to rpc_sleep_on().
--- fs/nfsd/nfs4callback.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +6 -2
@@ -784,8 +784,12 @@ static bool nfsd41_cb_get_slot(struct nfs4_client *clp, struct rpc_task *task) {if (test_and_set_bit (0 , &clp->cl_cb_slot_busy) !=0 ) {rpc_sleep_on (&clp->cl_cb_waitq, task,NULL ); -dprintk ("%s slot is busy\n" , __func__); -return false; +/* Race breaker */ +if (test_and_set_bit (0 , &clp->cl_cb_slot_busy) !=0 ) { +dprintk ("%s slot is busy\n" , __func__); +return false; + } +rpc_wake_up_queued_task (&clp->cl_cb_waitq, task); }return true; }
Signature · 1 line
2.1.3
PATCH 60/66 net/ping: handle protocol mismatching scenario
In reply to Jiri SlabyFrom: Jane Zhou <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 91a0b603469069cdcce4d572b7525ffc9fd352a6 upstream.
ping_lookup() may return a wrong sock if sk_buff's and sock's protocols dont' match. For example, sk_buff's protocol is ETH_P_IPV6, but sock's sk_family is AF_INET, in that case, if sk->sk_bound_dev_if is zero, a wrong sock will be returned.
the fix is to "continue" the searching, if no matching, return NULL.
--- net/ipv4/ping.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/ping.c +2 -0
@@ -214,6 +214,8 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident) &ipv6_hdr(skb)->daddr))continue ;#endif + }else { +continue ; }if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
Signature · 1 line
2.1.3
PATCH 61/66 bnx2fc: do not add shared skbs to the fcoe_rx_list
In reply to Jiri SlabyFrom: Maurizio Lombardi <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 01a4cc4d0cd6a836c7b923760e8eb1cbb6a47258 upstream.
In some cases, the fcoe_rx_list may contains multiple instances of the same skb (the so called "shared skbs").
the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list, modifies (and destroys) its content and then proceed to the next one. The problem is that if the skb is shared, the remaining instances will be corrupted.
The solution is to use skb_share_check() before adding the skb to the fcoe_rx_list.
[ 6286.808725] ------------[ cut here ]------------ [ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]() [ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio] [ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 3.10.0-121.el7.x86_64 #1 [ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013 [ 6286.808752] 0000000000000000 000000000b36e715 ffff8800deba1e00 ffffffff815ec0ba [ 6286.808753] ffff8800deba1e38 ffffffff8105dee1 ffffffffa05618c0 ffff8801e4c81888 [ 6286.808754] ffffe8ffff663868 ffff8801f402b180 ffff8801f56bc000 ffff8800deba1e48 [ 6286.808754] Call Trace: [ 6286.808759] [<ffffffff815ec0ba>] dump_stack+0x19/0x1b [ 6286.808762] [<ffffffff8105dee1>] warn_slowpath_common+0x61/0x80 [ 6286.808763] [<ffffffff8105e00a>] warn_slowpath_null+0x1a/0x20 [ 6286.808765] [<ffffffffa054f415>] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc] [ 6286.808767] [<ffffffffa054eff0>] ? bnx2fc_disable+0x90/0x90 [bnx2fc] [ 6286.808769] [<ffffffff81085aef>] kthread+0xcf/0xe0 [ 6286.808770] [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140 [ 6286.808772] [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0 [ 6286.808773] [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140 [ 6286.808774] ---[ end trace c6cdb939184ccb4e ]---
--- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +7 -0
@@ -411,6 +411,7 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,struct fc_frame_header *fh;struct fcoe_rcv_info *fr;struct fcoe_percpu_s *bg; +struct sk_buff *tmp_skb;unsigned short oxid; interface = container_of(ptype, struct bnx2fc_interface,
@@ -423,6 +424,12 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev, goto err; } + tmp_skb =skb_share_check (skb,GFP_ATOMIC ); +if (!tmp_skb) + goto err; + + skb = tmp_skb; +if (unlikely (eth_hdr (skb)->h_proto !=htons (ETH_P_FCOE ))) { printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n"); goto err;
Signature · 1 line
2.1.3
PATCH 62/66 drm/radeon: fix endian swapping in vbios fetch for tdp table
In reply to Jiri SlabyFrom: Alex Deucher <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 28731d5818ae25b92d1fb82fe0ac196e97102c1b upstream.
Value needs to be swapped on BE.
--- drivers/gpu/drm/radeon/r600_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/r600_dpm.c +1 -1
@@ -1193,7 +1193,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) (mode_info->atom_context->bios + data_offset +le16_to_cpu (ext_hdr->usPowerTuneTableOffset)); rdev->pm.dpm.dyn_state.cac_tdp_table->maximum_power_delivery_limit = - ppt->usMaximumPowerDeliveryLimit; +le16_to_cpu (ppt->usMaximumPowerDeliveryLimit); pt = &ppt->power_tune_table; }else { ATOM_PPLIB_POWERTUNE_Table *ppt = (ATOM_PPLIB_POWERTUNE_Table *)
Signature · 1 line
2.1.3
PATCH 63/66 gpu/radeon: Set flag to indicate broken 64-bit MSI
In reply to Jiri SlabyFrom: Benjamin Herrenschmidt <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 91ed6fd2c383bb8f02d66e98b4a4d2f7207249dc upstream.
Some radeon ASICs don't support all 64 address bits of MSIs despite advertising support for 64-bit MSIs in their configuration space.
This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can be assigned with some of the high address bits set.
This makes use of the newly introduced "no_64bit_msi" flag in structure pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs on those adapters.
Adding Alex's review tag. Patch to the driver is identical to the reviewed one, I dropped the arch/powerpc hunk rewrote the subject and cset comment.
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/radeon/radeon_irq_kms.c +10 -0
@@ -196,6 +196,16 @@ static bool radeon_msi_ok(struct radeon_device *rdev)if (rdev->flags &RADEON_IS_AGP )return false; +/* +* Older chips have a HW limitation, they can only generate 40 bits +* of address for "64-bit" MSIs which breaks on some platforms, notably +* IBM POWER servers, so we limit them +*/ +if (rdev->family <CHIP_BONAIRE ) { +dev_info (rdev->dev,"radeon: MSI limited to 32-bit\n" ); + rdev->pdev->no_64bit_msi =1 ; + } +/* force MSI on */ if (radeon_msi ==1 )return true;
Signature · 1 line
2.1.3
PATCH 64/66 locks: eliminate BUG() call when there's an unexpected lock on file close
In reply to Jiri SlabyFrom: Jeff Layton <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8c3cac5e6a85f03602ffe09c44f14418699e31ec upstream.
A leftover lock on the list is surely a sign of a problem of some sort, but it's not necessarily a reason to panic the box. Instead, just log a warning with some info about the lock, and then delete it like we would any other lock.
In the event that the filesystem declares a ->lock f_op, we may end up leaking something, but that's generally preferable to an immediate panic.
--- fs/locks.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
fs/locks.c +18 -6
@@ -2199,16 +2199,28 @@ void locks_remove_flock(struct file *filp)while ((fl = *before) !=NULL ) {if (fl->fl_file == filp) { -if (IS_FLOCK (fl)) { -locks_delete_lock (before); -continue ; - }if (IS_LEASE (fl)) {lease_modify (before,F_UNLCK );continue ; } -/* What? */ -BUG (); + +/* +* There's a leftover lock on the list of a type that +* we didn't expect to see. Most likely a classic +* POSIX lock that ended up not getting released +* properly, or that raced onto the list somehow. Log +* some info about it and then just remove it from +* the list. +*/ +WARN (!IS_FLOCK (fl), +"leftover lock: dev=%u:%u ino=%lu type=%hhd flags=0x%x start=%lld end=%lld\n" , +MAJOR (inode->i_sb->s_dev), +MINOR (inode->i_sb->s_dev), inode->i_ino, + fl->fl_type, fl->fl_flags, + fl->fl_start, fl->fl_end); + +locks_delete_lock (before); +continue ; } before = &fl->fl_next; }
Signature · 1 line
2.1.3
PATCH 65/66 powerpc/powernv: Honor the generic "no_64bit_msi" flag
In reply to Jiri SlabyFrom: Benjamin Herrenschmidt <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 360743814c4082515581aa23ab1d8e699e1fbe88 upstream.
Instead of the arch specific quirk which we are deprecating and that drivers don't understand.
--- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +-- arch/powerpc/platforms/powernv/pci.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/powerpc/platforms/powernv/pci-ioda.c +1 -2
@@ -792,7 +792,6 @@ static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, struct pci_dev *dev, unsigned int is_64, struct msi_msg *msg) { struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev); -struct pci_dn *pdn =pci_get_pdn (dev);struct irq_data *idata;struct irq_chip *ichip;unsigned int xive_num = hwirq - phb->msi_base;
@@ -809,7 +808,7 @@ static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, struct pci_dev *dev,return -ENXIO ;/* Force 32-bit MSI on some broken devices */ -if (pdn && pdn->force_32bit_msi) +if (dev->no_64bit_msi) is_64 =0 ;/* Assign XIVE to PE */
arch/powerpc/platforms/powernv/pci.c +2 -2
@@ -1,3 +1,4 @@ +/* * Support PCI/PCIe on PowerNV platforms *
@@ -50,9 +51,8 @@ static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type) {struct pci_controller *hose =pci_bus_to_host (pdev->bus);struct pnv_phb *phb = hose->private_data; -struct pci_dn *pdn =pci_get_pdn (pdev); -if (pdn && pdn->force_32bit_msi && !phb->msi32_support) +if (pdev->no_64bit_msi && !phb->msi32_support)return -ENODEV ;return (phb && phb->msi_bmp.bitmap) ?0 : -ENODEV ;
Signature · 1 line
2.1.3
PATCH 66/66 batman: fix a bogus warning from batadv_is_on_batman_iface()
In reply to Jiri SlabyFrom: Cong Wang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b6ed5498601df40489606dbc14a9c7011c16630b upstream.
batman tries to search dev->iflink to check if it's a batman interface, but ->iflink could be 0, which is not a valid ifindex. It should just avoid iflink == 0 case.
--- net/batman-adv/hard-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/hard-interface.c +1 -1
@@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)return true;/* no more parents..stop recursion */ -if (net_dev->iflink == net_dev->ifindex) +if (net_dev->iflink ==0 || net_dev->iflink == net_dev->ifindex)return false;/* recurse over the parent device */
Signature · 1 line
2.1.3
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.35 release. There are 66 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 Wed Dec 10 16:07:07 CET 2014. Anything received after that time might be too late.
Build results:
total: 135 pass: 135 fail: 0 Qemu tests: total: 27 pass: 27 fail: 0
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
Quoted 16 lines · Guenter Roeck
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.35 release. There are 66 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 Wed Dec 10 16:07:07 CET 2014. Anything received after that time might be too late.
Build results:
total: 135 pass: 135 fail: 0 Qemu tests: total: 27 pass: 27 fail: 0Details are available at http://server.roeck-us.net:8010/builders.
Quoted 1 line · Shuah Khan
Compiled and booted on my test system. No dmesg regressions.
Thank you both!
Signature · 2 lines
js suse labs
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.35 release. There are 66 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 Wed Dec 10 16:07:07 CET 2014. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.35-rc1.xzand the diffstat can be found below.
thanks,
js
Compiled and booted on my test system. No dmesg regressions.
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Open Source Group Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978