3.0.77-stable review
Subsystems (33)
Greg Kroah-Hartman
maintainercover 3.0.77-stable review
This is the start of the stable review cycle for the 3.0.77 release. There are 46 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 May 8 22:56:20 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.77-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.0.77-rc1
Greg Kroah-Hartman <[email protected]>
Revert :can: sja1000: fix handling on dt properties on little endian systems"
Linus Torvalds <[email protected]>
s390: move dummy io_remap_pfn_range() to asm/pgtable.h
Lars-Peter Clausen <[email protected]>
mfd: adp5520: Restore mode bits on resume
Philip Rakity <[email protected]>
mmc: core: Fix bit width test failing on old eMMC cards
Li Fei <[email protected]>
x86: Eliminate irq_mis_count counted in arch_irq_stat
Theodore Ts'o <[email protected]>
ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG
Robin Holt <[email protected]>
ipc: sysv shared memory limited to 8TiB
Johannes Berg <[email protected]>
wireless: regulatory: fix channel disabling race condition
Bryan Schumaker <[email protected]>
nfsd: Decode and send 64bit time values
J. Bruce Fields <[email protected]>
nfsd4: don't close read-write opens too soon
Trond Myklebust <[email protected]>
NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall
Trond Myklebust <[email protected]>
LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
Thomas Gleixner <[email protected]>
clockevents: Set dummy handler on CPU_DEAD shutdown
Li Zefan <[email protected]>
cgroup: fix an off-by-one bug which may trigger BUG_ON()
Derek Basehore <[email protected]>
drivers/rtc/rtc-cmos.c: don't disable hpet emulation on suspend
Prarit Bhargava <[email protected]>
hrtimer: Add expiry time overflow check in hrtimer_interrupt
David Engraf <[email protected]>
hrtimer: Fix ktime_add_ns() overflow on 32bit architectures
Dylan Reid <[email protected]>
ASoC: max98088: Fix logging of hardware revision.
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix autopm error during probing
Clemens Ladisch <[email protected]>
ALSA: usb-audio: disable autopm for MIDI devices
Anurup m <[email protected]>
fs/fscache/stats.c: fix memory leak
Stephan Schreiber <[email protected]>
Wrong asm register contraints in the kvm implementation
Stephan Schreiber <[email protected]>
Wrong asm register contraints in the futex implementation
Yinghai Lu <[email protected]>
PCI / ACPI: Don't query OSC support with all possible controls
Tony Luck <[email protected]>
Fix initialization of CMCI/CMCP interrupts
Steven A. Falco <[email protected]>
i2c: xiic: must always write 16-bit words to TX_FIFO
Namhyung Kim <[email protected]>
tracing: Reset ftrace_graph_filter_enabled if count is zero
Namhyung Kim <[email protected]>
tracing: Check return value of tracing_init_dentry()
Namhyung Kim <[email protected]>
tracing: Fix off-by-one on allocating stat->pages
Steven Rostedt (Red Hat) <[email protected]>
tracing: Remove most or all of stack tracer stack size from stack_max_size
Steven Rostedt (Red Hat) <[email protected]>
tracing: Fix stack tracer with fentry use
Steven Rostedt (Red Hat) <[email protected]>
tracing: Use stack of calling function for stack tracer
Mika Kuoppala <[email protected]>
fbcon: when font is freed, clear also vc_font.data
Linus Torvalds <[email protected]>
tty: fix up atime/mtime mess, take three
Federico Vaga <[email protected]>
serial_core.c: add put_device() after device_find_child()
Konrad Rzeszutek Wilk <[email protected]>
xen/time: Fix kasprintf splat when allocating timer%d IRQ line.
Heiko Carstens <[email protected]>
s390/memory hotplug: prevent offline of active memory increments
Tormod Volden <[email protected]>
usb-storage: CY7C68300A chips do not support Cypress ATACB
Hans de Goede <[email protected]>
usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep
Adrian Thomasset <[email protected]>
USB: ftdi_sio: correct ST Micro Connect Lite PIDs
Stefani Seibold <[email protected]>
USB: add ftdi_sio USB ID for GDM Boost V1.x
Ben Jencks <[email protected]>
usb/misc/appledisplay: Add 24" LED Cinema display
Bjørn Mork <[email protected]>
USB: option: add a D-Link DWM-156 variant
Filippo Turato <[email protected]>
USB: serial: option: Added support Olivetti Olicard 145
Michael Ellerman <[email protected]>
powerpc/spufs: Initialise inode->i_ino in spufs_new_inode()
Michael Neuling <[email protected]>
powerpc: Add isync to copy_and_flush
-------------
Diffstat:
Makefile | 4 +- arch/ia64/include/asm/futex.h | 5 +- arch/ia64/include/asm/mca.h | 1 + arch/ia64/kernel/irq.c | 8 +++ arch/ia64/kernel/mca.c | 37 ++++++++----- arch/ia64/kvm/vtlb.c | 2 +- arch/powerpc/kernel/head_64.S | 1 + arch/powerpc/platforms/cell/spufs/inode.c | 1 + arch/s390/include/asm/pgtable.h | 4 ++ arch/x86/kernel/irq.c | 4 -- arch/x86/xen/enlighten.c | 5 +- arch/x86/xen/time.c | 6 ++- drivers/acpi/pci_root.c | 4 +- drivers/i2c/busses/i2c-xiic.c | 6 +-- drivers/mfd/adp5520.c | 8 ++- drivers/mmc/core/mmc.c | 2 +- drivers/net/can/sja1000/sja1000_of_platform.c | 31 +++++------ drivers/rtc/rtc-cmos.c | 4 +- drivers/s390/char/sclp_cmd.c | 4 +- drivers/tty/pty.c | 3 ++ drivers/tty/serial/serial_core.c | 4 ++ drivers/tty/tty_io.c | 4 +- drivers/usb/core/devio.c | 2 + drivers/usb/misc/appledisplay.c | 1 + drivers/usb/serial/ftdi_sio.c | 5 +- drivers/usb/serial/ftdi_sio_ids.h | 4 +- drivers/usb/serial/option.c | 8 +++ drivers/usb/storage/cypress_atacb.c | 16 +++++- drivers/video/console/fbcon.c | 2 + fs/ext4/Kconfig | 3 +- fs/fscache/stats.c | 2 +- fs/lockd/clntlock.c | 3 ++ fs/lockd/clntproc.c | 3 -- fs/nfs/nfs4proc.c | 6 +++ fs/nfsd/nfs4state.c | 8 +-- fs/nfsd/nfs4xdr.c | 19 ++----- include/linux/ipc_namespace.h | 2 +- ipc/shm.c | 2 +- kernel/cgroup.c | 2 +- kernel/hrtimer.c | 6 +++ kernel/time/tick-broadcast.c | 4 ++ kernel/time/tick-common.c | 1 + kernel/trace/ftrace.c | 5 +- kernel/trace/trace.c | 2 + kernel/trace/trace_stack.c | 76 ++++++++++++++++++++++++--- kernel/trace/trace_stat.c | 2 + net/wireless/reg.c | 2 +- sound/soc/codecs/max98088.c | 2 +- sound/usb/card.c | 4 +- sound/usb/midi.c | 13 +---- 50 files changed, 243 insertions(+), 110 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/46 powerpc: Add isync to copy_and_flush
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <[email protected]>
commit 29ce3c5073057991217916abc25628e906911757 upstream.
In __after_prom_start we copy the kernel down to zero in two calls to copy_and_flush. After the first call (copy from 0 to copy_to_here:) we jump to the newly copied code soon after.
Unfortunately there's no isync between the copy of this code and the jump to it. Hence it's possible that stale instructions could still be in the icache or pipeline before we branch to it.
We've seen this on real machines and it's results in no console output after:
calling quiesce...
returning from prom_init
The below adds an isync to ensure that the copy and flushing has completed before any branching to the new instructions occurs.
--- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/head_64.S +1 -0
@@ -492,6 +492,7 @@ _GLOBAL(copy_and_flush) sync addi r5,r5,8 addi r6,r6,8 + isync blr .align 8
Greg Kroah-Hartman
maintainerPATCH 2/46 powerpc/spufs: Initialise inode->i_ino in spufs_new_inode()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
commit 6747e83235caecd30b186d1282e4eba7679f81b7 upstream.
In commit 85fe402 (fs: do not assign default i_ino in new_inode), the initialisation of i_ino was removed from new_inode() and pushed down into the callers. However spufs_new_inode() was not updated.
This exhibits as no files appearing in /spu, because all our dirents have a zero inode, which readdir() seems to dislike.
--- arch/powerpc/platforms/cell/spufs/inode.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
@@ -100,6 +100,7 @@ spufs_new_inode(struct super_block *sb,if (!inode) goto out; + inode->i_ino =get_next_ino (); inode->i_mode = mode; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid ();
Greg Kroah-Hartman
maintainerPATCH 3/46 USB: serial: option: Added support Olivetti Olicard 145
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filippo Turato <[email protected]>
commit d19bf5cedfd7d53854a3bd699c98b467b139833b upstream.
This adds PID for Olivetti Olicard 145 in option.c
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -347,6 +347,7 @@ static void option_instat_callback(struc/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c#define OLIVETTI_PRODUCT_OLICARD100 0xc000 +#define OLIVETTI_PRODUCT_OLICARD145 0xc003/* Celot products */ #define CELOT_VENDOR_ID 0x211f
@@ -1273,6 +1274,7 @@ static const struct usb_device_id option { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
Greg Kroah-Hartman
maintainerPATCH 4/46 USB: option: add a D-Link DWM-156 variant
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit a2a2d6c7f93e160b52a4ad0164db1f43f743ae0f upstream.
Adding support for a Mediatek based device labelled as D-Link Model: DWM-156, H/W Ver: A7
Also adding two other device IDs found in the Debian(!) packages included on the embedded device driver CD.
This is a composite MBIM + serial ports + card reader device:
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 14 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2001 ProdID=7d01 Rev= 3.00 S: Manufacturer=D-Link,Inc S: Product=D-Link DWM-156 C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=500us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -1352,6 +1352,12 @@ static const struct usb_device_id option { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Greg Kroah-Hartman
maintainerPATCH 5/46 usb/misc/appledisplay: Add 24" LED Cinema display
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Jencks <[email protected]>
commit e7d3b6e22c871ba36d052ca99bc8ceca4d546a60 upstream.
Add the Apple 24" LED Cinema display to the supported devices.
--- drivers/usb/misc/appledisplay.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/misc/appledisplay.c +1 -0
@@ -63,6 +63,7 @@ static const struct usb_device_id appled { APPLEDISPLAY_DEVICE(0x9219) }, { APPLEDISPLAY_DEVICE(0x921c) }, { APPLEDISPLAY_DEVICE(0x921d) }, + { APPLEDISPLAY_DEVICE(0x9236) }, /* Terminating entry */ { }
Greg Kroah-Hartman
maintainerPATCH 6/46 USB: add ftdi_sio USB ID for GDM Boost V1.x
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefani Seibold <[email protected]>
commit 58f8b6c4fa5a13cb2ddb400e26e9e65766d71e38 upstream.
This patch add a missing usb device id for the GDMBoost V1.x device
The patch is against 3.9-rc5
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -195,6 +195,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -74,6 +74,7 @@#define FTDI_OPENDCC_THROTTLE_PID 0xBFDA#define FTDI_OPENDCC_GATEWAY_PID 0xBFDB#define FTDI_OPENDCC_GBM_PID 0xBFDC +#define FTDI_OPENDCC_GBM_BOOST_PID 0xBFDD/* NZR SEM 16+ USB (http://www.nzr.de) */ #define FTDI_NZR_SEM_USB_PID 0xC1E0/* NZR SEM-LOG16+ */
Greg Kroah-Hartman
maintainerPATCH 7/46 USB: ftdi_sio: correct ST Micro Connect Lite PIDs
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Thomasset <[email protected]>
commit 9f06d15f8db6946e41f73196a122b84a37938878 upstream.
The current ST Micro Connect Lite uses the FT4232H hi-speed quad USB UART FTDI chip. It is also possible to drive STM reference targets populated with an on-board JTAG debugger based on the FT2232H chip with the same STMicroelectronics tools.
For this reason, the ST Micro Connect Lite PIDs should beST_STMCLT_2232_PID: 0x3746ST_STMCLT_4232_PID: 0x3747
--- drivers/usb/serial/ftdi_sio.c | 4 +++- drivers/usb/serial/ftdi_sio_ids.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/usb/serial/ftdi_sio.c +3 -1
@@ -877,7 +877,9 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, - { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), + { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID),
drivers/usb/serial/ftdi_sio_ids.h +2 -1
@@ -1151,7 +1151,8 @@* STMicroelectonics */ #define ST_VID 0x0483 -#define ST_STMCLT1030_PID 0x3747/* ST Micro Connect Lite STMCLT1030 */ +#define ST_STMCLT_2232_PID 0x3746 +#define ST_STMCLT_4232_PID 0x3747/* * Papouch products (http://www.papouch.com/)
Greg Kroah-Hartman
maintainerPATCH 8/46 usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104 upstream.
When usbfs receives a ctrl-request from userspace it calls check_ctrlrecip, which for a request with USB_RECIP_ENDPOINT tries to map this to an interface to see if this interface is claimed, except for ctrl-requests with a type of USB_TYPE_VENDOR.
When trying to use this device: http://www.akaipro.com/eiepro
redirected to a Windows vm running on qemu on top of Linux.
The windows driver makes a ctrl-req with USB_TYPE_CLASS and USB_RECIP_ENDPOINT with index 0, and the mapping of the endpoint (0) to the interface fails since ep 0 is the ctrl endpoint and thus never is part of an interface.
This patch fixes this ctrl-req failing by skipping the checkintf call for USB_RECIP_ENDPOINT ctrl-reqs on the ctrl endpoint.
--- drivers/usb/core/devio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/core/devio.c +2 -0
@@ -642,6 +642,8 @@ static int check_ctrlrecip(struct dev_st index &=0xff ;switch (requesttype &USB_RECIP_MASK ) {case USB_RECIP_ENDPOINT : +if ((index & ~USB_DIR_IN ) ==0 ) +return 0 ; ret =findintfep (ps->dev, index);if (ret >=0 ) ret =checkintf (ps, ret);
Greg Kroah-Hartman
maintainerPATCH 9/46 usb-storage: CY7C68300A chips do not support Cypress ATACB
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tormod Volden <[email protected]>
commit 671b4b2ba9266cbcfe7210a704e9ea487dcaa988 upstream.
Many cards based on CY7C68300A/B/C use the USB ID 04b4:6830 but only the B and C variants (EZ-USB AT2LP) support the ATA Command Block functionality, according to the data sheets. The A variant (EZ-USB AT2) locks up if ATACB is attempted, until a typical 30 seconds timeout runs out and a USB reset is performed.
https://bugs.launchpad.net/bugs/428469
It seems that one way to spot a CY7C68300A (at least where the card manufacturer left Cypress' EEPROM default vaules, against Cypress' recommendations) is to look at the USB string descriptor indices.
A http://media.digikey.com/pdf/Data%20Sheets/Cypress%20PDFs/CY7C68300A.pdf
B http://www.farnell.com/datasheets/43456.pdf
C http://www.cypress.com/?rID=14189
Note that a CY7C68300B/C chip appears as CY7C68300A if it is running in Backward Compatibility Mode, and if ATACB would be supported in this case there is anyway no way to tell which chip it really is.
For 5 years my external USB drive has been locking up for half a minute when plugged in and ata_id is run by udev, or anytime hdparm or similar is run on it.
Finally looking at the /correct/ datasheet I think I found the reason. I am aware the quirk in this patch is a bit hacky, but the hardware manufacturers haven't made it easy for us.
--- drivers/usb/storage/cypress_atacb.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/usb/storage/cypress_atacb.c +14 -2
@@ -248,14 +248,26 @@ static int cypress_probe(struct usb_inte {struct us_data *us;int result; +struct usb_device *device; result =usb_stor_probe1 (&us, intf, id, (id - cypress_usb_ids) + cypress_unusual_dev_list);if (result)return result; - us->protocol_name ="Transparent SCSI with Cypress ATACB" ; - us->proto_handler = cypress_atacb_passthrough; +/* Among CY7C68300 chips, the A revision does not support Cypress ATACB +* Filter out this revision from EEPROM default descriptor values +*/ + device =interface_to_usbdev (intf); +if (device->descriptor.iManufacturer !=0x38 || + device->descriptor.iProduct !=0x4e || + device->descriptor.iSerialNumber !=0x64 ) { + us->protocol_name ="Transparent SCSI with Cypress ATACB" ; + us->proto_handler = cypress_atacb_passthrough; + }else { + us->protocol_name ="Transparent SCSI" ; + us->proto_handler = usb_stor_transparent_scsi_command; + } result =usb_stor_probe2 (us);return result;
Greg Kroah-Hartman
maintainerPATCH 10/46 s390/memory hotplug: prevent offline of active memory increments
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
commit 94c163663fc1dcfc067a5fb3cc1446b9469975ce upstream.
In case a machine supports memory hotplug all active memory increments present at IPL time have been initialized with a "usecount" of 1. This is wrong if the memory increment size is larger than the memory section size of the memory hotplug code. If that is the case the usecount must be initialized with the number of memory sections that fit into one memory increment.
Otherwise it is possible to put a memory increment into standby state even if there are still active sections.
Afterwards addressing exceptions might happen which cause the kernel to panic.
However even worse, if a memory increment was put into standby state and afterwards into active state again, it's contents would have been zeroed, leading to memory corruption.
This was only an issue for machines that support standby memory and have at least 256GB memory.
This is broken since commit fdb1bb15 "[S390] sclp/memory hotplug: fix initial usecount of increments".
--- drivers/s390/char/sclp_cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/s390/char/sclp_cmd.c +3 -1
@@ -507,6 +507,8 @@ static void __init sclp_add_standby_memoadd_memory_merged (0 ); } +#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS) +static void __init insert_increment (u16 rn,int standby,int assigned) {struct memory_increment *incr, *new_incr;
@@ -519,7 +521,7 @@ static void __init insert_increment(u16 new_incr->rn = rn; new_incr->standby = standby;if (!standby) - new_incr->usecount =1 ; + new_incr->usecount = rzm >MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE :1 ; last_rn =0 ; prev = &sclp_mem_list;list_for_each_entry (incr, &sclp_mem_list, list) {
Greg Kroah-Hartman
maintainerPATCH 11/46 xen/time: Fix kasprintf splat when allocating timer%d IRQ line.
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit 7918c92ae9638eb8a6ec18e2b4a0de84557cccc8 upstream.
When we online the CPU, we get this splat:
smpboot: Booting Node 0 Processor 1 APIC 0x2
installing Xen timer for CPU 1
BUG: sleeping function called from invalid context at /home/konrad/ssd/konrad/linux/mm/slab.c:3179 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/1 Pid: 0, comm: swapper/1 Not tainted 3.9.0-rc6upstream-00001-g3884fad #1 Call Trace: [<ffffffff810c1fea>] __might_sleep+0xda/0x100 [<ffffffff81194617>] __kmalloc_track_caller+0x1e7/0x2c0 [<ffffffff81303758>] ? kasprintf+0x38/0x40 [<ffffffff813036eb>] kvasprintf+0x5b/0x90 [<ffffffff81303758>] kasprintf+0x38/0x40 [<ffffffff81044510>] xen_setup_timer+0x30/0xb0 [<ffffffff810445af>] xen_hvm_setup_cpu_clockevents+0x1f/0x30 [<ffffffff81666d0a>] start_secondary+0x19c/0x1a8
The solution to that is use kasprintf in the CPU hotplug path that 'online's the CPU. That is, do it in in xen_hvm_cpu_notify, and remove the call to in xen_hvm_setup_cpu_clockevents.
Unfortunatly the later is not a good idea as the bootup path does not use xen_hvm_cpu_notify so we would end up never allocating timer%d interrupt lines when booting. As such add the check for atomic() to continue.
--- arch/x86/xen/enlighten.c | 5 ++++- arch/x86/xen/time.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-)
arch/x86/xen/enlighten.c +4 -1
@@ -1365,8 +1365,11 @@ static int __cpuinit xen_hvm_cpu_notify(switch (action) {case CPU_UP_PREPARE :xen_vcpu_setup (cpu); -if (xen_have_vector_callback) +if (xen_have_vector_callback) {xen_init_lock_cpu (cpu); +if (xen_feature (XENFEAT_hvm_safe_pvclock)) +xen_setup_timer (cpu); + }break ;default :break ;
arch/x86/xen/time.c +5 -1
@@ -482,7 +482,11 @@ static void xen_hvm_setup_cpu_clockevent {int cpu =smp_processor_id ();xen_setup_runstate_info (cpu); -xen_setup_timer (cpu); +/* +* xen_setup_timer(cpu) - snprintf is bad in atomic context. Hence +* doing it xen_hvm_cpu_notify (which gets called by smp_init during +* early bootup and also during CPU hotplug events). +*/ xen_setup_cpu_clockevents (); }
Greg Kroah-Hartman
maintainerPATCH 12/46 serial_core.c: add put_device() after device_find_child()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Federico Vaga <[email protected]>
commit 5a65dcc04cda41f4122aacc37a5a348454645399 upstream.
The serial core uses device_find_child() but does not drop the reference to the retrieved child after using it. This patch add the missing put_device().
What I have done to test this issue.
I used a machine with an AMBA PL011 serial driver. I tested the patch on next-20120408 because the last branch [next-20120415] does not boot on this board.
For test purpose, I added some pr_info() messages to print the refcount after device_find_child() (lines: 1937,2009), and after put_device() (lines: 1947, 2021).
Boot the machine *without* put_device(). Then:
echo reboot > /sys/power/disk
echo disk > /sys/power/state
[ 87.058575] uart_suspend_port:1937 refcount 4 [ 87.058582] uart_suspend_port:1947 refcount 4 [ 87.098083] uart_resume_port:2009refcount 5 [ 87.098088] uart_resume_port:2021 refcount 5
echo disk > /sys/power/state
[ 103.055574] uart_suspend_port:1937 refcount 6 [ 103.055580] uart_suspend_port:1947 refcount 6 [ 103.095322] uart_resume_port:2009 refcount 7 [ 103.095327] uart_resume_port:2021 refcount 7
echo disk > /sys/power/state
[ 252.459580] uart_suspend_port:1937 refcount 8 [ 252.459586] uart_suspend_port:1947 refcount 8 [ 252.499611] uart_resume_port:2009 refcount 9 [ 252.499616] uart_resume_port:2021 refcount 9
The refcount continuously increased.
Boot the machine *with* this patch. Then:
echo reboot > /sys/power/disk
echo disk > /sys/power/state
[ 159.333559] uart_suspend_port:1937 refcount 4 [ 159.333566] uart_suspend_port:1947 refcount 3 [ 159.372751] uart_resume_port:2009 refcount 4 [ 159.372755] uart_resume_port:2021 refcount 3
echo disk > /sys/power/state
[ 185.713614] uart_suspend_port:1937 refcount 4 [ 185.713621] uart_suspend_port:1947 refcount 3 [ 185.752935] uart_resume_port:2009 refcount 4 [ 185.752940] uart_resume_port:2021 refcount 3
echo disk > /sys/power/state
[ 207.458584] uart_suspend_port:1937 refcount 4 [ 207.458591] uart_suspend_port:1947 refcount 3 [ 207.498598] uart_resume_port:2009 refcount 4 [ 207.498605] uart_resume_port:2021 refcount 3
The refcount correctly handled.
--- drivers/tty/serial/serial_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/serial_core.c +4 -0
@@ -1917,6 +1917,8 @@ int uart_suspend_port(struct uart_drivermutex_unlock (&port->mutex);return 0 ; } +put_device (tty_dev); +if (console_suspend_enabled || !uart_console (uport)) uport->suspended =1 ;
@@ -1982,9 +1984,11 @@ int uart_resume_port(struct uart_driverdisable_irq_wake (uport->irq); uport->irq_wake =0 ; } +put_device (tty_dev);mutex_unlock (&port->mutex);return 0 ; } +put_device (tty_dev); uport->suspended =0 ;/*
Greg Kroah-Hartman
maintainerPATCH 13/46 tty: fix up atime/mtime mess, take three
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit b0b885657b6c8ef63a46bc9299b2a7715d19acde upstream.
We first tried to avoid updating atime/mtime entirely (commitb0de59b5733d: "TTY: do not update atime/mtime on read/write"), and then limited it to only update it occasionally (commit 37b7f3c76595: "TTY:
fix atime/mtime regression"), but it turns out that this was both insufficient and overkill.
It was insufficient because we let people attach to the shared ptmx node to see activity without even reading atime/mtime, and it was overkill because the "only once a minute" means that you can't really tell an idle person from an active one with 'w'.
So this tries to fix the problem properly. It marks the shared ptmx node as un-notifiable, and it lowers the "only once a minute" to a few seconds instead - still long enough that you can't time individual keystrokes, but short enough that you can tell whether somebody is active or not.
--- drivers/tty/pty.c | 3 +++ drivers/tty/tty_io.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/tty/pty.c +3 -0
@@ -669,6 +669,9 @@ static int ptmx_open(struct inode *inodenonseekable_open (inode, filp); +/* We refuse fsnotify events on ptmx, since it's a shared resource */ + filp->f_mode |=FMODE_NONOTIFY ; + retval =tty_alloc_file (filp);if (retval)return retval;
drivers/tty/tty_io.c +2 -2
@@ -939,10 +939,10 @@ void start_tty(struct tty_struct *tty)EXPORT_SYMBOL (start_tty); +/* We limit tty time update visibility to every 8 seconds or so. */ static void tty_update_time (struct timespec *time) { -unsigned long sec =get_seconds (); - sec -= sec %60 ; +unsigned long sec =get_seconds () & ~7 ;if ((long )(sec - time->tv_sec) >0 ) time->tv_sec = sec; }
Greg Kroah-Hartman
maintainerPATCH 14/46 fbcon: when font is freed, clear also vc_font.data
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Kuoppala <[email protected]>
commit e6637d5427d2af9f3f33b95447bfc5347e5ccd85 upstream.
commit ae1287865f5361fa138d4d3b1b6277908b54eac9
Author: Dave Airlie <[email protected]> Date: Thu Jan 24 16:12:41 2013 +1000
fbcon: don't lose the console font across generic->chip driver switch
uses a pointer in vc->vc_font.data to load font into the new driver. However if the font is actually freed, we need to clear the data so that we don't reload font from dangling pointer.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=892340
--- drivers/video/console/fbcon.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/video/console/fbcon.c +2 -0
@@ -1229,6 +1229,8 @@ static void fbcon_deinit(struct vc_data finished:fbcon_free_font (p, free_font); +if (free_font) + vc->vc_font.data =NULL ;if (!con_is_bound (&fb_con))fbcon_exit ();
Greg Kroah-Hartman
maintainerPATCH 15/46 tracing: Use stack of calling function for stack tracer
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit 87889501d0adfae10e3b0f0e6f2d7536eed9ae84 upstream.
Use the stack of stack_trace_call() instead of check_stack() as the test pointer for max stack size. It makes it a bit cleaner and a little more accurate.
Adding stable, as a later fix depends on this patch.
--- kernel/trace/trace_stack.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/trace/trace_stack.c +7 -5
@@ -37,20 +37,21 @@ static DEFINE_MUTEX(stack_sysctl_mutex);int stack_tracer_enabled;static int last_stack_tracer_enabled; -static inline void check_stack (void ) +static inline void +check_stack (unsigned long *stack) {unsigned long this_size, flags;unsigned long *p, *top, *start;int i; - this_size = ((unsigned long )&this_size) & (THREAD_SIZE -1 ); + this_size = ((unsigned long )stack) & (THREAD_SIZE -1 ); this_size =THREAD_SIZE - this_size;if (this_size <= max_stack_size)return ;/* we do not handle interrupt stacks yet */ -if (!object_is_on_stack (&this_size)) +if (!object_is_on_stack (stack))return ;local_irq_save (flags);
@@ -71,7 +72,7 @@ static inline void check_stack(void)* Now find where in the stack these are. */ i =0 ; - start = &this_size; + start = stack; top = (unsigned long *) (((unsigned long )start & ~(THREAD_SIZE -1 )) +THREAD_SIZE );
@@ -110,6 +111,7 @@ static inline void check_stack(void)static void stack_trace_call (unsigned long ip,unsigned long parent_ip) { +unsigned long stack;int cpu;if (unlikely (!ftrace_enabled || stack_trace_disabled))
@@ -122,7 +124,7 @@ stack_trace_call(unsigned long ip, unsigif (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (); +check_stack (&stack); out:per_cpu (trace_active, cpu)--;
Greg Kroah-Hartman
maintainerPATCH 16/46 tracing: Fix stack tracer with fentry use
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit d4ecbfc49b4b1d4b597fb5ba9e4fa25d62f105c5 upstream.
When gcc 4.6 on x86 is used, the function tracer will use the new option -mfentry which does a call to "fentry" at every function instead of "mcount". The significance of this is that fentry is called as the first operation of the function instead of the mcount usage of being called after the stack.
This causes the stack tracer to show some bogus results for the size of the last function traced, as well as showing "ftrace_call" instead of the function. This is due to the stack frame not being set up by the function that is about to be traced.
# cat stack_trace
Depth Size Location (48 entries)
----- ---- --------
0) 4824 216 ftrace_call+0x5/0x2f
1) 4608 112 ____cache_alloc+0xb7/0x22d
2) 4496 80 kmem_cache_alloc+0x63/0x12fThe 216 size for ftrace_call includes both the ftrace_call stack (which includes the saving of registers it does), as well as the stack size of the parent.
To fix this, if CC_USING_FENTRY is defined, then the stack_tracer will reserve the first item in stack_dump_trace[] array when calling save_stack_trace(), and it will fill it in with the parent ip. Then the code will look for the parent pointer on the stack and give the real size of the parent's stack pointer:
# cat stack_trace
Depth Size Location (14 entries)
----- ---- --------
0) 2640 48 update_group_power+0x26/0x187
1) 2592 224 update_sd_lb_stats+0x2a5/0x4ac
2) 2368 160 find_busiest_group+0x31/0x1f1
3) 2208 256 load_balance+0xd9/0x662I'm Cc'ing stable, although it's not urgent, as it only shows bogus size for item #0, the rest of the trace is legit. It should still be corrected in previous stable releases.
--- kernel/trace/trace_stack.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-)
kernel/trace/trace_stack.c +29 -4
@@ -17,13 +17,27 @@#define STACK_TRACE_ENTRIES 500 +/* +* If fentry is used, then the function being traced will +* jump to fentry directly before it sets up its stack frame. +* We need to ignore that one and record the parent. Since +* the stack frame for the traced function wasn't set up yet, +* the stack_trace wont see the parent. That needs to be added +* manually to stack_dump_trace[] as the first element. +*/ +#ifdef CC_USING_FENTRY +# define add_func 1 +#else +# define add_func 0 +#endif +static unsigned long stack_dump_trace[STACK_TRACE_ENTRIES +1 ] = { [0 ... (STACK_TRACE_ENTRIES )] =ULONG_MAX };static unsigned stack_dump_index[STACK_TRACE_ENTRIES ];static struct stack_trace max_stack_trace = { - .max_entries =STACK_TRACE_ENTRIES , - .entries = stack_dump_trace, + .max_entries =STACK_TRACE_ENTRIES - add_func, + .entries = &stack_dump_trace[add_func], };static unsigned long max_stack_size;
@@ -38,7 +52,7 @@ int stack_tracer_enabled;static int last_stack_tracer_enabled;static inline void -check_stack (unsigned long *stack) +check_stack (unsigned long ip,unsigned long *stack) {unsigned long this_size, flags;unsigned long *p, *top, *start;
@@ -69,6 +83,17 @@ check_stack(unsigned long *stack)save_stack_trace (&max_stack_trace);/* +* When fentry is used, the traced function does not get +* its stack frame set up, and we lose the parent. +* Add that one in manally. We set up save_stack_trace() +* to not touch the first element in this case. +*/ +if (add_func) { + stack_dump_trace[0 ] = ip; + max_stack_trace.nr_entries++; + } + +/* * Now find where in the stack these are. */ i =0 ;
@@ -124,7 +149,7 @@ stack_trace_call(unsigned long ip, unsigif (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (&stack); +check_stack (parent_ip, &stack); out:per_cpu (trace_active, cpu)--;
Greg Kroah-Hartman
maintainerPATCH 17/46 tracing: Remove most or all of stack tracer stack size from stack_max_size
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit 4df297129f622bdc18935c856f42b9ddd18f9f28 upstream.
Currently, the depth reported in the stack tracer stack_trace file does not match the stack_max_size file. This is because the stack_max_size includes the overhead of stack tracer itself while the depth does not.
The first time a max is triggered, a calculation is not performed that figures out the overhead of the stack tracer and subtracts it from the stack_max_size variable. The overhead is stored and is subtracted from the reported stack size for comparing for a new max.
Now the stack_max_size corresponds to the reported depth:
# cat stack_max_size 4640
# cat stack_trace
Depth Size Location (48 entries)
----- ---- --------
0) 4640 32 _raw_spin_lock+0x18/0x24
1) 4608 112 ____cache_alloc+0xb7/0x22d
2) 4496 80 kmem_cache_alloc+0x63/0x12f
3) 4416 16 mempool_alloc_slab+0x15/0x17
[...]While testing against and older gcc on x86 that uses mcount instead of fentry, I found that pasing in ip + MCOUNT_INSN_SIZE let the stack trace show one more function deep which was missing before.
--- kernel/trace/trace_stack.c | 75 ++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 21 deletions(-)
kernel/trace/trace_stack.c +54 -21
@@ -17,27 +17,24 @@#define STACK_TRACE_ENTRIES 500 -/* -* If fentry is used, then the function being traced will -* jump to fentry directly before it sets up its stack frame. -* We need to ignore that one and record the parent. Since -* the stack frame for the traced function wasn't set up yet, -* the stack_trace wont see the parent. That needs to be added -* manually to stack_dump_trace[] as the first element. -*/ #ifdef CC_USING_FENTRY -# define add_func 1 +# define fentry 1#else -# define add_func 0 +# define fentry 0#endif static unsigned long stack_dump_trace[STACK_TRACE_ENTRIES +1 ] = { [0 ... (STACK_TRACE_ENTRIES )] =ULONG_MAX };static unsigned stack_dump_index[STACK_TRACE_ENTRIES ]; +/* +* Reserve one entry for the passed in ip. This will allow +* us to remove most or all of the stack size overhead +* added by the stack tracer itself. +*/ static struct stack_trace max_stack_trace = { - .max_entries =STACK_TRACE_ENTRIES - add_func, - .entries = &stack_dump_trace[add_func], + .max_entries =STACK_TRACE_ENTRIES -1 , + .entries = &stack_dump_trace[1 ], };static unsigned long max_stack_size;
@@ -56,10 +53,14 @@ check_stack(unsigned long ip, unsigned l {unsigned long this_size, flags;unsigned long *p, *top, *start; +static int tracer_frame; +int frame_size =ACCESS_ONCE (tracer_frame);int i; this_size = ((unsigned long )stack) & (THREAD_SIZE -1 ); this_size =THREAD_SIZE - this_size; +/* Remove the frame of the tracer */ + this_size -= frame_size;if (this_size <= max_stack_size)return ;
@@ -71,6 +72,10 @@ check_stack(unsigned long ip, unsigned llocal_irq_save (flags);arch_spin_lock (&max_stack_lock); +/* In case another CPU set the tracer_frame on us */ +if (unlikely (!frame_size)) + this_size -= tracer_frame; +/* a race could have already updated it */ if (this_size <= max_stack_size) goto out;
@@ -83,15 +88,12 @@ check_stack(unsigned long ip, unsigned lsave_stack_trace (&max_stack_trace);/* -* When fentry is used, the traced function does not get -* its stack frame set up, and we lose the parent. -* Add that one in manally. We set up save_stack_trace() -* to not touch the first element in this case. +* Add the passed in ip from the function tracer. +* Searching for this on the stack will skip over +* most of the overhead from the stack tracer itself. */ -if (add_func) { - stack_dump_trace[0 ] = ip; - max_stack_trace.nr_entries++; - } + stack_dump_trace[0 ] = ip; + max_stack_trace.nr_entries++;/* * Now find where in the stack these are.
@@ -121,6 +123,18 @@ check_stack(unsigned long ip, unsigned l found =1 ;/* Start the search from here */ start = p +1 ; +/* +* We do not want to show the overhead +* of the stack tracer stack in the +* max stack. If we haven't figured +* out what that is, then figure it out +* now. +*/ +if (unlikely (!tracer_frame) && i ==1 ) { + tracer_frame = (p - stack) * +sizeof (unsigned long ); + max_stack_size -= tracer_frame; + } } }
@@ -149,7 +163,26 @@ stack_trace_call(unsigned long ip, unsigif (per_cpu (trace_active, cpu)++ !=0 ) goto out; -check_stack (parent_ip, &stack); +/* +* When fentry is used, the traced function does not get +* its stack frame set up, and we lose the parent. +* The ip is pretty useless because the function tracer +* was called before that function set up its stack frame. +* In this case, we use the parent ip. +* +* By adding the return address of either the parent ip +* or the current ip we can disregard most of the stack usage +* caused by the stack tracer itself. +* +* The function tracer always reports the address of where the +* mcount call was, but the stack will hold the return address. +*/ +if (fentry) + ip = parent_ip; +else + ip +=MCOUNT_INSN_SIZE ; + +check_stack (ip, &stack); out:per_cpu (trace_active, cpu)--;
Greg Kroah-Hartman
maintainerPATCH 18/46 tracing: Fix off-by-one on allocating stat->pages
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit 39e30cd1537937d3c00ef87e865324e981434e5b upstream.
The first page was allocated separately, so no need to start from 0.
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -548,7 +548,7 @@ int ftrace_profile_pages_init(struct ftr pages =DIV_ROUND_UP (functions,PROFILES_PER_PAGE ); -for (i =0 ; i < pages; i++) { +for (i =1 ; i < pages; i++) { pg->next = (void *)get_zeroed_page (GFP_KERNEL );if (!pg->next) goto out_free;
Greg Kroah-Hartman
maintainerPATCH 19/46 tracing: Check return value of tracing_init_dentry()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit ed6f1c996bfe4b6e520cf7a74b51cd6988d84420 upstream.
Check return value and bail out if it's NULL.
--- kernel/trace/trace.c | 2 ++ kernel/trace/trace_stack.c | 2 ++ kernel/trace/trace_stat.c | 2 ++ 3 files changed, 6 insertions(+)
kernel/trace/trace.c +2 -0
@@ -4360,6 +4360,8 @@ static __init int tracer_init_debugfs(votrace_access_lock_init (); d_tracer =tracing_init_dentry (); +if (!d_tracer) +return 0 ;trace_create_file ("tracing_enabled" ,0644 , d_tracer, &global_trace, &tracing_ctrl_fops);
kernel/trace/trace_stack.c +2 -0
@@ -420,6 +420,8 @@ static __init int stack_trace_init(void)struct dentry *d_tracer; d_tracer =tracing_init_dentry (); +if (!d_tracer) +return 0 ;trace_create_file ("stack_max_size" ,0644 , d_tracer, &max_stack_size, &stack_max_size_fops);
kernel/trace/trace_stat.c +2 -0
@@ -307,6 +307,8 @@ static int tracing_stat_init(void)struct dentry *d_tracing; d_tracing =tracing_init_dentry (); +if (!d_tracing) +return 0 ; stat_dir =debugfs_create_dir ("trace_stat" , d_tracing);if (!stat_dir)
Greg Kroah-Hartman
maintainerPATCH 20/46 tracing: Reset ftrace_graph_filter_enabled if count is zero
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit 9f50afccfdc15d95d7331acddcb0f7703df089ae upstream.
The ftrace_graph_count can be decreased with a "!" pattern, so that the enabled flag should be updated too.
--- kernel/trace/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/ftrace.c +2 -1
@@ -3287,7 +3287,8 @@ out:if (fail)return -EINVAL ; - ftrace_graph_filter_enabled =1 ; + ftrace_graph_filter_enabled = !!(*idx); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 21/46 i2c: xiic: must always write 16-bit words to TX_FIFO
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven A. Falco" <[email protected]>
commit c39e8e4354ce4daf23336de5daa28a3b01f00aa6 upstream.
The TX_FIFO register is 10 bits wide. The lower 8 bits are the data to be written, while the upper two bits are flags to indicate stop/start.
The driver apparently attempted to optimize write access, by only writing a byte in those cases where the stop/start bits are zero. However, we have seen cases where the lower byte is duplicated onto the upper byte by the hardware, which causes inadvertent stop/starts.
This patch changes the write access to the transmit FIFO to always be 16 bits wide.
Signed off by: Steven A. Falco <[email protected]>
--- drivers/i2c/busses/i2c-xiic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-xiic.c +2 -4
@@ -311,10 +311,8 @@ static void xiic_fill_tx_fifo(struct xii/* last message in transfer -> STOP */ data |=XIIC_TX_DYN_STOP_MASK ;dev_dbg (i2c->adap.dev.parent,"%s TX STOP\n" , __func__); - -xiic_setreg16 (i2c,XIIC_DTR_REG_OFFSET , data); - }else -xiic_setreg8 (i2c,XIIC_DTR_REG_OFFSET , data); + } +xiic_setreg16 (i2c,XIIC_DTR_REG_OFFSET , data); } }
Greg Kroah-Hartman
maintainerPATCH 22/46 Fix initialization of CMCI/CMCP interrupts
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Luck <[email protected]>
commit d303e9e98fce56cdb3c6f2ac92f626fc2bd51c77 upstream.
Back 2010 during a revamp of the irq code some initializations were moved from ia64_mca_init() to ia64_mca_late_init() in
commit c75f2aa13f5b268aba369b5dc566088b5194377c Cannot use register_percpu_irq() from ia64_mca_init()
But this was hideously wrong. First of all these initializations are now down far too late. Specifically after all the other cpus have been brought up and initialized their own CMC vectors from smp_callin(). Also ia64_mca_late_init() may be called from any cpu so the line:
ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */
is generally not executed on the BSP, and so the CMC vector isn't setup at all on that processor.
Make use of the arch_early_irq_init() hook to get this code executed at just the right moment: not too early, not too late.
--- arch/ia64/include/asm/mca.h | 1 + arch/ia64/kernel/irq.c | 8 ++++++++ arch/ia64/kernel/mca.c | 37 ++++++++++++++++++++++++------------- 3 files changed, 33 insertions(+), 13 deletions(-)
arch/ia64/include/asm/mca.h +1 -0
@@ -143,6 +143,7 @@ extern unsigned long __per_cpu_mca[NR_CPextern int cpe_vector;extern int ia64_cpe_irq;extern void ia64_mca_init (void ); +extern void ia64_mca_irq_init (void );extern void ia64_mca_cpu_init (void *);extern void ia64_os_mca_dispatch (void );extern void ia64_os_mca_dispatch_end (void );
arch/ia64/kernel/irq.c +8 -0
@@ -23,6 +23,8 @@#include <linux/interrupt.h> #include <linux/kernel_stat.h> +#include <asm/mca.h> +/* * 'what should we do if we get a hw irq event on an illegal vector'. * each architecture has to answer this themselves.
@@ -83,6 +85,12 @@ bool is_affinity_mask_valid(const struct#endif /* CONFIG_SMP */ +int __init arch_early_irq_init (void ) +{ +ia64_mca_irq_init (); +return 0 ; +} +#ifdef CONFIG_HOTPLUG_CPU unsigned int vectors_in_migration[NR_IRQS ];
arch/ia64/kernel/mca.c +24 -13
@@ -2071,22 +2071,16 @@ ia64_mca_init(void)printk (KERN_INFO "MCA related initialization done\n" ); } +/* -* ia64_mca_late_init -* -* Opportunity to setup things that require initialization later -* than ia64_mca_init. Setup a timer to poll for CPEs if the -* platform doesn't support an interrupt driven mechanism. -* -* Inputs : None -* Outputs : Status +* These pieces cannot be done in ia64_mca_init() because it is called before +* early_irq_init() which would wipe out our percpu irq registrations. But we +* cannot leave them until ia64_mca_late_init() because by then all the other +* processors have been brought online and have set their own CMC vectors to +* point at a non-existant action. Called from arch_early_irq_init(). */ -static int __init -ia64_mca_late_init (void ) +void __init ia64_mca_irq_init (void ) { -if (!mca_init) -return 0 ; -/* * Configure the CMCI/P vector and handler. Interrupts for CMC are * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).
@@ -2105,6 +2099,23 @@ ia64_mca_late_init(void)/* Setup the CPEI/P handler */ register_percpu_irq (IA64_CPEP_VECTOR , &mca_cpep_irqaction);#endif +} + +/* +* ia64_mca_late_init +* +* Opportunity to setup things that require initialization later +* than ia64_mca_init. Setup a timer to poll for CPEs if the +* platform doesn't support an interrupt driven mechanism. +* +* Inputs : None +* Outputs : Status +*/ +static int __init +ia64_mca_late_init (void ) +{ +if (!mca_init) +return 0 ;register_hotcpu_notifier (&mca_cpu_notifier);
Greg Kroah-Hartman
maintainerPATCH 23/46 PCI / ACPI: Dont query OSC support with all possible controls
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
commit 545d6e189a41c94c11f55045a771118eccc9d9eb upstream.
Found problem on system that firmware that could handle pci aer. Firmware get error reporting after pci injecting error, before os boots. But after os boots, firmware can not get report anymore, even pci=noaer is passed.
Root cause: BIOS _OSC has problem with query bit checking. It turns out that BIOS vendor is copying example code from ACPI Spec. In ACPI Spec 5.0, page 290:
If (Not(And(CDW1,1))) // Query flag clear?
{ // Disable GPEs for features granted native control.
If (And(CTRL,0x01)) // Hot plug control granted?
{
Store(0,HPCE) // clear the hot plug SCI enable bit
Store(1,HPCS) // clear the hot plug SCI status bit
}
...
}When Query flag is set, And(CDW1,1) will be 1, Not(1) will return 0xfffffffe. So it will get into code path that should be for control set only. BIOS acpi code should be changed to "If (LEqual(And(CDW1,1), 0)))"
Current kernel code is using _OSC query to notify firmware about support from OS and then use _OSC to set control bits.
During query support, current code is using all possible controls. So will execute code that should be only for control set stage.
That will have problem when pci=noaer or aer firmware_first is used. As firmware have that control set for os aer already in query support stage, but later will not os aer handling.
We should avoid passing all possible controls, just use osc_control_set instead.
That should workaround BIOS bugs with affected systems on the field as more bios vendors are copying sample code from ACPI spec.
--- drivers/acpi/pci_root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/pci_root.c +2 -2
@@ -247,8 +247,8 @@ static acpi_status acpi_pci_query_osc(st *control &=OSC_PCI_CONTROL_MASKS ; capbuf[OSC_CONTROL_TYPE ] = *control | root->osc_control_set; }else { -/* Run _OSC query for all possible controls. */ - capbuf[OSC_CONTROL_TYPE ] =OSC_PCI_CONTROL_MASKS ; +/* Run _OSC query only with existing controls. */ + capbuf[OSC_CONTROL_TYPE ] = root->osc_control_set; } status =acpi_pci_run_osc (root->device->handle, capbuf, &result);
Greg Kroah-Hartman
maintainerPATCH 24/46 Wrong asm register contraints in the futex implementation
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Schreiber <[email protected]>
commit 136f39ddc53db3bcee2befbe323a56d4fbf06da8 upstream.
The Linux Kernel contains some inline assembly source code which has wrong asm register constraints in arch/ia64/include/asm/futex.h.
I observed this on Kernel 3.2.23 but it is also true on the most recent Kernel 3.9-rc1.
File arch/ia64/include/asm/futex.h:
static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
{
register unsigned long r8 __asm ("r8");
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov %0=r0 \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "=r" (r8), "=r" (prev)
: "r" (uaddr), "r" (newval),
"rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}The list of output registers is
: "=r" (r8), "=r" (prev)
The constraint "=r" means that the GCC has to maintain that these vars are in registers and contain valid info when the program flow leaves the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used as input registers. Input registers are uaddr, newval, oldval on the example.
The second assembly instruction
" mov %0=r0 \n"
is the first one which writes to a register; it sets %0 to 0. %0 means the first register operand; it is r8 here. (The r0 is read-only and always 0 on the Itanium; it can be used if an immediate zero value is needed.)
This instruction might overwrite one of the other registers which are still needed.
Whether it really happens depends on how GCC decides what registers it uses and how it optimizes the code.
The objdump utility can give us disassembly.
The futex_atomic_cmpxchg_inatomic() function is inline, so we have to look for a module that uses the funtion. This is the cmpxchg_futex_value_locked() function inkernel/futex.c:
static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
u32 uval, u32 newval)
{
int ret;
pagefault_disable();
ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval);
pagefault_enable();
return ret;
}Now the disassembly. At first from the Kernel package 3.2.23 which has been compiled with GCC 4.4, remeber this Kernel seemed to work:
objdump -d linux-3.2.23/debian/build/build_ia64_none_mckinley/kernel/futex.o
0000000000000230 <cmpxchg_futex_value_locked>:
230: 0b 18 80 1b 18 21 [MMI] adds r3=3168,r13;;
236: 80 40 0d 00 42 00 adds r8=40,r3
23c: 00 00 04 00 nop.i 0x0;;
240: 0b 50 00 10 10 10 [MMI] ld4 r10=[r8];;
246: 90 08 28 00 42 00 adds r9=1,r10
24c: 00 00 04 00 nop.i 0x0;;
250: 09 00 00 00 01 00 [MMI] nop.m 0x0
256: 00 48 20 20 23 00 st4 [r8]=r9
25c: 00 00 04 00 nop.i 0x0;;
260: 08 10 80 06 00 21 [MMI] adds r2=32,r3
266: 00 00 00 02 00 00 nop.m 0x0
26c: 02 08 f1 52 extr.u r16=r33,0,61
270: 05 40 88 00 08 e0 [MLX] addp4 r8=r34,r0
276: ff ff 0f 00 00 e0 movl r15=0xfffffffbfff;;
27c: f1 f7 ff 65
280: 09 70 00 04 18 10 [MMI] ld8 r14=[r2]
286: 00 00 00 02 00 c0 nop.m 0x0
28c: f0 80 1c d0 cmp.ltu p6,p7=r15,r16;;
290: 08 40 fc 1d 09 3b [MMI] cmp.eq p8,p9=-1,r14
296: 00 00 00 02 00 40 nop.m 0x0
29c: e1 08 2d d0 cmp.ltu p10,p11=r14,r33
2a0: 56 01 10 00 40 10 [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2a6: 02 08 00 80 21 03 (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
2ac: 40 00 00 41 (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2b0: 0a 00 00 00 22 00 [MMI] mf;;
2b6: 80 00 00 00 42 00 mov r8=r0
2bc: 00 00 04 00 nop.i 0x0
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;
2c6: 10 1a 85 22 20 00 cmpxchg4.acq r33=[r33],r35,ar.ccv
2cc: 00 00 04 00 nop.i 0x0;;
2d0: 10 00 84 40 90 11 [MIB] st4 [r32]=r33
2d6: 00 00 00 02 00 00 nop.i 0x0
2dc: 20 00 00 40 br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
2e0: 09 40 c8 f9 ff 27 [MMI] mov r8=-14
2e6: 00 00 00 02 00 00 nop.m 0x0
2ec: 00 00 04 00 nop.i 0x0;;
2f0: 0b 58 20 1a 19 21 [MMI] adds r11=3208,r13;;
2f6: 20 01 2c 20 20 00 ld4 r18=[r11]
2fc: 00 00 04 00 nop.i 0x0;;
300: 0b 88 fc 25 3f 23 [MMI] adds r17=-1,r18;;
306: 00 88 2c 20 23 00 st4 [r11]=r17
30c: 00 00 04 00 nop.i 0x0;;
310: 11 00 00 00 01 00 [MIB] nop.m 0x0
316: 00 00 00 02 00 80 nop.i 0x0
31c: 08 00 84 00 br.ret.sptk.many b0;;The lines
2b0: 0a 00 00 00 22 00 [MMI] mf;;
2b6: 80 00 00 00 42 00 mov r8=r0
2bc: 00 00 04 00 nop.i 0x0
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;
2c6: 10 1a 85 22 20 00 cmpxchg4.acq r33=[r33],r35,ar.ccv
2cc: 00 00 04 00 nop.i 0x0;;
are the instructions of the assembly block.
The line
2b6: 80 00 00 00 42 00 mov r8=r0
sets the r8 register to 0 and after that
2c0: 0b 00 20 40 2a 04 [MMI] mov.m ar.ccv=r8;;prepares the 'oldvalue' for the cmpxchg but it takes it from r8. This is wrong.
What happened here is what I explained above: An input register is overwritten which is still needed.
The register operand constraints in futex.h are wrong.
(The problem doesn't occur when the Kernel is compiled with GCC 4.6.)
The attached patch fixes the register operand constraints in futex.h. The code after patching of it:
static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
u32 oldval, u32 newval)
{
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
{
register unsigned long r8 __asm ("r8") = 0;
unsigned long prev;
__asm__ __volatile__(
" mf;; \n"
" mov ar.ccv=%4;; \n"
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
"[2:]"
: "+r" (r8), "=&r" (prev)
: "r" (uaddr), "r" (newval),
"rO" ((long) (unsigned) oldval)
: "memory");
*uval = prev;
return r8;
}
}I also initialized the 'r8' var with the C programming language. The _asm qualifier on the definition of the 'r8' var forces GCC to use the r8 processor register for it.
I don't believe that we should use inline assembly for zeroing out a local variable.
The constraint is
"+r" (r8)
what means that it is both an input register and an output register. Note that the page fault handler will modify the r8 register which will be the return value of the function.
The real fix is
"=&r" (prev)
The & means that GCC must not use any of the input registers to place this output register in.
Patched the Kernel 3.2.23 and compiled it with GCC4.4:
0000000000000230 <cmpxchg_futex_value_locked>:
230: 0b 18 80 1b 18 21 [MMI] adds r3=3168,r13;;
236: 80 40 0d 00 42 00 adds r8=40,r3
23c: 00 00 04 00 nop.i 0x0;;
240: 0b 50 00 10 10 10 [MMI] ld4 r10=[r8];;
246: 90 08 28 00 42 00 adds r9=1,r10
24c: 00 00 04 00 nop.i 0x0;;
250: 09 00 00 00 01 00 [MMI] nop.m 0x0
256: 00 48 20 20 23 00 st4 [r8]=r9
25c: 00 00 04 00 nop.i 0x0;;
260: 08 10 80 06 00 21 [MMI] adds r2=32,r3
266: 20 12 01 10 40 00 addp4 r34=r34,r0
26c: 02 08 f1 52 extr.u r16=r33,0,61
270: 05 40 00 00 00 e1 [MLX] mov r8=r0
276: ff ff 0f 00 00 e0 movl r15=0xfffffffbfff;;
27c: f1 f7 ff 65
280: 09 70 00 04 18 10 [MMI] ld8 r14=[r2]
286: 00 00 00 02 00 c0 nop.m 0x0
28c: f0 80 1c d0 cmp.ltu p6,p7=r15,r16;;
290: 08 40 fc 1d 09 3b [MMI] cmp.eq p8,p9=-1,r14
296: 00 00 00 02 00 40 nop.m 0x0
29c: e1 08 2d d0 cmp.ltu p10,p11=r14,r33
2a0: 56 01 10 00 40 10 [BBB] (p10) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2a6: 02 08 00 80 21 03 (p08) br.cond.dpnt.few 2b0
<cmpxchg_futex_value_locked+0x80>
2ac: 40 00 00 41 (p06) br.cond.spnt.few 2e0
<cmpxchg_futex_value_locked+0xb0>
2b0: 0b 00 00 00 22 00 [MMI] mf;;
2b6: 00 10 81 54 08 00 mov.m ar.ccv=r34
2bc: 00 00 04 00 nop.i 0x0;;
2c0: 09 58 8c 42 11 10 [MMI] cmpxchg4.acq r11=[r33],r35,ar.ccv
2c6: 00 00 00 02 00 00 nop.m 0x0
2cc: 00 00 04 00 nop.i 0x0;;
2d0: 10 00 2c 40 90 11 [MIB] st4 [r32]=r11
2d6: 00 00 00 02 00 00 nop.i 0x0
2dc: 20 00 00 40 br.few 2f0
<cmpxchg_futex_value_locked+0xc0>
2e0: 09 40 c8 f9 ff 27 [MMI] mov r8=-14
2e6: 00 00 00 02 00 00 nop.m 0x0
2ec: 00 00 04 00 nop.i 0x0;;
2f0: 0b 88 20 1a 19 21 [MMI] adds r17=3208,r13;;
2f6: 30 01 44 20 20 00 ld4 r19=[r17]
2fc: 00 00 04 00 nop.i 0x0;;
300: 0b 90 fc 27 3f 23 [MMI] adds r18=-1,r19;;
306: 00 90 44 20 23 00 st4 [r17]=r18
30c: 00 00 04 00 nop.i 0x0;;
310: 11 00 00 00 01 00 [MIB] nop.m 0x0
316: 00 00 00 02 00 80 nop.i 0x0
31c: 08 00 84 00 br.ret.sptk.many b0;;Much better.
There is a
270: 05 40 00 00 00 e1 [MLX] mov r8=r0
which was generated by C code r8 = 0. Below
2b6: 00 10 81 54 08 00 mov.m ar.ccv=r34what means that oldval is no longer overwritten.
This is Debian bug#702641
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702641).
The patch is applicable on Kernel 3.9-rc1, 3.2.23 and many other versions.
--- arch/ia64/include/asm/futex.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/ia64/include/asm/futex.h +2 -3
@@ -107,16 +107,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval,return -EFAULT ; { - registerunsigned long r8 __asm ("r8" ); + register unsigned long r8 __asm ("r8") = 0;unsigned long prev; __asm__ __volatile__(" mf;; \n" -" mov %0=r0 \n" " mov ar.ccv=%4;; \n" "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n" " .xdata4 \"__ex_table\", 1b-., 2f-. \n" "[2:]" - :"=r" (r8),"=r" (prev) + :"+r" (r8),"=&r" (prev) :"r" (uaddr),"r" (newval),"rO" ((long ) (unsigned ) oldval) :"memory" );
Greg Kroah-Hartman
maintainerPATCH 25/46 Wrong asm register contraints in the kvm implementation
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Schreiber <[email protected]>
commit de53e9caa4c6149ef4a78c2f83d7f5b655848767 upstream.
The Linux Kernel contains some inline assembly source code which has wrong asm register constraints in arch/ia64/kvm/vtlb.c.
I observed this on Kernel 3.2.35 but it is also true on the most recent Kernel 3.9-rc1.
File arch/ia64/kvm/vtlb.c:
u64 guest_vhpt_lookup(u64 iha, u64 *pte)
{
u64 ret;
struct thash_data *data;
data = __vtr_lookup(current_vcpu, iha, D_TLB);
if (data != NULL)
thash_vhpt_insert(current_vcpu, data->page_flags,
data->itir, iha, D_TLB);
asm volatile (
"rsm psr.ic|psr.i;;"
"srlz.d;;"
"ld8.s r9=[%1];;"
"tnat.nz p6,p7=r9;;"
"(p6) mov %0=1;"
"(p6) mov r9=r0;"
"(p7) extr.u r9=r9,0,53;;"
"(p7) mov %0=r0;"
"(p7) st8 [%2]=r9;;"
"ssm psr.ic;;"
"srlz.d;;"
"ssm psr.i;;"
"srlz.d;;"
: "=r"(ret) : "r"(iha), "r"(pte):"memory");
return ret;
}The list of output registers is
: "=r"(ret) : "r"(iha), "r"(pte):"memory");
The constraint "=r" means that the GCC has to maintain that these vars are in registers and contain valid info when the program flow leaves the assembly block (output registers).
But "=r" also means that GCC can put them in registers that are used as input registers. Input registers are iha, pte on the example. If the predicate p7 is true, the 8th assembly instruction
"(p7) mov %0=r0;"
is the first one which writes to a register which is maintained by the register constraints; it sets %0. %0 means the first register operand; it is ret here.
This instruction might overwrite the %2 register (pte) which is needed by the next instruction:
"(p7) st8 [%2]=r9;;"
Whether it really happens depends on how GCC decides what registers it uses and how it optimizes the code.
The attached patch fixes the register operand constraints in arch/ia64/kvm/vtlb.c.
The register constraints should be
: "=&r"(ret) : "r"(iha), "r"(pte):"memory");
The & means that GCC must not use any of the input registers to place this output register in.
This is Debian bug#702639
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702639).
The patch is applicable on Kernel 3.9-rc1, 3.2.35 and many other versions.
--- arch/ia64/kvm/vtlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/kvm/vtlb.c +1 -1
@@ -256,7 +256,7 @@ u64 guest_vhpt_lookup(u64 iha, u64 *pte)"srlz.d;;" "ssm psr.i;;" "srlz.d;;" - : "=r"(ret) : "r"(iha), "r"(pte):"memory"); + : "=&r"(ret) : "r"(iha), "r"(pte) : "memory"); return ret; }
Greg Kroah-Hartman
maintainerPATCH 26/46 fs/fscache/stats.c: fix memory leak
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anurup m <[email protected]>
commit ec686c9239b4d472052a271c505d04dae84214cc upstream.
There is a kernel memory leak observed when the proc file /proc/fs/fscache/stats is read.
The reason is that in fscache_stats_open, single_open is called and the respective release function is not called during release. Hence fix with correct release function - single_release().
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=57101
--- fs/fscache/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fscache/stats.c +1 -1
@@ -276,5 +276,5 @@ const struct file_operations fscache_sta .open = fscache_stats_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, };
Greg Kroah-Hartman
maintainerPATCH 27/46 ALSA: usb-audio: disable autopm for MIDI devices
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit cbc200bca4b51a8e2406d4b654d978f8503d430b upstream.
Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend) introduced autopm for all USB audio/MIDI devices. However, many MIDI devices, such as synthesizers, do not merely transmit MIDI messages but use their MIDI inputs to control other functions. With autopm, these devices would get powered down as soon as the last MIDI port device is closed on the host.
Even some plain MIDI interfaces could get broken: they automatically send Active Sensing messages while powered up, but as soon as these messages cease, the receiving device would interpret this as an accidental disconnection.
Commit f5f165418cab (ALSA: usb-audio: Fix missing autopm for MIDI input) introduced another regression: some devices (e.g. the Roland GAIA SH-01) are self-powered but do a reset whenever the USB interface's power state changes.
To work around all this, just disable autopm for all USB MIDI devices.
--- sound/usb/midi.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
sound/usb/midi.c +2 -11
@@ -125,7 +125,6 @@ struct snd_usb_midi {struct snd_usb_midi_in_endpoint *in; } endpoints[MIDI_MAX_ENDPOINTS ];unsigned long input_triggered; -bool autopm_reference;unsigned int opened[2 ];unsigned char disconnected;unsigned char input_running;
@@ -1023,7 +1022,6 @@ static int substream_open(struct snd_raw {struct snd_usb_midi * umidi = substream->rmidi->private_data;struct snd_kcontrol *ctl; -int err;down_read (&umidi->disc_rwsem);if (umidi->disconnected) {
@@ -1034,13 +1032,6 @@ static int substream_open(struct snd_rawmutex_lock (&umidi->mutex);if (open) {if (!umidi->opened[0 ] && !umidi->opened[1 ]) { - err =usb_autopm_get_interface (umidi->iface); - umidi->autopm_reference = err >=0 ; -if (err <0 && err != -EACCES ) { -mutex_unlock (&umidi->mutex); -up_read (&umidi->disc_rwsem); -return -EIO ; - }if (umidi->roland_load_ctl) { ctl = umidi->roland_load_ctl; ctl->vd[0 ].access |=SNDRV_CTL_ELEM_ACCESS_INACTIVE ;
@@ -1063,8 +1054,6 @@ static int substream_open(struct snd_rawsnd_ctl_notify (umidi->card,SNDRV_CTL_EVENT_MASK_INFO , &ctl->id); } -if (umidi->autopm_reference) -usb_autopm_put_interface (umidi->iface); } }mutex_unlock (&umidi->mutex);
@@ -2228,6 +2217,8 @@ int snd_usbmidi_create(struct snd_card *return err; } +usb_autopm_get_interface_no_resume (umidi->iface); +list_add_tail (&umidi->list, midi_list);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 28/46 ALSA: usb-audio: Fix autopm error during probing
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 60af3d037eb8c670dcce31401501d1271e7c5d95 upstream.
We've got strange errors in get_ctl_value() in mixer.c during probing, e.g. on Hercules RMX2 DJ Controller:
ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4 ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
....
It turned out that the culprit is autopm: snd_usb_autoresume() returns -ENODEV when called during card->probing = 1.
Since the call itself during card->probing = 1 is valid, let's fix the return value of snd_usb_autoresume() as success.
--- sound/usb/card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/usb/card.c +3 -1
@@ -610,7 +610,9 @@ int snd_usb_autoresume(struct snd_usb_auint err = -ENODEV ;down_read (&chip->shutdown_rwsem); -if (!chip->shutdown && !chip->probing) +if (chip->probing) + err =0 ; +else if (!chip->shutdown) err =usb_autopm_get_interface (chip->pm_intf);up_read (&chip->shutdown_rwsem);
Greg Kroah-Hartman
maintainerPATCH 29/46 ASoC: max98088: Fix logging of hardware revision.
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dylan Reid <[email protected]>
commit 98682063549bedd6e2d2b6b7222f150c6fbce68c upstream.
The hardware revision of the codec is based at 0x40. Subtract that before convering to ASCII. The same as it is done for 98095.
--- sound/soc/codecs/max98088.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98088.c +1 -1
@@ -1998,7 +1998,7 @@ static int max98088_probe(struct snd_soc ret); goto err_access; } -dev_info (codec->dev,"revision %c\n" , ret +'A' ); +dev_info (codec->dev,"revision %c\n" , ret -0x40 +'A' );snd_soc_write (codec,M98088_REG_51_PWR_SYS ,M98088_PWRSV );
Greg Kroah-Hartman
maintainerPATCH 30/46 hrtimer: Fix ktime_add_ns() overflow on 32bit architectures
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Engraf <[email protected]>
commit 51fd36f3fad8447c487137ae26b9d0b3ce77bb25 upstream.
One can trigger an overflow when using ktime_add_ns() on a 32bit architecture not supporting CONFIG_KTIME_SCALAR.
When passing a very high value for u64 nsec, e.g. 7881299347898368000 the do_div() function converts this value to seconds (7881299347) which is still to high to pass to the ktime_set() function as long. The result in is a negative value.
The problem on my system occurs in the tick-sched.c, tick_nohz_stop_sched_tick() when time_delta is set to timekeeping_max_deferment(). The check for time_delta < KTIME_MAX is valid, thus ktime_add_ns() is called with a too large value resulting in a negative expire value. This leads to an endless loop in the ticker code:
time_delta: 7881299347898368000
expires = ktime_add_ns(last_update, time_delta)
expires: negative value
This fix caps the value to KTIME_MAX.
This error doesn't occurs on 64bit or architectures supporting CONFIG_KTIME_SCALAR (e.g. ARM, x86-32).
--- kernel/hrtimer.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/hrtimer.c +4 -0
@@ -298,6 +298,10 @@ ktime_t ktime_sub_ns(const ktime_t kt, u }else {unsigned long rem =do_div (nsec,NSEC_PER_SEC ); +/* Make sure nsec fits into long */ +if (unlikely (nsec >KTIME_SEC_MAX )) +return (ktime_t ){ .tv64 =KTIME_MAX }; + tmp =ktime_set ((long )nsec, rem); }
Greg Kroah-Hartman
maintainerPATCH 31/46 hrtimer: Add expiry time overflow check in hrtimer_interrupt
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prarit Bhargava <[email protected]>
commit 8f294b5a139ee4b75e890ad5b443c93d1e558a8b upstream.
The settimeofday01 test in the LTP testsuite effectively does
gettimeofday(current time);
settimeofday(Jan 1, 1970 + 100 seconds);
settimeofday(current time);This test causes a stack trace to be displayed on the console during the setting of timeofday to Jan 1, 1970 + 100 seconds:
[ 131.066751] ------------[ cut here ]------------ [ 131.096448] WARNING: at kernel/time/clockevents.c:209 clockevents_program_event+0x135/0x140() [ 131.104935] Hardware name: Dinar [ 131.108150] Modules linked in: sg nfsv3 nfs_acl nfsv4 auth_rpcgss nfs dns_resolver fscache lockd sunrpc nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables kvm_amd kvm sp5100_tco bnx2 i2c_piix4 crc32c_intel k10temp fam15h_power ghash_clmulni_intel amd64_edac_mod pcspkr serio_raw edac_mce_amd edac_core microcode xfs libcrc32c sr_mod sd_mod cdrom ata_generic crc_t10dif pata_acpi radeon i2c_algo_bit drm_kms_helper ttm drm ahci pata_atiixp libahci libata usb_storage i2c_core dm_mirror dm_region_hash dm_log dm_mod [ 131.176784] Pid: 0, comm: swapper/28 Not tainted 3.8.0+ #6 [ 131.182248] Call Trace: [ 131.184684] <IRQ> [<ffffffff810612af>] warn_slowpath_common+0x7f/0xc0 [ 131.191312] [<ffffffff8106130a>] warn_slowpath_null+0x1a/0x20 [ 131.197131] [<ffffffff810b9fd5>] clockevents_program_event+0x135/0x140 [ 131.203721] [<ffffffff810bb584>] tick_program_event+0x24/0x30 [ 131.209534] [<ffffffff81089ab1>] hrtimer_interrupt+0x131/0x230 [ 131.215437] [<ffffffff814b9600>] ? cpufreq_p4_target+0x130/0x130 [ 131.221509] [<ffffffff81619119>] smp_apic_timer_interrupt+0x69/0x99 [ 131.227839] [<ffffffff8161805d>] apic_timer_interrupt+0x6d/0x80 [ 131.233816] <EOI> [<ffffffff81099745>] ? sched_clock_cpu+0xc5/0x120 [ 131.240267] [<ffffffff814b9ff0>] ? cpuidle_wrap_enter+0x50/0xa0 [ 131.246252] [<ffffffff814b9fe9>] ? cpuidle_wrap_enter+0x49/0xa0 [ 131.252238] [<ffffffff814ba050>] cpuidle_enter_tk+0x10/0x20 [ 131.257877] [<ffffffff814b9c89>] cpuidle_idle_call+0xa9/0x260 [ 131.263692] [<ffffffff8101c42f>] cpu_idle+0xaf/0x120 [ 131.268727] [<ffffffff815f8971>] start_secondary+0x255/0x257 [ 131.274449] ---[ end trace 1151a50552231615 ]---
When we change the system time to a low value like this, the value of timekeeper->offs_real will be a negative value.
It seems that the WARN occurs because an hrtimer has been started in the time between the releasing of the timekeeper lock and the IPI call (via a call to on_each_cpu) in clock_was_set() in the do_settimeofday() code. The end result is that a REALTIME_CLOCK timer has been added with softexpires = expires = KTIME_MAX. The hrtimer_interrupt() fires/is called and the loop at kernel/hrtimer.c:1289 is executed. In this loop the code subtracts the clock base's offset (which was set to timekeeper->offs_real in do_settimeofday()) from the current hrtimer_cpu_base->expiry value (which was KTIME_MAX):
KTIME_MAX - (a negative value) = overflow
A simple check for an overflow can resolve this problem. Using KTIME_MAX instead of the overflow value will result in the hrtimer function being run, and the reprogramming of the timer after that.
--- kernel/hrtimer.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/hrtimer.c +2 -0
@@ -1312,6 +1312,8 @@ retry: expires =ktime_sub (hrtimer_get_expires (timer), base->offset); +if (expires.tv64 <0 ) + expires.tv64 =KTIME_MAX ;if (expires.tv64 < expires_next.tv64) expires_next = expires;break ;
Greg Kroah-Hartman
maintainerPATCH 32/46 drivers/rtc/rtc-cmos.c: dont disable hpet emulation on suspend
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Derek Basehore <[email protected]>
commit e005715efaf674660ae59af83b13822567e3a758 upstream.
There's a bug where rtc alarms are ignored after the rtc cmos suspends but before the system finishes suspend. Since hpet emulation is disabled and it still handles the interrupts, a wake event is never registered which is done from the rtc layer.
This patch reverts commit d1b2efa83fbf ("rtc: disable hpet emulation on suspend") which disabled hpet emulation. To fix the problem mentioned in that commit, hpet_rtc_timer_init() is called directly on resume.
--- drivers/rtc/rtc-cmos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-cmos.c +2 -2
@@ -805,9 +805,8 @@ static int cmos_suspend(struct device *d mask =RTC_IRQMASK ; tmp &= ~mask;CMOS_WRITE (tmp,RTC_CONTROL ); +hpet_mask_rtc_irq_bit (mask); -/* shut down hpet emulation - we don't need it for alarm */ -hpet_mask_rtc_irq_bit (RTC_PIE |RTC_AIE |RTC_UIE );cmos_checkintr (cmos, tmp); }spin_unlock_irq (&rtc_lock);
@@ -872,6 +871,7 @@ static int cmos_resume(struct device *dertc_update_irq (cmos->rtc,1 , mask); tmp &= ~RTC_AIE ;hpet_mask_rtc_irq_bit (RTC_AIE ); +hpet_rtc_timer_init (); }while (mask &RTC_AIE );spin_unlock_irq (&rtc_lock); }
Greg Kroah-Hartman
maintainerPATCH 33/46 cgroup: fix an off-by-one bug which may trigger BUG_ON()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <[email protected]>
commit 3ac1707a13a3da9cfc8f242a15b2fae6df2c5f88 upstream.
The 3rd parameter of flex_array_prealloc() is the number of elements, not the index of the last element.
The effect of the bug is, when opening cgroup.procs, a flex array will be allocated and all elements of the array is allocated with GFP_KERNEL flag, but the last one is GFP_ATOMIC, and if we fail to allocate memory for it, it'll trigger a BUG_ON().
--- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup.c +1 -1
@@ -2026,7 +2026,7 @@ int cgroup_attach_proc(struct cgroup *cgif (!group)return -ENOMEM ;/* pre-allocate to guarantee space while iterating in rcu read-side. */ - retval =flex_array_prealloc (group,0 , group_size -1 ,GFP_KERNEL ); + retval =flex_array_prealloc (group,0 , group_size,GFP_KERNEL );if (retval) goto out_free_group_list;
Greg Kroah-Hartman
maintainerPATCH 34/46 clockevents: Set dummy handler on CPU_DEAD shutdown
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 6f7a05d7018de222e40ca003721037a530979974 upstream.
Vitaliy reported that a per cpu HPET timer interrupt crashes the system during hibernation. What happens is that the per cpu HPET timer gets shut down when the nonboot cpus are stopped. When the nonboot cpus are onlined again the HPET code sets up the MSI interrupt which fires before the clock event device is registered. The event handler is still set to hrtimer_interrupt, which then crashes the machine due to highres mode not being active.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700333
There is no real good way to avoid that in the HPET code. The HPET code alrady has a mechanism to detect spurious interrupts when event handler == NULL for a similar reason.
We can handle that in the clockevent/tick layer and replace the previous functional handler with a dummy handler like we do in tick_setup_new_device().
The original clockevents code did this in clockevents_exchange_device(), but that got removed by commit 7c1e76897 (clockevents: prevent clockevent event_handler ending up handler_noop) which forgot to fix it up in tick_shutdown(). Same issue with the broadcast device.
--- kernel/time/tick-broadcast.c | 4 ++++ kernel/time/tick-common.c | 1 + 2 files changed, 5 insertions(+)
kernel/time/tick-broadcast.c +4 -0
@@ -66,6 +66,8 @@ static void tick_broadcast_start_periodi*/ int tick_check_broadcast_device (struct clock_event_device *dev) { +struct clock_event_device *cur = tick_broadcast_device.evtdev; + if ((dev->features & CLOCK_EVT_FEAT_DUMMY) || (tick_broadcast_device.evtdev && tick_broadcast_device.evtdev->rating >= dev->rating) ||
@@ -73,6 +75,8 @@ int tick_check_broadcast_device(struct creturn 0 ;clockevents_exchange_device (tick_broadcast_device.evtdev, dev); +if (cur) + cur->event_handler = clockevents_handle_noop; tick_broadcast_device.evtdev = dev;if (!cpumask_empty (tick_get_broadcast_mask ()))tick_broadcast_start_periodic (dev);
kernel/time/tick-common.c +1 -0
@@ -323,6 +323,7 @@ static void tick_shutdown(unsigned int **/ dev->mode =CLOCK_EVT_MODE_UNUSED ;clockevents_exchange_device (dev,NULL ); + dev->event_handler = clockevents_handle_noop; td->evtdev =NULL ; }raw_spin_unlock_irqrestore (&tick_device_lock, flags);
Greg Kroah-Hartman
maintainerPATCH 35/46 LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 1dfd89af8697a299e7982ae740d4695ecd917eef upstream.
After a server reboot, the reclaimer thread will recover all the existing locks. For locks that are blocked, however, it will change the value of block->b_status to nlm_lck_denied_grace_period in order to signal that they need to wake up and resend the original blocking lock request.
Due to a bug, however, the block->b_status never gets reset after the blocked locks have been woken up, and so the process goes into an infinite loop of resends until the blocked lock is satisfied.
--- fs/lockd/clntlock.c | 3 +++ fs/lockd/clntproc.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
fs/lockd/clntlock.c +3 -0
@@ -141,6 +141,9 @@ int nlmclnt_block(struct nlm_wait *block timeout);if (ret <0 )return -ERESTARTSYS ; +/* Reset the lock status after a server reboot so we resend */ +if (block->b_status == nlm_lck_denied_grace_period) + block->b_status = nlm_lck_blocked; req->a_res.status = block->b_status;return 0 ; }
fs/lockd/clntproc.c +0 -3
@@ -550,9 +550,6 @@ again: status =nlmclnt_block (block, req,NLMCLNT_POLL_TIMEOUT );if (status <0 )break ; -/* Resend the blocking lock request after a server reboot */ -if (resp->status == nlm_lck_denied_grace_period) -continue ;if (resp->status != nlm_lck_blocked)break ; }
Greg Kroah-Hartman
maintainerPATCH 36/46 NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 8b6cc4d6f841d31f72fe7478453759166d366274 upstream.
A server shouldn't normally return NFS4ERR_GRACE if the client holds a delegation, since no conflicting lock reclaims can be granted, however the spec does not require the server to grant the open in this instance
--- fs/nfs/nfs4proc.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/nfs/nfs4proc.c +6 -0
@@ -1335,6 +1335,12 @@ int nfs4_open_delegation_recall(struct ncase -ENOMEM : err =0 ; goto out; +case -NFS4ERR_DELAY : +case -NFS4ERR_GRACE : +set_bit (NFS_DELEGATED_STATE , &state->flags); +ssleep (1 ); + err = -EAGAIN ; + goto out; } err =nfs4_handle_exception (server, err, &exception); }while (exception.retry);
Greg Kroah-Hartman
maintainerPATCH 37/46 nfsd4: dont close read-write opens too soon
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <[email protected]>
commit 0c7c3e67ab91ec6caa44bdf1fc89a48012ceb0c5 upstream.
Don't actually close any opens until we don't need them at all.
This means being left with write access when it's not really necessary, but that's better than putting a file that might still have posix locks held on it, as we have been.
--- fs/nfsd/nfs4state.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
fs/nfsd/nfs4state.c +1 -7
@@ -189,13 +189,7 @@ static void __nfs4_file_put_access(struc {if (atomic_dec_and_test (&fp->fi_access[oflag])) {nfs4_file_put_fd (fp, oflag); -/* -* It's also safe to get rid of the RDWR open *if* -* we no longer have need of the other kind of access -* or if we already have the other kind of open: -*/ -if (fp->fi_fds[1 -oflag] - ||atomic_read (&fp->fi_access[1 - oflag]) ==0 ) +if (atomic_read (&fp->fi_access[1 - oflag]) ==0 )nfs4_file_put_fd (fp,O_RDWR ); } }
Greg Kroah-Hartman
maintainerPATCH 38/46 nfsd: Decode and send 64bit time values
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryan Schumaker <[email protected]>
commit bf8d909705e9d9bac31d9b8eac6734d2b51332a7 upstream.
The seconds field of an nfstime4 structure is 64bit, but we are assuming that the first 32bits are zero-filled. So if the client tries to set atime to a value before the epoch (touch -t 196001010101), then the server will save the wrong value on disk.
--- fs/nfsd/nfs4xdr.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
fs/nfsd/nfs4xdr.c +5 -14
@@ -342,10 +342,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundall 32 bits of 'nseconds'. */ READ_BUF (12 ); len +=12 ; -READ32 (dummy32); -if (dummy32) -return nfserr_inval; -READ32 (iattr->ia_atime.tv_sec); +READ64 (iattr->ia_atime.tv_sec);READ32 (iattr->ia_atime.tv_nsec);if (iattr->ia_atime.tv_nsec >= (u32 )1000000000 )return nfserr_inval;
@@ -368,10 +365,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundall 32 bits of 'nseconds'. */ READ_BUF (12 ); len +=12 ; -READ32 (dummy32); -if (dummy32) -return nfserr_inval; -READ32 (iattr->ia_mtime.tv_sec); +READ64 (iattr->ia_mtime.tv_sec);READ32 (iattr->ia_mtime.tv_nsec);if (iattr->ia_mtime.tv_nsec >= (u32 )1000000000 )return nfserr_inval;
@@ -2148,8 +2142,7 @@ out_acl:if (bmval1 &FATTR4_WORD1_TIME_ACCESS ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.atime.tv_sec); +WRITE64 ((s64 )stat.atime.tv_sec);WRITE32 (stat.atime.tv_nsec); }if (bmval1 &FATTR4_WORD1_TIME_DELTA ) {
@@ -2162,15 +2155,13 @@ out_acl:if (bmval1 &FATTR4_WORD1_TIME_METADATA ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.ctime.tv_sec); +WRITE64 ((s64 )stat.ctime.tv_sec);WRITE32 (stat.ctime.tv_nsec); }if (bmval1 &FATTR4_WORD1_TIME_MODIFY ) {if ((buflen -=12 ) <0 ) goto out_resource; -WRITE32 (0 ); -WRITE32 (stat.mtime.tv_sec); +WRITE64 ((s64 )stat.mtime.tv_sec);WRITE32 (stat.mtime.tv_nsec); }if (bmval1 &FATTR4_WORD1_MOUNTED_ON_FILEID ) {
Greg Kroah-Hartman
maintainerPATCH 39/46 wireless: regulatory: fix channel disabling race condition
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 990de49f74e772b6db5208457b7aa712a5f4db86 upstream.
When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz part of the scan disables a 5.2 GHz channel due to, e.g. receiving country or frequency information, that 5.2 GHz channel might already be in the list of channels to scan next. Then, when the driver checks if it should do a passive scan, that will return false and attempt an active scan. This is not only wrong but can also lead to the iwlwifi device firmware crashing since it checks regulatory as well.
Fix this by not setting the channel flags to just disabled but rather OR'ing in the disabled flag. That way, even if the race happens, the channel will be scanned passively which is still (mostly) correct.
--- net/wireless/reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/reg.c +1 -1
@@ -852,7 +852,7 @@ static void handle_channel(struct wiphyreturn ;REG_DBG_PRINT ("Disabling freq %d MHz\n" , chan->center_freq); - chan->flags =IEEE80211_CHAN_DISABLED ; + chan->flags |=IEEE80211_CHAN_DISABLED ;return ; }
Greg Kroah-Hartman
maintainerPATCH 40/46 ipc: sysv shared memory limited to 8TiB
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robin Holt <[email protected]>
commit d69f3bad4675ac519d41ca2b11e1c00ca115cecd upstream.
Trying to run an application which was trying to put data into half of memory using shmget(), we found that having a shmall value below 8EiB-8TiB would prevent us from using anything more than 8TiB. By setting kernel.shmall greater than 8EiB-8TiB would make the job work.
In the newseg() function, ns->shm_tot which, at 8TiB is INT_MAX.
ipc/shm.c:
458 static int newseg(struct ipc_namespace *ns, struct ipc_params *params) 459 {
...
465 int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
...
474 if (ns->shm_tot + numpages > ns->shm_ctlall)
475 return -ENOSPC;
--- include/linux/ipc_namespace.h | 2 +- ipc/shm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/ipc_namespace.h +1 -1
@@ -42,8 +42,8 @@ struct ipc_namespace {size_t shm_ctlmax;size_t shm_ctlall; +unsigned long shm_tot;int shm_ctlmni; -int shm_tot;struct notifier_block ipcns_nb;
ipc/shm.c +1 -1
@@ -343,7 +343,7 @@ static int newseg(struct ipc_namespace *size_t size = params->u.size;int error;struct shmid_kernel *shp; -int numpages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +size_t numpages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ;struct file * file;char name[13 ];int id;
Greg Kroah-Hartman
maintainerPATCH 41/46 ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 7f3e3c7cfcec148ccca9c0dd2dbfd7b00b7ac10f upstream.
Fox the Kconfig documentation for CONFIG_EXT4_DEBUG to match the change made by commit a0b30c1229: ext4: use module parameters instead of debugfs for mballoc_debug
--- fs/ext4/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/Kconfig +2 -1
@@ -82,4 +82,5 @@ config EXT4_DEBUG Enables run-time debugging support for the ext4 filesystem. If you select Y here, then you will be able to turn on debugging - with a command such as "echo 1 > /sys/kernel/debug/ext4/mballoc-debug" + with a command such as: + echo 1 > /sys/module/ext4/parameters/mballoc_debug
Greg Kroah-Hartman
maintainerPATCH 42/46 x86: Eliminate irq_mis_count counted in arch_irq_stat
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Fei <[email protected]>
commit f7b0e1055574ce06ab53391263b4e205bf38daf3 upstream.
With the current implementation, kstat_cpu(cpu).irqs_sum is also increased in case of irq_mis_count increment.
So there is no need to count irq_mis_count in arch_irq_stat, otherwise irq_mis_count will be counted twice in the sum of /proc/stat.
--- arch/x86/kernel/irq.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/kernel/irq.c +0 -4
@@ -159,10 +159,6 @@ u64 arch_irq_stat_cpu(unsigned int cpu)u64 arch_irq_stat (void ) {u64 sum =atomic_read (&irq_err_count); - -#ifdef CONFIG_X86_IO_APIC - sum +=atomic_read (&irq_mis_count); -#endif return sum; }
Greg Kroah-Hartman
maintainerPATCH 43/46 mmc: core: Fix bit width test failing on old eMMC cards
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philip Rakity <[email protected]>
commit 836dc2fe89c968c10cada87e0dfae6626f8f9da3 upstream.
PARTITION_SUPPORT needs to be set before doing the compare on version number so the bit width test does not get invalid data. Before this patch, a Sandisk iNAND eMMC card would detect 1-bit width although the hardware supports 4-bit.
Only affects old emmc devices - pre 4.4 devices.
--- drivers/mmc/core/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
@@ -353,13 +353,13 @@ static int mmc_read_ext_csd(struct mmc_c ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT ]; card->ext_csd.raw_trim_mult = ext_csd[EXT_CSD_TRIM_MULT ]; + card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT ];if (card->ext_csd.rev >=4 ) {/* * Enhanced area feature support -- check whether the eMMC * card has the Enhanced area enabled. If so, export enhanced * area offset and size to user by adding sysfs interface. */ - card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT ];if ((ext_csd[EXT_CSD_PARTITION_SUPPORT ] &0x2 ) && (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE ] &0x1 )) { u8 hc_erase_grp_sz =
Greg Kroah-Hartman
maintainerPATCH 44/46 mfd: adp5520: Restore mode bits on resume
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
commit c6cc25fda58da8685ecef3f179adc7b99c8253b2 upstream.
The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is cleared. So we need to make sure to restore it during resume if it was set before suspend.
--- drivers/mfd/adp5520.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mfd/adp5520.c +6 -2
@@ -36,6 +36,7 @@ struct adp5520_chip {struct blocking_notifier_head notifier_list;int irq;unsigned long id; +uint8_t mode; }; static int __adp5520_read(struct i2c_client *client,
@@ -326,7 +327,10 @@ static int adp5520_suspend(struct devicestruct i2c_client *client =to_i2c_client (dev);struct adp5520_chip *chip =dev_get_drvdata (&client->dev); -adp5520_clr_bits (chip->dev,ADP5520_MODE_STATUS , ADP5520_nSTNBY); +adp5520_read (chip->dev,ADP5520_MODE_STATUS , &chip->mode); +/* All other bits are W1C */ + chip->mode &=ADP5520_BL_EN |ADP5520_DIM_EN | ADP5520_nSTNBY; +adp5520_write (chip->dev,ADP5520_MODE_STATUS ,0 );return 0 ; }
@@ -335,7 +339,7 @@ static int adp5520_resume(struct devicestruct i2c_client *client =to_i2c_client (dev);struct adp5520_chip *chip =dev_get_drvdata (&client->dev); -adp5520_set_bits (chip->dev,ADP5520_MODE_STATUS , ADP5520_nSTNBY); +adp5520_write (chip->dev,ADP5520_MODE_STATUS , chip->mode); return 0; }#endif
Greg Kroah-Hartman
maintainerPATCH 45/46 s390: move dummy io_remap_pfn_range() to asm/pgtable.h
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 4f2e29031e6c67802e7370292dd050fd62f337ee upstream.
Commit b4cbb197c7e7 ("vm: add vm_iomap_memory() helper function") added a helper function wrapper around io_remap_pfn_range(), and every other architecture defined it in <asm/pgtable.h>.
The s390 choice of <asm/io.h> may make sense, but is not very convenient for this case, and gratuitous differences like that cause unexpected errors like this:
mm/memory.c: In function 'vm_iomap_memory':
mm/memory.c:2439:2: error: implicit declaration of function 'io_remap_pfn_range' [-Werror=implicit-function-declaration]
Glory be the kbuild test robot who noticed this, bisected it, and reported it to the guilty parties (ie me).
--- arch/s390/include/asm/pgtable.h | 4 ++++ 1 file changed, 4 insertions(+)
arch/s390/include/asm/pgtable.h +4 -0
@@ -67,6 +67,10 @@ static inline int is_zero_pfn(unsigned l#define my_zero_pfn (addr) page_to_pfn(ZERO_PAGE(addr)) +/* TODO: s390 cannot support io_remap_pfn_range... */ +#define io_remap_pfn_range (vma, vaddr, pfn, size, prot) \ + remap_pfn_range(vma, vaddr, pfn, size, prot) +#endif /* !__ASSEMBLY__ */ /*
Greg Kroah-Hartman
maintainerPATCH 46/46 Revert :can: sja1000: fix handling on dt properties on little endian systems"
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 55fe10a686c3a8bce7bddc149e4ebb12f5a18c25 which is commit 0443de5fbf224abf41f688d8487b0c307dc5a4b4 upstream.
This causes a build breakage on 3.0, so we shouldn't apply it to that tree.
--- drivers/net/can/sja1000/sja1000_of_platform.c | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/net/can/sja1000/sja1000_of_platform.c +16 -15
@@ -93,8 +93,8 @@ static int __devinit sja1000_ofp_probe(sstruct net_device *dev;struct sja1000_priv *priv;struct resource res; -u32 prop; -int err, irq, res_size; +const u32 *prop; +int err, irq, res_size, prop_size;void __iomem *base; err =of_address_to_resource (np,0 , &res);
@@ -135,27 +135,27 @@ static int __devinit sja1000_ofp_probe(s priv->read_reg = sja1000_ofp_read_reg; priv->write_reg = sja1000_ofp_write_reg; - err =of_property_read_u32 (np,"nxp,external-clock-frequency" , &prop); -if (!err) - priv->can.clock.freq = prop /2 ; + prop =of_get_property (np,"nxp,external-clock-frequency" , &prop_size); +if (prop && (prop_size ==sizeof (u32))) + priv->can.clock.freq = *prop /2 ;else priv->can.clock.freq =SJA1000_OFP_CAN_CLOCK ;/* default */ - err =of_property_read_u32 (np,"nxp,tx-output-mode" , &prop); -if (!err) - priv->ocr |= prop &OCR_MODE_MASK ; + prop =of_get_property (np,"nxp,tx-output-mode" , &prop_size); +if (prop && (prop_size ==sizeof (u32))) + priv->ocr |= *prop &OCR_MODE_MASK ;else priv->ocr |=OCR_MODE_NORMAL ;/* default */ - err =of_property_read_u32 (np,"nxp,tx-output-config" , &prop); -if (!err) - priv->ocr |= (prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ; + prop =of_get_property (np,"nxp,tx-output-config" , &prop_size); +if (prop && (prop_size ==sizeof (u32))) + priv->ocr |= (*prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ;else priv->ocr |=OCR_TX0_PULLDOWN ;/* default */ - err =of_property_read_u32 (np,"nxp,clock-out-frequency" , &prop); -if (!err && prop) { -u32 divider = priv->can.clock.freq *2 / prop; + prop =of_get_property (np,"nxp,clock-out-frequency" , &prop_size); +if (prop && (prop_size ==sizeof (u32)) && *prop) { +u32 divider = priv->can.clock.freq *2 / *prop;if (divider >1 ) priv->cdr |= divider /2 -1 ;
@@ -165,7 +165,8 @@ static int __devinit sja1000_ofp_probe(s priv->cdr |=CDR_CLK_OFF ;/* default */ } -if (!of_property_read_bool (np,"nxp,no-comparator-bypass" )) + prop =of_get_property (np,"nxp,no-comparator-bypass" ,NULL ); +if (!prop) priv->cdr |=CDR_CBP ;/* default */ priv->irq_flags =IRQF_SHARED ;
A message that is not in the archive (sent off-list or not yet received): CAKocOOM7rXbFbD73ZZ2zmS6SGgaytmWd-36uV+G2OVO88Zb=Og@mail.gmail.com
Quoted 18 lines
From: Greg Kroah-Hartman <[email protected]>
Date: Mon, May 6, 2013 at 4:58 PM
Subject: [ 00/46] 3.0.77-stable review
To: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>, [email protected], [email protected], [email protected]This is the start of the stable review cycle for the 3.0.77 release. There are 46 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 May 8 22:56:20 UTC 2013. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.77-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.76, 3.4.43, 3.8.11, and 3.9.0
Compiled and booted on the following systems:
Samsung Series 9 Intel Corei5:
(3.4.44-rc1, 3.8.12-rc1, and 3.9.1-rc1)
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics:
(3.0.77-rc1, 3.4.44-rc1, 3.8.12-rc1, and 3.9.1-rc)
HP Compaq dc7700 SFF desktop: x86-64 Intel Core-i2:
(cross-compile testing: 3.0.77-rc1, 3.4.44-rc1, 3.8.12-rc1, and3.9.1-rc1)
dmesgs for all releases look good. No regressions compared to the previous dmesgs for each of these releases.
Cross-compile tests results:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.8.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.8.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
thanks,
-- Shuah
Shuah Khan Linux Kernel Developer - Open Source Group Samsung Research America (Silicon Valley) [email protected] | (970) 672-0658
[email protected]
maintainerQuoted 22 lines · Shuah Khan
Quoted 22 lines
From: Greg Kroah-Hartman <[email protected]>
Date: Mon, May 6, 2013 at 4:58 PM
Subject: [ 00/46] 3.0.77-stable review
To: [email protected]
Cc: Greg Kroah-Hartman <[email protected]>, [email protected], [email protected], [email protected]This is the start of the stable review cycle for the 3.0.77 release. There are 46 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 May 8 22:56:20 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.77-rc1.gzand the diffstat can be found below.
Quoted 7 lines
Quoted 4 lines
thanks,
greg k-h
Patches applied cleanly to 3.0.76, 3.4.43, 3.8.11, and 3.9.0
Compiled and booted on the following systems:
Thanks for testing all of these and letting us know.
greg k-h