3.4.48-stable review
Subsystems (41)
Greg Kroah-Hartman
maintainercover 3.4.48-stable review
This is the start of the stable review cycle for the 3.4.48 release. There are 44 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 Fri Jun 7 21:10:11 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.4.48-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.4.48-rc1
Manoj Iyer <[email protected]>
thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
Johannes Berg <[email protected]>
mac80211: close AP_VLAN interfaces before unregistering all
Martin Pelikan <[email protected]>
x86, um: Correct syscall table type attributes breaking gcc 4.8
Joerg Roedel <[email protected]>
iommu/amd: Workaround for ERBT1312
Suravee Suthikulpanit <[email protected]>
iommu/amd: Re-enable IOMMU event log interrupt after handling.
Wei Liu <[email protected]>
xen-netback: remove skb in xen_netbk_alloc_page
Dave Kleikamp <[email protected]>
jfs: fix a couple races
Keir Fraser <[email protected]>
xen/events: Handle VIRQ_TIMER before any other hardirq in event loop.
Finn Thain <[email protected]>
m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK
Vincent Pelletier <[email protected]>
libata: make ata_exec_internal_sg honor DMADIR
Chew, Chiau Ee <[email protected]>
ata_piix: add PCI IDs for Intel BayTail
Wolfgang Frisch <[email protected]>
USB: io_ti: Fix NULL dereference in chase_port()
Jeff Layton <[email protected]>
cifs: fix potential buffer overrun when composing a new options string
Alex Deucher <[email protected]>
drm/radeon: fix card_posted check for newer asics
Dave Chinner <[email protected]>
xfs: kill suid/sgid through the truncate path.
Trond Myklebust <[email protected]>
NFSv4: Fix a thinko in nfs4_try_open_cached
Kees Cook <[email protected]>
iscsi-target: fix heap buffer overflow on error
Aneesh Kumar K.V <[email protected]>
mm/THP: use pmd_populate() to update the pmd with pgtable_t pointer
Cliff Wickman <[email protected]>
mm/pagewalk.c: walk_page_range should avoid VM_PFNMAP areas
Brian Behlendorf <[email protected]>
drivers/block/brd.c: fix brd_lookup_page() race
Xiao Guangrong <[email protected]>
mm: mmu_notifier: re-fix freed page still mapped in secondary MMU
Ryusuke Konishi <[email protected]>
nilfs2: fix issue of nilfs_set_page_dirty() for page at EOF boundary
Imre Deak <[email protected]>
wait: fix false timeouts when using wait_event_timeout()
wang, biao <[email protected]>
klist: del waiter from klist_remove_waiters before wakeup waitting process
Leonid Yegoshin <[email protected]>
mm compaction: fix of improper cache flush in migration code
Christian Gmeiner <[email protected]>
drivers/leds/leds-ot200.c: fix error caused by shifted mask
Martin Michlmayr <[email protected]>
Kirkwood: Enable PCIe port 1 on QNAP TS-11x/TS-21x
Joseph Qi <[email protected]>
ocfs2: goto out_unlock if ocfs2_get_clusters_nocache() failed in ocfs2_fiemap()
Ben Hutchings <[email protected]>
perf: net_dropmonitor: Fix symbol-relative addresses
Ben Hutchings <[email protected]>
perf: net_dropmonitor: Fix trace parameter order
OGAWA Hirofumi <[email protected]>
fat: fix possible overflow for fat_clusters
Jeff Layton <[email protected]>
cifs: only set ops for inodes in I_NEW state
Alan Stern <[email protected]>
USB: UHCI: fix for suspend of virtual HP controller
Alan Stern <[email protected]>
USB: xHCI: override bogus bulk wMaxPacketSize values
Oliver Neukum <[email protected]>
USB: reset resume quirk needed by a hub
Schemmel Hans-Christoph <[email protected]>
USB: Blacklisted Cinterion's PLxx WWAN Interface
Wang YanQing <[email protected]>
TTY: Fix tty miss restart after we turn off flow-control
Dan Carpenter <[email protected]>
USB: cxacru: potential underflow in cxacru_cm_get_array()
Gomella, Andrew (NIH/NHLBI) [F] <[email protected]>
USB: ftdi_sio: Add support for Newport CONEX motor drivers
Dan Williams <[email protected]>
USB: option: add device IDs for Dell 5804 (Novatel E371) WWAN card
Teppo Kotilainen <[email protected]>
usb: option: Add Telewell TW-LTE 4G
Hema Prathaban <[email protected]>
staging: vt6656: use free_netdev instead of kfree
Gregory CLEMENT <[email protected]>
ARM: plat-orion: Fix num_resources and id for ge10 and ge11
Hans-Christian Egtvedt <[email protected]>
avr32: fix relocation check for signed 18-bit offset
-------------
Diffstat:
Makefile | 4 +- arch/arm/mach-kirkwood/ts219-setup.c | 2 +- arch/arm/plat-orion/common.c | 12 ++-- arch/avr32/kernel/module.c | 2 +- arch/m68k/kernel/head.S | 29 ++++++---- arch/x86/um/sys_call_table_32.c | 4 +- drivers/ata/ata_piix.c | 15 +++++ drivers/ata/libata-core.c | 6 ++ drivers/block/brd.c | 4 +- drivers/gpu/drm/radeon/radeon_device.c | 19 +++--- drivers/iommu/amd_iommu.c | 31 ++++++++-- drivers/iommu/amd_iommu_types.h | 1 + drivers/leds/leds-ot200.c | 14 ++--- drivers/net/xen-netback/netback.c | 5 +- drivers/platform/x86/thinkpad_acpi.c | 7 +++ drivers/staging/vt6656/hostap.c | 2 +- drivers/target/iscsi/iscsi_target_parameters.c | 8 +-- drivers/target/iscsi/iscsi_target_parameters.h | 4 +- drivers/tty/n_tty.c | 8 +++ drivers/usb/atm/cxacru.c | 3 +- drivers/usb/core/quirks.c | 3 + drivers/usb/host/uhci-hub.c | 3 +- drivers/usb/host/xhci-mem.c | 17 +++--- drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 2 + drivers/usb/serial/io_ti.c | 3 + drivers/usb/serial/option.c | 13 +++-- drivers/xen/events.c | 19 ++++-- fs/cifs/cifs_dfs_ref.c | 4 +- fs/cifs/inode.c | 3 +- fs/fat/inode.c | 15 ++++- fs/jfs/inode.c | 2 +- fs/jfs/jfs_logmgr.c | 3 +- fs/nfs/nfs4proc.c | 2 +- fs/nilfs2/inode.c | 27 +++++++-- fs/ocfs2/extent_map.c | 2 +- fs/xfs/xfs_iops.c | 47 ++++++++++----- include/linux/wait.h | 16 ++++-- lib/klist.c | 2 +- mm/huge_memory.c | 7 ++- mm/migrate.c | 2 +- mm/mmu_notifier.c | 80 +++++++++++++------------- mm/pagewalk.c | 70 +++++++++++----------- net/mac80211/iface.c | 9 +++ tools/perf/scripts/python/net_dropmonitor.py | 8 +-- 45 files changed, 355 insertions(+), 186 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/44 avr32: fix relocation check for signed 18-bit offset
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans-Christian Egtvedt <[email protected]>
commit e68c636d88db3fda74e664ecb1a213ae0d50a7d8 upstream.
Caught by static code analysis by David.
--- arch/avr32/kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/avr32/kernel/module.c +1 -1
@@ -264,7 +264,7 @@ int apply_relocate_add(Elf32_Shdr *sechdbreak ;case R_AVR32_GOT18SW :if ((relocation &0xfffe0003 ) !=0 - && (relocation &0xfffc0003 ) !=0xffff0000 ) + && (relocation &0xfffc0000 ) !=0xfffc0000 )return reloc_overflow (module,"R_AVR32_GOT18SW" , relocation); relocation >>=2 ;
Greg Kroah-Hartman
maintainerPATCH 2/44 ARM: plat-orion: Fix num_resources and id for ge10 and ge11
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory CLEMENT <[email protected]>
commit 2b8b2797142c7951e635c6eec5d1705ee9bc45c5 upstream.
When platform data were moved from arch/arm/mach-mv78xx0/common.c to arch/arm/plat-orion/common.c with the commit "7e3819d ARM: orion:
Consolidate ethernet platform data", there were few typo made on gigabit Ethernet interface ge10 and ge11. This commit writes back their initial value, which allows to use this interfaces again.
--- arch/arm/plat-orion/common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/plat-orion/common.c +6 -6
@@ -340,7 +340,7 @@ static struct resource orion_ge10_sharedstatic struct platform_device orion_ge10_shared = { .name =MV643XX_ETH_SHARED_NAME , - .id =1 , + .id =2 , .dev = { .platform_data = &orion_ge10_shared_data, },
@@ -355,8 +355,8 @@ static struct resource orion_ge10_resourstatic struct platform_device orion_ge10 = { .name =MV643XX_ETH_NAME , - .id =1 , - .num_resources =2 , + .id =2 , + .num_resources =1 , .resource = orion_ge10_resources, .dev = { .coherent_dma_mask =DMA_BIT_MASK (32 ),
@@ -393,7 +393,7 @@ static struct resource orion_ge11_sharedstatic struct platform_device orion_ge11_shared = { .name =MV643XX_ETH_SHARED_NAME , - .id =1 , + .id =3 , .dev = { .platform_data = &orion_ge11_shared_data, },
@@ -408,8 +408,8 @@ static struct resource orion_ge11_resourstatic struct platform_device orion_ge11 = { .name =MV643XX_ETH_NAME , - .id =1 , - .num_resources =2 , + .id =3 , + .num_resources =1 , .resource = orion_ge11_resources, .dev = { .coherent_dma_mask =DMA_BIT_MASK (32 ),
Greg Kroah-Hartman
maintainerPATCH 3/44 staging: vt6656: use free_netdev instead of kfree
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hema Prathaban <[email protected]>
commit 0a438d5b381e2bdfd5e02d653bf46fcc878356e3 upstream.
use free_netdev() instead of kfree(pDevice->apdev)
--- drivers/staging/vt6656/hostap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/hostap.c +1 -1
@@ -153,7 +153,7 @@ static int hostap_disable_hostapd(PSDeviDBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "%s: Netdevice %s unregistered\n" , pDevice->dev->name, pDevice->apdev->name); } -kfree (pDevice->apdev); +free_netdev (pDevice->apdev); pDevice->apdev =NULL ; pDevice->bEnable8021x = FALSE; pDevice->bEnableHostWEP = FALSE;
Greg Kroah-Hartman
maintainerPATCH 4/44 usb: option: Add Telewell TW-LTE 4G
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Teppo Kotilainen <[email protected]>
commit 73c042df6e1bc50544842a04b777b36bbe3630e6 upstream.
Information from driver description files:
diag: VID_19D2&PID_0412&MI_00 nmea: VID_19D2&PID_0412&MI_01 at: VID_19D2&PID_0412&MI_02
modem: VID_19D2&PID_0412&MI_03
net: VID_19D2&PID_0412&MI_04
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -966,6 +966,8 @@ static const struct usb_device_id option .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0412, 0xff, 0xff, 0xff), /* Telewell TW-LTE 4G */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
Greg Kroah-Hartman
maintainerPATCH 5/44 USB: option: add device IDs for Dell 5804 (Novatel E371) WWAN card
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 49c6e370dd6400b84897c4100095089b5c13a061 upstream.
A rebranded Novatel E371 for AT&T's LTE bands.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -196,6 +196,7 @@ static void option_instat_callback(struc#define DELL_PRODUCT_5800_MINICARD_VZW 0x8195/* Novatel E362 */ #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196/* Novatel E362 */ +#define DELL_PRODUCT_5804_MINICARD_ATT 0x819b/* Novatel E371 */ #define KYOCERA_VENDOR_ID 0x0c88#define KYOCERA_PRODUCT_KPC650 0x17da
@@ -771,6 +772,7 @@ static const struct usb_device_id option { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
Greg Kroah-Hartman
maintainerPATCH 6/44 USB: ftdi_sio: Add support for Newport CONEX motor drivers
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gomella, Andrew (NIH/NHLBI) [F]" <[email protected]>
commit 7138143972b7c293267c783fc99a194f0ceff7f2 upstream.
Here are two more devices that use FTDI USB-to-serial chips with new product ID's.
The devices are the Newport Conex-AGP and Conex-CC motor controllers.
(http://www.newport.com/CONEX-AGP-Integrated-Piezo-Motor-Rotation-Stages-/987623/1033/info.aspx)
(http://www.newport.com/CONEX-CC-DC-Servo-Controller-Actuators/934114/1033/info.aspx)
usb-devices command yields:
P: Vendor=104d ProdID=3002 Rev=06.00 S: Manufacturer=Newport S: Product=CONEX-CC
as well as
P: Vendor=104d ProdID=3006 Rev=06.00 S: Manufacturer=Newport S: Product=CONEX-AGP
--- drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -199,6 +199,8 @@ static struct usb_device_id id_table_com { 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(NEWPORT_VID, NEWPORT_CONEX_CC_PID) }, + { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
drivers/usb/serial/ftdi_sio_ids.h +2 -0
@@ -772,6 +772,8 @@*/ #define NEWPORT_VID 0x104D#define NEWPORT_AGILIS_PID 0x3000 +#define NEWPORT_CONEX_CC_PID 0x3002 +#define NEWPORT_CONEX_AGP_PID 0x3006/* Interbiometrics USB I/O Board */ /* Developed for Interbiometrics by Rudolf Gugler */
Greg Kroah-Hartman
maintainerPATCH 7/44 USB: cxacru: potential underflow in cxacru_cm_get_array()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 2a0ebf80aa95cc758d4725f74a7016e992606a39 upstream.
The value of "offd" comes off the instance->rcv_buf[] and we used it as the offset into an array. The problem is that we check the upper bound but not for negative values.
--- drivers/usb/atm/cxacru.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/atm/cxacru.c +2 -1
@@ -686,7 +686,8 @@ static int cxacru_cm_get_array(struct cx {int ret, len;__le32 *buf; -int offb, offd; +int offb; +unsigned int offd;const int stride =CMD_PACKET_SIZE / (4 *2 ) -1 ;int buflen = ((size -1 ) / stride +1 + size *2 ) *4 ;
Greg Kroah-Hartman
maintainerPATCH 8/44 TTY: Fix tty miss restart after we turn off flow-control
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang YanQing <[email protected]>
commit dab73b4eb9ef924a2b90dab84e539076d82b256f upstream.
I meet emacs hang in start if I do the operation below:
1: echo 3 > /proc/sys/vm/drop_caches
2: emacs BigFile
3: Press CTRL-S follow 2 immediately
Then emacs hang on, CTRL-Q can't resume, the terminal hang on, you can do nothing with this terminal except close it.
The reason is before emacs takeover control the tty, we use CTRL-S to XOFF it. Then when emacs takeover the control, it may don't use the flow-control, so emacs hang. This patch fix it.
This patch will fix a kind of strange tty relation hang problem, I believe I meet it with vim in ssh, and also see below bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=465823
--- drivers/tty/n_tty.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/tty/n_tty.c +8 -0
@@ -1529,6 +1529,14 @@ static void n_tty_set_termios(struct tty tty->real_raw =0 ; }n_tty_set_room (tty); +/* +* Fix tty hang when I_IXON(tty) is cleared, but the tty +* been stopped by STOP_CHAR(tty) before it. +*/ +if (!I_IXON (tty) && old && (old->c_iflag &IXON ) && !tty->flow_stopped) { +start_tty (tty); + } +/* The termios change make the tty ready for I/O */ wake_up_interruptible (&tty->write_wait);wake_up_interruptible (&tty->read_wait);
Greg Kroah-Hartman
maintainerPATCH 9/44 USB: Blacklisted Cinterions PLxx WWAN Interface
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Schemmel Hans-Christoph <[email protected]>
commit 8ff10bdb14a52e3f25d4ce09e0582a8684c1a6db upstream.
/drivers/usb/serial/option.c: Blacklisted Cinterion's PLxx WWAN Interface (USB Interface 4), because it will be handled by QMI WWAN driver. Product IDs renamed.
--- drivers/usb/serial/option.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/usb/serial/option.c +5 -4
@@ -342,8 +342,8 @@ static void option_instat_callback(struc#define CINTERION_PRODUCT_EU3_E 0x0051#define CINTERION_PRODUCT_EU3_P 0x0052#define CINTERION_PRODUCT_PH8 0x0053 -#define CINTERION_PRODUCT_AH6 0x0055 -#define CINTERION_PRODUCT_PLS8 0x0060 +#define CINTERION_PRODUCT_AHXX 0x0055 +#define CINTERION_PRODUCT_PLXX 0x0060/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1268,8 +1268,9 @@ static const struct usb_device_id option { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AH6) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLS8) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },
Greg Kroah-Hartman
maintainerPATCH 10/44 USB: reset resume quirk needed by a hub
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit bac6b03275184c912ad0818c9a0a736847804dca upstream.
Werner Fink has reported problems with this hub.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -110,6 +110,9 @@ static const struct usb_device_id usb_qu/* Edirol SD-20 */ { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Alcor Micro Corp. Hub */ + { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, + /* appletouch */ { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 11/44 USB: xHCI: override bogus bulk wMaxPacketSize values
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit e4f47e3675e6f1f40906b785b934ce963e9f2eb3 upstream.
This patch shortens the logic in xhci_endpoint_init() by moving common calculations involving max_packet and max_burst outside the switch statement, rather than repeating the same code in multiple case-specific statements. It also replaces two usages of max_packet which were clearly intended to be max_burst all along.
More importantly, it compensates for a common bug in high-speed bulk endpoint descriptors. In many devices there is a bulk endpoint having a wMaxPacketSize value smaller than 512, which is forbidden by the USB spec. Some xHCI controllers can't handle this and refuse to accept the endpoint. This patch changes the max_packet value to 512, which allows the controller to use the endpoint properly.
In practice the bogus maxpacket size doesn't matter, because none of the transfers sent via these endpoints are longer than the maxpacket value anyway.
--- drivers/usb/host/xhci-mem.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-mem.c +9 -8
@@ -1443,15 +1443,17 @@ int xhci_endpoint_init(struct xhci_hcd * ep_ctx->ep_info2 |=cpu_to_le32 (xhci_get_endpoint_type (udev, ep));/* Set the max packet size and max burst */ + max_packet =GET_MAX_PACKET (usb_endpoint_maxp (&ep->desc)); + max_burst =0 ;switch (udev->speed) {case USB_SPEED_SUPER : - max_packet =usb_endpoint_maxp (&ep->desc); - ep_ctx->ep_info2 |=cpu_to_le32 (MAX_PACKET (max_packet));/* dig out max burst from ep companion desc */ - max_packet = ep->ss_ep_comp.bMaxBurst; - ep_ctx->ep_info2 |=cpu_to_le32 (MAX_BURST (max_packet)); + max_burst = ep->ss_ep_comp.bMaxBurst;break ;case USB_SPEED_HIGH : +/* Some devices get this wrong */ +if (usb_endpoint_xfer_bulk (&ep->desc)) + max_packet =512 ;/* bits 11:12 specify the number of additional transaction * opportunities per microframe (USB 2.0, section 9.6.6) */
@@ -1459,17 +1461,16 @@ int xhci_endpoint_init(struct xhci_hcd * usb_endpoint_xfer_int(&ep->desc)) { max_burst = (usb_endpoint_maxp (&ep->desc) &0x1800 ) >>11 ; - ep_ctx->ep_info2 |=cpu_to_le32 (MAX_BURST (max_burst)); } -/* Fall through */ +break ;case USB_SPEED_FULL :case USB_SPEED_LOW : - max_packet =GET_MAX_PACKET (usb_endpoint_maxp (&ep->desc)); - ep_ctx->ep_info2 |=cpu_to_le32 (MAX_PACKET (max_packet));break ;default :BUG (); } + ep_ctx->ep_info2 |=cpu_to_le32 (MAX_PACKET (max_packet) | +MAX_BURST (max_burst)); max_esit_payload =xhci_get_max_esit_payload (xhci, udev, ep); ep_ctx->tx_info =cpu_to_le32 (MAX_ESIT_PAYLOAD_FOR_EP (max_esit_payload));
Greg Kroah-Hartman
maintainerPATCH 12/44 USB: UHCI: fix for suspend of virtual HP controller
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 997ff893603c6455da4c5e26ba1d0f81adfecdfc upstream.
HP's virtual UHCI host controller takes a long time to suspend (several hundred microseconds), even when no devices are attached. This provokes a warning message from uhci-hcd in the auto-stop case.
To prevent this from happening, this patch adds a test to avoid performing an auto-stop when the wait_for_hp quirk flag is set. The controller will still suspend through the normal runtime PM mechanism. And since that pathway includes a 1-ms delay, the slowness of the virtual hardware won't matter.
--- drivers/usb/host/uhci-hub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/uhci-hub.c +2 -1
@@ -222,7 +222,8 @@ static int uhci_hub_status_data(struct u/* auto-stop if nothing connected for 1 second */ if (any_ports_active (uhci)) uhci->rh_state =UHCI_RH_RUNNING ; -else if (time_after_eq (jiffies, uhci->auto_stop_time)) +else if (time_after_eq (jiffies, uhci->auto_stop_time) && + !uhci->wait_for_hp)suspend_rh (uhci,UHCI_RH_AUTO_STOPPED );break ;
Greg Kroah-Hartman
maintainerPATCH 13/44 cifs: only set ops for inodes in I_NEW state
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit c2b93e0699723700f886ce17bb65ffd771195a6d upstream.
It's generally not safe to reset the inode ops once they've been set. In the case where the inode was originally thought to be a directory and then later found to be a DFS referral, this can lead to an oops when we try to trigger an inode op on it after changing the ops to the blank referral operations.
--- fs/cifs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/inode.c +2 -1
@@ -173,7 +173,8 @@ cifs_fattr_to_inode(struct inode *inode,if (fattr->cf_flags &CIFS_FATTR_DFS_REFERRAL ) inode->i_flags |=S_AUTOMOUNT ; -cifs_set_ops (inode); +if (inode->i_state &I_NEW ) +cifs_set_ops (inode); }void
Greg Kroah-Hartman
maintainerPATCH 14/44 fat: fix possible overflow for fat_clusters
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: OGAWA Hirofumi <[email protected]>
commit 7b92d03c3239f43e5b86c9cc9630f026d36ee995 upstream.
Intermediate value of fat_clusters can be overflowed on 32bits arch.
--- fs/fat/inode.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
fs/fat/inode.c +14 -1
@@ -1237,6 +1237,19 @@ static int fat_read_root(struct inode *ireturn 0 ; } +static unsigned long calc_fat_clusters (struct super_block *sb) +{ +struct msdos_sb_info *sbi =MSDOS_SB (sb); + +/* Divide first to avoid overflow */ +if (sbi->fat_bits !=12 ) { +unsigned long ent_per_sec = sb->s_blocksize *8 / sbi->fat_bits; +return ent_per_sec * sbi->fat_length; + } + +return sbi->fat_length * sb->s_blocksize *8 / sbi->fat_bits; +} +/* * Read the super block of an MS-DOS FS. */
@@ -1433,7 +1446,7 @@ int fat_fill_super(struct super_block *s sbi->fat_bits = (total_clusters >MAX_FAT12 ) ?16 :12 ;/* check that FAT table does not overflow */ - fat_clusters = sbi->fat_length * sb->s_blocksize *8 / sbi->fat_bits; + fat_clusters =calc_fat_clusters (sb); total_clusters =min (total_clusters, fat_clusters -FAT_START_ENT );if (total_clusters >MAX_FAT (sb)) {if (!silent)
Greg Kroah-Hartman
maintainerPATCH 15/44 perf: net_dropmonitor: Fix trace parameter order
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 140c3c6a2bcd2c31e2f7f5a8d59689724776c8e5 upstream.
This works much better if we don't treat protocol numbers as addresses.
--- tools/perf/scripts/python/net_dropmonitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/scripts/python/net_dropmonitor.py +1 -1
@@ -64,7 +64,7 @@ def trace_end(): # called from perf, when it finds a correspoinding event def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, - skbaddr, protocol, location): + skbaddr, location, protocol): slocation = str(location) try: drop_log[slocation] = drop_log[slocation] + 1
Greg Kroah-Hartman
maintainerPATCH 16/44 perf: net_dropmonitor: Fix symbol-relative addresses
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 5a1e99dd2028e00998d42029be86835d8ef4a46e upstream.
The comparison between traced and symbol addresses is backwards: if the traced address doesn't exactly match a symbol (which we don't expect it to), we'll show the next symbol and the offset to it, whereas we should show the previous symbol and the offset from it.
--- tools/perf/scripts/python/net_dropmonitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/scripts/python/net_dropmonitor.py +3 -3
@@ -40,9 +40,9 @@ def get_kallsyms_table(): def get_sym(sloc): loc = int(sloc) - for i in kallsyms: - if (i['loc'] >= loc): - return (i['name'], i['loc']-loc) + for i in kallsyms[::-1]: + if loc >= i['loc']: + return (i['name'], loc - i['loc']) return (None, 0) def print_drop_table():
Greg Kroah-Hartman
maintainerPATCH 17/44 ocfs2: goto out_unlock if ocfs2_get_clusters_nocache() failed in ocfs2_fiemap()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
commit b4ca2b4b577c3530e34dcfaafccb2cc680ce95d1 upstream.
Last time we found there is lock/unlock bug in ocfs2_file_aio_write, and then we did a thorough search for all lock resources in ocfs2_inode_info, including rw, inode and open lockres and found this bug. My kernel version is 3.0.13, and it is also in the lastest version 3.9. In ocfs2_fiemap, once ocfs2_get_clusters_nocache failed, it should goto out_unlock instead of out, because we need release buffer head, up read alloc sem and unlock inode.
--- fs/ocfs2/extent_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/extent_map.c +1 -1
@@ -791,7 +791,7 @@ int ocfs2_fiemap(struct inode *inode, st &hole_size, &rec, &is_last);if (ret) {mlog_errno (ret); - goto out; + goto out_unlock; }if (rec.e_blkno ==0ULL ) {
Greg Kroah-Hartman
maintainerPATCH 18/44 Kirkwood: Enable PCIe port 1 on QNAP TS-11x/TS-21x
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Michlmayr <[email protected]>
commit 99e11334dcb846f9b76fb808196c7f47aa83abb3 upstream.
Enable KW_PCIE1 on QNAP TS-11x/TS-21x devices as newer revisions (rev 1.3) have a USB 3.0 chip from Etron on PCIe port 1. Thanks to Marek Vasut for identifying this issue!
--- arch/arm/mach-kirkwood/ts219-setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-kirkwood/ts219-setup.c +1 -1
@@ -124,7 +124,7 @@ static void __init qnap_ts219_init(void)static int __init ts219_pci_init (void ) {if (machine_is_ts219 ()) -kirkwood_pcie_init (KW_PCIE0 ); +kirkwood_pcie_init (KW_PCIE1 |KW_PCIE0 );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 19/44 drivers/leds/leds-ot200.c: fix error caused by shifted mask
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Gmeiner <[email protected]>
commit 4b949b8af12e24b8a48fa5bb775a13b558d9f4da upstream.
During the development of this driver an in-house register documentation was used. The last week some integration tests were done and this problem was found. It turned out that the released register documentation is wrong.
The fix is very simple: shift all masks by one.
--- drivers/leds/leds-ot200.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/leds/leds-ot200.c +7 -7
@@ -47,37 +47,37 @@ static struct ot200_led leds[] = { { .name = "led_1", .port = 0x49, - .mask = BIT(7), + .mask = BIT(6), }, { .name = "led_2", .port = 0x49, - .mask = BIT(6), + .mask = BIT(5), }, { .name = "led_3", .port = 0x49, - .mask = BIT(5), + .mask = BIT(4), }, { .name = "led_4", .port = 0x49, - .mask = BIT(4), + .mask = BIT(3), }, { .name = "led_5", .port = 0x49, - .mask = BIT(3), + .mask = BIT(2), }, { .name = "led_6", .port = 0x49, - .mask = BIT(2), + .mask = BIT(1), }, { .name = "led_7", .port = 0x49, - .mask = BIT(1), + .mask = BIT(0), } };
Greg Kroah-Hartman
maintainerPATCH 20/44 mm compaction: fix of improper cache flush in migration code
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leonid Yegoshin <[email protected]>
commit c2cc499c5bcf9040a738f49e8051b42078205748 upstream.
Page 'new' during MIGRATION can't be flushed with flush_cache_page(). Using flush_cache_page(vma, addr, pfn) is justified only if the page is already placed in process page table, and that is done right after flush_cache_page(). But without it the arch function has no knowledge of process PTE and does nothing.
Besides that, flush_cache_page() flushes an application cache page, but the kernel has a different page virtual address and dirtied it.
Replace it with flush_dcache_page(new) which is the proper usage.
The old page is flushed in try_to_unmap_one() before migration.
This bug takes place in Sead3 board with M14Kc MIPS CPU without cache aliasing (but Harvard arch - separate I and D cache) in tight memory environment (128MB) each 1-3days on SOAK test. It fails in cc1 during kernel build (SIGILL, SIGBUS, SIGSEG) if CONFIG_COMPACTION is switched ON.
--- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/migrate.c +1 -1
@@ -145,7 +145,7 @@ static int remove_migration_pte(struct pif (PageHuge (new)) pte =pte_mkhuge (pte);#endif -flush_cache_page (vma, addr,pte_pfn (pte)); +flush_dcache_page (new);set_pte_at (mm, addr, ptep, pte);if (PageHuge (new)) {
Greg Kroah-Hartman
maintainerPATCH 21/44 klist: del waiter from klist_remove_waiters before wakeup waitting process
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "wang, biao" <[email protected]>
commit ac5a2962b02f57dea76d314ef2521a2170b28ab6 upstream.
There is a race between klist_remove and klist_release. klist_remove uses a local var waiter saved on stack. When klist_release calls wake_up_process(waiter->process) to wake up the waiter, waiter might run immediately and reuse the stack. Then, klist_release calls list_del(&waiter->list) to change previous
wait data and cause prior waiter thread corrupt.
The patch fixes it against kernel 3.9.
--- lib/klist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/klist.c +1 -1
@@ -193,10 +193,10 @@ static void klist_release(struct kref *kif (waiter->node != n)continue ; +list_del (&waiter->list); waiter->woken =1 ;mb ();wake_up_process (waiter->process); -list_del (&waiter->list); }spin_unlock (&klist_remove_lock);knode_set_klist (n,NULL );
Greg Kroah-Hartman
maintainerPATCH 22/44 wait: fix false timeouts when using wait_event_timeout()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Deak <[email protected]>
commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e upstream.
Many callers of the wait_event_timeout() and wait_event_interruptible_timeout() expect that the return value will be positive if the specified condition becomes true before the timeout elapses. However, at the moment this isn't guaranteed. If the wake-up handler is delayed enough, the time remaining until timeout will be calculated as 0 - and passed back as a return value - even if the condition became true before the timeout has passed.
Fix this by returning at least 1 if the condition becomes true. This semantic is in line with what wait_for_condition_timeout() does; see commit bb10ed09 ("sched: fix wait_for_completion_timeout() spurious failure under heavy load").
Daniel said "We have 3 instances of this bug in drm/i915. One case even where we switch between the interruptible and not interruptible wait_event_timeout variants, foolishly presuming they have the same semantics. I very much like this."
One such bug is reported at
https://bugs.freedesktop.org/show_bug.cgi?id=64133
--- include/linux/wait.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
include/linux/wait.h +11 -5
@@ -233,6 +233,8 @@ do { \if (!ret) \break ; \ } \ +if (!ret && (condition)) \ + ret =1 ; \finish_wait (&wq, &__wait); \ }while (0 )
@@ -249,8 +251,9 @@ do { \* wake_up() has to be called after changing any variable that could * change the result of the wait condition. * -* The function returns 0 if the @timeout elapsed, and the remaining -* jiffies if the condition evaluated to true before the timeout elapsed. +* The function returns 0 if the @timeout elapsed, or the remaining +* jiffies (at least 1) if the @condition evaluated to %true before +* the @timeout elapsed. */ #define wait_event_timeout (wq, condition, timeout) \ ({ \
@@ -318,6 +321,8 @@ do { \ ret = -ERESTARTSYS ; \break ; \ } \ +if (!ret && (condition)) \ + ret =1 ; \finish_wait (&wq, &__wait); \ }while (0 )
@@ -334,9 +339,10 @@ do { \* wake_up() has to be called after changing any variable that could * change the result of the wait condition. * -* The function returns 0 if the @timeout elapsed, -ERESTARTSYS if it -* was interrupted by a signal, and the remaining jiffies otherwise -* if the condition evaluated to true before the timeout elapsed. +* Returns: +* 0 if the @timeout elapsed, -%ERESTARTSYS if it was interrupted by +* a signal, or the remaining jiffies (at least 1) if the @condition +* evaluated to %true before the @timeout elapsed. */ #define wait_event_interruptible_timeout (wq, condition, timeout) \ ({ \
Greg Kroah-Hartman
maintainerPATCH 23/44 nilfs2: fix issue of nilfs_set_page_dirty() for page at EOF boundary
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
commit 136e8770cd5d1fe38b3c613100dd6dc4db6d4fa6 upstream.
nilfs2: fix issue of nilfs_set_page_dirty for page at EOF boundary
DESCRIPTION:
There are use-cases when NILFS2 file system (formatted with block size
lesser than 4 KB) can be remounted in RO mode because of encountering of "broken bmap" issue.
The issue was reported by Anthony Doggett <[email protected]>:
"The machine I've been trialling nilfs on is running Debian Testing,
Linux version 3.2.0-4-686-pae ([email protected]) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.35-2), but I've also reproduced it (identically) with Debian Unstable amd64 and Debian Experimental (using the 3.8-trunk kernel). The problematic partitions were formatted with "mkfs.nilfs2 -b 1024 -B 8192"."
SYMPTOMS:
(1) System log contains error messages likewise:
[63102.496756] nilfs_direct_assign: invalid pointer: 0
[63102.496786] NILFS error (device dm-17): nilfs_bmap_assign: broken bmap (inode number=28)
[63102.496798]
[63102.524403] Remounting filesystem read-only(2) The NILFS2 file system is remounted in RO mode.
REPRODUSING PATH:
(1) Create volume group with name "unencrypted" by means of vgcreate utility.
(2) Run script (prepared by Anthony Doggett <[email protected]>):
----------------[BEGIN SCRIPT]--------------------
VG=unencrypted
lvcreate --size 2G --name ntest $VG
mkfs.nilfs2 -b 1024 -B 8192 /dev/mapper/$VG-ntest
mkdir /var/tmp/n
mkdir /var/tmp/n/ntest
mount /dev/mapper/$VG-ntest /var/tmp/n/ntest
mkdir /var/tmp/n/ntest/thedir
cd /var/tmp/n/ntest/thedir
sleep 2
date
darcs init
sleep 2
dmesg|tail -n 5
date
darcs whatsnew || true
date
sleep 2
dmesg|tail -n 5
----------------[END SCRIPT]--------------------
REPRODUCIBILITY: 100%
INVESTIGATION:
As it was discovered, the issue takes place during segment construction after executing such sequence of user-space operations:
open("_darcs/index", O_RDWR|O_CREAT|O_NOCTTY, 0666) = 7 fstat(7, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 ftruncate(7, 60)
The error message "NILFS error (device dm-17): nilfs_bmap_assign: broken bmap (inode number=28)" takes place because of trying to get block number for third block of the file with logical offset #3072 bytes. As it is possible to see from above output, the file has 60 bytes of the whole size. So, it is enough one block (1 KB in size) allocation for the whole file. Trying to operate with several blocks instead of one takes place because of discovering several dirty buffers for this file in nilfs_segctor_scan_file() method.
The root cause of this issue is in nilfs_set_page_dirty function which is called just before writing to an mmapped page.
When nilfs_page_mkwrite function handles a page at EOF boundary, it fills hole blocks only inside EOF through __block_page_mkwrite().
The __block_page_mkwrite() function calls set_page_dirty() after filling hole blocks, thus nilfs_set_page_dirty function (= a_ops->set_page_dirty) is called. However, the current implementation of nilfs_set_page_dirty() wrongly marks all buffers dirty even for page at EOF boundary.
As a result, buffers outside EOF are inconsistently marked dirty and queued for write even though they are not mapped with nilfs_get_block function.
FIX:
This modifies nilfs_set_page_dirty() not to mark hole blocks dirty.
Thanks to Vyacheslav Dubeyko for his effort on analysis and proposals for this issue.
--- fs/nilfs2/inode.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)
fs/nilfs2/inode.c +23 -4
@@ -195,13 +195,32 @@ static int nilfs_writepage(struct page *static int nilfs_set_page_dirty (struct page *page) { -int ret =__set_page_dirty_buffers (page); +int ret =__set_page_dirty_nobuffers (page); -if (ret) { +if (page_has_buffers (page)) {struct inode *inode = page->mapping->host; -unsigned nr_dirty =1 << (PAGE_SHIFT - inode->i_blkbits); +unsigned nr_dirty =0 ; +struct buffer_head *bh, *head; -nilfs_set_file_dirty (inode, nr_dirty); +/* +* This page is locked by callers, and no other thread +* concurrently marks its buffers dirty since they are +* only dirtied through routines in fs/buffer.c in +* which call sites of mark_buffer_dirty are protected +* by page lock. +*/ + bh = head =page_buffers (page); +do { +/* Do not mark hole blocks dirty */ +if (buffer_dirty (bh) || !buffer_mapped (bh)) +continue ; + +set_buffer_dirty (bh); + nr_dirty++; + }while (bh = bh->b_this_page, bh != head); + +if (nr_dirty) +nilfs_set_file_dirty (inode, nr_dirty); }return ret; }
Greg Kroah-Hartman
maintainerPATCH 24/44 mm: mmu_notifier: re-fix freed page still mapped in secondary MMU
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiao Guangrong <[email protected]>
commit d34883d4e35c0a994e91dd847a82b4c9e0c31d83 upstream.
Commit 751efd8610d3 ("mmu_notifier_unregister NULL Pointer deref and multiple ->release()") breaks the fix 3ad3d901bbcf ("mm: mmu_notifier:
fix freed page still mapped in secondary MMU").
Since hlist_for_each_entry_rcu() is changed now, we can not revert that patch directly, so this patch reverts the commit and simply fix the bug spotted by that patch
This bug spotted by commit 751efd8610d3 is:
There is a race condition between mmu_notifier_unregister() and __mmu_notifier_release().
Assume two tasks, one calling mmu_notifier_unregister() as a result of a filp_close() ->flush() callout (task A), and the other calling mmu_notifier_release() from an mmput() (task B).
A B
t1 srcu_read_lock()
t2 if (!hlist_unhashed())
t3 srcu_read_unlock()
t4 srcu_read_lock()
t5 hlist_del_init_rcu()
t6 synchronize_srcu()
t7 srcu_read_unlock()
t8 hlist_del_rcu() <--- NULL pointer deref.
This can be fixed by using hlist_del_init_rcu instead of hlist_del_rcu.
The another issue spotted in the commit is "multiple ->release() callouts", we needn't care it too much because it is really rare (e.g, can not happen on kvm since mmu-notify is unregistered after exit_mmap()) and the later call of multiple ->release should be fast since all the pages have already been released by the first call. Anyway, this issue should be fixed in a separate patch.
-stable suggestions: Any version that has commit 751efd8610d3 need to be backported. I find the oldest version has this commit is 3.0-stable.
--- mm/mmu_notifier.c | 80 +++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-)
mm/mmu_notifier.c +40 -40
@@ -37,51 +37,48 @@ static struct srcu_struct srcu;void __mmu_notifier_release (struct mm_struct *mm) {struct mmu_notifier *mn; +struct hlist_node *node;int id;/* -* srcu_read_lock() here will block synchronize_srcu() in -* mmu_notifier_unregister() until all registered -* ->release() callouts this function makes have -* returned. +* SRCU here will block mmu_notifier_unregister until +* ->release returns. */ id =srcu_read_lock (&srcu); +hlist_for_each_entry_rcu (mn, node, &mm->mmu_notifier_mm->list, hlist) +/* +* If ->release runs before mmu_notifier_unregister it must be +* handled, as it's the only way for the driver to flush all +* existing sptes and stop the driver from establishing any more +* sptes before all the pages in the mm are freed. +*/ +if (mn->ops->release) + mn->ops->release (mn, mm); +srcu_read_unlock (&srcu, id); +spin_lock (&mm->mmu_notifier_mm->lock);while (unlikely (!hlist_empty (&mm->mmu_notifier_mm->list))) { mn =hlist_entry (mm->mmu_notifier_mm->list.first, struct mmu_notifier, hlist); -/* -* Unlink. This will prevent mmu_notifier_unregister() -* from also making the ->release() callout. +* We arrived before mmu_notifier_unregister so +* mmu_notifier_unregister will do nothing other than to wait +* for ->release to finish and for mmu_notifier_unregister to +* return. */ hlist_del_init_rcu (&mn->hlist); -spin_unlock (&mm->mmu_notifier_mm->lock); - -/* -* Clear sptes. (see 'release' description in mmu_notifier.h) -*/ -if (mn->ops->release) - mn->ops->release (mn, mm); - -spin_lock (&mm->mmu_notifier_mm->lock); }spin_unlock (&mm->mmu_notifier_mm->lock);/* -* All callouts to ->release() which we have done are complete. -* Allow synchronize_srcu() in mmu_notifier_unregister() to complete -*/ -srcu_read_unlock (&srcu, id); - -/* -* mmu_notifier_unregister() may have unlinked a notifier and may -* still be calling out to it. Additionally, other notifiers -* may have been active via vmtruncate() et. al. Block here -* to ensure that all notifier callouts for this mm have been -* completed and the sptes are really cleaned up before returning -* to exit_mmap(). +* synchronize_srcu here prevents mmu_notifier_release from returning to +* exit_mmap (which would proceed with freeing all pages in the mm) +* until the ->release method returns, if it was invoked by +* mmu_notifier_unregister. +* +* The mmu_notifier_mm can't go away from under us because one mm_count +* is held by exit_mmap. */ synchronize_srcu (&srcu); }
@@ -302,31 +299,34 @@ void mmu_notifier_unregister(struct mmu_ {BUG_ON (atomic_read (&mm->mm_count) <=0 ); -spin_lock (&mm->mmu_notifier_mm->lock);if (!hlist_unhashed (&mn->hlist)) { +/* +* SRCU here will force exit_mmap to wait for ->release to +* finish before freeing the pages. +*/ int id; + id =srcu_read_lock (&srcu);/* -* Ensure we synchronize up with __mmu_notifier_release(). +* exit_mmap will block in mmu_notifier_release to guarantee +* that ->release is called before freeing the pages. */ - id =srcu_read_lock (&srcu); - -hlist_del_rcu (&mn->hlist); -spin_unlock (&mm->mmu_notifier_mm->lock); -if (mn->ops->release) mn->ops->release (mn, mm); +srcu_read_unlock (&srcu, id); +spin_lock (&mm->mmu_notifier_mm->lock);/* -* Allow __mmu_notifier_release() to complete. +* Can not use list_del_rcu() since __mmu_notifier_release +* can delete it before we hold the lock. */ -srcu_read_unlock (&srcu, id); - }else +hlist_del_init_rcu (&mn->hlist);spin_unlock (&mm->mmu_notifier_mm->lock); + }/* -* Wait for any running method to finish, including ->release() if it -* was run by __mmu_notifier_release() instead of us. +* Wait for any running method to finish, of course including +* ->release if it was run by mmu_notifier_relase instead of us. */ synchronize_srcu (&srcu);
Greg Kroah-Hartman
maintainerPATCH 25/44 drivers/block/brd.c: fix brd_lookup_page() race
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Behlendorf <[email protected]>
commit dfd20b2b174d3a9b258ea3b7a35ead33576587b1 upstream.
The index on the page must be set before it is inserted in the radix tree. Otherwise there is a small race which can occur during lookup where the page can be found with the incorrect index. This will trigger the BUG_ON() in brd_lookup_page().
--- drivers/block/brd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/brd.c +2 -2
@@ -117,13 +117,13 @@ static struct page *brd_insert_page(struspin_lock (&brd->brd_lock); idx = sector >>PAGE_SECTORS_SHIFT ; + page->index = idx;if (radix_tree_insert (&brd->brd_pages, idx, page)) {__free_page (page); page =radix_tree_lookup (&brd->brd_pages, idx);BUG_ON (!page);BUG_ON (page->index != idx); - }else - page->index = idx; + }spin_unlock (&brd->brd_lock);radix_tree_preload_end ();
Greg Kroah-Hartman
maintainerPATCH 26/44 mm/pagewalk.c: walk_page_range should avoid VM_PFNMAP areas
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cliff Wickman <[email protected]>
commit a9ff785e4437c83d2179161e012f5bdfbd6381f0 upstream.
A panic can be caused by simply cat'ing /proc/<pid>/smaps while an application has a VM_PFNMAP range. It happened in-house when a benchmarker was trying to decipher the memory layout of his program.
/proc/<pid>/smaps and similar walks through a user page table should not be looking at VM_PFNMAP areas.
Certain tests in walk_page_range() (specifically split_huge_page_pmd()) assume that all the mapped PFN's are backed with page structures. And this is not usually true for VM_PFNMAP areas. This can result in panics on kernel page faults when attempting to address those page structures.
There are a half dozen callers of walk_page_range() that walk through a task's entire page table (as N. Horiguchi pointed out). So rather than change all of them, this patch changes just walk_page_range() to ignore VM_PFNMAP areas.
The logic of hugetlb_vma() is moved back into walk_page_range(), as we want to test any vma in the range.
VM_PFNMAP areas are used by:
- graphics memory manager gpu/drm/drm_gem.c - global reference unit sgi-gru/grufile.c - sgi special memory char/mspec.c
- and probably several out-of-tree modules
--- mm/pagewalk.c | 70 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 34 deletions(-)
mm/pagewalk.c +36 -34
@@ -127,28 +127,7 @@ static int walk_hugetlb_range(struct vm_ return 0; } -static struct vm_area_struct *hugetlb_vma (unsigned long addr,struct mm_walk *walk) -{ -struct vm_area_struct *vma; - -/* We don't need vma lookup at all. */ -if (!walk->hugetlb_entry) -return NULL ; - -VM_BUG_ON (!rwsem_is_locked (&walk->mm->mmap_sem)); - vma =find_vma (walk->mm, addr); -if (vma && vma->vm_start <= addr &&is_vm_hugetlb_page (vma)) -return vma; - -return NULL ; -} -#else /* CONFIG_HUGETLB_PAGE */ -static struct vm_area_struct *hugetlb_vma (unsigned long addr,struct mm_walk *walk) -{ -return NULL ; -} -static int walk_hugetlb_range (struct vm_area_struct *vma,unsigned long addr,unsigned long end,struct mm_walk *walk)
@@ -199,30 +178,53 @@ int walk_page_range(unsigned long addr,if (!walk->mm)return -EINVAL ; +VM_BUG_ON (!rwsem_is_locked (&walk->mm->mmap_sem)); + pgd =pgd_offset (walk->mm, addr); do { - struct vm_area_struct *vma; + struct vm_area_struct *vma = NULL; next = pgd_addr_end(addr, end); /* - * handle hugetlb vma individually because pagetable walk for - * the hugetlb page is dependent on the architecture and - * we can't handled it in the same manner as non-huge pages. + * This function was not intended to be vma based. + * But there are vma special cases to be handled: + * - hugetlb vma's + * - VM_PFNMAP vma's */ - vma = hugetlb_vma(addr, walk); + vma = find_vma(walk->mm, addr); if (vma) { - if (vma->vm_end < next) + /* + * There are no page structures backing a VM_PFNMAP + * range, so do not allow split_huge_page_pmd(). + */ + if ((vma->vm_start <= addr) && + (vma->vm_flags & VM_PFNMAP)) { next = vma->vm_end; + pgd = pgd_offset(walk->mm, next); + continue; + } /* - * Hugepage is very tightly coupled with vma, so - * walk through hugetlb entries within a given vma. + * Handle hugetlb vma individually because pagetable + * walk for the hugetlb page is dependent on the + * architecture and we can't handled it in the same + * manner as non-huge pages. */ - err = walk_hugetlb_range(vma, addr, next, walk); - if (err) - break; - pgd = pgd_offset(walk->mm, next); - continue; + if (walk->hugetlb_entry && (vma->vm_start <= addr) && + is_vm_hugetlb_page(vma)) { + if (vma->vm_end < next) + next = vma->vm_end; + /* + * Hugepage is very tightly coupled with vma, + * so walk through hugetlb entries within a + * given vma. + */ + err = walk_hugetlb_range(vma, addr, next, walk); + if (err) + break; + pgd = pgd_offset(walk->mm, next); + continue; + } } if (pgd_none_or_clear_bad(pgd)) {
Greg Kroah-Hartman
maintainerPATCH 27/44 mm/THP: use pmd_populate() to update the pmd with pgtable_t pointer
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Aneesh Kumar K.V" <[email protected]>
commit 7c3425123ddfdc5f48e7913ff59d908789712b18 upstream.
We should not use set_pmd_at to update pmd_t with pgtable_t pointer. set_pmd_at is used to set pmd with huge pte entries and architectures like ppc64, clear few flags from the pte when saving a new entry. Without this change we observe bad pte errors like below on ppc64 with THP enabled.
BUG: Bad page map in process ld mm=0xc000001ee39f4780 pte:7fc3f37848000001 pmd:c000001ec0000000
--- mm/huge_memory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
mm/huge_memory.c +6 -1
@@ -1949,7 +1949,12 @@ static void collapse_huge_page(struct mmpte_unmap (pte);spin_lock (&mm->page_table_lock);BUG_ON (!pmd_none (*pmd)); -set_pmd_at (mm, address, pmd, _pmd); +/* +* We can only use set_pmd_at when establishing +* hugepmds and never for establishing regular pmds that +* points to regular pagetables. Use pmd_populate for that +*/ +pmd_populate (mm, pmd,pmd_pgtable (_pmd));spin_unlock (&mm->page_table_lock);anon_vma_unlock (vma->anon_vma); goto out;
Greg Kroah-Hartman
maintainerPATCH 28/44 iscsi-target: fix heap buffer overflow on error
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit cea4dcfdad926a27a18e188720efe0f2c9403456 upstream.
If a key was larger than 64 bytes, as checked by iscsi_check_key(), the error response packet, generated by iscsi_add_notunderstood_response(), would still attempt to copy the entire key into the packet, overflowing the structure on the heap.
Remote preauthentication kernel memory corruption was possible if a target was configured and listening on the network.
CVE-2013-2850
--- drivers/target/iscsi/iscsi_target_parameters.c | 8 +++----- drivers/target/iscsi/iscsi_target_parameters.h | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/target/iscsi/iscsi_target_parameters.c +3 -5
@@ -713,9 +713,9 @@ static int iscsi_add_notunderstood_respo }INIT_LIST_HEAD (&extra_response->er_list); -strncpy (extra_response->key, key,strlen (key) +1 ); -strncpy (extra_response->value,NOTUNDERSTOOD , -strlen (NOTUNDERSTOOD ) +1 ); +strlcpy (extra_response->key, key,sizeof (extra_response->key)); +strlcpy (extra_response->value,NOTUNDERSTOOD , +sizeof (extra_response->value));list_add_tail (&extra_response->er_list, ¶m_list->extra_response_list);
@@ -1571,8 +1571,6 @@ int iscsi_decode_text_input(if (phase &PHASE_SECURITY ) {if (iscsi_check_for_auth_key (key) >0 ) { -char *tmpptr = key +strlen (key); - *tmpptr ='=' ;kfree (tmpbuf);return 1 ; }
drivers/target/iscsi/iscsi_target_parameters.h +3 -1
@@ -1,8 +1,10 @@#ifndef ISCSI_PARAMETERS_H #define ISCSI_PARAMETERS_H +#include <scsi/iscsi_proto.h> +struct iscsi_extra_response { -char key[64 ]; +char key[KEY_MAXLEN ];char value[32 ];struct list_head er_list; }____cacheline_aligned ;
Greg Kroah-Hartman
maintainerPATCH 29/44 NFSv4: Fix a thinko in nfs4_try_open_cached
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit f448badd34700ae728a32ba024249626d49c10e1 upstream.
We need to pass the full open mode flags to nfs_may_open() when doing a delegated open.
--- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4proc.c +1 -1
@@ -1053,7 +1053,7 @@ static struct nfs4_state *nfs4_try_open_struct nfs4_state *state = opendata->state;struct nfs_inode *nfsi =NFS_I (state->inode);struct nfs_delegation *delegation; -int open_mode = opendata->o_arg.open_flags & (O_EXCL |O_TRUNC ); +int open_mode = opendata->o_arg.open_flags;fmode_t fmode = opendata->o_arg.fmode;nfs4_stateid stateid;int ret = -EAGAIN ;
Greg Kroah-Hartman
maintainerPATCH 30/44 xfs: kill suid/sgid through the truncate path.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
commit 2962f5a5dcc56f69cbf62121a7be67cc15d6940b upstream.
XFS has failed to kill suid/sgid bits correctly when truncating files of non-zero size since commit c4ed4243 ("xfs: split xfs_setattr") introduced in the 3.1 kernel. Fix it.
Fix it.
--- fs/xfs/xfs_iops.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-)
fs/xfs/xfs_iops.c +32 -15
@@ -457,6 +457,28 @@ xfs_vn_getattr(return 0 ; } +static void +xfs_setattr_mode ( +struct xfs_trans *tp, +struct xfs_inode *ip, +struct iattr *iattr) +{ +struct inode *inode =VFS_I (ip); +umode_t mode = iattr->ia_mode; + +ASSERT (tp); +ASSERT (xfs_isilocked (ip,XFS_ILOCK_EXCL )); + +if (!in_group_p (inode->i_gid) && !capable (CAP_FSETID )) + mode &= ~S_ISGID ; + + ip->i_d.di_mode &=S_IFMT ; + ip->i_d.di_mode |= mode & ~S_IFMT ; + + inode->i_mode &=S_IFMT ; + inode->i_mode |= mode & ~S_IFMT ; +} + int xfs_setattr_nonsize( struct xfs_inode *ip,
@@ -608,18 +630,8 @@ xfs_setattr_nonsize(/* * Change file access modes. */ -if (mask &ATTR_MODE ) { -umode_t mode = iattr->ia_mode; - -if (!in_group_p (inode->i_gid) && !capable (CAP_FSETID )) - mode &= ~S_ISGID ; - - ip->i_d.di_mode &=S_IFMT ; - ip->i_d.di_mode |= mode & ~S_IFMT ; - - inode->i_mode &=S_IFMT ; - inode->i_mode |= mode & ~S_IFMT ; - } +if (mask &ATTR_MODE ) +xfs_setattr_mode (tp, ip, iattr);/* * Change file access or modified times.
@@ -716,9 +728,8 @@ xfs_setattr_size(return XFS_ERROR (error);ASSERT (S_ISREG (ip->i_d.di_mode)); -ASSERT ((mask & (ATTR_MODE |ATTR_UID |ATTR_GID |ATTR_ATIME |ATTR_ATIME_SET | -ATTR_MTIME_SET |ATTR_KILL_SUID |ATTR_KILL_SGID | -ATTR_KILL_PRIV |ATTR_TIMES_SET )) ==0 ); +ASSERT ((mask & (ATTR_UID |ATTR_GID |ATTR_ATIME |ATTR_ATIME_SET | +ATTR_MTIME_SET |ATTR_KILL_PRIV |ATTR_TIMES_SET )) ==0 ); lock_flags =XFS_ILOCK_EXCL ;if (!(flags &XFS_ATTR_NOLOCK ))
@@ -861,6 +872,12 @@ xfs_setattr_size(xfs_iflags_set (ip,XFS_ITRUNCATED ); } +/* +* Change file access modes. +*/ +if (mask &ATTR_MODE ) +xfs_setattr_mode (tp, ip, iattr); +if (mask &ATTR_CTIME ) { inode->i_ctime = iattr->ia_ctime; ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec;
Greg Kroah-Hartman
maintainerPATCH 31/44 drm/radeon: fix card_posted check for newer asics
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 09fb8bd1a63b0f9f15e655c4fe8d047e5d2bf67a upstream.
Newer asics have variable numbers of crtcs. Use that rather than the asic family to determine which crtcs to check. This avoids checking non-existent crtcs or missing crtcs on certain asics.
--- drivers/gpu/drm/radeon/radeon_device.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/radeon/radeon_device.c +9 -10
@@ -363,18 +363,17 @@ bool radeon_card_posted(struct radeon_dereturn false;/* first check CRTCs */ -if (ASIC_IS_DCE41 (rdev)) { +if (ASIC_IS_DCE4 (rdev)) { reg =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET ) |RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET ); -if (reg &EVERGREEN_CRTC_MASTER_EN ) -return true; - }else if (ASIC_IS_DCE4 (rdev)) { - reg =RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC0_REGISTER_OFFSET ) | -RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC1_REGISTER_OFFSET ) | -RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET ) | -RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET ) | -RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET ) | -RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET ); +if (rdev->num_crtc >=4 ) { + reg |=RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC2_REGISTER_OFFSET ) | +RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC3_REGISTER_OFFSET ); + } +if (rdev->num_crtc >=6 ) { + reg |=RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC4_REGISTER_OFFSET ) | +RREG32 (EVERGREEN_CRTC_CONTROL +EVERGREEN_CRTC5_REGISTER_OFFSET ); + }if (reg &EVERGREEN_CRTC_MASTER_EN )return true; }else if (ASIC_IS_AVIVO (rdev)) {
Greg Kroah-Hartman
maintainerPATCH 32/44 cifs: fix potential buffer overrun when composing a new options string
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit 166faf21bd14bc5c5295a44874bf7f3930c30b20 upstream.
Consider the case where we have a very short ip= string in the original mount options, and when we chase a referral we end up with a very long IPv6 address. Be sure to allow for that possibility when estimating the size of the string to allocate.
--- fs/cifs/cifs_dfs_ref.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/cifs_dfs_ref.c +3 -1
@@ -18,6 +18,7 @@#include <linux/slab.h> #include <linux/vfs.h> #include <linux/fs.h> +#include <linux/inet.h> #include "cifsglob.h" #include "cifsproto.h" #include "cifsfs.h"
@@ -150,7 +151,8 @@ char *cifs_compose_mount_options(const c* assuming that we have 'unc=' and 'ip=' in * the original sb_mountdata */ - md_len =strlen (sb_mountdata) + rc +strlen (ref->node_name) +12 ; + md_len =strlen (sb_mountdata) + rc +strlen (ref->node_name) +12 + +INET6_ADDRSTRLEN ; mountdata =kzalloc (md_len+1 ,GFP_KERNEL );if (mountdata ==NULL ) { rc = -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 33/44 USB: io_ti: Fix NULL dereference in chase_port()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfgang Frisch <[email protected]>
commit 1ee0a224bc9aad1de496c795f96bc6ba2c394811 upstream.
The tty is NULL when the port is hanging up. chase_port() needs to check for this.
This patch is intended for stable series.
The behavior was observed and tested in Linux 3.2 and 3.7.1.
Johan Hovold submitted a more elaborate patch for the mainline kernel.
[ 56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84 [ 56.278811] usb 1-1: USB disconnect, device number 3 [ 56.278856] usb 1-1: edge_bulk_in_callback - stopping read! [ 56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8 [ 56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0 [ 56.282085] Oops: 0002 [#1] SMP [ 56.282744] Modules linked in: [ 56.283512] CPU 1 [ 56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox [ 56.283512] RIP: 0010:[<ffffffff8144e62a>] [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP: 0018:ffff88001fa99ab0 EFLAGS: 00010046 [ 56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064 [ 56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8 [ 56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000 [ 56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0 [ 56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4 [ 56.283512] FS: 0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000 [ 56.283512] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0 [ 56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80) [ 56.283512] Stack: [ 56.283512] 0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c [ 56.283512] ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001 [ 56.283512] ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296 [ 56.283512] Call Trace: [ 56.283512] [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6 [ 56.283512] [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199 [ 56.283512] [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298 [ 56.283512] [<ffffffff81300171>] ? edge_close+0x64/0x129 [ 56.283512] [<ffffffff810612f7>] ? __wake_up+0x35/0x46 [ 56.283512] [<ffffffff8106135b>] ? should_resched+0x5/0x23 [ 56.283512] [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44 [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351 [ 56.283512] [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed [ 56.283512] [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35 [ 56.283512] [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2 [ 56.283512] [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131 [ 56.283512] [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5 [ 56.283512] [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25 [ 56.283512] [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7 [ 56.283512] [<ffffffff8128b7a3>] ? device_del+0x119/0x167 [ 56.283512] [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180 [ 56.283512] [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6 [ 56.283512] [<ffffffff812e4435>] ? hub_thread+0x577/0xe82 [ 56.283512] [<ffffffff8144daa7>] ? __schedule+0x490/0x4be [ 56.283512] [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79 [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff810570b4>] ? kthread+0x81/0x89 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00 <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66 [ 56.283512] RIP [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP <ffff88001fa99ab0> [ 56.283512] CR2: 00000000000001c8 [ 56.283512] ---[ end trace 49714df27e1679ce ]---
--- drivers/usb/serial/io_ti.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/serial/io_ti.c +3 -0
@@ -550,6 +550,9 @@ static void chase_port(struct edgeport_pwait_queue_t wait;unsigned long flags; +if (!tty) +return ; +if (!timeout) timeout = (HZ *EDGE_CLOSING_WAIT )/100 ;
Greg Kroah-Hartman
maintainerPATCH 34/44 ata_piix: add PCI IDs for Intel BayTail
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Chew, Chiau Ee" <[email protected]>
commit fca8c90d519dedd4f4b19901d005c243f7f0bf2e upstream.
Adds IDE-mode SATA Device IDs for the Intel BayTrail platform.
--- drivers/ata/ata_piix.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/ata/ata_piix.c +15 -0
@@ -151,6 +151,7 @@ enum piix_controller_ids { piix_pata_vmw,/* PIIX4 for VMware, spurious DMA_ERR */ ich8_sata_snb, ich8_2port_sata_snb, + ich8_2port_sata_byt, }; struct piix_map_db {
@@ -348,6 +349,9 @@ static const struct pci_device_id piix_p { 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },/* SATA Controller IDE (Wellsburg) */ { 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (BayTrail) */ + { 0x8086, 0x0F20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, + { 0x8086, 0x0F21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, { } /* terminate list */ };
@@ -513,6 +517,7 @@ static const struct piix_map_db *piix_ma [tolapai_sata] = &tolapai_map_db, [ich8_sata_snb] = &ich8_map_db, [ich8_2port_sata_snb] = &ich8_2port_map_db, + [ich8_2port_sata_byt] = &ich8_2port_map_db, };static struct ata_port_info piix_port_info[] = {
@@ -663,6 +668,16 @@ static struct ata_port_info piix_port_in .udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, + + [ich8_2port_sata_byt] = + { + .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, + .pio_mask = ATA_PIO4, + .mwdma_mask = ATA_MWDMA2, + .udma_mask = ATA_UDMA6, + .port_ops = &piix_sata_ops, + }, + };static struct pci_bits piix_enable_bits[] = {
Greg Kroah-Hartman
maintainerPATCH 35/44 libata: make ata_exec_internal_sg honor DMADIR
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Pelletier <[email protected]>
commit e771451c0a831d96a7c14b0ca8a8ec671d98567b upstream.
libata honors DMADIR for regular commands, but not for internal commands used (among other) during device initialisation.
This makes SATA-host-to-PATA-device bridges based on Silicon Image SiL3611 (such as "Abit Serillel 2") end up disabled when used with an ATAPI device after a few tries.
Log output of the bridge being hot-plugged with an ATAPI drive:
[ 9631.212901] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen
[ 9631.212913] ata1: irq_stat 0x00000040, connection status changed
[ 9631.212923] ata1: SError: { CommWake 10B8B DevExch }
[ 9631.212939] ata1: hard resetting link
[ 9632.104962] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 9632.106393] ata1.00: ATAPI: PIONEER DVD-RW DVR-115, 1.06, max UDMA/33
[ 9632.106407] ata1.00: applying bridge limits
[ 9632.108151] ata1.00: configured for UDMA/33
[ 9637.105303] ata1.00: qc timeout (cmd 0xa0)
[ 9637.105324] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
[ 9637.105335] ata1: hard resetting link
[ 9638.044599] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 9638.047878] ata1.00: configured for UDMA/33
[ 9643.044933] ata1.00: qc timeout (cmd 0xa0)
[ 9643.044953] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
[ 9643.044963] ata1: limiting SATA link speed to 1.5 Gbps
[ 9643.044971] ata1.00: limiting speed to UDMA/33:PIO3
[ 9643.044979] ata1: hard resetting link
[ 9643.984225] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 9643.987471] ata1.00: configured for UDMA/33
[ 9648.984591] ata1.00: qc timeout (cmd 0xa0)
[ 9648.984612] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
[ 9648.984619] ata1.00: disabled
[ 9649.000593] ata1: hard resetting link
[ 9649.939902] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 9649.955864] ata1: EH completeWith this patch, the drive enumerates correctly when libata is loaded with atapi_dmadir=1:
[ 9891.810863] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen
[ 9891.810874] ata1: irq_stat 0x00000040, connection status changed
[ 9891.810884] ata1: SError: { CommWake 10B8B DevExch }
[ 9891.810900] ata1: hard resetting link
[ 9892.762105] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 9892.763544] ata1.00: ATAPI: PIONEER DVD-RW DVR-115, 1.06, max UDMA/33, DMADIR
[ 9892.763558] ata1.00: applying bridge limits
[ 9892.765393] ata1.00: configured for UDMA/33
[ 9892.786063] ata1: EH complete
[ 9892.792062] scsi 0:0:0:0: CD-ROM PIONEER DVD-RW DVR-115 1.06 PQ: 0 ANSI: 5
[ 9892.798455] sr2: scsi3-mmc drive: 12x/12x writer dvd-ram cd/rw xa/form2 cdda tray
[ 9892.798837] sr 0:0:0:0: Attached scsi CD-ROM sr2
[ 9892.799109] sr 0:0:0:0: Attached scsi generic sg6 type 5Based on a patch by Csaba Halász <[email protected]> on linux-ide:
http://marc.info/?l=linux-ide&m=136121147832295&w=2
tj: minor formatting changes.
--- drivers/ata/libata-core.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/ata/libata-core.c +6 -0
@@ -1599,6 +1599,12 @@ unsigned ata_exec_internal_sg(struct ata qc->tf = *tf;if (cdb)memcpy (qc->cdb, cdb,ATAPI_CDB_LEN ); + +/* some SATA bridges need us to indicate data xfer direction */ +if (tf->protocol ==ATAPI_PROT_DMA && (dev->flags &ATA_DFLAG_DMADIR ) && + dma_dir ==DMA_FROM_DEVICE ) + qc->tf.feature |=ATAPI_DMADIR ; + qc->flags |=ATA_QCFLAG_RESULT_TF ; qc->dma_dir = dma_dir;if (dma_dir !=DMA_NONE ) {
Greg Kroah-Hartman
maintainerPATCH 36/44 m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
commit df66834a43c461de2565c45d815288ba1c0def37 upstream.
The present code does not wait for the SCC to finish resetting itself before trying to initialise the device. The result is that the SCC interrupt sources become enabled (if they weren't already). This leads to an early boot crash (unexpected interrupt) given CONFIG_EARLY_PRINTK. Fix this by adding a delay. A successful reset disables the interrupt sources.
Also, after the reset for channel A setup, the SCC then gets a second reset for channel B setup which leaves channel A uninitialised again. Fix this by performing the reset only once.
--- arch/m68k/kernel/head.S | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
arch/m68k/kernel/head.S +19 -10
@@ -2752,11 +2752,9 @@ func_return get_new_page #ifdef CONFIG_MAC L(scc_initable_mac): - .byte 9,12 /* Reset */ .byte 4,0x44 /* x16, 1 stopbit, no parity */ .byte 3,0xc0 /* receiver: 8 bpc */ .byte 5,0xe2 /* transmitter: 8 bpc, assert dtr/rts */ - .byte 9,0 /* no interrupts */ .byte 10,0 /* NRZ */ .byte 11,0x50 /* use baud rate generator */ .byte 12,1,13,0 /* 38400 baud */
@@ -2899,6 +2897,7 @@ func_start serial_init,%d0/%d1/%a0/%a1 is_not_mac(L(serial_init_not_mac)) #ifdef SERIAL_DEBUG + /* You may define either or both of these. */ #define MAC_USE_SCC_A /* Modem port */ #define MAC_USE_SCC_B /* Printer port */
@@ -2908,9 +2907,21 @@ func_start serial_init,%d0/%d1/%a0/%a1 #define mac_scc_cha_b_data_offset 0x4 #define mac_scc_cha_a_data_offset 0x6 +#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) + movel %pc@(L(mac_sccbase)),%a0 + /* Reset SCC device */ + moveb #9,%a0@(mac_scc_cha_a_ctrl_offset) + moveb #0xc0,%a0@(mac_scc_cha_a_ctrl_offset) + /* Wait for 5 PCLK cycles, which is about 68 CPU cycles */ + /* 5 / 3.6864 MHz = approx. 1.36 us = 68 / 50 MHz */ + movel #35,%d0 +5: + subq #1,%d0 + jne 5b +#endif + #ifdef MAC_USE_SCC_A /* Initialize channel A */ - movel %pc@(L(mac_sccbase)),%a0 lea %pc@(L(scc_initable_mac)),%a1 5: moveb %a1@+,%d0 jmi 6f
@@ -2922,9 +2933,6 @@ func_start serial_init,%d0/%d1/%a0/%a1 #ifdef MAC_USE_SCC_B /* Initialize channel B */ -#ifndef MAC_USE_SCC_A /* Load mac_sccbase only if needed */ - movel %pc@(L(mac_sccbase)),%a0 -#endif /* MAC_USE_SCC_A */ lea %pc@(L(scc_initable_mac)),%a1 7: moveb %a1@+,%d0 jmi 8f
@@ -2933,6 +2941,7 @@ func_start serial_init,%d0/%d1/%a0/%a1 jra 7b 8: #endif /* MAC_USE_SCC_B */ + #endif /* SERIAL_DEBUG */ jra L(serial_init_done)
@@ -3006,17 +3015,17 @@ func_start serial_putc,%d0/%d1/%a0/%a1 #ifdef SERIAL_DEBUG -#ifdef MAC_USE_SCC_A +#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) movel %pc@(L(mac_sccbase)),%a1 +#endif + +#ifdef MAC_USE_SCC_A 3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset) jeq 3b moveb %d0,%a1@(mac_scc_cha_a_data_offset) #endif /* MAC_USE_SCC_A */ #ifdef MAC_USE_SCC_B -#ifndef MAC_USE_SCC_A /* Load mac_sccbase only if needed */ - movel %pc@(L(mac_sccbase)),%a1 -#endif /* MAC_USE_SCC_A */ 4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset) jeq 4b moveb %d0,%a1@(mac_scc_cha_b_data_offset)
Greg Kroah-Hartman
maintainerPATCH 37/44 xen/events: Handle VIRQ_TIMER before any other hardirq in event loop.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keir Fraser <[email protected]>
commit bee980d9e9642e96351fa3ca9077b853ecf62f57 upstream.
This avoids any other hardirq handler seeing a very stale jiffies value immediately after wakeup from a long idle period. The one observable symptom of this was a USB keyboard, with software keyboard repeat, which would always repeat a key immediately that it was pressed. This is due to the key press waking the guest, the key handler immediately runs, sees an old jiffies value, and then that jiffies value significantly updated, before the key is unpressed.
--- drivers/xen/events.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/xen/events.c +15 -4
@@ -1258,7 +1258,7 @@ static void __xen_evtchn_do_upcall(void) {int start_word_idx, start_bit_idx;int word_idx, bit_idx; -int i; +int i, irq;int cpu =get_cpu ();struct shared_info *s = HYPERVISOR_shared_info;struct vcpu_info *vcpu_info =__this_cpu_read (xen_vcpu);
@@ -1266,6 +1266,8 @@ static void __xen_evtchn_do_upcall(void) do { unsigned long pending_words; + unsigned long pending_bits; + struct irq_desc *desc; vcpu_info->evtchn_upcall_pending = 0;
@@ -1276,6 +1278,17 @@ static void __xen_evtchn_do_upcall(void)/* Clear master flag /before/ clearing selector flag. */ wmb ();#endif +if ((irq =per_cpu (virq_to_irq, cpu)[VIRQ_TIMER ]) !=-1 ) { +int evtchn =evtchn_from_irq (irq); + word_idx = evtchn /BITS_PER_LONG ; + pending_bits = evtchn %BITS_PER_LONG ; +if (active_evtchns (cpu, s, word_idx) & (1ULL << pending_bits)) { + desc =irq_to_desc (irq); +if (desc) +generic_handle_irq_desc (irq, desc); + } + } + pending_words =xchg (&vcpu_info->evtchn_pending_sel,0 ); start_word_idx =__this_cpu_read (current_word_idx);
@@ -1284,7 +1297,6 @@ static void __xen_evtchn_do_upcall(void) word_idx = start_word_idx;for (i =0 ; pending_words !=0 ; i++) { -unsigned long pending_bits;unsigned long words; words =MASK_LSBS (pending_words, word_idx);
@@ -1313,8 +1325,7 @@ static void __xen_evtchn_do_upcall(void) do { unsigned long bits; - int port, irq; - struct irq_desc *desc; + int port; bits = MASK_LSBS(pending_bits, bit_idx);
Greg Kroah-Hartman
maintainerPATCH 38/44 jfs: fix a couple races
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Kleikamp <[email protected]>
commit 73aaa22d5ffb2630456bac2f9a4ed9b81d0d7271 upstream.
This patch fixes races uncovered by xfstests testcase 068.
One race is the result of jfs_sync() trying to write a sync point to the journal after it has been frozen (or possibly in the process). Since freezing sync's the journal, there is no need to write a sync point so we simply want to return.
The second involves jfs_write_inode() being called on a deleted inode. It calls jfs_flush_journal which is held up by the jfs_commit thread doing the final iput on the same deleted inode, which itself is waiting for the I_SYNC flag to be cleared. jfs_write_inode need not do anything when i_nlink is zero, which is the easy fix.
--- fs/jfs/inode.c | 2 +- fs/jfs/jfs_logmgr.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
fs/jfs/inode.c +1 -1
@@ -125,7 +125,7 @@ int jfs_write_inode(struct inode *inode, {int wait = wbc->sync_mode ==WB_SYNC_ALL ; -if (test_cflag (COMMIT_Nolink, inode)) +if (inode->i_nlink ==0 )return 0 ;/* * If COMMIT_DIRTY is not set, the inode isn't really dirty.
fs/jfs/jfs_logmgr.c +2 -1
@@ -1058,7 +1058,8 @@ static int lmLogSync(struct jfs_log * lo*/ void jfs_syncpt (struct jfs_log *log,int hard_sync) {LOG_LOCK (log); -lmLogSync (log, hard_sync); +if (!test_bit (log_QUIESCE, &log->flag)) +lmLogSync (log, hard_sync);LOG_UNLOCK (log); }
Greg Kroah-Hartman
maintainerPATCH 39/44 xen-netback: remove skb in xen_netbk_alloc_page
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Liu <[email protected]>
commit 27f852282ab9a028f57da96d05c26f38c424a315 upstream.
This variable is never used.
--- drivers/net/xen-netback/netback.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/xen-netback/netback.c +2 -3
@@ -914,7 +914,6 @@ static int netbk_count_requests(struct x }static struct page *xen_netbk_alloc_page (struct xen_netbk *netbk, -struct sk_buff *skb,u16 pending_idx) {struct page *page;
@@ -948,7 +947,7 @@ static struct gnttab_copy *xen_netbk_get index =pending_index (netbk->pending_cons++); pending_idx = netbk->pending_ring[index]; - page =xen_netbk_alloc_page (netbk, skb, pending_idx); + page =xen_netbk_alloc_page (netbk, pending_idx);if (!page) goto err;
@@ -1353,7 +1352,7 @@ static unsigned xen_netbk_tx_build_gops( }/* XXX could copy straight to head */ - page =xen_netbk_alloc_page (netbk, skb, pending_idx); + page =xen_netbk_alloc_page (netbk, pending_idx);if (!page) {kfree_skb (skb);netbk_tx_err (vif, &txreq, idx);
Greg Kroah-Hartman
maintainerPATCH 40/44 iommu/amd: Re-enable IOMMU event log interrupt after handling.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suravee Suthikulpanit <[email protected]>
commit 925fe08bce38d1ff052fe2209b9e2b8d5fbb7f98 upstream.
Current driver does not clear the IOMMU event log interrupt bit in the IOMMU status register after processing an interrupt. This causes the IOMMU hardware to generate event log interrupt only once. This has been observed in both IOMMU v1 and V2 hardware.
This patch clears the bit by writing 1 to bit 1 of the IOMMU status register (MMIO Offset 2020h)
--- drivers/iommu/amd_iommu.c | 3 +++ drivers/iommu/amd_iommu_types.h | 1 + 2 files changed, 4 insertions(+)
drivers/iommu/amd_iommu.c +3 -0
@@ -534,6 +534,9 @@ static void iommu_poll_events(struct amdu32 head, tail;unsigned long flags; +/* enable event interrupts again */ +writel (MMIO_STATUS_EVT_INT_MASK , iommu->mmio_base +MMIO_STATUS_OFFSET ); +spin_lock_irqsave (&iommu->lock, flags); head =readl (iommu->mmio_base +MMIO_EVT_HEAD_OFFSET );
drivers/iommu/amd_iommu_types.h +1 -0
@@ -99,6 +99,7 @@#define PASID_MASK 0x000fffff/* MMIO status bits */ +#define MMIO_STATUS_EVT_INT_MASK (1 << 1)#define MMIO_STATUS_COM_WAIT_INT_MASK (1 << 2)#define MMIO_STATUS_PPR_INT_MASK (1 << 6)
Greg Kroah-Hartman
maintainerPATCH 41/44 iommu/amd: Workaround for ERBT1312
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joerg Roedel <[email protected]>
commit d3263bc29706e42f74d8800807c2dedf320d77f1 upstream.
Work around an IOMMU hardware bug where clearing the EVT_INT or PPR_INT bit in the status register may race with the hardware trying to set it again. When not handled the bit might not be cleared and we lose all future event or ppr interrupts.
--- drivers/iommu/amd_iommu.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-)
drivers/iommu/amd_iommu.c +26 -8
@@ -531,14 +531,23 @@ retry:static void iommu_poll_events (struct amd_iommu *iommu) { -u32 head, tail; +u32 head, tail, status;unsigned long flags; -/* enable event interrupts again */ -writel (MMIO_STATUS_EVT_INT_MASK , iommu->mmio_base +MMIO_STATUS_OFFSET ); -spin_lock_irqsave (&iommu->lock, flags); +/* enable event interrupts again */ +do { +/* +* Workaround for Erratum ERBT1312 +* Clearing the EVT_INT bit may race in the hardware, so read +* it again and make sure it was really cleared +*/ + status =readl (iommu->mmio_base +MMIO_STATUS_OFFSET ); +writel (MMIO_STATUS_EVT_INT_MASK , + iommu->mmio_base +MMIO_STATUS_OFFSET ); + }while (status &MMIO_STATUS_EVT_INT_MASK ); + head =readl (iommu->mmio_base +MMIO_EVT_HEAD_OFFSET ); tail =readl (iommu->mmio_base +MMIO_EVT_TAIL_OFFSET );
@@ -575,16 +584,25 @@ static void iommu_handle_ppr_entry(strucstatic void iommu_poll_ppr_log (struct amd_iommu *iommu) {unsigned long flags; -u32 head, tail; +u32 head, tail, status;if (iommu->ppr_log ==NULL )return ; -/* enable ppr interrupts again */ -writel (MMIO_STATUS_PPR_INT_MASK , iommu->mmio_base +MMIO_STATUS_OFFSET ); -spin_lock_irqsave (&iommu->lock, flags); +/* enable ppr interrupts again */ +do { +/* +* Workaround for Erratum ERBT1312 +* Clearing the PPR_INT bit may race in the hardware, so read +* it again and make sure it was really cleared +*/ + status =readl (iommu->mmio_base +MMIO_STATUS_OFFSET ); +writel (MMIO_STATUS_PPR_INT_MASK , + iommu->mmio_base +MMIO_STATUS_OFFSET ); + }while (status &MMIO_STATUS_PPR_INT_MASK ); + head =readl (iommu->mmio_base +MMIO_PPR_HEAD_OFFSET ); tail =readl (iommu->mmio_base +MMIO_PPR_TAIL_OFFSET );
Greg Kroah-Hartman
maintainerPATCH 42/44 x86, um: Correct syscall table type attributes breaking gcc 4.8
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Pelikan <[email protected]>
commit 9271b0b4b2044c6db06051fe60bc58cdd4f17c7c upstream.
The latest GCC 4.8 does some more checking on type attributes that break the build for ARCH=um -> fill them in. Specifically, the "asmlinkage" attributes is now tested for consistency.
--- arch/x86/um/sys_call_table_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/sys_call_table_32.c +2 -2
@@ -39,9 +39,9 @@#undef __SYSCALL_I386#define __SYSCALL_I386 (nr, sym, compat) [ nr ] = sym, -typedef void (*sys_call_ptr_t )(void ); +typedef asmlinkage void (*sys_call_ptr_t)(void); -extern void sys_ni_syscall (void ); +extern asmlinkage void sys_ni_syscall(void); const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {/*
Greg Kroah-Hartman
maintainerPATCH 43/44 mac80211: close AP_VLAN interfaces before unregistering all
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit c8aa22db0112f640ac6631347f850879c621840b upstream.
Since Eric's commit efe117ab8 ("Speedup ieee80211_remove_interfaces") there's a bug in mac80211 when it unregisters with AP_VLAN interfaces up. If the AP_VLAN interface was registered after the AP it belongs to (which is the typical case) and then we get into this code path, unregister_netdevice_many() will crash because it isn't prepared to deal with interfaces being closed in the middle of it. Exactly this happens though, because we iterate the list, find the AP master this AP_VLAN belongs to and dev_close() the dependent VLANs. After this, unregister_netdevice_many() won't pick up the fact that the AP_VLAN is already down and will do it again, causing a crash.
--- net/mac80211/iface.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/mac80211/iface.c +9 -0
@@ -1257,6 +1257,15 @@ void ieee80211_remove_interfaces(structASSERT_RTNL (); +/* +* Close all AP_VLAN interfaces first, as otherwise they +* might be closed while the AP interface they belong to +* is closed, causing unregister_netdevice_many() to crash. +*/ +list_for_each_entry (sdata, &local->interfaces, list) +if (sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) +dev_close (sdata->dev); +mutex_lock (&local->iflist_mtx);list_for_each_entry_safe (sdata, tmp, &local->interfaces, list) {list_del (&sdata->list);
Greg Kroah-Hartman
maintainerPATCH 44/44 thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manoj Iyer <[email protected]>
commit a4f46bb9fa84642e356898ee44b670989622f8bb upstream.
In the latest V-series bios DMI_PRODUCT_VERSION does not contain the string Lenovo or Thinkpad, but is set to the model number, this causes the thinkpad_acpi module to fail to load. Recognize laptop as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo.
Test on V490u
=============
== After the patch ==
[ 1350.295757] thinkpad_acpi: ThinkPad ACPI Extras v0.24 [ 1350.295760] thinkpad_acpi: http://ibm-acpi.sf.net/ [ 1350.295761] thinkpad_acpi: ThinkPad BIOS H7ET21WW (1.00 ), EC unknown [ 1350.295763] thinkpad_acpi: Lenovo LENOVO, model LV5DXXX [ 1350.296086] thinkpad_acpi: detected a 8-level brightness capable ThinkPad [ 1350.296694] thinkpad_acpi: radio switch found; radios are enabled [ 1350.296703] thinkpad_acpi: possible tablet mode switch found; ThinkPad in laptop mode [ 1350.306466] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [ 1350.307082] Registered led device: tpacpi::thinklight [ 1350.307215] Registered led device: tpacpi::power [ 1350.307255] Registered led device: tpacpi::standby [ 1350.307294] Registered led device: tpacpi::thinkvantage [ 1350.308160] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one [ 1350.308333] thinkpad_acpi: Console audio control enabled, mode: monitor (read only) [ 1350.312287] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input14
== Before the patch ==
sudo modprobe thinkpad_acpi
FATAL: Error inserting thinkpad_acpi (/lib/modules/3.2.0-27-generic/kernel/drivers/platform/x86/thinkpad_acpi.ko): No such device
Test on B485
=============
This patch was also test in a B485 where the thinkpad_acpi module does not have any issues loading. But, I tested it to make sure this patch does not break on already functioning models of Lenovo products.
[13486.746359] thinkpad_acpi: ThinkPad ACPI Extras v0.24 [13486.746364] thinkpad_acpi: http://ibm-acpi.sf.net/ [13486.746368] thinkpad_acpi: ThinkPad BIOS HJET15WW(1.01), EC unknown [13486.746373] thinkpad_acpi: Lenovo Lenovo LB485, model 814TR01 [13486.747300] thinkpad_acpi: detected a 8-level brightness capable ThinkPad [13486.752435] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [13486.752883] Registered led device: tpacpi::thinklight [13486.752915] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one [13486.753216] thinkpad_acpi: Console audio control enabled, mode: monitor (read only) [13486.757147] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input15
--- drivers/platform/x86/thinkpad_acpi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +7 -0
@@ -8662,6 +8662,13 @@ static int __must_check __init get_think tp->model_str =kstrdup (s,GFP_KERNEL );if (!tp->model_str)return -ENOMEM ; + }else { + s =dmi_get_system_info (DMI_BIOS_VENDOR ); +if (s && !(strnicmp (s,"Lenovo" ,6 ))) { + tp->model_str =kstrdup (s,GFP_KERNEL ); +if (!tp->model_str) +return -ENOMEM ; + } } s =dmi_get_system_info (DMI_PRODUCT_NAME );