2.6.27-stable review
Subsystems (16)
cover 2.6.27-stable review
This is the start of the stable review cycle for the 2.6.27.15 release. There are 41 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 us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
These patches are sent out with a number of different people on the Cc:
line. If you wish to be a reviewer, please email [email protected] to add your name to the list. If you want to be off the reviewer list, also email us.
Responses should be made by Friday, February 6, 19:00:00 UTC. 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/v2.6/stable-review/patch-2.6.27.15-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/ia64/sn/kernel/io_acpi_init.c | 8 ++-- arch/m68knommu/Kconfig | 4 ++ arch/x86/Kconfig | 3 + arch/x86/kernel/acpi/cstate.c | 4 +- arch/x86/lib/usercopy_32.c | 4 +- arch/x86/lib/usercopy_64.c | 4 +- arch/x86/mm/pageattr.c | 49 ++++++++++++------ arch/x86/pci/irq.c | 1 + drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_memhotplug.c | 5 +- drivers/acpi/asus_acpi.c | 4 +- drivers/acpi/battery.c | 5 +- drivers/acpi/bay.c | 2 +- drivers/acpi/bus.c | 4 +- drivers/acpi/button.c | 4 +- drivers/acpi/container.c | 2 +- drivers/acpi/dispatcher/dsmethod.c | 3 + drivers/acpi/dock.c | 6 +- drivers/acpi/ec.c | 8 ++- drivers/acpi/namespace/nsutils.c | 8 +++- drivers/acpi/namespace/nsxfname.c | 1 + drivers/acpi/numa.c | 2 +- drivers/acpi/osl.c | 5 +- drivers/acpi/parser/psparse.c | 4 +- drivers/acpi/pci_link.c | 4 -- drivers/acpi/pci_root.c | 2 +- drivers/acpi/pci_slot.c | 10 ++-- drivers/acpi/power.c | 2 +- drivers/acpi/processor_core.c | 4 +- drivers/acpi/processor_idle.c | 1 + drivers/acpi/processor_perflib.c | 2 +- drivers/acpi/processor_throttling.c | 2 +- drivers/acpi/sbshc.c | 2 +- drivers/acpi/scan.c | 12 ++++- drivers/acpi/sleep/main.c | 10 +++- drivers/acpi/thermal.c | 43 ++++++++++------ drivers/acpi/utils.c | 4 +- drivers/acpi/video.c | 47 +++++++++-------- drivers/ata/libata-acpi.c | 2 +- drivers/ata/sata_mv.c | 6 +- drivers/ata/sata_nv.c | 77 ++++++++++++++++++---------- drivers/char/selection.c | 2 +- drivers/cpuidle/cpuidle.c | 9 +++- drivers/cpuidle/governors/menu.c | 10 +++- drivers/input/keyboard/atkbd.c | 34 ++++++++++++ drivers/misc/asus-laptop.c | 15 +++--- drivers/misc/eeepc-laptop.c | 2 +- drivers/misc/fujitsu-laptop.c | 8 ++-- drivers/misc/intel_menlow.c | 29 ++++++----- drivers/net/ixgb/ixgb_main.c | 8 ++- drivers/pci/hotplug/acpiphp_glue.c | 14 +++--- drivers/pci/hotplug/acpiphp_ibm.c | 4 +- drivers/pci/hotplug/sgi_hotplug.c | 4 +- drivers/serial/jsm/jsm_tty.c | 6 ++ drivers/usb/host/isp1760-if.c | 96 ++++++++++++++++++++--------------- drivers/video/aty/mach64_ct.c | 11 ++++ fs/cifs/connect.c | 18 +++--- fs/dlm/plock.c | 2 + fs/nfsd/nfs4state.c | 31 +++++++---- include/acpi/acpi_bus.h | 2 +- include/acpi/actypes.h | 2 +- include/linux/if_vlan.h | 7 +++ include/linux/pci_ids.h | 1 + net/8021q/vlan_core.c | 46 ++++++++++++----- net/core/dev.c | 3 + 66 files changed, 480 insertions(+), 258 deletions(-)
PATCH 1/41 cifs: make sure we allocate enough storage for socket address
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit a9ac49d303f967be0dabd97cb722c4a13109c6c2 upstream.
cifs_mount declares a struct sockaddr on the stack and then casts it to the proper address type. The storage allocated is fine for ipv4, but is too small for ipv6 addresses. Declare it as "struct sockaddr_storage" instead of struct sockaddr".
This bug was manifesting itself as oopses and address corruption when mounting IPv6 addresses.
--- fs/cifs/connect.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/cifs/connect.c +9 -9
@@ -1349,7 +1349,7 @@ cifs_parse_mount_options(char *options, }static struct TCP_Server_Info * -cifs_find_tcp_session (struct sockaddr *addr) +cifs_find_tcp_session (struct sockaddr_storage *addr) {struct list_head *tmp;struct TCP_Server_Info *server;
@@ -1369,11 +1369,11 @@ cifs_find_tcp_session(struct sockaddr *aif (server->tcpStatus == CifsNew)continue ; -if (addr->sa_family ==AF_INET && +if (addr->ss_family ==AF_INET && (addr4->sin_addr.s_addr != server->addr.sockAddr.sin_addr.s_addr))continue ; -else if (addr->sa_family ==AF_INET6 && +else if (addr->ss_family ==AF_INET6 &&memcmp (&server->addr.sockAddr6.sin6_addr, &addr6->sin6_addr,sizeof (addr6->sin6_addr)))continue ;
@@ -2027,7 +2027,7 @@ cifs_mount(struct super_block *sb, strucint rc =0 ;int xid;struct socket *csocket =NULL ; -struct sockaddr addr; +struct sockaddr_storage addr;struct sockaddr_in *sin_server = (struct sockaddr_in *) &addr;struct sockaddr_in6 *sin_server6 = (struct sockaddr_in6 *) &addr;struct smb_vol volume_info;
@@ -2039,7 +2039,7 @@ cifs_mount(struct super_block *sb, struc/* cFYI(1, ("Entering cifs_mount. Xid: %d with: %s", xid, mount_data)); */ -memset (&addr,0 ,sizeof (struct sockaddr )); +memset (&addr,0 ,sizeof (struct sockaddr_storage ));memset (&volume_info,0 ,sizeof (struct smb_vol ));if (cifs_parse_mount_options (mount_data, devname, &volume_info)) { rc = -EINVAL ;
@@ -2069,9 +2069,9 @@ cifs_mount(struct super_block *sb, struc rc =cifs_inet_pton (AF_INET6 , volume_info.UNCip, &sin_server6->sin6_addr.in6_u);if (rc >0 ) - addr.sa_family =AF_INET6 ; + addr.ss_family =AF_INET6 ; }else { - addr.sa_family =AF_INET ; + addr.ss_family =AF_INET ; }if (rc <=0 ) {
@@ -2113,7 +2113,7 @@ cifs_mount(struct super_block *sb, struc srvTcp =cifs_find_tcp_session (&addr);if (!srvTcp) {/* create socket */ -if (addr.sa_family ==AF_INET6 ) { +if (addr.ss_family ==AF_INET6 ) {cFYI (1 , ("attempting ipv6 connect" ));/* BB should we allow ipv6 on port 139? */ /* other OS never observed in Wild doing 139 with v6 */
@@ -2144,7 +2144,7 @@ cifs_mount(struct super_block *sb, struc }else { srvTcp->noblocksnd = volume_info.noblocksnd; srvTcp->noautotune = volume_info.noautotune; -if (addr.sa_family ==AF_INET6 ) +if (addr.ss_family ==AF_INET6 )memcpy (&srvTcp->addr.sockAddr6, sin_server6,sizeof (struct sockaddr_in6 ));else
PATCH 2/41 ixgb: fix bug when freeing resources
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Brandeburg, Jesse <[email protected]>
commit 23e55a32ca1ffdbe7a492ef99f0e0ac48e504a13 upstream.
It was pointed out by Breno Leitao <[email protected]> that ixgb would crash on PPC when an IOMMU was in use, if change_mtu was called.
It appears to be a pretty simple issue in the driver that wasn't discovered because most systems don't run with an IOMMU. The driver needs to only unmap buffers that are mapped (duh).
--- drivers/net/ixgb/ixgb_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ixgb/ixgb_main.c +5 -3
@@ -977,15 +977,17 @@ ixgb_clean_rx_ring(struct ixgb_adapter *for (i =0 ; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; -if (buffer_info->skb) { - +if (buffer_info->dma) {pci_unmap_single (pdev, buffer_info->dma, buffer_info->length,PCI_DMA_FROMDEVICE ); + buffer_info->dma =0 ; + buffer_info->length =0 ; + } +if (buffer_info->skb) {dev_kfree_skb (buffer_info->skb); - buffer_info->skb =NULL ; } }
PATCH 3/41 m68knommu: set NO_DMA
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Adrian Bunk <[email protected]>
commit e0212e72186e855027dd35b37e9d7a99a078448c upstream.
m68knommu does not set the Kconfig NO_DMA variable, but also does not provide the required functions, resulting in the following build error triggered by commit a40c24a13366e324bc0ff8c3bb107db89312c984 (net: Add SKB DMA mapping helper functions.):
<-- snip -->
..
LD vmlinuxnet/built-in.o: In function `skb_dma_unmap':
(.text+0xac5e): undefined reference to dma_unmap_single' net/built-in.o: In function skb_dma_unmap':
(.text+0xac7a): undefined reference to dma_unmap_page' net/built-in.o: In function skb_dma_map':
(.text+0xacdc): undefined reference to dma_map_single' net/built-in.o: In function skb_dma_map':
(.text+0xace8): undefined reference to dma_mapping_error' net/built-in.o: In function skb_dma_map':
(.text+0xad10): undefined reference to dma_map_page' net/built-in.o: In function skb_dma_map':
(.text+0xad82): undefined reference to dma_unmap_page' net/built-in.o: In function skb_dma_map':
(.text+0xadc6): undefined reference to `dma_unmap_single' make[1]: *** [vmlinux] Error 1
<-- snip -->
--- arch/m68knommu/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
arch/m68knommu/Kconfig +4 -0
@@ -14,6 +14,10 @@ config MMU bool default n +config NO_DMA + bool + default y + config FPU bool default n
PATCH 4/41 sata_mv: fix 8-port timeouts on 508x/6081 chips
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Lord <[email protected]>
commit b0bccb18bc523d1d5060d25958f12438062829a9 upstream.
Fix a longstanding bug for the 8-port Marvell Sata controllers (508x/6081), where accesses to the upper 4 ports would cause lost-interrupts / timeouts for the lower 4-ports. With this patch, the 6081 boards should finally be reliable enough for mainstream use with Linux.
--- drivers/ata/sata_mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_mv.c +1 -1
@@ -883,7 +883,7 @@ static void mv_start_dma(struct ata_portstruct mv_host_priv *hpriv = ap->host->private_data;int hardport =mv_hardport_from_port (ap->port_no);void __iomem *hc_mmio =mv_hc_base_from_port ( -mv_host_base (ap->host), hardport); +mv_host_base (ap->host), ap->port_no);u32 hc_irq_cause, ipending;/* clear EDMA event indicators, if any */
PATCH 7/41 fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Risto Suominen <[email protected]>
commit 7fbb7cadd062baf299fd8b26a80ea99da0c3fe01 upstream.
Since the complete re-write in 2.6.10, some PowerMacs (At least PowerMac 5500 and PowerMac G3 Beige rev A) with ATI Mach64 chip have suffered from unstable columns in their framebuffer image. This seems to depend on a value (4) read from PLL_EXT_CNTL register, which leads to incorrect DSP config parameters to be written to the chip. This patch uses a value calculated by aty_init_pll_ct instead, as a starting point.
There are questions as to whether this should be extended to other platforms or maybe made dependent on specific chip types, but in the meantime, this has been tested on various powermacs and works for them so let's commit it.
--- drivers/video/aty/mach64_ct.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/video/aty/mach64_ct.c +11 -0
@@ -8,6 +8,9 @@#include <asm/io.h> #include <video/mach64.h> #include "atyfb.h" +#ifdef CONFIG_PPC +#include <asm/machdep.h> +#endif #undef DEBUG
@@ -536,6 +539,14 @@ static int __devinit aty_init_pll_ct(con pll->ct.xclk_post_div_real = postdividers[xpost_div]; pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real /8 ; +#ifdef CONFIG_PPC +if (machine_is (powermac)) { +/* Override PLL_EXT_CNTL & 0x07. */ + pll->ct.xclk_post_div = xpost_div; + pll->ct.xclk_ref_div =1 ; + } +#endif +#ifdef DEBUG pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) / (par->ref_clk_per * pll->ct.pll_ref_div);
PATCH 8/41 Fix memory corruption in console selection
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikulas Patocka <[email protected]>
commit 878b8619f711280fd05845e21956434b5e588cc4 upstream.
Fix an off-by-two memory error in console selection.
The loop below goes from sel_start to sel_end (inclusive), so it writes one more character. This one more character was added to the allocated size (+1), but it was not multiplied by an UTF-8 multiplier.
This patch fixes a memory corruption when UTF-8 console is used and the user selects a few characters, all of them 3-byte in UTF-8 (for example a frame line).
When memory redzones are enabled, a redzone corruption is reported. When they are not enabled, trashing of random memory occurs.
--- drivers/char/selection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/selection.c +1 -1
@@ -268,7 +268,7 @@ int set_selection(const struct tiocl_sel/* Allocate a new buffer before freeing the old one ... */ multiplier = use_unicode ?3 :1 ;/* chars can take up to 3 bytes */ - bp =kmalloc ((sel_end-sel_start)/2 *multiplier+1 ,GFP_KERNEL ); + bp =kmalloc (((sel_end-sel_start)/2 +1 )*multiplier,GFP_KERNEL );if (!bp) {printk (KERN_WARNING "selection: kmalloc() failed\n" );clear_selection ();
PATCH 6/41 Add enable_ms to jsm driver
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paul Larson <[email protected]>
commit 0461ec5bc7745b89a8ab67ba0ea497abd58a6301 upstream.
This fixes a crash observed when non-existant enable_ms function is called for jsm driver.
--- drivers/serial/jsm/jsm_tty.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/serial/jsm/jsm_tty.c +6 -0
@@ -161,6 +161,11 @@ static void jsm_tty_stop_rx(struct uart_ channel->ch_bd->bd_ops->disable_receiver (channel); } +static void jsm_tty_enable_ms (struct uart_port *port) +{ +/* Nothing needed */ +} +static void jsm_tty_break (struct uart_port *port,int break_state) {unsigned long lock_flags;
@@ -345,6 +350,7 @@ static struct uart_ops jsm_ops = { .start_tx = jsm_tty_start_tx, .send_xchar = jsm_tty_send_xchar, .stop_rx = jsm_tty_stop_rx, + .enable_ms = jsm_tty_enable_ms, .break_ctl = jsm_tty_break, .startup = jsm_tty_open, .shutdown = jsm_tty_close,
PATCH 5/41 x86: use early clobbers in usercopy*.c
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andi Kleen <[email protected]>
commit e0a96129db574d6365e3439d16d88517c437ab33 upstream.
Impact: fix rare (but currently harmless) miscompile with certain configs and gcc versions
Hugh Dickins noticed that strncpy_from_user() was miscompiled in some circumstances with gcc 4.3.
Thanks to Hugh's excellent analysis it was easy to track down.
Quoted 22 lines · Hugh
Try building an
x86_64defconfig 2.6.29-rc1 kernel tree, except not quite defconfig, switchCONFIG_PREEMPT_NONE=yandCONFIG_PREEMPT_VOLUNTARYoff (because it expands amight_fault()there, which hides the issue): using a gcc 4.3.2 (I've checked both openSUSE 11.1 and Fedora 10).It generates the following:
0000000000000000 <
__strncpy_from_user>:0: 48 89 d1 mov %rdx,%rcx 3: 48 85 c9 test %rcx,%rcx 6: 74 0e je 16 <__strncpy_from_user+0x16> 8: ac lods %ds:(%rsi),%al 9: aa stos %al,%es:(%rdi) a: 84 c0 test %al,%al c: 74 05 je 13 <__strncpy_from_user+0x13> e: 48 ff c9 dec %rcx 11: 75 f5 jne 8 <__strncpy_from_user+0x8> 13: 48 29 c9 sub %rcx,%rcx 16: 48 89 c8 mov %rcx,%rax 19: c3 retq
Quoted 3 lines
Observe that "sub %rcx,%rcx; mov %rcx,%rax", whereas gcc 4.2.1 (and many other configs) say "sub %rcx,%rdx; mov %rdx,%rax". Isn't it returning 0 when it ought to be returning strlen?
The asm constraints for the strncpy_from_user() result were missing an early clobber, which tells gcc that the last output arguments are written before all input arguments are read.
Also add more early clobbers in the rest of the file and fix 32-bit usercopy.c in the same way.
[ since this API is rarely used and no in-kernel user relies on a 'len'
return value (they only rely on negative return values) this miscompile was never noticed in the field. But it's worth fixing it nevertheless. ]
--- arch/x86/lib/usercopy_32.c | 4 ++-- arch/x86/lib/usercopy_64.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/lib/usercopy_32.c +2 -2
@@ -49,7 +49,7 @@ do { \" jmp 2b\n" \".previous\n" \ _ASM_EXTABLE(0b ,3b ) \ - : "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \ + : "=&d"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \" =&D " (__d2) \ : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \: " memory"); \
@@ -211,7 +211,7 @@ long strnlen_user(const char __user *s," .align 4\n" " .long 0b,2b\n" ".previous" - :"=r" (n), "=D" (s), "=a" (res), "=c" (tmp) + :"=&r" (n), "=&D" (s), "=&a" (res), "=&c" (tmp) :"0" (n), "1" (s), "2" (0), "3" (mask) :"cc"); return res & mask;
arch/x86/lib/usercopy_64.c +2 -2
@@ -32,7 +32,7 @@ do { \" jmp 2b\n" \".previous\n" \ _ASM_EXTABLE(0b ,3b ) \ - : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \ + : "=&r"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \" =&D " (__d2) \ : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \: " memory"); \
@@ -86,7 +86,7 @@ unsigned long __clear_user(void __user *".previous\n" _ASM_EXTABLE(0b,3b)_ASM_EXTABLE (1b ,2b ) - : [size8] "=c"(size), [dst] "=&D" (__d0) + : [size8] "=&c"(size), [dst] "=&D" (__d0) : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr), [zero] "r" (0UL), [eight] "r" (8UL)); return size;
PATCH 9/41 Input: atkbd - broaden the Dell DMI signatures
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Garrett <[email protected]>
commit 2a3ec3265741c3b2a7ebbd1b33f538e5a5583c48 upstream.
Some Dells need the dell input quirk applied but have a different vendor string in their DMI tables. Add an extra entry to cover these machines as well.
--- drivers/input/keyboard/atkbd.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/input/keyboard/atkbd.c +9 -0
@@ -1486,6 +1486,15 @@ static struct dmi_system_id atkbd_dmi_qu .driver_data = atkbd_dell_laptop_keymap_fixup, }, { + .ident = "Dell Laptop", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), +DMI_MATCH (DMI_CHASSIS_TYPE ,"8" ),/* Portable */ + }, + .callback = atkbd_setup_fixup, + .driver_data = atkbd_dell_laptop_keymap_fixup, + }, + { .ident ="HP 2133" , .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
PATCH 10/41 Input: atkbd - Samsung NC10 key repeat fix
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stuart Hopkins <[email protected]>
commit 4200844bd9dc511088258437d564a187f0ffc94e upstream.
This patch fixes the key repeat issue with the Fn+F? keys on the new Samsung NC10 Netbook, so that the keys can be defined and used within ACPID correctly, otherwise the keys repeat indefinately.
This solves part of http://bugzilla.kernel.org/show_bug.cgi?id=12021
--- drivers/input/keyboard/atkbd.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
drivers/input/keyboard/atkbd.c +25 -0
@@ -884,6 +884,22 @@ static void atkbd_inventec_keymap_fixup( }/* +* Samsung NC10 with Fn+F? key release not working +*/ +static void atkbd_samsung_keymap_fixup (struct atkbd *atkbd) +{ +const unsigned int forced_release_keys[] = { +0x82 ,0x83 ,0x84 ,0x86 ,0x88 ,0x89 ,0xb3 ,0xf7 ,0xf9 , + }; +int i; + +if (atkbd->set ==2 ) +for (i =0 ; i <ARRAY_SIZE (forced_release_keys); i++) +__set_bit (forced_release_keys[i], + atkbd->force_release_mask); +} + +/* * atkbd_set_keycode_table() initializes keyboard's keycode table * according to the selected scancode set */
@@ -1512,6 +1528,15 @@ static struct dmi_system_id atkbd_dmi_qu .callback = atkbd_setup_fixup, .driver_data = atkbd_inventec_keymap_fixup, }, + { + .ident = "Samsung NC10", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), + DMI_MATCH(DMI_PRODUCT_NAME, "NC10"), + }, + .callback = atkbd_setup_fixup, + .driver_data = atkbd_samsung_keymap_fixup, + }, { } };
PATCH 11/41 net: fix packet socket delivery in rx irq handler
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Patrick McHardy <[email protected]>
commit 9b22ea560957de1484e6b3e8538f7eef202e3596 upstream.
The changes to deliver hardware accelerated VLAN packets to packet sockets (commit bc1d0411) caused a warning for non-NAPI drivers. The __vlan_hwaccel_rx() function is called directly from the drivers RX function, for non-NAPI drivers that means its still in RX IRQ context:
[ 27.779463] ------------[ cut here ]------------ [ 27.779509] WARNING: at kernel/softirq.c:136 local_bh_enable+0x37/0x81() ... [ 27.782520] [<c0264755>] netif_nit_deliver+0x5b/0x75 [ 27.782590] [<c02bba83>] __vlan_hwaccel_rx+0x79/0x162 [ 27.782664] [<f8851c1d>] atl1_intr+0x9a9/0xa7c [atl1] [ 27.782738] [<c0155b17>] handle_IRQ_event+0x23/0x51 [ 27.782808] [<c015692e>] handle_edge_irq+0xc2/0x102 [ 27.782878] [<c0105fd5>] do_IRQ+0x4d/0x64
Split hardware accelerated VLAN reception into two parts to fix this:
- __vlan_hwaccel_rx just stores the VLAN TCI and performs the VLAN device lookup, then calls netif_receive_skb()/netif_rx()
- vlan_hwaccel_do_receive(), which is invoked by netif_receive_skb() in softirq context, performs the real reception and delivery to packet sockets.
--- include/linux/if_vlan.h | 7 +++++++ net/8021q/vlan_core.c | 46 +++++++++++++++++++++++++++++++++------------- net/core/dev.c | 3 +++ 3 files changed, 43 insertions(+), 13 deletions(-)
include/linux/if_vlan.h +7 -0
@@ -114,6 +114,8 @@ extern u16 vlan_dev_vlan_id(const structextern int __vlan_hwaccel_rx (struct sk_buff *skb,struct vlan_group *grp,u16 vlan_tci,int polling); +extern int vlan_hwaccel_do_receive (struct sk_buff *skb); +#else static inline struct net_device *vlan_dev_real_dev (const struct net_device *dev) {
@@ -133,6 +135,11 @@ static inline int __vlan_hwaccel_rx(struBUG (); return NET_XMIT_SUCCESS; } + +static inline int vlan_hwaccel_do_receive (struct sk_buff *skb) +{ +return 0 ; +}#endif /**
net/8021q/vlan_core.c +33 -13
80 lines not on this page · raw message
net/core/dev.c +3 -0
@@ -2187,6 +2187,9 @@ int netif_receive_skb(struct sk_buff *skint ret =NET_RX_DROP ;__be16 type; +if (skb->vlan_tci &&vlan_hwaccel_do_receive (skb)) +return NET_RX_SUCCESS ; +/* if we've gotten here through NAPI, check netpoll */ if (netpoll_receive_skb (skb))return NET_RX_DROP ;
PATCH 12/41 nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: J. Bruce Fields <[email protected]>
commit 55ef1274dddd4de387c54d110e354ffbb6cdc706 upstream.
Since nfsv4 allows LOCKT without an open, but the ->lock() method is a file method, we fake up a struct file in the nfsv4 code with just the fields we need initialized. But we forgot to initialize the file operations, with the result that LOCKT never results in a call to the filesystem's ->lock() method (if it exists).
We could just add that one more initialization. But this hack of faking up a struct file with only some fields initialized seems the kind of thing that might cause more problems in the future. We should either do an open and get a real struct file, or make lock-testing an inode (not a file) method.
This patch does the former.
--- fs/nfsd/nfs4state.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
fs/nfsd/nfs4state.c +20 -10
@@ -2767,6 +2767,25 @@ out: }/* +* The NFSv4 spec allows a client to do a LOCKT without holding an OPEN, +* so we do a temporary open here just to get an open file to pass to +* vfs_test_lock. (Arguably perhaps test_lock should be done with an +* inode operation.) +*/ +static int nfsd_test_lock (struct svc_rqst *rqstp,struct svc_fh *fhp,struct file_lock *lock) +{ +struct file *file; +int err; + + err =nfsd_open (rqstp, fhp,S_IFREG ,NFSD_MAY_READ , &file); +if (err) +return err; + err =vfs_test_lock (file, lock); +nfsd_close (file); +return err; +} + +/* * LOCKT operation */ __be32
@@ -2774,7 +2793,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru struct nfsd4_lockt *lockt) {struct inode *inode; -struct file file;struct file_lock file_lock;int error;__be32 status;
@@ -2832,16 +2850,8 @@ nfsd4_lockt(struct svc_rqst *rqstp, strunfs4_transform_lock_offset (&file_lock); -/* vfs_test_lock uses the struct file _only_ to resolve the inode. -* since LOCKT doesn't require an OPEN, and therefore a struct -* file may not exist, pass vfs_test_lock a struct file with -* only the dentry:inode set. -*/ -memset (&file,0 ,sizeof (struct file )); - file.f_path.dentry = cstate->current_fh.fh_dentry; - status = nfs_ok; - error =vfs_test_lock (&file, &file_lock); + error =nfsd_test_lock (rqstp, &cstate->current_fh, &file_lock);if (error) { status =nfserrno (error); goto out;
PATCH 13/41 nfsd: only set file_lock.fl_lmops in nfsd4_lockt if a stateowner is found
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit fa82a491275a613b15489aab4b99acecb00958d3 upstream.
nfsd4_lockt does a search for a lockstateowner when building the lock struct to test. If one is found, it'll set fl_owner to it. Regardless of whether that happens, it'll also set fl_lmops. Given that this lock is basically a "lightweight" lock that's just used for checking conflicts, setting fl_lmops is probably not appropriate for it.
This behavior exposed a bug in DLM's GETLK implementation where it wasn't clearing out the fields in the file_lock before filling in conflicting lock info. While we were able to fix this in DLM, it still seems pointless and dangerous to set the fl_lmops this way when we may have a NULL lockstateowner.
--- fs/nfsd/nfs4state.c | 1 - 1 file changed, 1 deletion(-)
fs/nfsd/nfs4state.c +0 -1
@@ -2840,7 +2840,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, stru file_lock.fl_owner = (fl_owner_t )lockt->lt_stateowner; file_lock.fl_pid = current->tgid; file_lock.fl_flags =FL_POSIX ; - file_lock.fl_lmops = &nfsd_posix_mng_ops; file_lock.fl_start = lockt->lt_offset;if ((lockt->lt_length == ~(u64 )0 ) ||LOFF_OVERFLOW (lockt->lt_offset, lockt->lt_length))
PATCH 14/41 PCI: irq and pci_ids patch for Intel Tigerpoint DeviceIDs
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Seth Heasley <[email protected]>
commit 57064d213d2e44654d4f13c66df135b5e7389a26 upstream.
This patch adds the Intel Tigerpoint LPC Controller DeviceIDs.
--- arch/x86/pci/irq.c | 1 + include/linux/pci_ids.h | 1 + 2 files changed, 2 insertions(+)
arch/x86/pci/irq.c +1 -0
@@ -573,6 +573,7 @@ static __init int intel_router_probe(strcase PCI_DEVICE_ID_INTEL_ICH7_1 :case PCI_DEVICE_ID_INTEL_ICH7_30 :case PCI_DEVICE_ID_INTEL_ICH7_31 : +case PCI_DEVICE_ID_INTEL_TGP_LPC :case PCI_DEVICE_ID_INTEL_ESB2_0 :case PCI_DEVICE_ID_INTEL_ICH8_0 :case PCI_DEVICE_ID_INTEL_ICH8_1 :
include/linux/pci_ids.h +1 -0
@@ -2384,6 +2384,7 @@#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 +#define PCI_DEVICE_ID_INTEL_TGP_LPC 0x27bc#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
PATCH 15/41 sata_nv: rename nv_nf2_hardreset()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit e8caa3c70e94d867ca2efe9e53fd388b52d6d0c8 upstream.
nv_nf2_hardreset() will be used by other flavors too. Rename it to nv_noclassify_hardreset().
--- drivers/ata/sata_nv.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/ata/sata_nv.c +14 -14
@@ -305,10 +305,10 @@ static irqreturn_t nv_ck804_interrupt(instatic int nv_scr_read (struct ata_port *ap,unsigned int sc_reg,u32 *val);static int nv_scr_write (struct ata_port *ap,unsigned int sc_reg,u32 val); +static int nv_noclassify_hardreset (struct ata_link *link,unsigned int *class, +unsigned long deadline);static void nv_nf2_freeze (struct ata_port *ap);static void nv_nf2_thaw (struct ata_port *ap); -static int nv_nf2_hardreset (struct ata_link *link,unsigned int *class, -unsigned long deadline);static void nv_ck804_freeze (struct ata_port *ap);static void nv_ck804_thaw (struct ata_port *ap);static int nv_adma_slave_config (struct scsi_device *sdev);
@@ -432,7 +432,7 @@ static struct ata_port_operations nv_nf2 .inherits = &nv_common_ops, .freeze = nv_nf2_freeze, .thaw = nv_nf2_thaw, - .hardreset = nv_nf2_hardreset, + .hardreset = nv_noclassify_hardreset, };/* CK804 finally gets hardreset right */
@@ -1530,6 +1530,17 @@ static int nv_scr_write(struct ata_portreturn 0 ; } +static int nv_noclassify_hardreset (struct ata_link *link,unsigned int *class, +unsigned long deadline) +{ +bool online; +int rc; + + rc =sata_link_hardreset (link, sata_deb_timing_hotplug, deadline, + &online,NULL ); +return online ? -EAGAIN : rc; +} +static void nv_nf2_freeze (struct ata_port *ap) {void __iomem *scr_addr = ap->host->ports[0 ]->ioaddr.scr_addr;
@@ -1554,17 +1565,6 @@ static void nv_nf2_thaw(struct ata_portiowrite8 (mask, scr_addr +NV_INT_ENABLE ); } -static int nv_nf2_hardreset (struct ata_link *link,unsigned int *class, -unsigned long deadline) -{ -bool online; -int rc; - - rc =sata_link_hardreset (link, sata_deb_timing_hotplug, deadline, - &online,NULL ); -return online ? -EAGAIN : rc; -} -static void nv_ck804_freeze (struct ata_port *ap) {void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR ];
PATCH 16/41 sata_nv: fix MCP5x reset
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 2d775708bc6613f1be47f1e720781343341ecc94 upstream.
MCP5x family of controllers seem to share much more with nf2's as far as reset protocol is concerned. It requires heardreset to get the PHY going and classfication code report after hardreset is unreliable. Create a new board type MCP5x and use noclassify hardreset. SWNCQ is modified to inherit from this new type.
This fixes hotplug regression reported in kernel bz#12351.
--- drivers/ata/sata_nv.c | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-)
drivers/ata/sata_nv.c +29 -13
@@ -352,6 +352,7 @@ enum nv_host_typeNFORCE3 =NFORCE2 ,/* NF2 == NF3 as far as sata_nv is concerned */ CK804 ,ADMA , + MCP5x, SWNCQ, };
@@ -363,10 +364,10 @@ static const struct pci_device_id nv_pci { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2), CK804 }, { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA), CK804 }, { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2), CK804 }, - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), SWNCQ }, - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ }, - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ }, - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ }, + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), MCP5x }, + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), MCP5x }, + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), MCP5x }, + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), MCP5x }, { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
@@ -467,8 +468,19 @@ static struct ata_port_operations nv_adm .host_stop = nv_adma_host_stop, }; +/* Kernel bz#12351 reports that when SWNCQ is enabled, for hotplug to +* work, hardreset should be used and hardreset can't report proper +* signature, which suggests that mcp5x is closer to nf2 as long as +* reset quirkiness is concerned. Define separate ops for mcp5x with +* nv_noclassify_hardreset(). +*/ +static struct ata_port_operations nv_mcp5x_ops = { + .inherits = &nv_common_ops, + .hardreset = nv_noclassify_hardreset, +}; +static struct ata_port_operations nv_swncq_ops = { - .inherits = &nv_generic_ops, + .inherits = &nv_mcp5x_ops, .qc_defer = ata_std_qc_defer, .qc_prep = nv_swncq_qc_prep,
@@ -531,6 +543,15 @@ static const struct ata_port_info nv_por .port_ops = &nv_adma_ops, .private_data = NV_PI_PRIV(nv_adma_interrupt, &nv_adma_sht), }, +/* MCP5x */ + { + .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, + .pio_mask = NV_PIO_MASK, + .mwdma_mask = NV_MWDMA_MASK, + .udma_mask = NV_UDMA_MASK, + .port_ops = &nv_mcp5x_ops, + .private_data = NV_PI_PRIV(nv_generic_interrupt, &nv_sht), + },/* SWNCQ */ { .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
@@ -2355,14 +2376,9 @@ static int nv_init_one(struct pci_dev *pif (type ==CK804 && adma_enabled) {dev_printk (KERN_NOTICE , &pdev->dev,"Using ADMA mode\n" ); type =ADMA ; - } - -if (type ==SWNCQ ) { -if (swncq_enabled) -dev_printk (KERN_NOTICE , &pdev->dev, -"Using SWNCQ mode\n" ); -else - type =GENERIC ; + }else if (type == MCP5x && swncq_enabled) { +dev_printk (KERN_NOTICE , &pdev->dev,"Using SWNCQ mode\n" ); + type =SWNCQ ; } ppi[0 ] = &nv_port_info[type];
PATCH 17/41 sata_nv: ck804 has borked hardreset too
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 8d993eaa9c3c61b8a5929a7f695078a1fcfb4869 upstream.
While playing with nvraid, I found out that rmmoding and insmoding often trigger hardreset failure on the first port (the second one was always okay). Seriously, how diverse can you get with hardreset behaviors? Anyways, make ck804 use noclassify variant too.
--- drivers/ata/sata_nv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ata/sata_nv.c +6 -1
@@ -436,11 +436,16 @@ static struct ata_port_operations nv_nf2 .hardreset = nv_noclassify_hardreset, }; -/* CK804 finally gets hardreset right */ +/* For initial probing after boot and hot plugging, hardreset mostly +* works fine on CK804 but curiously, reprobing on the initial port by +* rescanning or rmmod/insmod fails to acquire the initial D2H Reg FIS +* in somewhat undeterministic way. Use noclassify hardreset. +*/ static struct ata_port_operations nv_ck804_ops = { .inherits = &nv_common_ops, .freeze = nv_ck804_freeze, .thaw = nv_ck804_thaw, + .hardreset = nv_noclassify_hardreset, .host_stop = nv_ck804_host_stop, };
PATCH 18/41 USB: isp1760: Fix probe in PCI glue code
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Karl Bongers <[email protected]>
This is the backported version of the upstream commit Stefan Bader <[email protected]> did the backport
Contains fixes so probe on x86 PCI runs, apparently I'm first to try this. Several fixes to memory access to probe host scratch register. Previously would bug check on chip_addr var used uninitialized. Scratch reg write failed in one instance due to 16-bit initial access mode, so added "& 0x0000ffff" to the readl as fix.
Includes some general cleanup - remove global vars, organize memory map resource use.
--- drivers/usb/host/isp1760-if.c | 96 ++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 41 deletions(-)
drivers/usb/host/isp1760-if.c +55 -41
@@ -129,23 +129,23 @@ static struct of_platform_driver isp1760#endif #ifdef CONFIG_PCI -static u32 nxp_pci_io_base; -static u32 iolength; -static u32 pci_mem_phy0; -static u32 length; -static u8 __iomem *chip_addr; -static u8 __iomem *iobase; -static int __devinit isp1761_pci_probe (struct pci_dev *dev,const struct pci_device_id *id) {u8 latency, limit;__u32 reg_data;int retry_count; -int length; -int status =1 ;struct usb_hcd *hcd;unsigned int devflags =0 ; +int ret_status =0 ; + +resource_size_t pci_mem_phy0; +resource_size_t memlength; + +u8 __iomem *chip_addr; +u8 __iomem *iobase; +resource_size_t nxp_pci_io_base; +resource_size_t iolength;if (usb_disabled ())return -ENODEV ;
@@ -168,26 +168,30 @@ static int __devinit isp1761_pci_probe(s iobase =ioremap_nocache (nxp_pci_io_base, iolength);if (!iobase) {printk (KERN_ERR "ioremap #1\n" ); -release_mem_region (nxp_pci_io_base, iolength); -return -ENOMEM ; + ret_status = -ENOMEM ; + goto cleanup1; }/* Grab the PLX PCI shared memory of the ISP 1761 we need */ pci_mem_phy0 =pci_resource_start (dev,3 ); - length =pci_resource_len (dev,3 ); - -if (length <0xffff ) { -printk (KERN_ERR "memory length for this resource is less than " -"required\n" ); -release_mem_region (nxp_pci_io_base, iolength); -iounmap (iobase); -return -ENOMEM ; + memlength =pci_resource_len (dev,3 ); +if (memlength <0xffff ) { +printk (KERN_ERR "memory length for this resource is wrong\n" ); + ret_status = -ENOMEM ; + goto cleanup2; } -if (!request_mem_region (pci_mem_phy0, length,"ISP-PCI" )) { +if (!request_mem_region (pci_mem_phy0, memlength,"ISP-PCI" )) {printk (KERN_ERR "host controller already in use\n" ); -release_mem_region (nxp_pci_io_base, iolength); -iounmap (iobase); -return -EBUSY ; + ret_status = -EBUSY ; + goto cleanup2; + } + +/* map available memory */ + chip_addr =ioremap_nocache (pci_mem_phy0,memlength); +if (!chip_addr) { +printk (KERN_ERR "Error ioremap failed\n" ); + ret_status = -ENOMEM ; + goto cleanup3; }/* bad pci latencies can contribute to overruns */
@@ -210,38 +214,54 @@ static int __devinit isp1761_pci_probe(s* */ writel (0xface , chip_addr +HC_SCRATCH_REG );udelay (100 ); - reg_data =readl (chip_addr +HC_SCRATCH_REG ); + reg_data =readl (chip_addr +HC_SCRATCH_REG ) &0x0000ffff ; retry_count--; } +iounmap (chip_addr); +/* Host Controller presence is detected by writing to scratch register * and reading back and checking the contents are same or not */ if (reg_data !=0xFACE ) {err ("scratch register mismatch %x" , reg_data); - goto clean; + ret_status = -ENOMEM ; + goto cleanup3; }pci_set_master (dev); - status =readl (iobase +0x68 ); - status |=0x900 ; -writel (status, iobase +0x68 ); +/* configure PLX PCI chip to pass interrupts */ +#define PLX_INT_CSR_REG 0x68 + reg_data =readl (iobase +PLX_INT_CSR_REG ); + reg_data |=0x900 ; +writel (reg_data, iobase +PLX_INT_CSR_REG ); dev->dev.dma_mask =NULL ; - hcd =isp1760_register (pci_mem_phy0, length, dev->irq, + hcd =isp1760_register (pci_mem_phy0, memlength, dev->irq,IRQF_SHARED |IRQF_DISABLED , &dev->dev,dev_name (&dev->dev), devflags); +if (IS_ERR (hcd)) { + ret_status = -ENODEV ; + goto cleanup3; + } + +/* done with PLX IO access */ +iounmap (iobase); +release_mem_region (nxp_pci_io_base, iolength); +pci_set_drvdata (dev, hcd); -if (!hcd) -return 0 ; -clean: - status = -ENODEV ; +return 0 ; + +cleanup3: +release_mem_region (pci_mem_phy0, memlength); +cleanup2:iounmap (iobase); -release_mem_region (pci_mem_phy0, length); +cleanup1:release_mem_region (nxp_pci_io_base, iolength); -return status; +return ret_status; } +static void isp1761_pci_remove (struct pci_dev *dev) {struct usb_hcd *hcd;
@@ -254,12 +274,6 @@ static void isp1761_pci_remove(struct pcusb_put_hcd (hcd);pci_disable_device (dev); - -iounmap (iobase); -iounmap (chip_addr); - -release_mem_region (nxp_pci_io_base, iolength); -release_mem_region (pci_mem_phy0, length); }static void isp1761_pci_shutdown (struct pci_dev *dev)
PATCH 19/41 x86: fix page attribute corruption with cpa()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit a1e46212a410793d575718818e81ddc442a65283 upstream.
Impact: fix sporadic slowdowns and warning messages
This patch fixes a performance issue reported by Linus on his Nehalem system. While Linus reverted the PAT patch (commit 58dab916dfb57328d50deb0aa9b3fc92efa248ff) which exposed the issue, existing cpa() code can potentially still cause wrong(page attribute corruption) behavior.
This patch also fixes the "WARNING: at arch/x86/mm/pageattr.c:560" that various people reported.
In 64bit kernel, kernel identity mapping might have holes depending on the available memory and how e820 reports the address range covering the RAM, ACPI, PCI reserved regions. If there is a 2MB/1GB hole in the address range that is not listed by e820 entries, kernel identity mapping will have a corresponding hole in its 1-1 identity mapping.
If cpa() happens on the kernel identity mapping which falls into these holes,
existing code fails like this:
__change_page_attr_set_clr()
__change_page_attr()
returns 0 because of if (!kpte). But doesn't set cpa->numpages and cpa->pfn.
cpa_process_alias()
uses uninitialized cpa->pfn (random value) which can potentially lead to changing the page attribute of kernel text/data, kernel identity mapping of RAM pages etc. oops!
This bug was easily exposed by another PAT patch which was doing cpa() more often on kernel identity mapping holes (physical range betweenmax_low_pfn_mapped and 4GB), where in here it was setting the cache disable attribute(PCD) for kernel identity mappings aswell.
Fix cpa() to handle the kernel identity mapping holes. Retain the WARN() for cpa() calls to other not present address ranges (kernel-text/data, ioremap() addresses)
--- arch/x86/mm/pageattr.c | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-)
arch/x86/mm/pageattr.c +34 -15
@@ -582,6 +582,36 @@ out_unlock:return 0 ; } +static int __cpa_process_fault (struct cpa_data *cpa,unsigned long vaddr, +int primary) +{ +/* +* Ignore all non primary paths. +*/ +if (!primary) +return 0 ; + +/* +* Ignore the NULL PTE for kernel identity mapping, as it is expected +* to have holes. +* Also set numpages to '1' indicating that we processed cpa req for +* one virtual address page and its pfn. TBD: numpages can be set based +* on the initial value and the level returned by lookup_address(). +*/ +if (within (vaddr,PAGE_OFFSET , +PAGE_OFFSET + (max_pfn_mapped <<PAGE_SHIFT ))) { + cpa->numpages =1 ; + cpa->pfn =__pa (vaddr) >>PAGE_SHIFT ; +return 0 ; + }else { +WARN (1 ,KERN_WARNING "CPA: called for zero pte. " +"vaddr = %lx cpa->vaddr = %lx\n" , vaddr, + cpa->vaddr); + +return -EINVAL ; + } +} +static int __change_page_attr (struct cpa_data *cpa,int primary) {unsigned long address = cpa->vaddr;
@@ -592,17 +622,11 @@ static int __change_page_attr(struct cpa repeat: kpte =lookup_address (address, &level);if (!kpte) -return 0 ; +return __cpa_process_fault (cpa, address, primary); old_pte = *kpte; -if (!pte_val (old_pte)) { -if (!primary) -return 0 ; -WARN (1 ,KERN_WARNING "CPA: called for zero pte. " -"vaddr = %lx cpa->vaddr = %lx\n" , address, - cpa->vaddr); -return -EINVAL ; - } +if (!pte_val (old_pte)) +return __cpa_process_fault (cpa, address, primary);if (level ==PG_LEVEL_4K ) {pte_t new_pte;
@@ -676,12 +700,7 @@ static int cpa_process_alias(struct cpa_* mapping already: */ if (!(within (cpa->vaddr,PAGE_OFFSET , -PAGE_OFFSET + (max_low_pfn_mapped <<PAGE_SHIFT )) -#ifdef CONFIG_X86_64 - ||within (cpa->vaddr,PAGE_OFFSET + (1UL <<32 ), -PAGE_OFFSET + (max_pfn_mapped <<PAGE_SHIFT )) -#endif - )) { +PAGE_OFFSET + (max_pfn_mapped <<PAGE_SHIFT )))) { alias_cpa = *cpa; alias_cpa.vaddr = (unsigned long )__va (cpa->pfn <<PAGE_SHIFT );
PATCH 20/41 cpuidle: update the last_state acpi cpuidle reflecting actual state entered
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Venkatesh Pallipadi <[email protected]>
commit addbad46ed0906cd584784423b9d0babc7476446
reflect the actual state entered in dev->last_state, when actaul state entered is different from intended one.
--- drivers/acpi/processor_idle.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/processor_idle.c +1 -0
@@ -1587,6 +1587,7 @@ static int acpi_idle_enter_bm(struct cpuif (acpi_idle_bm_check ()) {if (dev->safe_state) { + dev->last_state = dev->safe_state;return dev->safe_state->enter (dev, dev->safe_state); }else {local_irq_disable ();
PATCH 21/41 cpuidle: upon BIOS bug, default to default_idle rather than polling
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Venkatesh Pallipadi <[email protected]>
commit 89cedfefca1d446ee2598fd3bcbb23ee3802e26a upstream
http://bugzilla.kernel.org/show_bug.cgi?id=11345
--- arch/x86/Kconfig | 3 +++ drivers/cpuidle/cpuidle.c | 4 ++++ 2 files changed, 7 insertions(+)
arch/x86/Kconfig +3 -0
@@ -123,6 +123,9 @@ config GENERIC_TIME_VSYSCALL config ARCH_HAS_CPU_RELAX def_bool y +config ARCH_HAS_DEFAULT_IDLE + def_bool y + config ARCH_HAS_CACHE_LINE_SIZE def_bool y
drivers/cpuidle/cpuidle.c +4 -0
@@ -56,7 +56,11 @@ static void cpuidle_idle_call(void)if (pm_idle_old)pm_idle_old (); else +#if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE ) +default_idle (); +#else local_irq_enable (); +#endif return ; }
PATCH 22/41 cpuidle: use last_state which can reflect the actual state entered
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Venkatesh Pallipadi <[email protected]>
commit 887e301aa1105326f1412a98749024263b1031c7 upstream
cpuidle accounts the idle time for the C-state it was trying to enter and not to the actual state that the driver eventually entered. The driver may select a different state than the one chosen by cpuidle due to constraints like bus-mastering, etc.
Change the time acounting code to look at the dev->last_state after returning from target_state->enter(). Driver can modify dev->last_state internally, inside the enter routine to reflect the actual C-state entered.
--- drivers/cpuidle/cpuidle.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle.c +4 -1
@@ -71,8 +71,11 @@ static void cpuidle_idle_call(void) target_state = &dev->states[next_state];/* enter the state and update stats */ - dev->last_residency = target_state->enter (dev, target_state); dev->last_state = target_state; + dev->last_residency = target_state->enter (dev, target_state); +if (dev->last_state) + target_state = dev->last_state; + target_state->time += (unsigned long long )dev->last_residency; target_state->usage++;
PATCH 23/41 cpuidle: Add decaying history logic to menu idle predictor
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Venkatesh Pallipadi <[email protected]>
commit 816bb611e41be29b476dc16f6297eb551bf4d747 upstream
Add decaying history of predicted idle time, instead of using the last early wakeup. This logic helps menu governor do better job of predicting idle time.
With this change, we also measured noticable (~8%) power savings on a DP server system with CPUs supporting deep C states, when system was lightly loaded. There was no change to power or perf on other load conditions.
--- drivers/cpuidle/governors/menu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/cpuidle/governors/menu.c +9 -1
@@ -15,12 +15,14 @@#include <linux/tick.h> #define BREAK_FUZZ 4/* 4 us */ +#define PRED_HISTORY_PCT 50struct menu_device {int last_state_idx;unsigned int expected_us;unsigned int predicted_us; +unsigned int current_predicted_us;unsigned int last_measured_us;unsigned int elapsed_us; };
@@ -47,6 +49,12 @@ static int menu_select(struct cpuidle_de data->expected_us = (u32 )ktime_to_ns (tick_nohz_get_sleep_length ()) /1000 ; +/* Recalculate predicted_us based on prediction_history_pct */ + data->predicted_us *=PRED_HISTORY_PCT ; + data->predicted_us += (100 -PRED_HISTORY_PCT ) * + data->current_predicted_us; + data->predicted_us /=100 ; +/* find the deepest idle state that satisfies our constraints */ for (i =CPUIDLE_DRIVER_STATE_START +1 ; i < dev->state_count; i++) {struct cpuidle_state *s = &dev->states[i];
@@ -97,7 +105,7 @@ static void menu_reflect(struct cpuidle_ measured_us =-1 ;/* Predict time until next break event */ - data->predicted_us =max (measured_us, data->last_measured_us); + data->current_predicted_us =max (measured_us, data->last_measured_us);if (last_idle_us +BREAK_FUZZ < data->expected_us - target->exit_latency) {
PATCH 24/41 ACPI: Avoid array address overflow when _CST MWAIT hint bits are set
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhao Yakui <[email protected]>
commit 13b40a1a065824d2d4e55c8b48ea9f3f9d162929 upstream.
The Cx Register address obtained from the _CST object is used as the MWAIT hints if the register type is FFixedHW. And it is used to check whether the Cx type is supported or not.
On some boxes the following Cx state package is obtained from _CST object:
Quoted 1 line
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000889759, // Address
0x03, // Access Size
)
},
0x03,
0xF5,
0x015E } In such case we should use the bit[7:4] of Cx address to check whether
the Cx type is supported or not.
mask the MWAIT hint to avoid array address overflow
--- arch/x86/kernel/acpi/cstate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/acpi/cstate.c +3 -1
@@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_estatic short mwait_supported[ACPI_PROCESSOR_MAX_POWER ];#define MWAIT_SUBSTATE_MASK (0xf) +#define MWAIT_CSTATE_MASK (0xf)#define MWAIT_SUBSTATE_SIZE (4)#define CPUID_MWAIT_LEAF (5)
@@ -98,7 +99,8 @@ int acpi_processor_ffh_cstate_probe(unsicpuid (CPUID_MWAIT_LEAF , &eax, &ebx, &ecx, &edx);/* Check whether this particular cx_type (in CST) is supported or not */ - cstate_type = (cx->address >>MWAIT_SUBSTATE_SIZE ) +1 ; + cstate_type = ((cx->address >>MWAIT_SUBSTATE_SIZE ) & +MWAIT_CSTATE_MASK ) +1 ; edx_part = edx >> (cstate_type *MWAIT_SUBSTATE_SIZE ); num_cstate_subtype = edx_part &MWAIT_SUBSTATE_MASK ;
PATCH 25/41 ACPI: Attach the ACPI device to the ACPI handle as early as possible
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhao Yakui <[email protected]>
commit eab4b645769fa2f8703f5a3cb0cc4ac090d347af upstream.
Attach the ACPI device to the ACPI handle as early as possible so that OS can get the corresponding ACPI device by the acpi handle in the course of getting the power/wakeup/performance flags.
http://bugzilla.kernel.org/show_bug.cgi?id=8049
http://bugzilla.kernel.org/show_bug.cgi?id=11000
--- drivers/acpi/scan.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/acpi/scan.c +10 -2
@@ -1262,6 +1262,16 @@ acpi_add_single_object(struct acpi_devicacpi_device_set_id (device, parent, handle, type);/* +* The ACPI device is attached to acpi handle before getting +* the power/wakeup/peformance flags. Otherwise OS can't get +* the corresponding ACPI device by the acpi handle in the course +* of getting the power/wakeup/performance flags. +*/ + result =acpi_device_set_context (device, type); +if (result) + goto end; + +/* * Power Management * ---------------- */
@@ -1291,8 +1301,6 @@ acpi_add_single_object(struct acpi_devic goto end; } -if ((result =acpi_device_set_context (device, type))) - goto end; result =acpi_device_register (device, parent);
PATCH 26/41 ACPICA: Fixed a couple memory leaks associated with "implicit return"
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lin Ming <[email protected]>
commit d8a0ec914afa1a994d2f6184ac4c6668b5f8068f upstream
Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled.
http://www.acpica.org/bugzilla/show_bug.cgi?id=349
--- drivers/acpi/dispatcher/dsmethod.c | 3 +++ drivers/acpi/parser/psparse.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/acpi/dispatcher/dsmethod.c +3 -0
@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, NULL);acpi_ex_enter_interpreter (); } + +acpi_ds_clear_implicit_return (walk_state); +#ifdef ACPI_DISASSEMBLER if (ACPI_FAILURE (status)) {
drivers/acpi/parser/psparse.c +3 -1
@@ -641,10 +641,12 @@ acpi_status acpi_ps_parse_aml(struct acpACPI_WALK_METHOD_RESTART ; } }else { -/* On error, delete any return object */ +/* On error, delete any return object or implicit return */ acpi_ut_remove_reference (previous_walk_state-> return_desc); +acpi_ds_clear_implicit_return + (previous_walk_state); } }
PATCH 27/41 ACPICA: Add check for invalid handle in acpi_get_object_info
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Fiodor Suietov <[email protected]>
commit 237a927682a63f02adb542dbdaafe8a81566451d upstream
Return AE_BAD_PARAMETER if input handle is invalid.
http://www.acpica.org/bugzilla/show_bug.cgi?id=474
--- drivers/acpi/namespace/nsxfname.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/namespace/nsxfname.c +1 -0
@@ -253,6 +253,7 @@ acpi_get_object_info(acpi_handle handle, node =acpi_ns_map_handle_to_node (handle);if (!node) { (void )acpi_ut_release_mutex (ACPI_MTX_NAMESPACE ); + status =AE_BAD_PARAMETER ; goto cleanup; }
PATCH 28/41 ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Wilcox <[email protected]>
commit 27663c5855b10af9ec67bc7dfba001426ba21222 upstream
As of version 2.0, ACPI can return 64-bit integers. The current acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms. Change the argument to take a pointer to an acpi_integer so we support 64-bit integers on all platforms.
lenb: replaced use of "acpi_integer" with "unsigned long long"
lenb: fixed bug in acpi_thermal_trips_update()
--- arch/ia64/sn/kernel/io_acpi_init.c | 8 +++--- drivers/acpi/ac.c | 2 - drivers/acpi/acpi_memhotplug.c | 5 +--- drivers/acpi/asus_acpi.c | 2 - drivers/acpi/bay.c | 2 - drivers/acpi/bus.c | 4 +-- drivers/acpi/button.c | 4 +-- drivers/acpi/container.c | 2 - drivers/acpi/dock.c | 6 ++--- drivers/acpi/ec.c | 7 ++++- drivers/acpi/numa.c | 2 - drivers/acpi/osl.c | 5 +--- drivers/acpi/pci_root.c | 2 - drivers/acpi/pci_slot.c | 10 ++++---- drivers/acpi/power.c | 2 - drivers/acpi/processor_core.c | 4 +-- drivers/acpi/processor_perflib.c | 2 - drivers/acpi/processor_throttling.c | 2 - drivers/acpi/sbshc.c | 2 - drivers/acpi/sleep/main.c | 2 - drivers/acpi/thermal.c | 43 ++++++++++++++++++++++-------------- drivers/acpi/utils.c | 4 +-- drivers/acpi/video.c | 42 +++++++++++++++++------------------ drivers/ata/libata-acpi.c | 2 - drivers/misc/asus-laptop.c | 12 +++++----- drivers/misc/eeepc-laptop.c | 2 - drivers/misc/fujitsu-laptop.c | 8 +++--- drivers/misc/intel_menlow.c | 27 +++++++++++----------- drivers/pci/hotplug/acpiphp_glue.c | 14 +++++------ drivers/pci/hotplug/acpiphp_ibm.c | 2 - drivers/pci/hotplug/sgi_hotplug.c | 4 +-- include/acpi/acpi_bus.h | 2 - 32 files changed, 125 insertions(+), 112 deletions(-)
arch/ia64/sn/kernel/io_acpi_init.c +4 -4
@@ -232,7 +232,7 @@ exit:static unsigned int get_host_devfn (acpi_handle device_handle,acpi_handle rootbus_handle) { -unsigned long adr; +unsigned long long adr;acpi_handle child;unsigned int devfn;int function;
@@ -292,8 +292,8 @@ get_host_devfn(acpi_handle device_handlestatic acpi_status find_matching_device (acpi_handle handle,u32 lvl,void *context,void **rv) { -unsigned long bbn =-1 ; -unsigned long adr; +unsigned long long bbn =-1 ; +unsigned long long adr;acpi_handle parent =NULL ;acpi_status status;unsigned int devfn;
@@ -348,7 +348,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *unsigned int host_devfn;struct sn_pcidev_match pcidev_match;acpi_handle rootbus_handle; -unsigned long segment; +unsigned long long segment;acpi_status status; rootbus_handle =PCI_CONTROLLER (dev)->acpi_handle;
drivers/acpi/ac.c +1 -1
@@ -85,7 +85,7 @@ struct acpi_ac {struct power_supply charger;#endif struct acpi_device * device; -unsigned long state; +unsigned long long state; };#define to_acpi_ac (x) container_of(x, struct acpi_ac, charger);
drivers/acpi/acpi_memhotplug.c +2 -3
@@ -194,8 +194,7 @@ acpi_memory_get_device(acpi_handle handlstatic int acpi_memory_check_device (struct acpi_memory_device *mem_device) { -unsigned long current_status; - +unsigned long long current_status;/* Get device present/absent information from the _STA */ if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
@@ -264,7 +263,7 @@ static int acpi_memory_powerdown_device(acpi_status status;struct acpi_object_list arg_list;union acpi_object arg; -unsigned long current_status; +unsigned long long current_status;/* Issue the _EJ0 command */
drivers/acpi/asus_acpi.c +1 -1
@@ -753,7 +753,7 @@ static int get_lcd_state(void)/* That's what the AML code does */ lcd = out_obj.integer.value >>8 ; }else if (hotk->model == F3Sa) { -unsigned long tmp; +unsigned long long tmp;union acpi_object param;struct acpi_object_list input;acpi_status status;
drivers/acpi/bay.c +1 -1
@@ -90,7 +90,7 @@ static int is_ejectable(acpi_handle hand*/ static int bay_present (struct bay *bay) { -unsigned long sta; +unsigned long long sta;acpi_status status;if (bay) {
drivers/acpi/bus.c +2 -2
@@ -77,7 +77,7 @@ EXPORT_SYMBOL(acpi_bus_get_device);int acpi_bus_get_status (struct acpi_device *device) {acpi_status status =AE_OK ; -unsigned long sta =0 ; +unsigned long long sta =0 ;if (!device)
@@ -155,7 +155,7 @@ int acpi_bus_get_power(acpi_handle handlint result =0 ;acpi_status status =0 ;struct acpi_device *device =NULL ; -unsigned long psc =0 ; +unsigned long long psc =0 ; result =acpi_bus_get_device (handle, &device);
drivers/acpi/button.c +2 -2
@@ -145,7 +145,7 @@ static int acpi_button_state_seq_show(st {struct acpi_button *button = seq->private;acpi_status status; -unsigned long state; +unsigned long long state;if (!button || !button->device)return 0 ;
@@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct-------------------------------------------------------------------------- */ static int acpi_lid_send_state (struct acpi_button *button) { -unsigned long state; +unsigned long long state;acpi_status status; status = acpi_evaluate_integer(button->device->handle, "_LID", NULL,
drivers/acpi/container.c +1 -1
@@ -76,7 +76,7 @@ static int is_device_present(acpi_handle {acpi_handle temp;acpi_status status; -unsigned long sta; +unsigned long long sta; status =acpi_get_handle (handle,"_STA" , &temp);
drivers/acpi/dock.c +3 -3
@@ -229,7 +229,7 @@ EXPORT_SYMBOL_GPL(is_dock_device);*/ static int dock_present (struct dock_station *ds) { -unsigned long sta; +unsigned long long sta;acpi_status status;if (ds) {
@@ -730,13 +730,13 @@ static DEVICE_ATTR(undock, S_IWUSR, NULLstatic ssize_t show_dock_uid (struct device *dev,struct device_attribute *attr,char *buf) { -unsigned long lbuf; +unsigned long long lbuf;acpi_status status =acpi_evaluate_integer (dock_station->handle,"_UID" ,NULL , &lbuf);if (ACPI_FAILURE (status))return 0 ; -return snprintf (buf,PAGE_SIZE ,"%lx\n" , lbuf); +return snprintf (buf,PAGE_SIZE ,"%llx\n" , lbuf); } static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
drivers/acpi/ec.c +5 -2
@@ -769,6 +769,7 @@ static acpi_status ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) { acpi_status status; +unsigned long long tmp;struct acpi_ec *ec = context; status = acpi_walk_resources(handle, METHOD_NAME__CRS,
@@ -778,11 +779,13 @@ ec_parse_device(acpi_handle handle, u32/* Get GPE bit assignment (EC events). */ /* TODO: Add support for _GPE returning a package */ - status =acpi_evaluate_integer (handle,"_GPE" ,NULL , &ec->gpe); + status =acpi_evaluate_integer (handle,"_GPE" ,NULL , &tmp);if (ACPI_FAILURE (status))return status; + ec->gpe = tmp;/* Use the global lock for all EC transactions? */ -acpi_evaluate_integer (handle,"_GLK" ,NULL , &ec->global_lock); +acpi_evaluate_integer (handle,"_GLK" ,NULL , &tmp); + ec->global_lock = tmp; ec->handle = handle;return AE_CTRL_TERMINATE ; }
drivers/acpi/numa.c +1 -1
@@ -258,7 +258,7 @@ int __init acpi_numa_init(void)int acpi_get_pxm (acpi_handle h) { -unsigned long pxm; +unsigned long long pxm;acpi_status status;acpi_handle handle;acpi_handle phandle = h;
drivers/acpi/osl.c +2 -3
@@ -608,7 +608,7 @@ static void acpi_os_derive_pci_id_2(acpiacpi_handle handle;struct acpi_pci_id *pci_id = *id;acpi_status status; -unsigned long temp; +unsigned long long temp;acpi_object_type type;acpi_get_parent (chandle, &handle);
@@ -620,8 +620,7 @@ static void acpi_os_derive_pci_id_2(acpiif ((ACPI_FAILURE (status)) || (type !=ACPI_TYPE_DEVICE ))return ; - status = -acpi_evaluate_integer (handle,METHOD_NAME__ADR ,NULL , + status =acpi_evaluate_integer (handle,METHOD_NAME__ADR ,NULL , &temp);if (ACPI_SUCCESS (status)) {u32 val;
drivers/acpi/pci_root.c +1 -1
@@ -190,7 +190,7 @@ static int __devinit acpi_pci_root_add(sstruct acpi_pci_root *root =NULL ;struct acpi_pci_root *tmp;acpi_status status =AE_OK ; -unsigned long value =0 ; +unsigned long long value =0 ;acpi_handle handle =NULL ;struct acpi_device *child;
drivers/acpi/pci_slot.c +5 -5
@@ -76,10 +76,10 @@ static struct acpi_pci_driver acpi_pci_s };static int -check_slot (acpi_handle handle,unsigned long *sun) +check_slot (acpi_handle handle,unsigned long long *sun) {int device =-1 ; -unsigned long adr, sta; +unsigned long long adr, sta;acpi_status status;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };
@@ -132,7 +132,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) { int device; -unsigned long sun; +unsigned long long sun;char name[SLOT_NAME_SIZE ];struct acpi_pci_slot *slot;struct pci_slot *pci_slot;
@@ -182,7 +182,7 @@ static acpi_status walk_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) { int device, function; -unsigned long adr; +unsigned long long adr;acpi_status status;acpi_handle dummy_handle;acpi_walk_callback user_function;
@@ -239,7 +239,7 @@ static int walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function) { int seg, bus; -unsigned long tmp; +unsigned long long tmp;acpi_status status;acpi_handle dummy_handle;struct pci_bus *pci_bus;
drivers/acpi/power.c +1 -1
@@ -131,7 +131,7 @@ acpi_power_get_context(acpi_handle handlstatic int acpi_power_get_state (struct acpi_power_resource *resource,int *state) {acpi_status status =AE_OK ; -unsigned long sta =0 ; +unsigned long long sta =0 ;if (!resource || !state)
drivers/acpi/processor_core.c +2 -2
@@ -563,7 +563,7 @@ static int acpi_processor_get_info(struc/* Check if it is a Device with HID and UID */ if (has_uid) { -unsigned long value; +unsigned long long value; status =acpi_evaluate_integer (pr->handle,METHOD_NAME__UID ,NULL , &value);if (ACPI_FAILURE (status)) {
@@ -875,7 +875,7 @@ static int acpi_processor_remove(structstatic int is_processor_present (acpi_handle handle) {acpi_status status; -unsigned long sta =0 ; +unsigned long long sta =0 ; status =acpi_evaluate_integer (handle,"_STA" ,NULL , &sta);
drivers/acpi/processor_perflib.c +1 -1
@@ -126,7 +126,7 @@ static struct notifier_block acpi_ppc_nostatic int acpi_processor_get_platform_limit (struct acpi_processor *pr) {acpi_status status =0 ; -unsigned long ppc =0 ; +unsigned long long ppc =0 ;if (!pr)
drivers/acpi/processor_throttling.c +1 -1
@@ -274,7 +274,7 @@ static int acpi_processor_throttling_notstatic int acpi_processor_get_platform_limit (struct acpi_processor *pr) {acpi_status status =0 ; -unsigned long tpc =0 ; +unsigned long long tpc =0 ;if (!pr)return -EINVAL ;
drivers/acpi/sbshc.c +1 -1
@@ -258,7 +258,7 @@ extern int acpi_ec_add_query_handler(strstatic int acpi_smbus_hc_add (struct acpi_device *device) {int status; -unsigned long val; +unsigned long long val;struct acpi_smb_hc *hc;if (!device)
drivers/acpi/sleep/main.c +1 -1
@@ -492,7 +492,7 @@ int acpi_pm_device_sleep_state(struct deacpi_handle handle =DEVICE_ACPI_HANDLE (dev);struct acpi_device *adev;char acpi_method[] ="_SxD" ; -unsigned long d_min, d_max; +unsigned long long d_min, d_max;if (!handle ||ACPI_FAILURE (acpi_bus_get_device (handle, &adev))) {printk (KERN_DEBUG "ACPI handle has no context!\n" );
drivers/acpi/thermal.c +27 -16
135 lines not on this page · raw message
drivers/acpi/utils.c +2 -2
@@ -256,7 +256,7 @@ EXPORT_SYMBOL(acpi_extract_package);acpi_status acpi_evaluate_integer (acpi_handle handle,acpi_string pathname, -struct acpi_object_list *arguments,unsigned long *data) +struct acpi_object_list *arguments,unsigned long long *data) {acpi_status status =AE_OK ;union acpi_object *element;
@@ -288,7 +288,7 @@ acpi_evaluate_integer(acpi_handle handle *data = element->integer.value;kfree (element); -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Return value [%lu]\n" , *data)); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Return value [%llu]\n" , *data));return AE_OK ; }
drivers/acpi/video.c +21 -21
167 lines not on this page · raw message
drivers/ata/libata-acpi.c +1 -1
@@ -180,7 +180,7 @@ static void ata_acpi_handle_hotplug(struint wait =0 ;unsigned long flags;acpi_handle handle, tmphandle; -unsigned long sta; +unsigned long long sta;acpi_status status;if (dev) {
drivers/misc/asus-laptop.c +6 -6
@@ -280,7 +280,7 @@ static int write_acpi_int(acpi_handle hastatic int read_wireless_status (int mask) { -ulong status; +unsigned long long status;acpi_status rv =AE_OK ;if (!wireless_status_handle)
@@ -297,7 +297,7 @@ static int read_wireless_status(int maskstatic int read_gps_status (void ) { -ulong status; +unsigned long long status;acpi_status rv =AE_OK ; rv =acpi_evaluate_integer (gps_status_handle,NULL ,NULL , &status);
@@ -404,7 +404,7 @@ static void lcd_blank(int blank)static int read_brightness (struct backlight_device *bd) { -ulong value; +unsigned long long value;acpi_status rv =AE_OK ; rv =acpi_evaluate_integer (brightness_get_handle,NULL ,NULL , &value);
@@ -455,7 +455,7 @@ static ssize_t show_infos(struct device struct device_attribute *attr, char *page) { int len = 0; -ulong temp; +unsigned long long temp;char buf[16 ];//enough for all info acpi_status rv =AE_OK ;
@@ -603,7 +603,7 @@ static void set_display(int value)static int read_display (void ) { -ulong value =0 ; +unsigned long long value =0 ;acpi_status rv =AE_OK ;/* In most of the case, we know how to set the display, but sometime
@@ -849,7 +849,7 @@ static int asus_hotk_get_info(void) {struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };union acpi_object *model =NULL ; -ulong bsts_result, hwrs_result; +unsigned long long bsts_result, hwrs_result;char *string =NULL ;acpi_status status;
drivers/misc/eeepc-laptop.c +1 -1
@@ -204,7 +204,7 @@ static int write_acpi_int(acpi_handle hastatic int read_acpi_int (acpi_handle handle,const char *method,int *val) {acpi_status status; -ulong result; +unsigned long long result; status =acpi_evaluate_integer (handle, (char *)method,NULL , &result);if (ACPI_FAILURE (status)) {
drivers/misc/fujitsu-laptop.c +4 -4
@@ -224,7 +224,7 @@ static int set_lcd_level_alt(int level)static int get_lcd_level (void ) { -unsigned long state =0 ; +unsigned long long state =0 ;acpi_status status =AE_OK ;vdbg_printk (FUJLAPTOP_DBG_TRACE ,"get lcd level via GBLL\n" );
@@ -246,7 +246,7 @@ static int get_lcd_level(void)static int get_max_brightness (void ) { -unsigned long state =0 ; +unsigned long long state =0 ;acpi_status status =AE_OK ;vdbg_printk (FUJLAPTOP_DBG_TRACE ,"get max lcd level via RBLL\n" );
@@ -263,7 +263,7 @@ static int get_max_brightness(void)static int get_lcd_level_alt (void ) { -unsigned long state =0 ; +unsigned long long state =0 ;acpi_status status =AE_OK ;vdbg_printk (FUJLAPTOP_DBG_TRACE ,"get lcd level via GBLS\n" );
@@ -384,7 +384,7 @@ static ssize_t store_lcd_level(struct destatic int get_irb (void ) { -unsigned long state =0 ; +unsigned long long state =0 ;acpi_status status =AE_OK ;vdbg_printk (FUJLAPTOP_DBG_TRACE ,"Get irb\n" );
drivers/misc/intel_menlow.c +14 -13
@@ -57,7 +57,7 @@ static int memory_get_int_max_bandwidth( {struct acpi_device *device = cdev->devdata;acpi_handle handle = device->handle; -unsigned long value; +unsigned long long value;struct acpi_object_list arg_list;union acpi_object arg;acpi_status status =AE_OK ;
@@ -90,7 +90,7 @@ static int memory_get_cur_bandwidth(stru {struct acpi_device *device = cdev->devdata;acpi_handle handle = device->handle; -unsigned long value; +unsigned long long value;struct acpi_object_list arg_list;union acpi_object arg;acpi_status status =AE_OK ;
@@ -115,7 +115,7 @@ static int memory_set_cur_bandwidth(strustruct acpi_object_list arg_list;union acpi_object arg;acpi_status status; -int temp; +unsigned long long temp;unsigned long max_state;if (memory_get_int_max_bandwidth (cdev, &max_state))
@@ -131,7 +131,7 @@ static int memory_set_cur_bandwidth(stru status =acpi_evaluate_integer (handle,MEMORY_SET_BANDWIDTH , &arg_list, - (unsigned long *)&temp); + &temp);printk (KERN_INFO "Bandwidth value was %d: status is %d\n" , state, status);
@@ -252,7 +252,8 @@ static DEFINE_MUTEX(intel_menlow_attr_lo* @auxtype : AUX0/AUX1 * @buf: syfs buffer */ -static int sensor_get_auxtrip (acpi_handle handle,int index,int *value) +static int sensor_get_auxtrip (acpi_handle handle,int index, +unsigned long long *value) {acpi_status status;
@@ -260,7 +261,7 @@ static int sensor_get_auxtrip(acpi_handlreturn -EINVAL ; status =acpi_evaluate_integer (handle, index ?GET_AUX1 :GET_AUX0 , -NULL , (unsigned long *)value); +NULL , value);if (ACPI_FAILURE (status))return -EIO ;
@@ -282,13 +283,13 @@ static int sensor_set_auxtrip(acpi_handlstruct acpi_object_list args = {1 , &arg }; -int temp; +unsigned long long temp;if (index !=0 && index !=1 )return -EINVAL ; status =acpi_evaluate_integer (handle, index ?GET_AUX0 :GET_AUX1 , -NULL , (unsigned long *)&temp); +NULL , &temp);if (ACPI_FAILURE (status))return -EIO ;if ((index && value < temp) || (!index && value > temp))
@@ -296,7 +297,7 @@ static int sensor_set_auxtrip(acpi_handl arg.integer.value = value; status =acpi_evaluate_integer (handle, index ?SET_AUX1 :SET_AUX0 , - &args, (unsigned long *)&temp); + &args, &temp);if (ACPI_FAILURE (status))return -EIO ;
@@ -312,7 +313,7 @@ static ssize_t aux0_show(struct device * struct device_attribute *dev_attr, char *buf) { struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); -int value; +unsigned long long value;int result; result =sensor_get_auxtrip (attr->handle,0 , &value);
@@ -324,7 +325,7 @@ static ssize_t aux1_show(struct device * struct device_attribute *dev_attr, char *buf) { struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); -int value; +unsigned long long value;int result; result =sensor_get_auxtrip (attr->handle,1 , &value);
@@ -376,7 +377,7 @@ static ssize_t bios_enabled_show(struct struct device_attribute *attr, char *buf) { acpi_status status; -unsigned long bios_enabled; +unsigned long long bios_enabled; status =acpi_evaluate_integer (NULL ,BIOS_ENABLED ,NULL , &bios_enabled);if (ACPI_FAILURE (status))
@@ -492,7 +493,7 @@ static int __init intel_menlow_module_in {int result = -ENODEV ;acpi_status status; -unsigned long enable; +unsigned long long enable;if (acpi_disabled)return result;
drivers/pci/hotplug/acpiphp_glue.c +7 -7
@@ -180,7 +180,7 @@ register_slot(acpi_handle handle, u32 lvstruct acpiphp_func *newfunc;acpi_handle tmp;acpi_status status =AE_OK ; -unsigned long adr, sun; +unsigned long long adr, sun;int device, function, retval; status =acpi_evaluate_integer (handle,"_ADR" ,NULL , &adr);
@@ -528,7 +528,7 @@ find_p2p_bridge(acpi_handle handle, u32 {acpi_status status;acpi_handle dummy_handle; -unsigned long tmp; +unsigned long long tmp;int device, function;struct pci_dev *dev;struct pci_bus *pci_bus = context;
@@ -573,7 +573,7 @@ find_p2p_bridge(acpi_handle handle, u32static int add_bridge (acpi_handle handle) {acpi_status status; -unsigned long tmp; +unsigned long long tmp;int seg, bus;acpi_handle dummy_handle;struct pci_bus *pci_bus;
@@ -767,7 +767,7 @@ static int get_gsi_base(acpi_handle hand {acpi_status status;int result =-1 ; -unsigned long gsb; +unsigned long long gsb;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };union acpi_object *obj;void *table;
@@ -808,7 +808,7 @@ static acpi_status ioapic_add(acpi_handle handle, u32 lvl, void *context, void **rv) { acpi_status status; -unsigned long sta; +unsigned long long sta;acpi_handle tmp;struct pci_dev *pdev;u32 gsi_base;
@@ -872,7 +872,7 @@ static acpi_status ioapic_remove(acpi_handle handle, u32 lvl, void *context, void **rv) { acpi_status status; -unsigned long sta; +unsigned long long sta;acpi_handle tmp;u32 gsi_base;struct acpiphp_ioapic *pos, *n, *ioapic =NULL ;
@@ -1264,7 +1264,7 @@ static int disable_device(struct acpiphpstatic unsigned int get_slot_status (struct acpiphp_slot *slot) {acpi_status status; -unsigned long sta =0 ; +unsigned long long sta =0 ;u32 dvid;struct list_head *l;struct acpiphp_func *func;
drivers/pci/hotplug/acpiphp_ibm.c +1 -1
@@ -183,7 +183,7 @@ static int ibm_set_attention_status(struunion acpi_object args[2 ];struct acpi_object_list params = { .pointer = args, .count =2 };acpi_status stat; -unsigned long rc; +unsigned long long rc;union apci_descriptor *ibm_slot; ibm_slot =ibm_slot_from_id (hpslot_to_sun (slot));
drivers/pci/hotplug/sgi_hotplug.c +2 -2
@@ -413,7 +413,7 @@ static int enable_slot(struct hotplug_sl/* * Add the slot's devices to the ACPI infrastructure */ if (SN_ACPI_BASE_SUPPORT () && ssdt) { -unsigned long adr; +unsigned long long adr;struct acpi_device *pdevice;struct acpi_device *device;acpi_handle phandle;
@@ -505,7 +505,7 @@ static int disable_slot(struct hotplug_s/* free the ACPI resources for the slot */ if (SN_ACPI_BASE_SUPPORT () &&PCI_CONTROLLER (slot->pci_bus)->acpi_handle) { -unsigned long adr; +unsigned long long adr;struct acpi_device *device;acpi_handle phandle;acpi_handle chandle =NULL ;
include/acpi/acpi_bus.h +1 -1
@@ -46,7 +46,7 @@ acpi_extract_package(union acpi_object *acpi_status acpi_evaluate_integer (acpi_handle handle,acpi_string pathname, -struct acpi_object_list *arguments,unsigned long *data); +struct acpi_object_list *arguments,unsigned long long *data); acpi_status acpi_evaluate_reference(acpi_handle handle, acpi_string pathname,
PATCH 30/41 ACPI EC: Fix regression due to use of uninitialized variable
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Starikovskiy <[email protected]>
commit d21cf3c16b1191f3154a51e0b20c82bf851cc553 upstream.
breakage introduced by following patch
commit 27663c5855b10af9ec67bc7dfba001426ba21222
Author: Matthew Wilcox <[email protected]> Date: Fri Oct 10 02:22:59 2008 -0400
acpi_evaluate_integer() does not clear passed variable if there is an error at evaluation.
So if we ignore error, we must supply initialized variable.
http://bugzilla.kernel.org/show_bug.cgi?id=11917
--- drivers/acpi/ec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/ec.c +2 -1
@@ -769,7 +769,7 @@ static acpi_status ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) { acpi_status status; -unsigned long long tmp; +unsigned long long tmp =0 ;struct acpi_ec *ec = context; status = acpi_walk_resources(handle, METHOD_NAME__CRS,
@@ -784,6 +784,7 @@ ec_parse_device(acpi_handle handle, u32return status; ec->gpe = tmp;/* Use the global lock for all EC transactions? */ + tmp =0 ;acpi_evaluate_integer (handle,"_GLK" ,NULL , &tmp); ec->global_lock = tmp; ec->handle = handle;
PATCH 29/41 ACPI: Fix compiler warnings introduced by 32 to 64 bit acpi conversions
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Renninger <[email protected]>
commit: 27663c5855b10af9ec67bc7dfba001426ba21222 forgot to convert things at two prints.
--- drivers/misc/intel_menlow.c | 2 +- drivers/pci/hotplug/acpiphp_ibm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/intel_menlow.c +1 -1
@@ -104,7 +104,7 @@ static int memory_get_cur_bandwidth(struif (ACPI_FAILURE (status))return -EFAULT ; -return sprintf (buf,"%ld\n" , value); +return sprintf (buf,"%lld\n" , value); } static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
drivers/pci/hotplug/acpiphp_ibm.c +1 -1
@@ -204,7 +204,7 @@ static int ibm_set_attention_status(struerr ("APLS evaluation failed: 0x%08x\n" , stat);return -ENODEV ; }else if (!rc) { -err ("APLS method failed: 0x%08lx\n" , rc); +err ("APLS method failed: 0x%08llx\n" , rc);return -ERANGE ; }return 0 ;
PATCH 31/41 ACPICA: Fix wrong resource descriptor length for 64-bit build
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Moore <[email protected]>
commit 9db4fcd99f7ef886ded97cd26a8642c70fbe34df upstream.
The "minimal" descriptors such as EndTag are calculated as 12 bytes long, but the actual length in the internal descriptor is 16 because of the round-up to 8 on 64-bit build.
http://www.acpica.org/bugzilla/show_bug.cgi?id=728
--- include/acpi/actypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/actypes.h +1 -1
@@ -1225,8 +1225,8 @@ struct acpi_resource {#pragma pack() -#define ACPI_RS_SIZE_MIN 12#define ACPI_RS_SIZE_NO_DATA 8/* Id + Length fields */ +#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)#define ACPI_RS_SIZE (type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))#define ACPI_NEXT_RESOURCE (res) (struct acpi_resource *)((u8 *) res + res->length)
PATCH 32/41 asus-laptop: Add support for P30/P35
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Torsten Krah <[email protected]>
commit 4d0b856ef7eea5c03f4c1fa57793286ac068f4cd upstream.
Add support for P30/P35.
http://bugzilla.kernel.org/show_bug.cgi?id=10848
--- drivers/misc/asus-laptop.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/asus-laptop.c +1 -0
@@ -139,6 +139,7 @@ ASUS_HANDLE(lcd_switch, "\\_SB.PCI0.SBRG"\\_SB.PCI0.PX40.ECD0._Q10" ,/* L3C */ "\\_SB.PCI0.PX40.EC0.Q10" ,/* M1A */ "\\_SB.PCI0.LPCB.EC0._Q10" ,/* P30 */ +"\\_SB.PCI0.LPCB.EC0._Q0E" ,/* P30/P35 */ "\\_SB.PCI0.PX40.Q10" ,/* S1x */ "\\Q10"); /* A2x, L2D, L3D, M2E */
PATCH 33/41 asus-laptop: Fix the led behavior with value > 1
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Corentin Chary <[email protected]>
commit e3deda9c87ac5eef2b5d18cd0b5511370979ca26 upstream.
Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 .
--- drivers/misc/asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/asus-laptop.c +1 -1
@@ -351,7 +351,7 @@ static void write_status(acpi_handle han static void object##_led_set(struct led_classdev *led_cdev, \enum led_brightness value) \ { \ - object##_led_wk = value; \ + object##_led_wk = (value > 0) ? 1 : 0; \ queue_work(led_workqueue, &object##_led_work); \ } \ static void object##_led_update(struct work_struct *ignored) \
PATCH 34/41 video: always update the brightness when poking "brightness"
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhang Rui <[email protected]>
commit 9e6dada9d255497127251c03aaa59296d186f959 upstream.
always update props.brightness no matter the backlight is changed via procfs, hotkeys or sysfs.
--- drivers/acpi/video.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/acpi/video.c +5 -0
@@ -482,6 +482,7 @@ acpi_video_device_lcd_set_level(struct aint status =AE_OK ;union acpi_object arg0 = {ACPI_TYPE_INTEGER };struct acpi_object_list args = {1 , &arg0 }; +int state; arg0.integer.value = level;
@@ -490,6 +491,10 @@ acpi_video_device_lcd_set_level(struct a status =acpi_evaluate_object (device->dev->handle,"_BCM" , &args,NULL ); device->brightness->curr = level; +for (state =2 ; state < device->brightness->count; state++) +if (level == device->brightness->levels[state]) + device->backlight->props.brightness = state -2 ; +return status; }
PATCH 35/41 dont load asus-acpi if model is not supported
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Zhang Rui <[email protected]>
commit 7745384080ef70f7710530afa3e45477b126e056 upstream.
asus_hotk_get_info should return -ENODEV if the model is not supported.
http://bugzilla.kernel.org/show_bug.cgi?id=10389
--- drivers/acpi/asus_acpi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/asus_acpi.c +2 -0
@@ -1244,6 +1244,8 @@ static int asus_hotk_get_info(void) "default values\n", string);printk (KERN_NOTICE " send /proc/acpi/dsdt to the developers\n" ); +kfree (model); +return -ENODEV ; } hotk->methods = &model_conf[hotk->model];return AE_OK ;
PATCH 36/41 Newly inserted battery might differ from one just removed, so
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Starikovskiy <[email protected]>
commit 50b178512b7d6e7724f87459f6bd06504c9c2da1 upstream.
--- drivers/acpi/battery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/battery.c +3 -2
@@ -472,7 +472,7 @@ static void sysfs_remove_battery(structstatic int acpi_battery_update (struct acpi_battery *battery) { -int result; +int result, old_present =acpi_battery_present (battery); result =acpi_battery_get_status (battery);if (result)return result;
@@ -483,7 +483,8 @@ static int acpi_battery_update(struct ac return 0; }#endif -if (!battery->update_time) { +if (!battery->update_time || + old_present !=acpi_battery_present (battery)) { result =acpi_battery_get_info (battery);if (result)return result;
PATCH 37/41 ACPI: Do not modify SCI_EN directly
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 11e93130c7ce5228d484fd5e86f3984835d4256b upstream.
According to the ACPI specification the SCI_EN flag is controlled by the hardware, which sets this flag to inform the kernel that ACPI is enabled. For this reason, we shouldn't try to modify SCI_EN directly. Also, we don't need to do it in irqrouter_resume(), since lower-level resume code takes care of enabling ACPI in case it hasn't been enabled by the BIOS before passing control to the kernel (which by the way is against the ACPI specification).
--- drivers/acpi/pci_link.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/acpi/pci_link.c +0 -4
@@ -796,10 +796,6 @@ static int irqrouter_resume(struct sys_dstruct list_head *node =NULL ;struct acpi_pci_link *link =NULL ; - -/* Make sure SCI is enabled again (Apple firmware bug?) */ -acpi_set_register (ACPI_BITREG_SCI_ENABLE ,1 ); -list_for_each (node, &acpi_link.entries) { link = list_entry(node, struct acpi_pci_link, node);if (!link) {
PATCH 38/41 ACPI suspend: Blacklist HP xw4600 Workstation for old code ordering
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 4fb507b6b764195bb7821cf2baa988f6eb677d30
HP xw4600 Workstation is known to require the "old" (ie. compatible with ACPI 1.0) suspend code ordering, so blacklist it for this purpose.
--- drivers/acpi/sleep/main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/sleep/main.c +8 -0
@@ -344,6 +344,14 @@ static struct dmi_system_id __initdata a DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), }, }, + { + .callback = init_old_suspend_ordering, + .ident = "HP xw4600 Workstation", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), + DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), + }, + }, {}, };#endif /* CONFIG_SUSPEND */
PATCH 40/41 sata_mv: Fix chip type for Hightpoint RocketRaid 1740/1742
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Lord <[email protected]>
commit 4462254ac6be9150aae87d54d388fc348d6fcead upstream.
Fix chip type for the Highpoint RocketRAID 1740 and 1742 PCI cards. These really do have Marvell 6042 chips on them, rather than the 5081 chip.
Confirmed by multiple (two) users (for the 1740), and by examining the product photographs from Highpoint's web site.
--- drivers/ata/sata_mv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/sata_mv.c +2 -2
@@ -669,8 +669,8 @@ static const struct pci_device_id mv_pci { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },/* RocketRAID 1720/174x have different identifiers */ { PCI_VDEVICE(TTI, 0x1720), chip_6042 }, - { PCI_VDEVICE(TTI, 0x1740), chip_508x }, - { PCI_VDEVICE(TTI, 0x1742), chip_508x }, + { PCI_VDEVICE(TTI, 0x1740), chip_6042 }, + { PCI_VDEVICE(TTI, 0x1742), chip_6042 }, { PCI_VDEVICE(MARVELL, 0x6040), chip_604x }, { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
PATCH 39/41 dlm: initialize file_lock struct in GETLK before copying conflicting lock
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit 20d5a39929232a715f29e6cb7e3f0d0c790f41eb upstream.
dlm_posix_get fills out the relevant fields in the file_lock before returning when there is a lock conflict, but doesn't clean out any of the other fields in the file_lock.
When nfsd does a NFSv4 lockt call, it sets the fl_lmops to nfsd_posix_mng_ops before calling the lower fs. When the lock comes back after testing a lock on GFS2, it still has that field set. This confuses nfsd into thinking that the file_lock is a nfsd4 lock.
Fix this by making DLM reinitialize the file_lock before copying the fields from the conflicting lock.
--- fs/dlm/plock.c | 2 ++ 1 file changed, 2 insertions(+)
fs/dlm/plock.c +2 -0
@@ -304,7 +304,9 @@ int dlm_posix_get(dlm_lockspace_t *locksif (rv == -ENOENT ) rv =0 ;else if (rv >0 ) { +locks_init_lock (fl); fl->fl_type = (op->info.ex) ?F_WRLCK :F_RDLCK ; + fl->fl_flags =FL_POSIX ; fl->fl_pid = op->info.pid; fl->fl_start = op->info.start; fl->fl_end = op->info.end;
PATCH 41/41 ACPICA: Allow multiple backslash prefix in namepaths
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lin Ming <[email protected]>
commit d037c5fd7367548191eab2b376a1d08c4ffaf7ff upstream.
In a fully qualified namepath, allow multiple backslash prefixes. This can happen because of the use of a double-backslash in strings (since backslash is the escape character) causing confusion. ACPICA BZ 739 Lin Ming.
http://www.acpica.org/bugzilla/show_bug.cgi?id=739
--- drivers/acpi/namespace/nsutils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/acpi/namespace/nsutils.c +7 -1
@@ -314,9 +314,15 @@ void acpi_ns_get_internal_name_length(st* * strlen() + 1 covers the first name_seg, which has no path separator */ -if (acpi_ns_valid_root_prefix (next_external_char[0 ])) { +if (acpi_ns_valid_root_prefix (*next_external_char)) { info->fully_qualified = TRUE; next_external_char++; + +/* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */ + +while (acpi_ns_valid_root_prefix (*next_external_char)) { + next_external_char++; + } }else {/* * Handle Carat prefixes
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
In reply to Greg KHQuoted 3 lines · Greg KH
plain text document attachment (fbdev-atyfb-fix-dsp-config-on-some-powermacs-powerbooks.patch) 2.6.27-stable review patch. If anyone has any objections, please let us know.
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
Cheers,
Ben.
Quoted 59 lines
------------------
From: Risto Suominen <[email protected]>
commit
7fbb7cadd062baf299fd8b26a80ea99da0c3fe01upstream.Since the complete re-write in 2.6.10, some PowerMacs (At least PowerMac 5500 and PowerMac G3 Beige rev A) with ATI Mach64 chip have suffered from unstable columns in their framebuffer image. This seems to depend on a value (4) read from
PLL_EXT_CNTLregister, which leads to incorrect DSP config parameters to be written to the chip. This patch uses a value calculated byaty_init_pll_ctinstead, as a starting point.There are questions as to whether this should be extended to other platforms or maybe made dependent on specific chip types, but in the meantime, this has been tested on various powermacs and works for them so let's commit it.
Signed-off-by Risto Suominen <[email protected]>Tested-by Michael Pettersson <[email protected]>Signed-off-by Benjamin Herrenschmidt <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/video/aty/mach64_ct.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/video/aty/mach64_ct.c +11
-1@@ -8,6 +8,9 @@#include <asm/io.h> #include <video/mach64.h> #include "atyfb.h" +#ifdef CONFIG_PPC +#include <asm/machdep.h> +#endif #undef DEBUG@@ -536,6 +539,14 @@ static int __devinit aty_init_pll_ct(con pll->ct.xclk_post_div_real = postdividers[xpost_div]; pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real /8 ; +#ifdef CONFIG_PPC +if (machine_is (powermac)) { +/* Override PLL_EXT_CNTL & 0x07. */ + pll->ct.xclk_post_div = xpost_div; + pll->ct.xclk_ref_div =1 ; + } +#endif +#ifdef DEBUG pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) / (par->ref_clk_per * pll->ct.pll_ref_div); --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 3 lines · Greg KH
plain text document attachment (fbdev-atyfb-fix-dsp-config-on-some-powermacs-powerbooks.patch) 2.6.27-stable review patch. If anyone has any objections, please let us know.
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
But this patch is already in Linus's tree, so why would you worry about this?
thanks,
greg k-h
Re: [patch 30/41] ACPI EC: Fix regression due to use of uninitialized variable
In reply to Greg KHHi,
Quoted 2 lines · On Wednesday 04 February 2009 19:46:48 Greg KH wrote:
2.6.27-stable review patch. If anyone has any objections, please let us know.
Does this one patch cleanly in 2.6.27-stable?
I had it on my list, but this seem to have been introduced after 2.6.27 and I thought I removed this one again?
Or this is a follow up of another fix that should go in?
Thomas
Quoted 46 lines
------------------
From: Alexey Starikovskiy <[email protected]>
commit
d21cf3c16b1191f3154a51e0b20c82bf851cc553upstream.breakage introduced by following patch
commit27663c5855b10af9ec67bc7dfba001426ba21222Author: Matthew Wilcox <[email protected]> Date: Fri Oct 10 02:22:59 2008 -0400
acpi_evaluate_integer()does not clear passed variable if there is an error at evaluation.
So if we ignore error, we must supply initialized variable.http://bugzilla.kernel.org/show_bug.cgi?id=11917
Signed-off-by Alexey Starikovskiy <[email protected]>Tested-by Alan Jenkins <[email protected]>Signed-off-by Len Brown <[email protected]>Cc Thomas Renninger <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/acpi/ec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/acpi/ec.c +2
-1@@ -769,7 +769,7 @@ static acpi_status ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) { acpi_status status; -unsigned long long tmp; +unsigned long long tmp =0 ;struct acpi_ec *ec = context; status = acpi_walk_resources(handle, METHOD_NAME__CRS,@@ -784,6 +784,7 @@ ec_parse_device(acpi_handle handle, u32return status; ec->gpe = tmp;/* Use the global lock for all EC transactions? */ + tmp =0 ;acpi_evaluate_integer (handle,"_GLK" ,NULL , &tmp); ec->global_lock = tmp; ec->handle = handle;
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
In reply to Greg KHQuoted 6 lines · Greg KH
Quoted 5 lines · Benjamin Herrenschmidt
Quoted 3 lines · Greg KH
plain text document attachment (fbdev-atyfb-fix-dsp-config-on-some-powermacs-powerbooks.patch) 2.6.27-stable review patch. If anyone has any objections, please let us know.
Quoted 8 lines
Quoted 5 lines
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
But this patch is already in Linus's tree, so why would you worry about this?
Oh I always worry about things I can't test ;-) Just felt like increasing the chances of finding the one or two users still with that specific machine model :-)
Cheers,
Ben.
Re: [patch 30/41] ACPI EC: Fix regression due to use of uninitialized variable
In reply to Thomas RenningerQuoted 9 lines · On Thursday 05 February 2009 09:08:42 Thomas Renninger wrote:
Hi,
Quoted 2 lines · On Wednesday 04 February 2009 19:46:48 Greg KH wrote:
2.6.27-stable review patch. If anyone has any objections, please let us know.
Does this one patch cleanly in 2.6.27-stable?
I had it on my list, but this seem to have been introduced after 2.6.27 and I thought I removed this one again?
Or this is a follow up of another fix that should go in?
Yes this got in by another patch.
The huge "make ACPI integer 64 bit aware" one. Which looked like it could fix really nasty bugs and is safe due to only long to long long conversions. But maybe this wasn't such a good idea, as exported kernel functions change from long to long long...
Thomas
Quoted 51 lines
Thomas
Quoted 46 lines
------------------
From: Alexey Starikovskiy <[email protected]>
commit
d21cf3c16b1191f3154a51e0b20c82bf851cc553upstream.breakage introduced by following patch
commit27663c5855b10af9ec67bc7dfba001426ba21222Author: Matthew Wilcox <[email protected]> Date: Fri Oct 10 02:22:59 2008 -0400
acpi_evaluate_integer()does not clear passed variable if there is an error at evaluation.
So if we ignore error, we must supply initialized variable.http://bugzilla.kernel.org/show_bug.cgi?id=11917
Signed-off-by Alexey Starikovskiy <[email protected]>Tested-by Alan Jenkins <[email protected]>Signed-off-by Len Brown <[email protected]>Cc Thomas Renninger <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/acpi/ec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/acpi/ec.c +2
-1@@ -769,7 +769,7 @@ static acpi_status ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) { acpi_status status; -unsigned long long tmp; +unsigned long long tmp =0 ;struct acpi_ec *ec = context; status = acpi_walk_resources(handle, METHOD_NAME__CRS,@@ -784,6 +784,7 @@ ec_parse_device(acpi_handle handle, u32return status; ec->gpe = tmp;/* Use the global lock for all EC transactions? */ + tmp =0 ;acpi_evaluate_integer (handle,"_GLK" ,NULL , &tmp); ec->global_lock = tmp; ec->handle = handle;
Re: [patch 30/41] ACPI EC: Fix regression due to use of uninitialized variable
In reply to Thomas RenningerQuoted 6 lines · Thomas Renninger
Hi,
Quoted 2 lines · On Wednesday 04 February 2009 19:46:48 Greg KH wrote:
2.6.27-stable review patch. If anyone has any objections, please let us know.
Does this one patch cleanly in 2.6.27-stable?
Yes it did.
thanks,
greg k-h
Re: [patch 30/41] ACPI EC: Fix regression due to use of uninitialized variable
In reply to Thomas RenningerQuoted 10 lines · Thomas Renninger
Quoted 9 lines · On Thursday 05 February 2009 09:08:42 Thomas Renninger wrote:
Hi,
Quoted 2 lines · On Wednesday 04 February 2009 19:46:48 Greg KH wrote:
2.6.27-stable review patch. If anyone has any objections, please let us know.
Does this one patch cleanly in 2.6.27-stable?
I had it on my list, but this seem to have been introduced after 2.6.27 and I thought I removed this one again?
Or this is a follow up of another fix that should go in?
Quoted 5 lines
Yes this got in by another patch.
The huge "make ACPI integer 64 bit aware" one. Which looked like it could fix really nasty bugs and is safe due to only long to long long conversions. But maybe this wasn't such a good idea, as exported kernel functions change from long to long long...
That's ok, there is no "stable abi" requirement for the -stable releases.
thanks,
greg k-h
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
In reply to Benjamin HerrenschmidtQuoted 5 lines · Benjamin Herrenschmidt
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
I think I have one in the shed. That's a PowerBook1,1?
Signature · 1 line
dwmw2
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
2009/2/6 David Woodhouse <[email protected]>:
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 5 lines
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
I think I have one in the shed. That's a PowerBook1,1?
I think it should be either PowerBook2,1 or 2,2.
Risto
Re: [patch 07/41] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks
In reply to David WoodhouseQuoted 8 lines · David Woodhouse
Quoted 5 lines · Benjamin Herrenschmidt
My only possible worry with that one is the first generation clamshell iBook which uses a Mobility M1 chip, for which we haven't had anybody testing whether this would break it or not ...
So if anybody with such a machine is reading this, please holler...
I think I have one in the shed. That's a PowerBook1,1?
Nah, I think that's the lombard (black) ... well, iirc, I don't remember 100%, though I can try to find out.
Ben.
Re: [patch 33/41] asus-laptop: Fix the led behavior with value > 1
In reply to Greg KHQuoted 22 lines · Greg KH
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Corentin Chary <[email protected]>
commit
e3deda9c87ac5eef2b5d18cd0b5511370979ca26upstream.Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 .
Signed-off-by Corentin Chary <[email protected]>Signed-off-by Len Brown <[email protected]>Cc Thomas Renninger <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/misc/asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/asus-laptop.c static void write_status(acpi_handle han · line 354
Quoted 5 lines
drivers/misc/asus-laptop.c +1
-1@@ -351,7 +351,7 @@ static void write_status(acpi_handle han static void object##_led_set(struct led_classdev *led_cdev, \enum led_brightness value) \ { \ - object##_led_wk = value; \ + object##_led_wk = (value > 0) ? 1 : 0; \
"= !!value" is standard way to do that.... for unsigned value.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [patch 33/41] asus-laptop: Fix the led behavior with value > 1
Quoted 20 lines · Pavel Machek
Quoted 19 lines · Greg KH
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Corentin Chary <[email protected]>
commit
e3deda9c87ac5eef2b5d18cd0b5511370979ca26upstream.Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 .
Signed-off-by Corentin Chary <[email protected]>Signed-off-by Len Brown <[email protected]>Cc Thomas Renninger <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/misc/asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines
drivers/misc/asus-laptop.c static void write_status(acpi_handle han · line 354
Quoted 8 lines
drivers/misc/asus-laptop.c +1
-1@@ -351,7 +351,7 @@ static void write_status(acpi_handle han static void object##_led_set(struct led_classdev *led_cdev, \enum led_brightness value) \ { \ - object##_led_wk = value; \ + object##_led_wk = (value > 0) ? 1 : 0; \"= !!value" is standard way to do that.... for unsigned value.
No dispute here, but that's what is upstream :)
thanks,
greg k-h
Re: [patch 33/41] asus-laptop: Fix the led behavior with value > 1
Quoted 27 lines
Quoted 16 lines
Quoted 16 lines
From: Corentin Chary <[email protected]>
commit
e3deda9c87ac5eef2b5d18cd0b5511370979ca26upstream.Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 .
Signed-off-by Corentin Chary <[email protected]>Signed-off-by Len Brown <[email protected]>Cc Thomas Renninger <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/misc/asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 10 lines
drivers/misc/asus-laptop.c static void write_status(acpi_handle han · line 354
Quoted 8 lines
drivers/misc/asus-laptop.c +1
-1@@ -351,7 +351,7 @@ static void write_status(acpi_handle han static void object##_led_set(struct led_classdev *led_cdev, \enum led_brightness value) \ { \ - object##_led_wk = value; \ + object##_led_wk = (value > 0) ? 1 : 0; \"= !!value" is standard way to do that.... for unsigned value.
Quoted 1 line
No dispute here, but that's what is upstream :)
No dispute there, I just hope original author fixes it in the upstream on one sunny day :).
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [patch 33/41] asus-laptop: Fix the led behavior with value > 1
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
"= !!value" is standard way to do that.... for unsigned value.
No dispute here, but that's what is upstream :)
No dispute there, I just hope original author fixes it in the upstream on one sunny day :).
I'll fix that, but currently it's rainning =)
Signature · 2 lines
Corentin Chary http://xf.iksaif.net