2.6.33.7-rc1 stable review
Subsystems (78)
cover 2.6.33.7-rc1 stable review
Note, this is the LAST .33 -stable release.
This is the start of the stable review cycle for the 2.6.33.7 release. There are 140 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.
Responses should be made by August 1, 2010, 18: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.33.7-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/kernel/kprobes-decode.c | 5 +- arch/arm/mach-omap2/board-rx51-peripherals.c | 17 ++- arch/arm/mach-realview/Kconfig | 2 + arch/arm/mach-realview/include/mach/barriers.h | 8 + arch/ia64/mm/tlb.c | 2 +- arch/mips/include/asm/mipsregs.h | 9 +- arch/mips/math-emu/cp1emu.c | 15 ++- arch/powerpc/include/asm/cpm.h | 24 ++++ arch/powerpc/kernel/irq.c | 5 +- arch/powerpc/sysdev/micropatch.c | 12 ++- arch/sparc/include/asm/stat.h | 4 +- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/suspend_32.h | 2 + arch/x86/include/asm/suspend_64.h | 2 + arch/x86/include/asm/system.h | 2 +- arch/x86/kernel/acpi/cstate.c | 9 ++ arch/x86/kernel/acpi/sleep.c | 2 - arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/hpet.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 17 ++- arch/x86/kernel/traps.c | 11 ++- arch/x86/kvm/mmu.c | 5 + arch/x86/kvm/svm.c | 96 ++++++++++++++- arch/x86/power/cpu.c | 4 + block/cfq-iosched.c | 13 ++- drivers/acpi/processor_idle.c | 2 +- drivers/acpi/sleep.c | 157 +---------------------- drivers/ata/ahci.c | 10 ++ drivers/ata/ata_generic.c | 6 + drivers/base/firmware_class.c | 26 +++- drivers/char/agp/amd64-agp.c | 27 ++-- drivers/char/tpm/tpm.h | 1 + drivers/char/tpm/tpm_tis.c | 9 +- drivers/cpufreq/cpufreq.c | 11 +-- drivers/edac/Kconfig | 2 +- drivers/edac/amd64_edac.c | 24 ++-- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/i915/i915_gem.c | 13 ++- drivers/gpu/drm/i915/i915_reg.h | 64 +++++++++ drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/radeon/r100.c | 61 +++++---- drivers/gpu/drm/radeon/r200.c | 5 + drivers/gpu/drm/radeon/r300.c | 5 + drivers/gpu/drm/radeon/radeon_atombios.c | 20 +++- drivers/gpu/drm/radeon/radeon_connectors.c | 27 ++-- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + drivers/gpu/drm/radeon/radeon_legacy_tv.c | 4 +- drivers/hwmon/coretemp.c | 32 +++++- drivers/hwmon/it87.c | 22 +++ drivers/hwmon/k10temp.c | 14 ++- drivers/hwmon/k8temp.c | 12 +- drivers/ide/cmd640.c | 6 +- drivers/ide/ide-taskfile.c | 6 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +- drivers/input/keyboard/twl4030_keypad.c | 17 ++- drivers/input/serio/i8042-x86ia64io.h | 7 + drivers/md/raid10.c | 12 +- drivers/media/dvb/dvb-core/dvb_net.c | 12 ++- drivers/media/dvb/ttpci/Kconfig | 5 +- drivers/media/video/cx23885/cx23885-i2c.c | 12 ++- drivers/media/video/cx88/cx88-i2c.c | 16 ++- drivers/media/video/uvc/uvc_driver.c | 30 ++++- drivers/media/video/uvc/uvcvideo.h | 7 +- drivers/mmc/host/sdhci-s3c.c | 20 +++ drivers/net/3c503.c | 42 +++++-- drivers/net/cpmac.c | 3 +- drivers/net/cxgb3/ael1002.c | 2 +- drivers/net/dm9000.c | 38 ++++-- drivers/net/forcedeth.c | 2 +- drivers/net/r8169.c | 11 ++ drivers/net/sky2.c | 19 ++- drivers/net/usb/pegasus.h | 2 +- drivers/net/veth.c | 1 - drivers/net/wireless/ath/ath5k/attach.c | 1 + drivers/net/wireless/ath/ath5k/base.c | 7 +- drivers/net/wireless/ath/ath9k/initvals.h | 8 +- drivers/net/wireless/hostap/hostap_cs.c | 15 ++- drivers/net/wireless/hostap/hostap_hw.c | 13 ++ drivers/net/wireless/hostap/hostap_wlan.h | 2 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 1 + drivers/net/wireless/iwlwifi/iwl-tx.c | 5 + drivers/net/wireless/libertas/if_sdio.c | 22 +++ drivers/net/wireless/p54/p54pci.c | 2 + drivers/rtc/rtc-ds1307.c | 4 +- drivers/scsi/aacraid/commctrl.c | 4 +- drivers/serial/cpm_uart/cpm_uart_core.c | 143 ++++++++++++--------- drivers/spi/spi_mpc8xxx.c | 22 --- drivers/ssb/driver_chipcommon.c | 3 + drivers/ssb/driver_chipcommon_pmu.c | 17 +-- drivers/ssb/pci.c | 46 ++++++- drivers/ssb/sprom.c | 15 ++ drivers/staging/rtl8192su/r8192U_core.c | 1 + drivers/usb/core/driver.c | 15 +-- drivers/usb/core/quirks.c | 7 + drivers/usb/gadget/u_serial.c | 16 +-- drivers/usb/host/ehci-mxc.c | 13 ++- drivers/usb/misc/sisusbvga/sisusb.c | 5 +- drivers/usb/serial/ftdi_sio.c | 9 ++ drivers/usb/serial/ftdi_sio_ids.h | 15 ++ drivers/usb/serial/option.c | 4 + drivers/usb/serial/sierra.c | 1 + fs/btrfs/ioctl.c | 4 +- fs/cifs/cifsfs.c | 6 +- fs/cifs/dns_resolve.c | 69 ++++++++++ fs/cifs/dns_resolve.h | 4 +- fs/cifs/inode.c | 4 + fs/cifs/sess.c | 10 +-- fs/ecryptfs/messaging.c | 17 ++- fs/nfs/nfs4xdr.c | 4 +- fs/nfs/super.c | 22 +++- include/acpi/processor.h | 3 +- include/linux/acpi.h | 1 - include/linux/ethtool.h | 2 + include/linux/fb.h | 4 +- include/linux/firmware.h | 1 + include/linux/ieee80211.h | 2 + include/linux/mmc/sdio.h | 2 + include/linux/pci_ids.h | 1 + include/linux/ssb/ssb.h | 1 + include/linux/ssb/ssb_driver_chipcommon.h | 2 + include/linux/ssb/ssb_regs.h | 3 +- include/math-emu/op-common.h | 2 +- include/net/sock.h | 7 +- kernel/futex.c | 17 +-- kernel/irq/manage.c | 3 + kernel/module.c | 4 +- kernel/sched.c | 9 +- net/bridge/br_fdb.c | 6 +- net/core/dev.c | 17 +-- net/core/ethtool.c | 43 +++++-- net/core/neighbour.c | 5 +- net/core/skbuff.c | 1 + net/dccp/input.c | 6 +- net/ipv4/arp.c | 6 +- net/ipv4/syncookies.c | 2 +- net/ipv4/tcp_output.c | 12 +- net/ipv6/af_inet6.c | 2 +- net/ipv6/ndisc.c | 2 +- net/ipv6/netfilter/ip6t_REJECT.c | 6 +- net/llc/llc_sap.c | 2 +- net/mac80211/mlme.c | 17 ++- net/mac80211/rx.c | 5 + net/mac80211/scan.c | 21 ++-- net/netfilter/ipvs/ip_vs_conn.c | 4 + net/sunrpc/xprtsock.c | 38 +++--- scripts/mod/modpost.c | 2 +- sound/pci/echoaudio/echoaudio.c | 4 +- sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/wm8776.c | 1 - tools/perf/util/callchain.h | 3 + virt/kvm/ioapic.c | 3 +- 152 files changed, 1298 insertions(+), 638 deletions(-)
PATCH 1/140 bridge: fdb cleanup runs too often
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: stephen hemminger <[email protected]>
[ Upstream commit 25442e06d20aaba7d7b16438078a562b3e4cf19b ]
It is common in end-node, non STP bridges to set forwarding delay to zero; which causes the forwarding database cleanup to run every clock tick. Change to run only as soon as needed or at next ageing timer interval which ever is sooner.
Use round_jiffies_up macro rather than attempting round up by changing value.
--- net/bridge/br_fdb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/bridge/br_fdb.c +2 -4
@@ -127,7 +127,7 @@ void br_fdb_cleanup(unsigned long _data) {struct net_bridge *br = (struct net_bridge *)_data;unsigned long delay =hold_time (br); -unsigned long next_timer = jiffies + br->forward_delay; +unsigned long next_timer = jiffies + br->ageing_time;int i;spin_lock_bh (&br->hash_lock);
@@ -148,9 +148,7 @@ void br_fdb_cleanup(unsigned long _data) }spin_unlock_bh (&br->hash_lock); -/* Add HZ/4 to ensure we round the jiffies upwards to be after the next -* timer, otherwise we might round down and will have no-op run. */ -mod_timer (&br->gc_timer,round_jiffies (next_timer +HZ /4 )); +mod_timer (&br->gc_timer,round_jiffies_up (next_timer)); }/* Completely flush all dynamic entries in forwarding database.*/
PATCH 2/140 net/dccp: expansion of error code size
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yoichi Yuasa <[email protected]>
[ Upstream commit d9b52dc6fd1fbb2bad645cbc86a60f984c1cb179 ]
Because MIPS's EDQUOT value is 1133(0x46d). It's larger than u8.
--- net/dccp/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/dccp/input.c +3 -3
@@ -123,9 +123,9 @@ static int dccp_rcv_closereq(struct sockreturn queued; } -static u8 dccp_reset_code_convert (const u8 code) +static u16 dccp_reset_code_convert (const u8 code) { -const u8 error_code[] = { +const u16 error_code[] = { [DCCP_RESET_CODE_CLOSED ] =0 ,/* normal termination */ [DCCP_RESET_CODE_UNSPECIFIED ] =0 ,/* nothing known */ [DCCP_RESET_CODE_ABORTED ] =ECONNRESET ,
@@ -147,7 +147,7 @@ static u8 dccp_reset_code_convert(conststatic void dccp_rcv_reset (struct sock *sk,struct sk_buff *skb) { -u8 err =dccp_reset_code_convert (dccp_hdr_reset (skb)->dccph_reset_code); +u16 err =dccp_reset_code_convert (dccp_hdr_reset (skb)->dccph_reset_code); sk->sk_err = err;
PATCH 3/140 gro: Fix bogus gso_size on the first fraglist entry
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 622e0ca1cd4d459f5af4f2c65f4dc0dd823cb4c3 ]
When GRO produces fraglist entries, and the resulting skb hits an interface that is incapable of TSO but capable of FRAGLIST, we end up producing a bogus packet with gso_size non-zero.
This was reported in the field with older versions of KVM that did not set the TSO bits on tuntap.
This patch fixes that.
--- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+)
net/core/skbuff.c +1 -0
@@ -2729,6 +2729,7 @@ int skb_gro_receive(struct sk_buff **hea *NAPI_GRO_CB (nskb) = *NAPI_GRO_CB (p);skb_shinfo (nskb)->frag_list = p;skb_shinfo (nskb)->gso_size = pinfo->gso_size; + pinfo->gso_size =0 ;skb_header_release (p); nskb->prev = p;
PATCH 4/140 ipv6: Fix default multicast hops setting.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit f935aa9e99d6ec74a50871c120e6b21de7256efb ]
As per RFC 3493 the default multicast hops setting for a socket should be "1" just like ipv4.
Ironically we have a IPV6_DEFAULT_MCASTHOPS macro it just wasn't being used.
--- net/ipv6/af_inet6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/af_inet6.c +1 -1
@@ -199,7 +199,7 @@ lookup_protocol:inet_sk (sk)->pinet6 = np =inet6_sk_generic (sk); np->hop_limit =-1 ; - np->mcast_hops =-1 ; + np->mcast_hops =IPV6_DEFAULT_MCASTHOPS ; np->mc_loop =1 ; np->pmtudisc =IPV6_PMTUDISC_WANT ; np->ipv6only = net->ipv6.sysctl.bindv6only;
PATCH 5/140 net: Fix FDDI and TR config checks in ipv4 arp and LLC.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit f0ecde1466f21edf577b809735f4f35f354777a0 ]
Need to check both CONFIG_FOO and CONFIG_FOO_MODULE
--- net/ipv4/arp.c | 6 +++--- net/llc/llc_sap.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
net/ipv4/arp.c +3 -3
@@ -619,13 +619,13 @@ struct sk_buff *arp_create(int type, int#endif #endif -#ifdef CONFIG_FDDI +#if defined(CONFIG_FDDI ) || defined(CONFIG_FDDI_MODULE )case ARPHRD_FDDI : arp->ar_hrd =htons (ARPHRD_ETHER ); arp->ar_pro =htons (ETH_P_IP );break ;#endif -#ifdef CONFIG_TR +#if defined(CONFIG_TR ) || defined(CONFIG_TR_MODULE )case ARPHRD_IEEE802_TR : arp->ar_hrd =htons (ARPHRD_IEEE802 ); arp->ar_pro =htons (ETH_P_IP );
@@ -1005,7 +1005,7 @@ static int arp_req_set(struct net *net,return -EINVAL ; }switch (dev->type) { -#ifdef CONFIG_FDDI +#if defined(CONFIG_FDDI ) || defined(CONFIG_FDDI_MODULE )case ARPHRD_FDDI :/* * According to RFC 1390, FDDI devices should accept ARP
net/llc/llc_sap.c +1 -1
@@ -30,7 +30,7 @@ static int llc_mac_header_len(unsigned scase ARPHRD_ETHER :case ARPHRD_LOOPBACK :return sizeof (struct ethhdr ); -#ifdef CONFIG_TR +#if defined(CONFIG_TR ) || defined(CONFIG_TR_MODULE )case ARPHRD_IEEE802_TR :return sizeof (struct trh_hdr );#endif
PATCH 6/140 pegasus: fix USB device ID for ETX-US2
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tadashi Abe <[email protected]>
[ Upstream commit 95718c1c25370b2c85061a4d8dfab2831b3ad280 ]
USB device ID definition for I-O Data ETX-US2 is wrong. Correct ID is 0x093a. Here's snippet from /proc/bus/usb/devices;
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=04bb ProdID=093a Rev= 1.01 S: Manufacturer=I-O DATA DEVICE,INC. S: Product=I-O DATA ETX2-US2 S: SerialNumber=A26427 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=224mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=pegasus E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=125us
This patch enables pegasus driver to work fine with ETX-US2.
--- drivers/net/usb/pegasus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/pegasus.h +1 -1
@@ -254,7 +254,7 @@ PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR DEFAULT_GPIO_RESET ) PEGASUS_DEV( "IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913, DEFAULT_GPIO_RESET | PEGASUS_II ) -PEGASUS_DEV( "IO DATA USB ETX-US2", VENDOR_IODATA, 0x092a, +PEGASUS_DEV( "IO DATA USB ETX-US2", VENDOR_IODATA, 0x093a, DEFAULT_GPIO_RESET | PEGASUS_II )PEGASUS_DEV ("Kingston KNU101TX Ethernet" ,VENDOR_KINGSTON ,0x000a ,DEFAULT_GPIO_RESET )
PATCH 7/140 r8169: fix random mdio_write failures
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Timo Teräs <[email protected]>
[ Upstream commit 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e ]
Some configurations need delay between the "write completed" indication and new write to work reliably.
Realtek driver seems to use longer delay when polling the "write complete" bit, so it waits long enough between writes with high probability (but could probably break too). This patch adds a new udelay to make sure we wait unconditionally some time after the write complete indication.
This caused a regression with XID 18000000 boards when the board specific phy configuration writing many mdio registers was added in commit 2e955856ff (r8169: phy init for the 8169scd). Some of the configration mdio writes would almost always fail, and depending on failure might leave the PHY in non-working state.
--- drivers/net/r8169.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/r8169.c +5 -0
@@ -557,6 +557,11 @@ static void mdio_write(void __iomem *ioabreak ;udelay (25 ); } +/* +* Some configurations require a small delay even after the write +* completed indication or the next write might fail. +*/ +udelay (25 ); }static int mdio_read (void __iomem *ioaddr,int reg_addr)
PATCH 8/140 r8169: fix mdio_read and update mdio_write according to hw specs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Timo Teräs <[email protected]>
[ Upstream commit 81a95f049962ec20a9aed888e676208b206f0f2e ]
Realtek confirmed that a 20us delay is needed after mdio_read and mdio_write operations. Reduce the delay in mdio_write, and add it to mdio_read too. Also add a comment that the 20us is from hw specs.
--- drivers/net/r8169.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/r8169.c +9 -3
@@ -558,10 +558,10 @@ static void mdio_write(void __iomem *ioaudelay (25 ); }/* -* Some configurations require a small delay even after the write -* completed indication or the next write might fail. +* According to hardware specs a 20us delay is required after write +* complete indication, but before sending next command. */ -udelay (25 ); +udelay (20 ); }static int mdio_read (void __iomem *ioaddr,int reg_addr)
@@ -581,6 +581,12 @@ static int mdio_read(void __iomem *ioadd }udelay (25 ); } +/* +* According to hardware specs a 20us delay is required after read +* complete indication, but before sending next command. +*/ +udelay (20 ); +return value; }
PATCH 9/140 tcp: tcp_synack_options() fix
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit de213e5eedecdfb1b1eea7e6be28bc64cac5c078 ]
Commit 33ad798c924b4a (tcp: options clean up) introduced a problem if MD5+SACK+timestamps were used in initial SYN message.
Some stacks (old linux for example) try to negotiate MD5+SACK+TSTAMP sessions, but since 40 bytes of tcp options space are not enough to store all the bits needed, we chose to disable timestamps in this case.
We send a SYN-ACK _without_ timestamp option, but socket has timestamps enabled and all further outgoing messages contain a TS block, all with the initial timestamp of the remote peer.
Fix is to really disable timestamps option for the whole session.
--- net/ipv4/tcp_output.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
net/ipv4/tcp_output.c +4 -5
@@ -659,7 +659,6 @@ static unsigned tcp_synack_options(strucu8 cookie_plus = (xvp !=NULL && !xvp->cookie_out_never) ? xvp->cookie_plus :0 ; -bool doing_ts = ireq->tstamp_ok;#ifdef CONFIG_TCP_MD5SIG *md5 =tcp_rsk (req)->af_specific->md5_lookup (sk, req);
@@ -672,7 +671,7 @@ static unsigned tcp_synack_options(struc* rather than TS in order to fit in better with old, * buggy kernels, but that was deemed to be unnecessary. */ - doing_ts &= !ireq->sack_ok; + ireq->tstamp_ok &= !ireq->sack_ok; }#else *md5 =NULL ;
@@ -687,7 +686,7 @@ static unsigned tcp_synack_options(struc opts->options |=OPTION_WSCALE ; remaining -=TCPOLEN_WSCALE_ALIGNED ; } -if (likely (doing_ts)) { +if (likely (ireq->tstamp_ok)) { opts->options |=OPTION_TS ; opts->tsval =TCP_SKB_CB (skb)->when; opts->tsecr = req->ts_recent;
@@ -695,7 +694,7 @@ static unsigned tcp_synack_options(struc }if (likely (ireq->sack_ok)) { opts->options |=OPTION_SACK_ADVERTISE ; -if (unlikely (!doing_ts)) +if (unlikely (!ireq->tstamp_ok)) remaining -=TCPOLEN_SACKPERM_ALIGNED ; }
@@ -703,7 +702,7 @@ static unsigned tcp_synack_options(struc* If the <SYN> options fit, the same options should fit now! */ if (*md5 ==NULL && - doing_ts && + ireq->tstamp_ok && cookie_plus >TCPOLEN_COOKIE_BASE ) {int need = cookie_plus;/* has TCPOLEN_COOKIE_BASE */
PATCH 10/140 tcp: use correct net ns in cookie_v4_check()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit c44649216522cd607a4027d2ebf4a8147d3fa94c ]
Its better to make a route lookup in appropriate namespace.
--- net/ipv4/syncookies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/syncookies.c +1 -1
@@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock { .sport = th->dest, .dport = th->source } } };security_req_classify_flow (req, &fl); -if (ip_route_output_key (&init_net, &rt, &fl)) { +if (ip_route_output_key (sock_net (sk), &rt, &fl)) {reqsk_free (req); goto out; }
PATCH 11/140 veth: Dont kfree_skb() after dev_forward_skb()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 6ec82562ffc6f297d0de36d65776cff8e5704867 ]
In case of congestion, netif_rx() frees the skb, so we must assume dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not double free it.
Bug report : http://marc.info/?l=linux-netdev&m=127310770900442&w=3
--- drivers/net/veth.c | 1 - net/core/dev.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/veth.c +0 -1
@@ -186,7 +186,6 @@ tx_drop:return NETDEV_TX_OK ; rx_drop: -kfree_skb (skb); rcv_stats->rx_dropped++;return NETDEV_TX_OK ; }
net/core/dev.c +5 -5
@@ -1428,7 +1428,7 @@ static inline void net_timestamp(struct* * return values: * NET_RX_SUCCESS (no congestion) -* NET_RX_DROP (packet was dropped) +* NET_RX_DROP (packet was dropped, but freed) * * dev_forward_skb can be used for injecting an skb from the * start_xmit function of one device into the receive queue
@@ -1442,11 +1442,11 @@ int dev_forward_skb(struct net_device *d {skb_orphan (skb); -if (!(dev->flags &IFF_UP )) -return NET_RX_DROP ; - -if (skb->len > (dev->mtu + dev->hard_header_len)) +if (!(dev->flags &IFF_UP ) || + (skb->len > (dev->mtu + dev->hard_header_len))) { +kfree_skb (skb);return NET_RX_DROP ; + }skb_dst_drop (skb); skb->tstamp.tv64 =0 ;
PATCH 12/140 ssb: Handle Netbook devices where the SPROM address is changed
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Fritz <[email protected]>
For some Netbook computers with Broadcom BCM4312 wireless interfaces, the SPROM has been moved to a new location. When the ssb driver tries to read the old location, the systems hangs when trying to read a non-existent location. Such freezes are particularly bad as they do not log the failure.
This patch is modified from commit da1fdb02d9200ff28b6f3a380d21930335fe5429 with some pieces from other mainline changes so that it can be applied to stable 2.6.34.Y.
--- drivers/ssb/driver_chipcommon.c | 3 + drivers/ssb/driver_chipcommon_pmu.c | 17 ++++------- drivers/ssb/pci.c | 46 ++++++++++++++++++++++++++---- drivers/ssb/sprom.c | 15 +++++++++ include/linux/ssb/ssb.h | 1 include/linux/ssb/ssb_driver_chipcommon.h | 2 + include/linux/ssb/ssb_regs.h | 3 + 7 files changed, 70 insertions(+), 17 deletions(-)
drivers/ssb/driver_chipcommon.c +3 -0
@@ -233,6 +233,9 @@ void ssb_chipcommon_init(struct ssb_chip {if (!cc->dev)return ;/* We don't have a ChipCommon */ +if (cc->dev->id.revision >=11 ) + cc->status =chipco_read32 (cc,SSB_CHIPCO_CHIPSTAT ); + ssb_dprintk(KERN_INFO PFX "chipcommon status is 0x%x\n", cc->status);ssb_pmu_init (cc);chipco_powercontrol_init (cc);ssb_chipco_set_clockmode (cc,SSB_CLKMODE_FAST );
drivers/ssb/driver_chipcommon_pmu.c +7 -10
@@ -495,9 +495,9 @@ static void ssb_pmu_resources_init(strucchipco_write32 (cc,SSB_CHIPCO_PMU_MAXRES_MSK , max_msk); } +/* http://bcm-v4.sipsolutions.net/802.11/SSB/PmuInit */ void ssb_pmu_init (struct ssb_chipcommon *cc) { -struct ssb_bus *bus = cc->dev->bus;u32 pmucap;if (!(cc->capabilities &SSB_CHIPCO_CAP_PMU ))
@@ -509,15 +509,12 @@ void ssb_pmu_init(struct ssb_chipcommon ssb_dprintk(KERN_DEBUG PFX "Found rev %u PMU (capabilities 0x%08X)\n", cc->pmu.rev, pmucap); -if (cc->pmu.rev >=1 ) { -if ((bus->chip_id ==0x4325 ) && (bus->chip_rev <2 )) { -chipco_mask32 (cc,SSB_CHIPCO_PMU_CTL , - ~SSB_CHIPCO_PMU_CTL_NOILPONW ); - }else { -chipco_set32 (cc,SSB_CHIPCO_PMU_CTL , -SSB_CHIPCO_PMU_CTL_NOILPONW ); - } - } +if (cc->pmu.rev ==1 ) +chipco_mask32 (cc,SSB_CHIPCO_PMU_CTL , + ~SSB_CHIPCO_PMU_CTL_NOILPONW ); +else +chipco_set32 (cc,SSB_CHIPCO_PMU_CTL , +SSB_CHIPCO_PMU_CTL_NOILPONW );ssb_pmu_pll_init (cc);ssb_pmu_resources_init (cc); }
drivers/ssb/pci.c +40 -6
89 lines not on this page · raw message
drivers/ssb/sprom.c +15 -0
@@ -175,3 +175,18 @@ const struct ssb_sprom *ssb_get_fallback {return fallback_sprom; } + +/* http://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */ +bool ssb_is_sprom_available (struct ssb_bus *bus) +{ +/* status register only exists on chipcomon rev >= 11 and we need check +for >= 31 only */ +/* this routine differs from specs as we do not access SPROM directly +on PCMCIA */ +if (bus->bustype ==SSB_BUSTYPE_PCI && + bus->chipco.dev &&/* can be unavailible! */ + bus->chipco.dev->id.revision >=31 ) +return bus->chipco.capabilities &SSB_CHIPCO_CAP_SPROM ; + +return true; +}
include/linux/ssb/ssb.h +1 -0
@@ -306,6 +306,7 @@ struct ssb_bus {u16 chip_id;u16 chip_rev;u16 sprom_size;/* number of words in sprom */ +u16 sprom_offset;u8 chip_package;/* List of devices (cores) on the backplane. */
include/linux/ssb/ssb_driver_chipcommon.h +2 -0
@@ -46,6 +46,7 @@#define SSB_PLLTYPE_7 0x00038000/* 25Mhz, 4 dividers */ #define SSB_CHIPCO_CAP_PCTL 0x00040000/* Power Control */ #define SSB_CHIPCO_CAP_OTPS 0x00380000/* OTP size */ +#define SSB_CHIPCO_CAP_SPROM 0x40000000/* SPROM present */ #define SSB_CHIPCO_CAP_OTPS_SHIFT 19#define SSB_CHIPCO_CAP_OTPS_BASE 5#define SSB_CHIPCO_CAP_JTAGM 0x00400000/* JTAG master present */
@@ -564,6 +565,7 @@ struct ssb_chipcommon_pmu {struct ssb_chipcommon {struct ssb_device *dev;u32 capabilities; +u32 status;/* Fast Powerup Delay constant */ u16 fast_pwrup_delay;struct ssb_chipcommon_pmu pmu;
include/linux/ssb/ssb_regs.h +2 -1
@@ -170,7 +170,8 @@#define SSB_SPROMSIZE_WORDS_R4 220#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16))#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) -#define SSB_SPROM_BASE 0x1000 +#define SSB_SPROM_BASE1 0x1000 +#define SSB_SPROM_BASE31 0x0800#define SSB_SPROM_REVISION 0x107E#define SSB_SPROM_REVISION_REV 0x00FF/* SPROM Revision number */ #define SSB_SPROM_REVISION_CRC 0xFF00/* SPROM CRC8 value */
PATCH 13/140 hwmon: (k8temp) Bypass core swapping on single-core processors
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit cd4de21f7e65a8cd04860f5661b3c18648ee52a1 upstream.
Commit a2e066bba2aad6583e3ff648bf28339d6c9f0898 introduced core swapping for CPU models 64 and later. I recently had a report about a Sempron 3200+, model 95, for which this patch broke temperature reading. It happens that this is a single-core processor, so the effect of the swapping was to read a temperature value for a core that didn't exist, leading to an incorrect value (-49 degrees C.)
Disabling core swapping on singe-core processors should fix this.
Additional comment from Andreas:
The BKDG says
Thermal Sensor Core Select (ThermSenseCoreSel)-Bit 2. This bit selects the CPU whose temperature is reported in the CurTemp field. This bit only applies to dual core processors. For single core processors CPU0 Thermal Sensor is always selected.
k8temp_probe() correctly detected that SEL_CORE can't be used on single core CPU. Thus k8temp did never update the temperature values stored in temp[1][x] and -49 degrees was reported. For single core CPUs we must use the values read into temp[0][x].
--- drivers/hwmon/k8temp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/k8temp.c +1 -1
@@ -120,7 +120,7 @@ static ssize_t show_temp(struct device *int temp;struct k8temp_data *data =k8temp_update_device (dev); -if (data->swap_core_select) +if (data->swap_core_select && (data->sensorsp &SEL_CORE )) core = core ?0 :1 ; temp =TEMP_FROM_REG (data->temp[core][place]) + data->temp_offset;
PATCH 14/140 hwmon: (k8temp) Fix temperature reporting for ASB1 processor revisions
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andreas Herrmann <[email protected]>
commit d535bad90dad4eb42ec6528043fcfb53627d4f89 upstream.
Reported temperature for ASB1 CPUs is too high.
Add ASB1 CPU revisions (these are also non-desktop variants) to the list of CPUs for which the temperature fixup is not required.
Example: (from LENOVO ThinkPad Edge 13, 01972NG, system was idle)
Current kernel reports
$ sensors k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +74.0 C Core0 Temp: +70.0 C Core1 Temp: +69.0 C Core1 Temp: +70.0 C
With this patch I have
$ sensors k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +54.0 C Core0 Temp: +51.0 C Core1 Temp: +48.0 C Core1 Temp: +49.0 C
--- drivers/hwmon/k8temp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/hwmon/k8temp.c +6 -4
@@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct }if ((model >=0x69 ) && - !(model ==0xc1 || model ==0x6c || model ==0x7c )) { + !(model ==0xc1 || model ==0x6c || model ==0x7c || + model ==0x6b || model ==0x6f || model ==0x7f )) {/* -* RevG desktop CPUs (i.e. no socket S1G1 parts) -* need additional offset, otherwise reported -* temperature is below ambient temperature +* RevG desktop CPUs (i.e. no socket S1G1 or +* ASB1 parts) need additional offset, +* otherwise reported temperature is below +* ambient temperature */ data->temp_offset =21000 ; }
PATCH 15/140 hwmon: (k10temp) Do not blacklist known working CPU models
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit eefc2d9e3d4f8820f2c128a0e44a23de28b1ed64 upstream.
When detecting AM2+ or AM3 socket with DDR2, only blacklist cores which are known to exist in AM2+ format.
--- drivers/hwmon/k10temp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hwmon/k10temp.c +12 -2
@@ -112,11 +112,21 @@ static bool __devinit has_erratum_319(stif (pkg_type !=CPUID_PKGTYPE_AM2R2_AM3 )return false; -/* Differentiate between AM2+ (bad) and AM3 (good) */ +/* DDR3 memory implies socket AM3, which is good */ pci_bus_read_config_dword (pdev->bus,PCI_DEVFN (PCI_SLOT (pdev->devfn),2 ),REG_DCT0_CONFIG_HIGH , ®_dram_cfg); -return !(reg_dram_cfg &DDR3_MODE ); +if (reg_dram_cfg &DDR3_MODE ) +return false; + +/* +* Unfortunately it is possible to run a socket AM3 CPU with DDR2 +* memory. We blacklist all the cores which do exist in socket AM2+ +* format. It still isn't perfect, as RB-C2 cores exist in both AM2+ +* and AM3 formats, but that's the best we can do. +*/ +return boot_cpu_data.x86_model <4 || + (boot_cpu_data.x86_model ==4 && boot_cpu_data.x86_mask <=2 ); } static int __devinit k10temp_probe(struct pci_dev *pdev,
PATCH 16/140 hwmon: (coretemp) Properly label the sensors
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c upstream.
Don't assume that CPU entry number and core ID always match. It worked in the simple cases (single CPU, no HT) but fails on multi-CPU systems.
--- drivers/hwmon/coretemp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/coretemp.c +5 -1
@@ -53,6 +53,7 @@ struct coretemp_data {struct mutex update_lock;const char *name;u32 id; +u16 core_id;char valid;/* zero until following fields are valid */ unsigned long last_updated;/* in jiffies */ int temp;
@@ -75,7 +76,7 @@ static ssize_t show_name(struct device *if (attr->index ==SHOW_NAME ) ret =sprintf (buf,"%s\n" , data->name);else /* show label */ - ret =sprintf (buf,"Core %d\n" , data->id); + ret =sprintf (buf,"Core %d\n" , data->core_id);return ret; }
@@ -255,6 +256,9 @@ static int __devinit coretemp_probe(stru } data->id = pdev->id; +#ifdef CONFIG_SMP + data->core_id = c->cpu_core_id; +#endif data->name ="coretemp" ;mutex_init (&data->update_lock);
PATCH 17/140 hwmon: (coretemp) Skip duplicate CPU entries
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit d883b9f0977269d519469da72faec6a7f72cb489 upstream.
On hyper-threaded CPUs, each core appears twice in the CPU list. Skip the second entry to avoid duplicate sensors.
--- drivers/hwmon/coretemp.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hwmon/coretemp.c +25 -1
@@ -356,6 +356,10 @@ struct pdev_entry {struct list_head list;struct platform_device *pdev;unsigned int cpu; +#ifdef CONFIG_SMP +u16 phys_proc_id; +u16 cpu_core_id; +#endif };static LIST_HEAD (pdev_list);
@@ -366,6 +370,22 @@ static int __cpuinit coretemp_device_addint err;struct platform_device *pdev;struct pdev_entry *pdev_entry; +#ifdef CONFIG_SMP +struct cpuinfo_x86 *c = &cpu_data (cpu); +#endif + +mutex_lock (&pdev_list_mutex); + +#ifdef CONFIG_SMP +/* Skip second HT entry of each core */ +list_for_each_entry (pdev_entry, &pdev_list, list) { +if (c->phys_proc_id == pdev_entry->phys_proc_id && + c->cpu_core_id == pdev_entry->cpu_core_id) { + err =0 ;/* Not an error */ + goto exit; + } + } +#endif pdev =platform_device_alloc (DRVNAME , cpu);if (!pdev) {
@@ -389,7 +409,10 @@ static int __cpuinit coretemp_device_add pdev_entry->pdev = pdev; pdev_entry->cpu = cpu; -mutex_lock (&pdev_list_mutex); +#ifdef CONFIG_SMP + pdev_entry->phys_proc_id = c->phys_proc_id; + pdev_entry->cpu_core_id = c->cpu_core_id; +#endif list_add_tail (&pdev_entry->list, &pdev_list);mutex_unlock (&pdev_list_mutex);
@@ -400,6 +423,7 @@ exit_device_free: exit_device_put:platform_device_put (pdev); exit: +mutex_unlock (&pdev_list_mutex);return err; }
PATCH 18/140 hwmon: (it87) Fix in7 on IT8720F
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit 436cad2a41a40c6c32bd9152b63d17eeb1f7c99b upstream.
The IT8720F has no VIN7 pin, so VCCH should always be routed internally to VIN7 with an internal divider. Curiously, there still is a configuration bit to control this, which means it can be set incorrectly. And even more curiously, many boards out there are improperly configured, even though the IT8720F datasheet claims that the internal routing of VCCH to VIN7 is the default setting. So we force the internal routing in this case.
It turns out that all boards with the wrong setting are from Gigabyte, so I suspect a BIOS bug. But it's easy enough to workaround in the driver, so let's do it.
--- drivers/hwmon/it87.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/hwmon/it87.c +22 -0
@@ -80,6 +80,13 @@ superio_inb(int reg)return inb (VAL ); } +static inline void +superio_outb (int reg,int val) +{ +outb (reg,REG ); +outb (val,VAL ); +} +static int superio_inw (int reg) {int val;
@@ -1064,6 +1071,21 @@ static int __init it87_find(unsigned sho sio_data->vid_value =superio_inb (IT87_SIO_VID_REG ); reg =superio_inb (IT87_SIO_PINX2_REG ); +/* +* The IT8720F has no VIN7 pin, so VCCH should always be +* routed internally to VIN7 with an internal divider. +* Curiously, there still is a configuration bit to control +* this, which means it can be set incorrectly. And even +* more curiously, many boards out there are improperly +* configured, even though the IT8720F datasheet claims +* that the internal routing of VCCH to VIN7 is the default +* setting. So we force the internal routing in this case. +*/ +if (sio_data->type == it8720 && !(reg & (1 <<1 ))) { + reg |= (1 <<1 ); +superio_outb (IT87_SIO_PINX2_REG , reg); +pr_notice ("it87: Routing internal VCCH to in7\n" ); + }if (reg & (1 <<0 ))pr_info ("it87: in3 is VCC (+5V)\n" );if (reg & (1 <<1 ))
PATCH 19/140 cifs: remove bogus first_time check in NTLMv2 session setup code
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit 8a224d489454b7457105848610cfebebdec5638d upstream.
This bug appears to be the result of a cut-and-paste mistake from the NTLMv1 code. The function to generate the MAC key was commented out, but not the conditional above it. The conditional then ended up causing the session setup key not to be copied to the buffer unless this was the first session on the socket, and that made all but the first NTLMv2 session setup fail.
Fix this by removing the conditional and all of the commented clutter that made it difficult to see.
--- fs/cifs/sess.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
fs/cifs/sess.c +1 -9
@@ -722,15 +722,7 @@ ssetup_ntlmssp_authenticate:/* calculate session key */ setup_ntlmv2_rsp (ses, v2_sess_key, nls_cp); -if (first_time)/* should this be moved into common code -with similar ntlmv2 path? */ -/* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key, -response BB FIXME, v2_sess_key); */ - -/* copy session key */ - -/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE); -bcc_ptr += LM2_SESS_KEY_SIZE; */ +/* FIXME: calculate MAC key */ memcpy (bcc_ptr, (char *)v2_sess_key,sizeof (struct ntlmv2_resp )); bcc_ptr +=sizeof (struct ntlmv2_resp );
PATCH 20/140 cifs: dont attempt busy-file rename unless its in same directory
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit ed0e3ace576d297a5c7015401db1060bbf677b94 upstream.
Busy-file renames don't actually work across directories, so we need to limit this code to renames within the same dir.
This fixes the bug detailed here:
https://bugzilla.redhat.com/show_bug.cgi?id=591938
--- fs/cifs/inode.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/cifs/inode.c +4 -0
@@ -1284,6 +1284,10 @@ cifs_do_rename(int xid, struct dentry *fif (rc ==0 || rc != -ETXTBSY )return rc; +/* open-file renames don't work across directories */ +if (to_dentry->d_parent != from_dentry->d_parent) +return rc; +/* open the file to be renamed -- we need DELETE perms */ rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE, CREATE_NOT_DIR, &srcfid, &oplock, NULL,
PATCH 21/140 CIFS: Fix a malicious redirect problem in the DNS lookup code
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit 4c0c03ca54f72fdd5912516ad0a23ec5cf01bda7 upstream.
Fix the security problem in the CIFS filesystem DNS lookup code in which a malicious redirect could be installed by a random user by simply adding a result record into one of their keyrings with add_key() and then invoking a CIFS CFS lookup [CVE-2010-2524].
This is done by creating an internal keyring specifically for the caching of DNS lookups. To enforce the use of this keyring, the module init routine creates a set of override credentials with the keyring installed as the thread keyring and instructs request_key() to only install lookup result keys in that keyring.
The override is then applied around the call to request_key().
This has some additional benefits when a kernel service uses this module to request a key:
(1) The result keys are owned by root, not the user that caused the lookup.
(2) The result keys don't pop up in the user's keyrings.
(3) The result keys don't come out of the quota of the user that caused the lookup.
The keyring can be viewed as root by doing cat /proc/keys:
2a0ca6c3 I----- 1 perm 1f030000 0 0 keyring .dns_resolver: 1/4
It can then be listed with 'keyctl list' by root.
# keyctl list 0x2a0ca6c3 1 key in keyring: 726766307: --alswrv 0 0 dns_resolver: foo.bar.com
--- fs/cifs/cifsfs.c | 6 ++-- fs/cifs/dns_resolve.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/cifs/dns_resolve.h | 4 +- 3 files changed, 74 insertions(+), 5 deletions(-)
fs/cifs/cifsfs.c +3 -3
@@ -1034,7 +1034,7 @@ init_cifs(void) goto out_unregister_filesystem;#endif #ifdef CONFIG_CIFS_DFS_UPCALL - rc =register_key_type (&key_type_dns_resolver); + rc =cifs_init_dns_resolver ();if (rc) goto out_unregister_key_type;#endif
@@ -1046,7 +1046,7 @@ init_cifs(void) out_unregister_resolver_key: #ifdef CONFIG_CIFS_DFS_UPCALL -unregister_key_type (&key_type_dns_resolver); +cifs_exit_dns_resolver (); out_unregister_key_type:#endif #ifdef CONFIG_CIFS_UPCALL
@@ -1072,7 +1072,7 @@ exit_cifs(void)cifs_proc_clean ();#ifdef CONFIG_CIFS_DFS_UPCALL cifs_dfs_release_automount_timer (); -unregister_key_type (&key_type_dns_resolver); +cifs_exit_dns_resolver ();#endif #ifdef CONFIG_CIFS_UPCALL unregister_key_type (&cifs_spnego_key_type);
fs/cifs/dns_resolve.c +69 -0
99 lines not on this page · raw message
fs/cifs/dns_resolve.h +2 -2
@@ -24,8 +24,8 @@#define _DNS_RESOLVE_H#ifdef __KERNEL__ -#include <linux/key-type.h> -extern struct key_type key_type_dns_resolver; +extern int __init cifs_init_dns_resolver (void ); +extern void __exit cifs_exit_dns_resolver(void);extern int dns_resolve_server_name_to_ip (const char *unc,char **ip_addr);#endif /* KERNEL */
PATCH 22/140 ALSA: hda - Add Macbook 5,2 quirk
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luke Yelavich <[email protected]>
commit 3bfea98ff73d377ffce0d4c7f938b7ef958cdb35 upstream.
Set Macbook 5,2 (106b:4a00) hardware to use ALC885_MB5
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9122,6 +9122,7 @@ static struct snd_pci_quirk alc882_ssid_SND_PCI_QUIRK (0x106b ,0x3e00 ,"iMac 24 Aluminum" ,ALC885_IMAC24 ),SND_PCI_QUIRK (0x106b ,0x4900 ,"iMac 9,1 Aluminum" ,ALC885_IMAC91 ),SND_PCI_QUIRK (0x106b ,0x3f00 ,"Macbook 5,1" ,ALC885_MB5 ), + SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),/* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, * so apparently no perfect solution yet */
PATCH 23/140 cpmac: do not leak struct net_device on phy_connect errors
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Florian Fainelli <[email protected]>
commit ed770f01360b392564650bf1553ce723fa46afec upstream.
If the call to phy_connect fails, we will return directly instead of freeing the previously allocated struct net_device.
--- drivers/net/cpmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/cpmac.c +2 -1
@@ -1174,7 +1174,8 @@ static int __devinit cpmac_probe(structif (netif_msg_drv (priv))printk (KERN_ERR "%s: Could not attach to PHY\n" , dev->name); -return PTR_ERR (priv->phy); + rc =PTR_ERR (priv->phy); + goto fail; }if ((rc =register_netdev (dev))) {
PATCH 24/140 sky2: enable rx/tx in sky2_phy_reinit()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Brandon Philips <[email protected]>
commit 38000a94a902e94ca8b5498f7871c6316de8957a upstream.
sky2_phy_reinit is called by the ethtool helpers sky2_set_settings, sky2_nway_reset and sky2_set_pauseparam when netif_running.
However, at the end of sky2_phy_init GM_GP_CTRL has GM_GPCR_RX_ENA and GM_GPCR_TX_ENA cleared. So, doing these commands causes the device to stop working:
$ ethtool -r eth0 $ ethtool -A eth0 autoneg off
Fix this issue by enabling Rx/Tx after running sky2_phy_init in sky2_phy_reinit.
--- drivers/net/sky2.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/net/sky2.c +14 -5
@@ -716,11 +716,24 @@ static void sky2_phy_power_down(struct ssky2_write8 (hw,B2_TST_CTRL1 ,TST_CFG_WRITE_OFF ); } +/* Enable Rx/Tx */ +static void sky2_enable_rx_tx (struct sky2_port *sky2) +{ +struct sky2_hw *hw = sky2->hw; +unsigned port = sky2->port; +u16 reg; + + reg =gma_read16 (hw, port,GM_GP_CTRL ); + reg |=GM_GPCR_RX_ENA |GM_GPCR_TX_ENA ; +gma_write16 (hw, port,GM_GP_CTRL , reg); +} +/* Force a renegotiation */ static void sky2_phy_reinit (struct sky2_port *sky2) {spin_lock_bh (&sky2->phy_lock);sky2_phy_init (sky2->hw, sky2->port); +sky2_enable_rx_tx (sky2);spin_unlock_bh (&sky2->phy_lock); }
@@ -1971,7 +1984,6 @@ static void sky2_link_up(struct sky2_por {struct sky2_hw *hw = sky2->hw;unsigned port = sky2->port; -u16 reg;static const char *fc_name[] = { [FC_NONE ] ="none" , [FC_TX ] ="tx" ,
@@ -1979,10 +1991,7 @@ static void sky2_link_up(struct sky2_por [FC_BOTH ] ="both" , }; -/* enable Rx/Tx */ - reg =gma_read16 (hw, port,GM_GP_CTRL ); - reg |=GM_GPCR_RX_ENA |GM_GPCR_TX_ENA ; -gma_write16 (hw, port,GM_GP_CTRL , reg); +sky2_enable_rx_tx (sky2);gm_phy_write (hw, port,PHY_MARV_INT_MASK ,PHY_M_DEF_MSK );
PATCH 25/140 net: fix problem in reading sock TX queue
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tom Herbert <[email protected]>
commit b0f77d0eae0c58a5a9691a067ada112ceeae2d00 upstream.
Fix problem in reading the tx_queue recorded in a socket. In dev_pick_tx, the TX queue is read by doing a check with sk_tx_queue_recorded on the socket, followed by a sk_tx_queue_get. The problem is that there is not mutual exclusion across these calls in the socket so it it is possible that the queue in the sock can be invalidated after sk_tx_queue_recorded is called so that sk_tx_queue get returns -1, which sets 65535 in queue_index and thus dev_pick_tx returns 65536 which is a bogus queue and can cause crash in dev_queue_xmit.
We fix this by only calling sk_tx_queue_get which does the proper checks. The interface is that sk_tx_queue_get returns the TX queue if the sock argument is non-NULL and TX queue is recorded, else it returns -1. sk_tx_queue_recorded is no longer used so it can be completely removed.
--- include/net/sock.h | 7 +------ net/core/dev.c | 7 +++---- 2 files changed, 4 insertions(+), 10 deletions(-)
include/net/sock.h +1 -6
@@ -1130,12 +1130,7 @@ static inline void sk_tx_queue_clear(strstatic inline int sk_tx_queue_get (const struct sock *sk) { -return sk->sk_tx_queue_mapping; -} - -static inline bool sk_tx_queue_recorded (const struct sock *sk) -{ -return (sk && sk->sk_tx_queue_mapping >=0 ); +return sk ? sk->sk_tx_queue_mapping :-1 ; }static inline void sk_set_socket (struct sock *sk,struct socket *sock)
net/core/dev.c +3 -4
@@ -1915,12 +1915,11 @@ static inline u16 dev_cap_txqueue(structstatic struct netdev_queue *dev_pick_tx (struct net_device *dev,struct sk_buff *skb) { -u16 queue_index; +int queue_index;struct sock *sk = skb->sk; -if (sk_tx_queue_recorded (sk)) { - queue_index =sk_tx_queue_get (sk); - }else { + queue_index =sk_tx_queue_get (sk); +if (queue_index <0 ) {const struct net_device_ops *ops = dev->netdev_ops;if (ops->ndo_select_queue) {
PATCH 26/140 tcp: fix crash in tcp_xmit_retransmit_queue
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ilpo Järvinen <[email protected]>
commit 45e77d314585869dfe43c82679f7e08c9b35b898 upstream.
It can happen that there are no packets in queue while calling tcp_xmit_retransmit_queue(). tcp_write_queue_head() then returns NULL and that gets deref'ed to get sacked into a local var.
There is no work to do if no packets are outstanding so we just exit early.
This oops was introduced by 08ebd1721ab8fd (tcp: remove tp->lost_out guard to make joining diff nicer).
--- net/ipv4/tcp_output.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/tcp_output.c +3 -0
@@ -2203,6 +2203,9 @@ void tcp_xmit_retransmit_queue(struct soint mib_idx;int fwd_rexmitting =0 ; +if (!tp->packets_out) +return ; +if (!tp->lost_out) tp->retransmit_high = tp->snd_una;
PATCH 27/140 net/core: neighbour update Oops
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Doug Kehn <[email protected]>
commit 91a72a70594e5212c97705ca6a694bd307f7a26b upstream.
When configuring DMVPN (GRE + openNHRP) and a GRE remote address is configured a kernel Oops is observed. The obserseved Oops is caused by a NULL header_ops pointer (neigh->dev->header_ops) in neigh_update_hhs() when
void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *) = neigh->dev->header_ops->cache_update;
is executed. The dev associated with the NULL header_ops is the GRE interface. This patch guards against the possibility that header_ops is NULL.
This Oops was first observed in kernel version 2.6.26.8.
--- net/core/neighbour.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/neighbour.c +4 -1
@@ -945,7 +945,10 @@ static void neigh_update_hhs(struct neig {struct hh_cache *hh;void (*update)(struct hh_cache *,const struct net_device *,const unsigned char *) - = neigh->dev->header_ops->cache_update; + =NULL ; + +if (neigh->dev->header_ops) + update = neigh->dev->header_ops->cache_update;if (update) {for (hh = neigh->hh; hh; hh = hh->hh_next) {
PATCH 28/140 sparc: Fix use of uid16_t and gid16_t in asm/stat.h
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rob Landley <[email protected]>
commit 7469a9acf919d36836f6c635099d8edc9be4528a upstream.
--- arch/sparc/include/asm/stat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sparc/include/asm/stat.h +2 -2
@@ -53,8 +53,8 @@ struct stat {ino_t st_ino;mode_t st_mode;short st_nlink; -uid16_t st_uid; -gid16_t st_gid; +unsigned short st_uid; +unsigned short st_gid;unsigned short st_rdev;off_t st_size;time_t st_atime;
PATCH 29/140 math-emu: correct test for downshifting fraction in _FP_FROM_INT()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikael Pettersson <[email protected]>
commit f8324e20f8289dffc646d64366332e05eaacab25 upstream.
The kernel's math-emu code contains a macro _FP_FROM_INT() which is used to convert an integer to a raw normalized floating-point value. It does this basically in three steps:
1. Compute the exponent from the number of leading zero bits.
2. Downshift large fractions to put the MSB in the right position for normalized fractions.
3. Upshift small fractions to put the MSB in the right position.
There is an boundary error in step 2, causing a fraction with its MSB exactly one bit above the normalized MSB position to not be downshifted. This results in a non-normalized raw float, which when packed becomes a massively inaccurate representation for that input.
The impact of this depends on a number of arch-specific factors, but it is known to have broken emulation of FXTOD instructions on UltraSPARC III, which was originally reported as GCC bug 44631
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44631>.
Any arch which uses math-emu to emulate conversions from integers to same-size floats may be affected.
The fix is simple: the exponent comparison used to determine if the fraction should be downshifted must be "<=" not "<".
I'm sending a kernel module to test this as a reply to this message. There are also SPARC user-space test cases in the GCC bug entry.
--- include/math-emu/op-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/math-emu/op-common.h +1 -1
@@ -799,7 +799,7 @@ do { \ X##_e -= (_FP_W_TYPE_SIZE - rsize); \ X##_e = rsize - X##_e - 1; \ \ - if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \ + if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e) \ __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\ _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \
PATCH 30/140 cmd640: fix kernel oops in test_irq() method
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sergei Shtylyov <[email protected]>
commit a9ddabc52ce3757a4331d6c1e8bf4065333cc51b upstream.
When implementing the test_iqr() method, I forgot that this driver is not an ordinary PCI driver and also needs to support VLB variant of the chip. Moreover, 'hwif->dev' should be NULL, potentially causing oops in pci_read_config_byte().
--- drivers/ide/cmd640.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ide/cmd640.c +2 -4
@@ -632,12 +632,10 @@ static void cmd640_init_dev(ide_drive_tstatic int cmd640_test_irq (ide_hwif_t *hwif) { -struct pci_dev *dev =to_pci_dev (hwif->dev);int irq_reg = hwif->channel ?ARTTIM23 :CFR ; -u8 irq_stat, irq_mask = hwif->channel ?ARTTIM23_IDE23INTR : +u8 irq_mask = hwif->channel ?ARTTIM23_IDE23INTR :CFR_IDE01INTR ; - -pci_read_config_byte (dev, irq_reg, &irq_stat); +u8 irq_stat =get_cmd640_reg (irq_reg);return (irq_stat & irq_mask) ?1 :0 ; }
PATCH 31/140 ide: Fix IDE taskfile with cfq scheduler
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikulas Patocka <[email protected]>
commit 720fc22a7af79d91ec460c80efa92c65c12d105e upstream.
When ide taskfile access is being used (for example with hdparm --security commands) and cfq scheduler is selected, the scheduler crashes on BUG in cfq_put_request.
The reason is that the cfq scheduler is tracking counts of read and write requests separately; the ide-taskfile subsystem allocates a read request and then flips the flag to make it a write request. The counters in cfq will mismatch.
This patch changes ide-taskfile to allocate the READ or WRITE request as required and don't change the flag later.
--- drivers/ide/ide-taskfile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ide/ide-taskfile.c +2 -4
@@ -428,13 +428,11 @@ int ide_raw_taskfile(ide_drive_t *drive, {struct request *rq;int error; +int rw = !(cmd->tf_flags &IDE_TFLAG_WRITE ) ?READ :WRITE ; - rq =blk_get_request (drive->queue,READ , __GFP_WAIT); + rq =blk_get_request (drive->queue, rw, __GFP_WAIT); rq->cmd_type =REQ_TYPE_ATA_TASKFILE ; -if (cmd->tf_flags &IDE_TFLAG_WRITE ) - rq->cmd_flags |=REQ_RW ; -/* * (ks) We transfer currently only whole sectors. * This is suffient for now. But, it would be great,
PATCH 32/140 NFSv4: Fix an embarassing typo in encode_attrs()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit d3f6baaa34c54040b3ef30950e59b54ac0624b21 upstream.
Apparently, we have never been able to set the atime correctly from the NFSv4 client.
--- fs/nfs/nfs4xdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4xdr.c +2 -2
@@ -863,8 +863,8 @@ static void encode_attrs(struct xdr_stre bmval1 |=FATTR4_WORD1_TIME_ACCESS_SET ; *p++ =cpu_to_be32 (NFS4_SET_TO_CLIENT_TIME ); *p++ =cpu_to_be32 (0 ); - *p++ =cpu_to_be32 (iap->ia_mtime.tv_sec); - *p++ =cpu_to_be32 (iap->ia_mtime.tv_nsec); + *p++ =cpu_to_be32 (iap->ia_atime.tv_sec); + *p++ =cpu_to_be32 (iap->ia_atime.tv_nsec); }else if (iap->ia_valid &ATTR_ATIME ) { bmval1 |=FATTR4_WORD1_TIME_ACCESS_SET ;
PATCH 33/140 NFSv4: Ensure that /proc/self/mountinfo displays the minor version number
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit 0be8189f2c87fcc747d6a4a657a0b6e2161b2318 upstream.
Currently, we do not display the minor version mount parameter in the /proc mount info.
--- fs/nfs/super.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
fs/nfs/super.c +18 -4
@@ -565,6 +565,22 @@ static void nfs_show_mountd_options(strunfs_show_mountd_netid (m, nfss, showdefaults); } +#ifdef CONFIG_NFS_V4 +static void nfs_show_nfsv4_options (struct seq_file *m,struct nfs_server *nfss, +int showdefaults) +{ +struct nfs_client *clp = nfss->nfs_client; + +seq_printf (m,",clientaddr=%s" , clp->cl_ipaddr); +seq_printf (m,",minorversion=%u" , clp->cl_minorversion); +} +#else +static void nfs_show_nfsv4_options (struct seq_file *m,struct nfs_server *nfss, +int showdefaults) +{ +} +#endif +/* * Describe the mount options in force on this server representation */
@@ -626,11 +642,9 @@ static void nfs_show_mount_options(strucif (version !=4 )nfs_show_mountd_options (m, nfss, showdefaults); +else +nfs_show_nfsv4_options (m, nfss, showdefaults); -#ifdef CONFIG_NFS_V4 -if (clp->rpc_ops->version ==4 ) -seq_printf (m,",clientaddr=%s" , clp->cl_ipaddr); -#endif if (nfss->options &NFS_OPTION_FSCACHE )seq_printf (m,",fsc" ); }
PATCH 34/140 SUNRPC: Fix a re-entrancy bug in xs_tcp_read_calldir()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit b76ce56192bcf618013fb9aecd83488cffd645cc upstream.
If the attempt to read the calldir fails, then instead of storing the read bytes, we currently discard them. This leads to a garbage final result when upon re-entry to the same routine, we read the remaining bytes.
Fixes the regression in bugzilla number 16213. Please see
https://bugzilla.kernel.org/show_bug.cgi?id=16213
--- net/sunrpc/xprtsock.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-)
net/sunrpc/xprtsock.c +22 -16
@@ -224,7 +224,8 @@ struct sock_xprt {* State of TCP reply receive */ __be32 tcp_fraghdr, - tcp_xid; + tcp_xid, + tcp_calldir;u32 tcp_offset, tcp_reclen;
@@ -947,7 +948,7 @@ static inline void xs_tcp_read_calldir(s {size_t len, used;u32 offset; -__be32 calldir; +char *p;/* * We want transport->tcp_offset to be 8 at the end of this routine
@@ -956,26 +957,33 @@ static inline void xs_tcp_read_calldir(s* transport->tcp_offset is 4 (after having already read the xid). */ offset = transport->tcp_offset -sizeof (transport->tcp_xid); - len =sizeof (calldir) - offset; + len =sizeof (transport->tcp_calldir) - offset;dprintk ("RPC: reading CALL/REPLY flag (%Zu bytes)\n" , len); - used =xdr_skb_read_bits (desc, &calldir, len); + p = ((char *) &transport->tcp_calldir) + offset; + used =xdr_skb_read_bits (desc, p, len); transport->tcp_offset += used;if (used != len)return ; transport->tcp_flags &= ~TCP_RCV_READ_CALLDIR ; - transport->tcp_flags |=TCP_RCV_COPY_CALLDIR ; - transport->tcp_flags |=TCP_RCV_COPY_DATA ;/* * We don't yet have the XDR buffer, so we will write the calldir * out after we get the buffer from the 'struct rpc_rqst' */ -if (ntohl (calldir) ==RPC_REPLY ) +switch (ntohl (transport->tcp_calldir)) { +case RPC_REPLY : + transport->tcp_flags |=TCP_RCV_COPY_CALLDIR ; + transport->tcp_flags |=TCP_RCV_COPY_DATA ; transport->tcp_flags |=TCP_RPC_REPLY ; -else +break ; +case RPC_CALL : + transport->tcp_flags |=TCP_RCV_COPY_CALLDIR ; + transport->tcp_flags |=TCP_RCV_COPY_DATA ; transport->tcp_flags &= ~TCP_RPC_REPLY ; -dprintk ("RPC: reading %s CALL/REPLY flag %08x\n" , - (transport->tcp_flags &TCP_RPC_REPLY ) ? -"reply for" :"request with" , calldir); +break ; +default : +dprintk ("RPC: invalid request message type\n" ); +xprt_force_disconnect (&transport->xprt); + }xs_tcp_check_fraghdr (transport); }
@@ -995,12 +1003,10 @@ static inline void xs_tcp_read_common(st/* * Save the RPC direction in the XDR buffer */ -__be32 calldir = transport->tcp_flags &TCP_RPC_REPLY ? -htonl (RPC_REPLY ) :0 ; -memcpy (rcvbuf->head[0 ].iov_base + transport->tcp_copied, - &calldir,sizeof (calldir)); - transport->tcp_copied +=sizeof (calldir); + &transport->tcp_calldir, +sizeof (transport->tcp_calldir)); + transport->tcp_copied +=sizeof (transport->tcp_calldir); transport->tcp_flags &= ~TCP_RCV_COPY_CALLDIR ; }
PATCH 35/140 ath5k: drop warning on jumbo frames
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 9637e516d16a58b13f6098cfe899e22963132be3 upstream.
Jumbo frames are not supported, and if they are seen it is likely a bogus frame so just silently discard them instead of warning on them all time. Also, instead of dropping them immediately though move the check *after* we check for all sort of frame errors. This should enable us to discard these frames if the hardware picks other bogus items first. Lets see if we still get those jumbo counters increasing still with this.
Jumbo frames would happen if we tell hardware we can support a small 802.11 chunks of DMA'd frame, hardware would split RX'd frames into parts and we'd have to reconstruct them in software. This is done with USB due to the bulk size but with ath5k we already provide a good limit to hardware and this should not be happening.
This is reported quite often and if it fills the logs then this needs to be addressed and to avoid spurious reports.
--- drivers/net/wireless/ath/ath5k/base.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +2 -5
@@ -1851,11 +1851,6 @@ ath5k_tasklet_rx(unsigned long data)return ; } -if (unlikely (rs.rs_more)) { -ATH5K_WARN (sc,"unsupported jumbo\n" ); - goto next; - } -if (unlikely (rs.rs_status)) {if (rs.rs_status &AR5K_RXERR_PHY ) goto next;
@@ -1885,6 +1880,8 @@ ath5k_tasklet_rx(unsigned long data) sc->opmode != NL80211_IFTYPE_MONITOR) goto next; } +if (unlikely (rs.rs_more)) + goto next; accept: next_skb =ath5k_rx_skb_alloc (sc, &next_skb_addr);
PATCH 36/140 ath9k: Avoid corrupt frames being forwarded to mac80211.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <[email protected]>
commit 3a37495268ab45507b4cab9d4cb18c5496ab7a10 upstream.
If bit 29 is set, MAC H/W can attempt to decrypt the received aggregate with WEP or TKIP, eventhough the received frame may be a CRC failed corrupted frame. If this bit is set, H/W obeys key type in keycache. If it is not set and if the key type in keycache is neither open nor AES, H/W forces key type to be open. But bit 29 should be set to 1 for AsyncFIFO feature to encrypt/decrypt the aggregate with WEP or TKIP.
--- drivers/net/wireless/ath/ath9k/initvals.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/initvals.h +4 -4
@@ -246,7 +246,7 @@ static const u32 ar5416Common[][2] = { { 0x00008258, 0x00000000 }, { 0x0000825c, 0x400000ff }, { 0x00008260, 0x00080922 }, - { 0x00008264, 0xa8000010 }, + { 0x00008264, 0x88000010 }, { 0x00008270, 0x00000000 }, { 0x00008274, 0x40000000 }, { 0x00008278, 0x003e4180 },
@@ -2766,7 +2766,7 @@ static const u32 ar9280Common_9280_2[][2 { 0x00008258, 0x00000000 }, { 0x0000825c, 0x400000ff }, { 0x00008260, 0x00080922 }, - { 0x00008264, 0xa8a00010 }, + { 0x00008264, 0x88a00010 }, { 0x00008270, 0x00000000 }, { 0x00008274, 0x40000000 }, { 0x00008278, 0x003e4180 },
@@ -3936,7 +3936,7 @@ static const u_int32_t ar9285Common_9285 { 0x00008258, 0x00000000 }, { 0x0000825c, 0x400000ff }, { 0x00008260, 0x00080922 }, - { 0x00008264, 0xa8a00010 }, + { 0x00008264, 0x88a00010 }, { 0x00008270, 0x00000000 }, { 0x00008274, 0x40000000 }, { 0x00008278, 0x003e4180 },
@@ -5073,7 +5073,7 @@ static const u_int32_t ar9287Common_9287 { 0x00008258, 0x00000000 }, { 0x0000825c, 0x400000ff }, { 0x00008260, 0x00080922 }, - { 0x00008264, 0xa8a00010 }, + { 0x00008264, 0x88a00010 }, { 0x00008270, 0x00000000 }, { 0x00008274, 0x40000000 }, { 0x00008278, 0x003e4180 },
PATCH 37/140 hostap: Protect against initialization interrupt
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tim Gardner <[email protected]>
commit d6a574ff6bfb842bdb98065da053881ff527be46 upstream.
Use an irq spinlock to hold off the IRQ handler until enough early card init is complete such that the handler can run without faulting.
--- drivers/net/wireless/hostap/hostap_cs.c | 15 +++++++++++++-- drivers/net/wireless/hostap/hostap_hw.c | 13 +++++++++++++ drivers/net/wireless/hostap/hostap_wlan.h | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-)
drivers/net/wireless/hostap/hostap_cs.c +13 -2
@@ -602,6 +602,7 @@ static int prism2_config(struct pcmcia_dlocal_info_t *local;int ret =1 ;struct hostap_cs_priv *hw_priv; +unsigned long flags;PDEBUG (DEBUG_FLOW ,"prism2_config()\n" );
@@ -636,6 +637,12 @@ static int prism2_config(struct pcmcia_d link->dev_node = &hw_priv->node;/* +* Make sure the IRQ handler cannot proceed until at least +* dev->base_addr is initialized. +*/ +spin_lock_irqsave (&local->irq_init_lock, flags); + +/* * Allocate an interrupt line. Note that this does not assign a * handler to the interrupt, unless the 'Handler' member of the * irq structure is initialized.
@@ -645,7 +652,7 @@ static int prism2_config(struct pcmcia_d link->irq.Handler = prism2_interrupt; ret =pcmcia_request_irq (link, &link->irq);if (ret) - goto failed; + goto failed_unlock; }/*
@@ -655,11 +662,13 @@ static int prism2_config(struct pcmcia_d*/ ret =pcmcia_request_configuration (link, &link->conf);if (ret) - goto failed; + goto failed_unlock; dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; +spin_unlock_irqrestore (&local->irq_init_lock, flags); +/* Finally, report what we've done */ printk (KERN_INFO "%s: index 0x%02x: " , dev_info, link->conf.ConfigIndex);
@@ -688,6 +697,8 @@ static int prism2_config(struct pcmcia_d }return ret; + failed_unlock: +spin_unlock_irqrestore (&local->irq_init_lock, flags); failed:kfree (hw_priv);prism2_release ((u_long )link);
drivers/net/wireless/hostap/hostap_hw.c +13 -0
@@ -2621,6 +2621,18 @@ static irqreturn_t prism2_interrupt(int iface =netdev_priv (dev); local = iface->local; +/* Detect early interrupt before driver is fully configued */ +spin_lock (&local->irq_init_lock); +if (!dev->base_addr) { +if (net_ratelimit ()) { +printk (KERN_DEBUG "%s: Interrupt, but dev not configured\n" , + dev->name); + } +spin_unlock (&local->irq_init_lock); +return IRQ_HANDLED ; + } +spin_unlock (&local->irq_init_lock); +prism2_io_debug_add (dev,PRISM2_IO_DEBUG_CMD_INTERRUPT ,0 ,0 );if (local->func->card_present && !local->func->card_present (local)) {
@@ -3138,6 +3150,7 @@ prism2_init_local_data(struct prism2_helspin_lock_init (&local->cmdlock);spin_lock_init (&local->baplock);spin_lock_init (&local->lock); +spin_lock_init (&local->irq_init_lock);mutex_init (&local->rid_bap_mtx);if (card_idx <0 || card_idx >=MAX_PARM_DEVICES )
drivers/net/wireless/hostap/hostap_wlan.h +1 -1
@@ -654,7 +654,7 @@ struct local_info {rwlock_t iface_lock;/* hostap_interfaces read lock; use write lock * when removing entries from the list. * TX and RX paths can use read lock. */ -spinlock_t cmdlock, baplock, lock; +spinlock_t cmdlock, baplock, lock, irq_init_lock;struct mutex rid_bap_mtx;u16 infofid;/* MAC buffer id for info frame */ /* txfid, intransmitfid, next_txtid, and next_alloc are protected by
PATCH 38/140 TPM: ReadPubEK output struct fix
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajiv Andrade <[email protected]>
commit 02a077c52ef7631275a79862ffd9f3dbe9d38bc2 upstream.
This patch adds a missing element of the ReadPubEK command output, that prevents future overflow of this buffer when copying the TPM output result into it.
Prevents a kernel panic in case the user tries to read the pubek from sysfs.
--- drivers/char/tpm/tpm.h | 1 + 1 file changed, 1 insertion(+)
drivers/char/tpm/tpm.h +1 -0
@@ -224,6 +224,7 @@ struct tpm_readpubek_params_out {u8 algorithm[4 ];u8 encscheme[2 ];u8 sigscheme[2 ]; +__be32 paramsize;u8 parameters[12 ];/*assuming RSA*/ __be32 keysize;u8 modulus[256 ];
PATCH 39/140 fb: fix colliding defines for fb flags.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Airlie <[email protected]>
commit b26c949755c06ec79e55a75817210083bd78fc9a upstream.
When I added the flags I must have been using a 25 line terminal and missed the following flags.
The collided with flag has one user in staging despite being in-tree for 5 years.
I'm happy to push this via my drm tree unless someone really wants to do it.
--- include/linux/fb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/fb.h +2 -2
@@ -785,8 +785,6 @@ struct fb_tile_ops {#define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */ #define FBINFO_MISC_TILEBLITTING 0x20000/* use tile blitting */ -#define FBINFO_MISC_FIRMWARE 0x40000/* a replaceable firmware -inited framebuffer */ /* A driver may set this flag to indicate that it does want a set_par to be * called every time when fbcon_switch is executed. The advantage is that with
@@ -800,6 +798,8 @@ struct fb_tile_ops {*/ #define FBINFO_MISC_ALWAYS_SETPAR 0x40000 +/* where the fb is a firmware driver, and can be replaced with a proper one */ +#define FBINFO_MISC_FIRMWARE 0x80000/* * Host and GPU endianness differ. */
PATCH 40/140 iwlwifi: cancel scan watchdog in iwl_bg_abort_scan
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: John W. Linville <[email protected]>
commit a69b03e941abae00380fc6bc1877fb797a1b31e6 upstream.
Avoids this:
WARNING: at net/mac80211/scan.c:312 ieee80211_scan_completed+0x5f/0x1f1 [mac80211]() Hardware name: Latitude E5400 Modules linked in: aes_x86_64 aes_generic fuse ipt_MASQUERADE iptable_nat
nf_nat rfcomm sco bridge stp llc bnep l2cap sunrpc cpufreq_ondemand acpi_cpufreq freq_table xt_physdev ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 kvm_intel kvm uinput arc4 ecb snd_hda_codec_intelhdmi snd_hda_codec_idt snd_hda_intel iwlagn snd_hda_codec snd_hwdep snd_seq snd_seq_device iwlcore snd_pcm dell_wmi sdhci_pci sdhci iTCO_wdt tg3 dell_laptop mmc_core i2c_i801 wmi mac80211 snd_timer iTCO_vendor_support btusb joydev dcdbas cfg80211 bluetooth snd soundcore microcode rfkill snd_page_alloc firewire_ohci firewire_core crc_itu_t yenta_socket rsrc_nonstatic i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: scsi_wait_scan]
Pid: 979, comm: iwlagn Tainted: G W 2.6.33.3-85.fc13.x86_64 #1
Call Trace: [<ffffffff8104b558>] warn_slowpath_common+0x77/0x8f [<ffffffff8104b57f>] warn_slowpath_null+0xf/0x11 [<ffffffffa01bb7d9>] ieee80211_scan_completed+0x5f/0x1f1 [mac80211] [<ffffffffa02a23f0>] iwl_bg_scan_completed+0xbb/0x17a [iwlcore] [<ffffffff81060d3d>] worker_thread+0x1a4/0x232 [<ffffffffa02a2335>] ? iwl_bg_scan_completed+0x0/0x17a [iwlcore] [<ffffffff81064817>] ? autoremove_wake_function+0x0/0x34 [<ffffffff81060b99>] ? worker_thread+0x0/0x232 [<ffffffff810643c7>] kthread+0x7a/0x82 [<ffffffff8100a924>] kernel_thread_helper+0x4/0x10 [<ffffffff8106434d>] ? kthread+0x0/0x82 [<ffffffff8100a920>] ? kernel_thread_helper+0x0/0x10
Reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=590436
--- drivers/net/wireless/iwlwifi/iwl-scan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/iwlwifi/iwl-scan.c +1 -0
@@ -812,6 +812,7 @@ void iwl_bg_abort_scan(struct work_strucmutex_lock (&priv->mutex); +cancel_delayed_work_sync (&priv->scan_check);set_bit (STATUS_SCAN_ABORTING , &priv->status);iwl_send_scan_abort (priv);
PATCH 41/140 mac80211: do not wip out old supported rates
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit f0b058b61711ebf5be94d6865ca7b2c259b71d37 upstream.
Use old supported rates, if AP do not provide supported rates information element in a new managment frame.
--- net/mac80211/scan.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
net/mac80211/scan.c +11 -10
@@ -60,7 +60,7 @@ ieee80211_bss_info_update(struct ieee802 bool beacon) {struct ieee80211_bss *bss; -int clen; +int clen, srlen;s32 signal =0 ;if (local->hw.flags &IEEE80211_HW_SIGNAL_DBM )
@@ -92,23 +92,24 @@ ieee80211_bss_info_update(struct ieee802if (bss->dtim_period ==0 ) bss->dtim_period =1 ; - bss->supp_rates_len =0 ; +/* replace old supported rates if we get new values */ + srlen =0 ;if (elems->supp_rates) { - clen =IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; + clen =IEEE80211_MAX_SUPP_RATES ;if (clen > elems->supp_rates_len) clen = elems->supp_rates_len; -memcpy (&bss->supp_rates[bss->supp_rates_len], elems->supp_rates, - clen); - bss->supp_rates_len += clen; +memcpy (bss->supp_rates, elems->supp_rates, clen); + srlen += clen; }if (elems->ext_supp_rates) { - clen =IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; + clen =IEEE80211_MAX_SUPP_RATES - srlen;if (clen > elems->ext_supp_rates_len) clen = elems->ext_supp_rates_len; -memcpy (&bss->supp_rates[bss->supp_rates_len], - elems->ext_supp_rates, clen); - bss->supp_rates_len += clen; +memcpy (bss->supp_rates + srlen, elems->ext_supp_rates, clen); + srlen += clen; } +if (srlen) + bss->supp_rates_len = srlen; bss->wmm_used = elems->wmm_param || elems->wmm_info;
PATCH 42/140 mac80211: Handle mesh action frames in ieee80211_rx_h_action
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Javier Cardona <[email protected]>
commit 1cb561f83793191cf86a2db3948d28f5f42df9ff upstream.
This fixes the problem introduced in commit 8404080568613d93ad7cf0a16dfb68 which broke mesh peer link establishment.
changes:
v2 Added missing break (Johannes)
v3 Broke original patch into two (Johannes)
--- include/linux/ieee80211.h | 2 ++ net/mac80211/rx.c | 5 +++++ 2 files changed, 7 insertions(+)
include/linux/ieee80211.h +2 -0
@@ -1137,6 +1137,8 @@ enum ieee80211_category {WLAN_CATEGORY_SA_QUERY =8 ,WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION =9 ,WLAN_CATEGORY_WMM =17 , +WLAN_CATEGORY_MESH_PLINK =30 ,/* Pending ANA approval */ +WLAN_CATEGORY_MESH_PATH_SEL =32 ,/* Pending ANA approval */ WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED =126 , WLAN_CATEGORY_VENDOR_SPECIFIC = 127, };
net/mac80211/rx.c +5 -0
@@ -2023,6 +2023,11 @@ ieee80211_rx_h_action(struct ieee80211_rreturn RX_CONTINUE ; }break ; +case WLAN_CATEGORY_MESH_PLINK : +case WLAN_CATEGORY_MESH_PATH_SEL : +if (ieee80211_vif_is_mesh (&sdata->vif)) +return ieee80211_mesh_rx_mgmt (sdata, rx->skb); +break ;default :/* do not process rejected action frames */ if (mgmt->u.action.category &0x80 )
PATCH 43/140 Btrfs: fix checks in BTRFS_IOC_CLONE_RANGE
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Rosenberg <[email protected]>
commit 2ebc3464781ad24474abcbd2274e6254689853b5 upstream.
1. The BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE ioctls should check whether the donor file is append-only before writing to it.
2. The BTRFS_IOC_CLONE_RANGE ioctl appears to have an integer overflow that allows a user to specify an out-of-bounds range to copy from the source file (if off + len wraps around). I haven't been able to successfully exploit this, but I'd imagine that a clever attacker could use this to read things he shouldn't. Even if it's not exploitable, it couldn't hurt to be safe.
--- fs/btrfs/ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/ioctl.c +2 -2
@@ -952,7 +952,7 @@ static noinline long btrfs_ioctl_clone(s*/ /* the destination must be opened for writing */ -if (!(file->f_mode &FMODE_WRITE )) +if (!(file->f_mode &FMODE_WRITE ) || (file->f_flags &O_APPEND ))return -EINVAL ; ret =mnt_want_write (file->f_path.mnt);
@@ -1005,7 +1005,7 @@ static noinline long btrfs_ioctl_clone(s/* determine range to clone */ ret = -EINVAL ; -if (off >= src->i_size || off + len > src->i_size) +if (off + len > src->i_size || off + len < off) goto out_unlock;if (len ==0 ) olen = len = src->i_size - off;
PATCH 44/140 p54pci: add Symbol AP-300 minipci adapters pciid
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joerg Albert <[email protected]>
commit 50900f1698f68127e54c67fdfe829e4a97b1be2b upstream.
--- drivers/net/wireless/p54/p54pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/p54/p54pci.c +2 -0
@@ -40,6 +40,8 @@ static struct pci_device_id p54p_table[] { PCI_DEVICE(0x1260, 0x3877) },/* Intersil PRISM Javelin/Xbow Wireless LAN adapter */ { PCI_DEVICE(0x1260, 0x3886) }, +/* Intersil PRISM Xbow Wireless LAN adapter (Symbol AP-300) */ + { PCI_DEVICE(0x1260, 0xffff) }, { }, };
PATCH 45/140 dynamic debug: move ddebug_remove_module() down into free_module()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jason Baron <[email protected]>
commit b82bab4bbe9efa7bc7177fc20620fff19bd95484 upstream.
The command
echo "file ec.c +p" >/sys/kernel/debug/dynamic_debug/control
causes an oops.
Move the call to ddebug_remove_module() down into free_module(). In this way it should be called from all error paths. Currently, we are missing the remove if the module init routine fails.
--- kernel/module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/module.c +3 -1
@@ -720,7 +720,6 @@ SYSCALL_DEFINE2(delete_module, const chamutex_lock (&module_mutex);/* Store the name of the last unloaded module for diagnostic purposes */ strlcpy (last_unloaded_module, mod->name,sizeof (last_unloaded_module)); -ddebug_remove_module (mod->name);free_module (mod); out:
@@ -1383,6 +1382,9 @@ static void free_module(struct module *mremove_sect_attrs (mod);mod_kobject_remove (mod); +/* Remove dynamic debug info */ +ddebug_remove_module (mod->name); +/* Arch-specific cleanup. */ module_arch_cleanup (mod);
PATCH 46/140 drm/i915: fix hibernation since i915 self-reclaim fixes
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 985b823b919273fe1327d56d2196b4f92e5d0fae upstream.
Since commit 4bdadb9785696439c6e2b3efe34aa76df1149c83 ("drm/i915:
Selectively enable self-reclaim"), we've been passing GFP_MOVABLE to the i915 page allocator where we weren't before due to some over-eager removal of the page mapping gfp_flags games the code used to play.
This caused hibernate on Intel hardware to result in a lot of memory corruptions on resume. See for example
http://bugzilla.kernel.org/show_bug.cgi?id=13811
--- drivers/gpu/drm/i915/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -2288,7 +2288,7 @@ i915_gem_object_get_pages(struct drm_gem mapping = inode->i_mapping;for (i =0 ; i < page_count; i++) { page =read_cache_page_gfp (mapping, i, -mapping_gfp_mask (mapping) | +GFP_HIGHUSER | __GFP_COLD | gfpmask);if (IS_ERR (page))
PATCH 47/140 drm/i915: add reclaimable to i915 self-reclaimable page allocations
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit cd9f040df6ce46573760a507cb88192d05d27d86 upstream.
The hibernate issues that got fixed in commit 985b823b9192 ("drm/i915:
fix hibernation since i915 self-reclaim fixes") turn out to have been incomplete. Vefa Bicakci tested lots of hibernate cycles, and without the __GFP_RECLAIMABLE flag the system eventually fails to resume.
With the flag added, Vefa can apparently hibernate forever (or until he gets bored running his automated scripts, whichever comes first).
The reclaimable flag was there originally, and was one of the flags that were dropped (unintentionally) by commit 4bdadb978569 ("drm/i915:
Selectively enable self-reclaim") that introduced all these problems, but I didn't want to just blindly add back all the flags in commit 985b823b9192, and it looked like __GFP_RECLAIM wasn't necessary. It clearly was.
I still suspect that there is some subtle reason we're missing that causes the problems, but __GFP_RECLAIMABLE is certainly not wrong to use in this context, and is what the code historically used. And we have no idea what the causes the corruption without it.
--- drivers/gpu/drm/i915/i915_gem.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_gem.c +1 -0
@@ -2290,6 +2290,7 @@ i915_gem_object_get_pages(struct drm_gem page =read_cache_page_gfp (mapping, i,GFP_HIGHUSER | __GFP_COLD | + __GFP_RECLAIMABLE | gfpmask);if (IS_ERR (page)) goto err_pages;
PATCH 48/140 i915: fix lock imbalance on error path...
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel J Blueman <[email protected]>
commit f953c9353f5fe6e98fa7f32f51060a74d845b5f8 upstream.
While investigating Intel i5 Arrandale GPU lockups with -rc4, I noticed a lock imbalance.
--- drivers/gpu/drm/i915/i915_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_drv.c +1 -0
@@ -328,6 +328,7 @@ int i965_reset(struct drm_device *dev, u } }else {DRM_ERROR ("Error occurred. Don't know how to reset this chip.\n" ); +mutex_unlock (&dev->struct_mutex);return -ENODEV ; }
PATCH 49/140 drm/i915: Define MI_ARB_STATE bits
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Keith Packard <[email protected]>
commit 45503ded966c98e604c9667c0b458d40666b9ef3 upstream.
The i915 memory arbiter has a register full of configuration bits which are currently not defined in the driver header file.
--- drivers/gpu/drm/i915/i915_reg.h | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +64 -0
@@ -326,6 +326,70 @@#define LM_BURST_LENGTH 0x00000700#define LM_FIFO_WATERMARK 0x0000001F#define MI_ARB_STATE 0x020e4/* 915+ only */ +#define MI_ARB_MASK_SHIFT 16/* shift for enable bits */ + +/* Make render/texture TLB fetches lower priorty than associated data +* fetches. This is not turned on by default +*/ +#define MI_ARB_RENDER_TLB_LOW_PRIORITY (1 << 15) + +/* Isoch request wait on GTT enable (Display A/B/C streams). +* Make isoch requests stall on the TLB update. May cause +* display underruns (test mode only) +*/ +#define MI_ARB_ISOCH_WAIT_GTT (1 << 14) + +/* Block grant count for isoch requests when block count is +* set to a finite value. +*/ +#define MI_ARB_BLOCK_GRANT_MASK (3 << 12) +#define MI_ARB_BLOCK_GRANT_8 (0 << 12)/* for 3 display planes */ +#define MI_ARB_BLOCK_GRANT_4 (1 << 12)/* for 2 display planes */ +#define MI_ARB_BLOCK_GRANT_2 (2 << 12)/* for 1 display plane */ +#define MI_ARB_BLOCK_GRANT_0 (3 << 12)/* don't use */ + +/* Enable render writes to complete in C2/C3/C4 power states. +* If this isn't enabled, render writes are prevented in low +* power states. That seems bad to me. +*/ +#define MI_ARB_C3_LP_WRITE_ENABLE (1 << 11) + +/* This acknowledges an async flip immediately instead +* of waiting for 2TLB fetches. +*/ +#define MI_ARB_ASYNC_FLIP_ACK_IMMEDIATE (1 << 10) + +/* Enables non-sequential data reads through arbiter +*/ +#define MI_ARB_DUAL_DATA_PHASE_DISABLE (1 << 9) + +/* Disable FSB snooping of cacheable write cycles from binner/render +* command stream +*/ +#define MI_ARB_CACHE_SNOOP_DISABLE (1 << 8) + +/* Arbiter time slice for non-isoch streams */ +#define MI_ARB_TIME_SLICE_MASK (7 << 5) +#define MI_ARB_TIME_SLICE_1 (0 << 5) +#define MI_ARB_TIME_SLICE_2 (1 << 5) +#define MI_ARB_TIME_SLICE_4 (2 << 5) +#define MI_ARB_TIME_SLICE_6 (3 << 5) +#define MI_ARB_TIME_SLICE_8 (4 << 5) +#define MI_ARB_TIME_SLICE_10 (5 << 5) +#define MI_ARB_TIME_SLICE_14 (6 << 5) +#define MI_ARB_TIME_SLICE_16 (7 << 5) + +/* Low priority grace period page size */ +#define MI_ARB_LOW_PRIORITY_GRACE_4KB (0 << 4)/* default */ +#define MI_ARB_LOW_PRIORITY_GRACE_8KB (1 << 4) + +/* Disable display A/B trickle feed */ +#define MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE (1 << 2) + +/* Set display plane priority */ +#define MI_ARB_DISPLAY_PRIORITY_A_B (0 << 0)/* display A > display B */ +#define MI_ARB_DISPLAY_PRIORITY_B_A (1 << 0)/* display B > display A */ +#define CACHE_MODE_0 0x02120/* 915+ only */ #define CM0_MASK_SHIFT 16#define CM0_IZ_OPT_DISABLE (1<<6)
PATCH 50/140 drm/i915: enable low power render writes on GEN3 hardware.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Airlie <[email protected]>
commit 944001201ca0196bcdb088129e5866a9f379d08c upstream.
A lot of 945GMs have had stability issues for a long time, this manifested as X hangs, blitter engine hangs, and lots of crashes.
one such report is at:
https://bugs.freedesktop.org/show_bug.cgi?id=20560
along with numerous distro bugzillas.
This only took a week of digging and hair ripping to figure out.
Tracked down and tested on a 945GM Lenovo T60,
previously running
x11perf -copypixwin500
or
x11perf -copywinpix500
repeatedly would cause the GPU to wedge within 4 or 5 tries, with random busy bits set.
After this patch no hangs were observed.
--- drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +10 -0
@@ -4999,6 +4999,16 @@ i915_gem_load(struct drm_device *dev)list_add (&dev_priv->mm.shrink_list, &shrink_list);spin_unlock (&shrink_list_lock); +/* On GEN3 we really need to make sure the ARB C3 LP bit is set */ +if (IS_GEN3 (dev)) { +u32 tmp =I915_READ (MI_ARB_STATE ); +if (!(tmp &MI_ARB_C3_LP_WRITE_ENABLE )) { +/* arb state is a masked write, so set bit + bit in mask */ + tmp =MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE <<MI_ARB_MASK_SHIFT ); +I915_WRITE (MI_ARB_STATE , tmp); + } + } +/* Old X drivers will take 0-2 for front, back, depth buffers */ dev_priv->fence_reg_start =3 ;
PATCH 51/140 drm/i915: Make G4X-style PLL search more permissive
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Adam Jackson <[email protected]>
commit 6ba770dc5c334aff1c055c8728d34656e0f091e2 upstream.
Fixes an Ironlake laptop with a 68.940MHz 1280x800 panel and 120MHz SSC reference clock.
More generally, the 0.488% tolerance used before is just too tight to reliably find a PLL setting. I extracted the search algorithm and modified it to find the dot clocks with maximum error over the valid range for the given output type:
http://people.freedesktop.org/~ajax/intel_g4x_find_best_pll.c
This gave:
Worst dotclock for Ironlake DAC refclk is 350000kHz (error 0.00571) Worst dotclock for Ironlake SL-LVDS refclk is 102321kHz (error 0.00524) Worst dotclock for Ironlake DL-LVDS refclk is 219642kHz (error 0.00488) Worst dotclock for Ironlake SL-LVDS SSC refclk is 84374kHz (error 0.00529) Worst dotclock for Ironlake DL-LVDS SSC refclk is 183035kHz (error 0.00488) Worst dotclock for G4X SDVO refclk is 267600kHz (error 0.00448) Worst dotclock for G4X HDMI refclk is 334400kHz (error 0.00478) Worst dotclock for G4X SL-LVDS refclk is 95571kHz (error 0.00449) Worst dotclock for G4X DL-LVDS refclk is 224000kHz (error 0.00510)
--- drivers/gpu/drm/i915/intel_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -879,8 +879,8 @@ intel_g4x_find_best_PLL(const intel_limiintel_clock_t clock;int max_n;bool found; -/* approximately equals target * 0.00488 */ -int err_most = (target >>8 ) + (target >>10 ); +/* approximately equals target * 0.00585 */ +int err_most = (target >>8 ) + (target >>9 ); found = false;if (intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS )) {
PATCH 52/140 drm/radeon/r200: handle more hw tex coord types
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roland Scheidegger <[email protected]>
commit 688acaa2897462e4c5e2482496e2868db0760809 upstream.
Code did not handle projected 2d and depth coordinates, meaning potentially set 3d or cube special handling might stick.
(Not sure what depth coord actually does, but I guess handling it like a normal coordinate is the right thing to do.)
Might be related to https://bugs.freedesktop.org/show_bug.cgi?id=26428
--- drivers/gpu/drm/radeon/r200.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/radeon/r200.c +2 -0
@@ -368,6 +368,8 @@ int r200_packet0_check(struct radeon_cs_/* 2D, 3D, CUBE */ switch (tmp) {case 0 : +case 3 : +case 4 :case 5 :case 6 :case 7 :
PATCH 53/140 drm/radeon/r100/r200: fix calculation of compressed cube maps
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roland Scheidegger <[email protected]>
commit 37cf6b03f9f28c62dafb0b9ce5f1ba29c8baffa9 upstream.
This needs similar handling to other compressed textures. Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=26428
--- drivers/gpu/drm/radeon/r100.c | 58 ++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 27 deletions(-)
drivers/gpu/drm/radeon/r100.c +31 -27
@@ -2750,33 +2750,6 @@ static inline void r100_cs_track_textureDRM_ERROR ("compress format %d\n" , t->compress_format); } -static int r100_cs_track_cube (struct radeon_device *rdev, -struct r100_cs_track *track,unsigned idx) -{ -unsigned face, w, h; -struct radeon_bo *cube_robj; -unsigned long size; - -for (face =0 ; face <5 ; face++) { - cube_robj = track->textures[idx].cube_info[face].robj; - w = track->textures[idx].cube_info[face].width; - h = track->textures[idx].cube_info[face].height; - - size = w * h; - size *= track->textures[idx].cpp; - - size += track->textures[idx].cube_info[face].offset; - -if (size >radeon_bo_size (cube_robj)) { -DRM_ERROR ("Cube texture offset greater than object size %lu %lu\n" , - size,radeon_bo_size (cube_robj)); -r100_cs_track_texture_print (&track->textures[idx]); -return -1 ; - } - } -return 0 ; -} -static int r100_track_compress_size (int compress_format,int w,int h) {int block_width, block_height, block_bytes;
@@ -2807,6 +2780,37 @@ static int r100_track_compress_size(intreturn sz; } +static int r100_cs_track_cube (struct radeon_device *rdev, +struct r100_cs_track *track,unsigned idx) +{ +unsigned face, w, h; +struct radeon_bo *cube_robj; +unsigned long size; +unsigned compress_format = track->textures[idx].compress_format; + +for (face =0 ; face <5 ; face++) { + cube_robj = track->textures[idx].cube_info[face].robj; + w = track->textures[idx].cube_info[face].width; + h = track->textures[idx].cube_info[face].height; + +if (compress_format) { + size =r100_track_compress_size (compress_format, w, h); + }else + size = w * h; + size *= track->textures[idx].cpp; + + size += track->textures[idx].cube_info[face].offset; + +if (size >radeon_bo_size (cube_robj)) { +DRM_ERROR ("Cube texture offset greater than object size %lu %lu\n" , + size,radeon_bo_size (cube_robj)); +r100_cs_track_texture_print (&track->textures[idx]); +return -1 ; + } + } +return 0 ; +} +static int r100_cs_track_texture_check (struct radeon_device *rdev,struct r100_cs_track *track) {
PATCH 54/140 drm/radeon/kms: CS checker texture fixes for r1xx/r2xx/r3xx
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roland Scheidegger <[email protected]>
commit f9da52d54eb0e8822b5e7f32ab1cfa6522533d6e upstream.
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28459
agd5f: apply to r1xx/r2xx as well.
--- drivers/gpu/drm/radeon/r100.c | 3 +++ drivers/gpu/drm/radeon/r200.c | 3 +++ drivers/gpu/drm/radeon/r300.c | 5 +++++ 3 files changed, 11 insertions(+)
drivers/gpu/drm/radeon/r100.c +3 -0
@@ -1384,6 +1384,7 @@ static int r100_packet0_check(struct radcase RADEON_TXFORMAT_RGB332 :case RADEON_TXFORMAT_Y8 : track->textures[i].cpp =1 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case RADEON_TXFORMAT_AI88 :case RADEON_TXFORMAT_ARGB1555 :
@@ -1395,12 +1396,14 @@ static int r100_packet0_check(struct radcase RADEON_TXFORMAT_LDUDV655 :case RADEON_TXFORMAT_DUDV88 : track->textures[i].cpp =2 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case RADEON_TXFORMAT_ARGB8888 :case RADEON_TXFORMAT_RGBA8888 :case RADEON_TXFORMAT_SHADOW32 :case RADEON_TXFORMAT_LDUDUV8888 : track->textures[i].cpp =4 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case RADEON_TXFORMAT_DXT1 : track->textures[i].cpp =1 ;
drivers/gpu/drm/radeon/r200.c +3 -0
@@ -405,6 +405,7 @@ int r200_packet0_check(struct radeon_cs_case R200_TXFORMAT_RGB332 :case R200_TXFORMAT_Y8 : track->textures[i].cpp =1 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R200_TXFORMAT_AI88 :case R200_TXFORMAT_ARGB1555 :
@@ -416,6 +417,7 @@ int r200_packet0_check(struct radeon_cs_case R200_TXFORMAT_DVDU88 :case R200_TXFORMAT_AVYU4444 : track->textures[i].cpp =2 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R200_TXFORMAT_ARGB8888 :case R200_TXFORMAT_RGBA8888 :
@@ -423,6 +425,7 @@ int r200_packet0_check(struct radeon_cs_case R200_TXFORMAT_BGR111110 :case R200_TXFORMAT_LDVDU8888 : track->textures[i].cpp =4 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R200_TXFORMAT_DXT1 : track->textures[i].cpp =1 ;
drivers/gpu/drm/radeon/r300.c +5 -0
@@ -870,6 +870,7 @@ static int r300_packet0_check(struct radcase R300_TX_FORMAT_Y4X4 :case R300_TX_FORMAT_Z3Y3X2 : track->textures[i].cpp =1 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R300_TX_FORMAT_X16 :case R300_TX_FORMAT_Y8X8 :
@@ -881,6 +882,7 @@ static int r300_packet0_check(struct radcase R300_TX_FORMAT_B8G8_B8G8 :case R300_TX_FORMAT_G8R8_G8B8 : track->textures[i].cpp =2 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R300_TX_FORMAT_Y16X16 :case R300_TX_FORMAT_Z11Y11X10 :
@@ -891,14 +893,17 @@ static int r300_packet0_check(struct radcase R300_TX_FORMAT_FL_I32 :case 0x1e : track->textures[i].cpp =4 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R300_TX_FORMAT_W16Z16Y16X16 :case R300_TX_FORMAT_FL_R16G16B16A16 :case R300_TX_FORMAT_FL_I32A32 : track->textures[i].cpp =8 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R300_TX_FORMAT_FL_R32G32B32A32 : track->textures[i].cpp =16 ; + track->textures[i].compress_format =R100_TRACK_COMP_NONE ;break ;case R300_TX_FORMAT_DXT1 : track->textures[i].cpp =1 ;
PATCH 55/140 drm/radeon/kms: fix shared ddc handling
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit b2ea4aa67bfd084834edd070e0a4a47857d6db59 upstream.
Connectors with a shared ddc line can be connected to different encoders.
Reported by Pasi Kärkkäinen <[email protected]> on dri-devel
--- drivers/gpu/drm/radeon/radeon_connectors.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_connectors.c +3 -1
@@ -793,7 +793,9 @@ static enum drm_connector_status radeon_if (connector == list_connector)continue ; list_radeon_connector =to_radeon_connector (list_connector); -if (radeon_connector->devices == list_radeon_connector->devices) { +if (list_radeon_connector->shared_ddc && + (list_radeon_connector->ddc_bus->rec.i2c_id == + radeon_connector->ddc_bus->rec.i2c_id)) {if (drm_detect_hdmi_monitor (radeon_connector->edid)) {if (connector->connector_type ==DRM_MODE_CONNECTOR_DVID ) {kfree (radeon_connector->edid);
PATCH 56/140 drm/radeon/kms: fix shared ddc harder
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 42f14c4b454946650cf0bf66e0b631d02e328f61 upstream.
This fixes a regression caused by b2ea4aa67bfd084834edd070e0a4a47857d6db59 due to the way shared ddc with multiple digital connectors was handled.
You generally have two cases where DDC lines are shared:
- HDMI + VGA
- HDMI + DVI-D
HDMI + VGA is easy to deal with because you can check the EDID for the to see if the attached monitor is digital. A shared DDC line with two digital connectors is more complex. You can't use the hdmi bits in the EDID since they may not be there with DVI<->HDMI adapters. In this case all we can do is check the HPD pins to see which is connected as we have no way of knowing using the EDID.
--- drivers/gpu/drm/radeon/radeon_connectors.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +9 -14
@@ -779,14 +779,14 @@ static enum drm_connector_status radeon_ }else ret = connector_status_connected; -/* multiple connectors on the same encoder with the same ddc line -* This tends to be HDMI and DVI on the same encoder with the -* same ddc line. If the edid says HDMI, consider the HDMI port -* connected and the DVI port disconnected. If the edid doesn't -* say HDMI, vice versa. +/* This gets complicated. We have boards with VGA + HDMI with a +* shared DDC line and we have boards with DVI-D + HDMI with a shared +* DDC line. The latter is more complex because with DVI<->HDMI adapters +* you don't really know what's connected to which port as both are digital. */ if (radeon_connector->shared_ddc && (ret == connector_status_connected)) {struct drm_device *dev = connector->dev; +struct radeon_device *rdev = dev->dev_private;struct drm_connector *list_connector;struct radeon_connector *list_radeon_connector;list_for_each_entry (list_connector, &dev->mode_config.connector_list, head) {
@@ -796,15 +796,10 @@ static enum drm_connector_status radeon_if (list_radeon_connector->shared_ddc && (list_radeon_connector->ddc_bus->rec.i2c_id == radeon_connector->ddc_bus->rec.i2c_id)) { -if (drm_detect_hdmi_monitor (radeon_connector->edid)) { -if (connector->connector_type ==DRM_MODE_CONNECTOR_DVID ) { -kfree (radeon_connector->edid); - radeon_connector->edid =NULL ; - ret = connector_status_disconnected; - } - }else { -if ((connector->connector_type ==DRM_MODE_CONNECTOR_HDMIA ) || - (connector->connector_type ==DRM_MODE_CONNECTOR_HDMIB )) { +/* cases where both connectors are digital */ +if (list_connector->connector_type !=DRM_MODE_CONNECTOR_VGA ) { +/* hpd is our only option in this case */ +if (!radeon_hpd_sense (rdev, radeon_connector->hpd.hpd)) {kfree (radeon_connector->edid); radeon_connector->edid =NULL ; ret = connector_status_disconnected;
PATCH 57/140 drm/radeon/kms: add quirk for ASUS HD 3600 board
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit e153b70b89770968a704eda0b55707c6066b2d44 upstream.
Connector is actually DVI rather than HDMI.
--- drivers/gpu/drm/radeon/radeon_atombios.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/radeon/radeon_atombios.c +9 -0
@@ -268,6 +268,15 @@ static bool radeon_atom_apply_quirks(str } } +/* ASUS HD 3600 board lists the DVI port as HDMI */ +if ((dev->pdev->device ==0x9598 ) && + (dev->pdev->subsystem_vendor ==0x1043 ) && + (dev->pdev->subsystem_device ==0x01e4 )) { +if (*connector_type ==DRM_MODE_CONNECTOR_HDMIA ) { + *connector_type =DRM_MODE_CONNECTOR_DVII ; + } + } +/* ASUS HD 3450 board lists the DVI port as HDMI */ if ((dev->pdev->device == 0x95C5) && (dev->pdev->subsystem_vendor == 0x1043) &&
PATCH 58/140 drm/radeon/kms: fix possible mis-detection of sideport on rs690/rs740
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 5099fa7f23d3711538cbe9fe072b4ce1ba814035 upstream.
Check ulBootUpMemoryClock on AMD IGPs.
Fix regression noticed by Torsten Kaiser <[email protected]>
--- drivers/gpu/drm/radeon/radeon_atombios.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +9 -2
@@ -986,8 +986,15 @@ bool radeon_atombios_sideport_present(stif (igp_info) {switch (crev) {case 1 : -if (igp_info->info.ucMemoryType &0xf0 ) -return true; +/* AMD IGPS */ +if ((rdev->family ==CHIP_RS690 ) || + (rdev->family ==CHIP_RS740 )) { +if (igp_info->info.ulBootUpMemoryClock) +return true; + }else { +if (igp_info->info.ucMemoryType &0xf0 ) +return true; + }break ;case 2 :if (igp_info->info_2.ucMemoryType &0x0f )
PATCH 59/140 drm/radeon/kms: fix legacy LVDS dpms sequence
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 15cb02c0a0338ee724bf23e31c7c410ecbffeeba upstream.
Add delay after turning off the LVDS encoder.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=16389
--- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/radeon_legacy_encoders.c +1 -0
@@ -108,6 +108,7 @@ static void radeon_legacy_lvds_dpms(struudelay (panel_pwr_delay *1000 );WREG32 (RADEON_LVDS_GEN_CNTL , lvds_gen_cntl);WREG32_PLL (RADEON_PIXCLKS_CNTL , pixclks_cntl); +udelay (panel_pwr_delay *1000 );break ; }
PATCH 60/140 drm/radeon/kms: fix legacy tv-out pal mode
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit ff3f011cd859072b5d6e64c0b968cff9bfdc0b37 upstream.
fixes fdo bug 26915
--- drivers/gpu/drm/radeon/radeon_legacy_tv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_legacy_tv.c +2 -2
@@ -642,8 +642,8 @@ void radeon_legacy_tv_mode_set(struct dr } flicker_removal = (tmp +500 ) /1000 ; -if (flicker_removal <2 ) - flicker_removal =2 ; +if (flicker_removal <3 ) + flicker_removal =3 ;for (i =0 ; i <ARRAY_SIZE (SLOPE_limit); ++i) {if (flicker_removal == SLOPE_limit[i])break ;
PATCH 61/140 tpm_tis: fix subsequent suspend failures
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajiv Andrade <[email protected]>
commit 59f6fbe4291fcc078ba26ce4edf8373a7620a13a upstream.
Fix subsequent suspends by issuing tpm_continue_selftest during resume. Otherwise, the tpm chip seems to be not fully initialized and will reject the save state command during suspend, thus preventing the whole system to suspend.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16256
--- drivers/char/tpm/tpm_tis.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +8 -1
@@ -622,7 +622,14 @@ static int tpm_tis_pnp_suspend(struct pnstatic int tpm_tis_pnp_resume (struct pnp_dev *dev) { -return tpm_pm_resume (&dev->dev); +struct tpm_chip *chip =pnp_get_drvdata (dev); +int ret; + + ret =tpm_pm_resume (&dev->dev); +if (!ret) +tpm_continue_selftest (chip); + +return ret; }static struct pnp_device_id tpm_pnp_tbl[]__devinitdata = {
PATCH 62/140 ipvs: Add missing locking during connection table hashing and unhashing
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sven Wegener <[email protected]>
commit aea9d711f3d68c656ad31ab578ecfb0bb5cd7f97 upstream.
The code that hashes and unhashes connections from the connection table is missing locking of the connection being modified, which opens up a race condition and results in memory corruption when this race condition is hit.
Here is what happens in pretty verbose form:
CPU 0 CPU 1
------------ ------------
An active connection is terminated and
we schedule ip_vs_conn_expire() on this
CPU to expire this connection.
IRQ assignment is changed to this CPU, but the expire timer stays scheduled on the other CPU.
New connection from same ip:port comes in right before the timer expires, we find the inactive connection in our connection table and get a reference to it. We proper lock the connection in tcp_state_transition() and read the connection flags in set_tcp_state().
ip_vs_conn_expire() gets called, we
unhash the connection from our
connection table and remove the hashed
flag in ip_vs_conn_unhash(), without
proper locking!
While still holding proper locks we write the connection flags in set_tcp_state() and this sets the hashed flag again.
ip_vs_conn_expire() fails to expire the
connection, because the other CPU has
incremented the reference count. We try
to re-insert the connection into our
connection table, but this fails inip_vs_conn_hash(), because the hashed
flag has been set by the other CPU. We
re-schedule execution ofip_vs_conn_expire(). Now this connection
has the hashed flag set, but isn't
actually hashed in our connection table
and has a dangling list_head.
We drop the reference we held on the connection and schedule the expire timer for timeouting the connection on this CPU. Further packets won't be able to find this connection in our connection table.
ip_vs_conn_expire() gets called again, we think it's already hashed, but the list_head is dangling and while removing the connection from our connection table we write to the memory location where this list_head points to.
The result will probably be a kernel oops at some other point in time.
This race condition is pretty subtle, but it can be triggered remotely. It needs the IRQ assignment change or another circumstance where packets coming from the same ip:port for the same service are being processed on different CPUs. And it involves hitting the exact time at which ip_vs_conn_expire() gets called. It can be avoided by making sure that all packets from one connection are always processed on the same CPU and can be made harder to exploit by changing the connection timeouts to some custom values.
--- net/netfilter/ipvs/ip_vs_conn.c | 4 ++++ 1 file changed, 4 insertions(+)
net/netfilter/ipvs/ip_vs_conn.c +4 -0
@@ -146,6 +146,7 @@ static inline int ip_vs_conn_hash(struct hash =ip_vs_conn_hashkey (cp->af, cp->protocol, &cp->caddr, cp->cport);ct_write_lock (hash); +spin_lock (&cp->lock);if (!(cp->flags &IP_VS_CONN_F_HASHED )) {list_add (&cp->c_list, &ip_vs_conn_tab[hash]);
@@ -158,6 +159,7 @@ static inline int ip_vs_conn_hash(struct ret =0 ; } +spin_unlock (&cp->lock);ct_write_unlock (hash);return ret;
@@ -177,6 +179,7 @@ static inline int ip_vs_conn_unhash(stru hash =ip_vs_conn_hashkey (cp->af, cp->protocol, &cp->caddr, cp->cport);ct_write_lock (hash); +spin_lock (&cp->lock);if (cp->flags &IP_VS_CONN_F_HASHED ) {list_del (&cp->c_list);
@@ -186,6 +189,7 @@ static inline int ip_vs_conn_unhash(stru }else ret =0 ; +spin_unlock (&cp->lock);ct_write_unlock (hash);return ret;
PATCH 63/140 ipv6: fix NULL reference in proxy neighbor discovery
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: stephen hemminger <[email protected]>
commit 9f888160bdcccf0565dd2774956b8d9456e610be upstream.
The addition of TLLAO option created a kernel OOPS regression for the case where neighbor advertisement is being sent via proxy path. When using proxy, ipv6_get_ifaddr() returns NULL causing the NULL dereference.
Change causing the bug was:
commit f7734fdf61ec6bb848e0bafc1fb8bad2c124bb50
Author: Octavian Purdila <[email protected]> Date: Fri Oct 2 11:39:15 2009 +0000
make TLLAO option for NA packets configurable
--- net/ipv6/ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ndisc.c +1 -1
@@ -585,6 +585,7 @@ static void ndisc_send_na(struct net_dev src_addr = solicited_addr;if (ifp->flags &IFA_F_OPTIMISTIC ) override =0 ; + inc_opt |= ifp->idev->cnf.force_tllao;in6_ifa_put (ifp); }else { if (ipv6_dev_get_saddr(dev_net(dev), dev, daddr,
@@ -598,7 +599,6 @@ static void ndisc_send_na(struct net_dev icmp6h.icmp6_solicited = solicited; icmp6h.icmp6_override = override; - inc_opt |= ifp->idev->cnf.force_tllao;__ndisc_send (dev, neigh, daddr, src_addr, &icmp6h, solicited_addr, inc_opt ?ND_OPT_TARGET_LL_ADDR :0 );
PATCH 64/140 netfilter: ip6t_REJECT: fix a dst leak in ipv6 REJECT
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit 499031ac8a3df6738f6186ded9da853e8ea18253 upstream.
We should release dst if dst->error is set.
Bug introduced in 2.6.14 by commit e104411b82f5c ([XFRM]: Always release dst_entry on error in xfrm_lookup)
--- net/ipv6/netfilter/ip6t_REJECT.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_REJECT.c +4 -2
@@ -95,9 +95,11 @@ static void send_reset(struct net *net, fl.fl_ip_dport = otcph.source;security_skb_classify_flow (oldskb, &fl); dst =ip6_route_output (net,NULL , &fl); -if (dst ==NULL ) +if (dst ==NULL || dst->error) { +dst_release (dst);return ; -if (dst->error ||xfrm_lookup (net, &dst, &fl,NULL ,0 )) + } +if (xfrm_lookup (net, &dst, &fl,NULL ,0 ))return ; hh_len = (dst->dev->hard_header_len +15 )&~15 ;
PATCH 65/140 SCSI: aacraid: Eliminate use after free
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <[email protected]>
commit 8a52da632ceb9d8b776494563df579e87b7b586b upstream.
The debugging code using the freed structure is moved before the kfree.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@free@
expression E;
position p;
@@
kfree@p(E)
@@
expression free.E, subE<=free.E, E1;
position free.p;
@@
kfree@p(E)
...
(
subE = E1
|
* E
)
// </smpl>
--- drivers/scsi/aacraid/commctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/commctrl.c +2 -2
@@ -655,9 +655,9 @@ static int aac_send_raw_srb(struct aac_d/* Does this really need to be GFP_DMA? */ p =kmalloc (usg->sg[i].count,GFP_KERNEL |__GFP_DMA);if (!p) { -kfree (usg); -dprintk ((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n" , +dprintk ((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n" , usg->sg[i].count,i,usg->count)); +kfree (usg); rcode = -ENOMEM ; goto cleanup; }
PATCH 66/140 md: raid10: Fix null pointer dereference in fix_read_error()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Prasanna S. Panchamukhi <[email protected]>
commit 0544a21db02c1d8883158fd6f323364f830a120a upstream.
Such NULL pointer dereference can occur when the driver was fixing the read errors/bad blocks and the disk was physically removed causing a system crash. This patch check if thercu_dereference() returns valid rdev before accessing it in fix_read_error().
--- drivers/md/raid10.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/md/raid10.c +6 -6
@@ -1486,14 +1486,14 @@ static void fix_read_error(conf_t *conf,int sectors = r10_bio->sectors;mdk_rdev_t *rdev;int max_read_errors =atomic_read (&mddev->max_corr_read_errors); +int d = r10_bio->devs[r10_bio->read_slot].devnum;rcu_read_lock (); - { -int d = r10_bio->devs[r10_bio->read_slot].devnum; + rdev =rcu_dereference (conf->mirrors[d].rdev); +if (rdev) {/* If rdev is not NULL */ char b[BDEVNAME_SIZE ];int cur_read_error_count =0 ; - rdev =rcu_dereference (conf->mirrors[d].rdev);bdevname (rdev->bdev, b);if (test_bit (Faulty, &rdev->flags)) {
@@ -1533,7 +1533,7 @@ static void fix_read_error(conf_t *conf,rcu_read_lock (); do { - int d = r10_bio->devs[sl].devnum; + d = r10_bio->devs[sl].devnum; rdev = rcu_dereference(conf->mirrors[d].rdev); if (rdev && test_bit(In_sync, &rdev->flags)) {
@@ -1567,7 +1567,7 @@ static void fix_read_error(conf_t *conf,rcu_read_lock ();while (sl != r10_bio->read_slot) {char b[BDEVNAME_SIZE ]; -int d; +if (sl==0 ) sl = conf->copies; sl--;
@@ -1603,7 +1603,7 @@ static void fix_read_error(conf_t *conf, } sl = start;while (sl != r10_bio->read_slot) { -int d; +if (sl==0 ) sl = conf->copies; sl--;
PATCH 67/140 amd64-agp: Probe unknown AGP devices the right way
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit 6fd024893911dcb51b4a0aa71971db5ba38f7071 upstream.
The current initialisation code probes 'unsupported' AGP devices simply by calling its own probe function. It does not lock these devices or even check whether another driver is already bound to them.
We must use the device core to manage this. So if the specific device id table didn't match anything and agp_try_unsupported=1, switch the device id table and call driver_attach() again.
--- drivers/char/agp/amd64-agp.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/char/agp/amd64-agp.c +15 -12
@@ -499,6 +499,10 @@ static int __devinit agp_amd64_probe(stru8 cap_ptr;int err; +/* The Highlander principle */ +if (agp_bridges_found) +return -ENODEV ; + cap_ptr =pci_find_capability (pdev,PCI_CAP_ID_AGP );if (!cap_ptr)return -ENODEV ;
@@ -562,6 +566,8 @@ static void __devexit agp_amd64_remove(s amd64_aperture_sizes[bridge->aperture_size_idx].size);agp_remove_bridge (bridge);agp_put_bridge (bridge); + + agp_bridges_found--; }#ifdef CONFIG_PM
@@ -709,6 +715,11 @@ static struct pci_device_id agp_amd64_pcMODULE_DEVICE_TABLE (pci, agp_amd64_pci_table); +static DEFINE_PCI_DEVICE_TABLE (agp_amd64_pci_promisc_table) = { + {PCI_DEVICE_CLASS (0 ,0 ) }, + { } +}; +static struct pci_driver agp_amd64_pci_driver = { .name ="agpgart-amd64" , .id_table = agp_amd64_pci_table,
@@ -734,7 +745,6 @@ int __init agp_amd64_init(void)return err;if (agp_bridges_found ==0 ) { -struct pci_dev *dev;if (!agp_try_unsupported && !agp_try_unsupported_boot) { printk(KERN_INFO PFX "No supported AGP bridge found.\n");#ifdef MODULE
@@ -750,17 +760,10 @@ int __init agp_amd64_init(void)return -ENODEV ;/* Look for any AGP bridge */ - dev =NULL ; - err = -ENODEV ; -for_each_pci_dev (dev) { -if (!pci_find_capability (dev,PCI_CAP_ID_AGP )) -continue ; -/* Only one bridge supported right now */ -if (agp_amd64_probe (dev,NULL ) ==0 ) { - err =0 ; -break ; - } - } + agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table; + err =driver_attach (&agp_amd64_pci_driver.driver); +if (err ==0 && agp_bridges_found ==0 ) + err = -ENODEV ; }return err; }
PATCH 68/140 amd64_edac: Fix syndrome calculation on K8
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 41c310447fe06bcedc22b75752c18b60e0b9521b upstream.
When calculating the DCT channel from the syndrome we need to know the syndrome type (x4 vs x8). On F10h, this is read out from extended PCI cfg space register F3x180 while on K8 we only support x4 syndromes and don't have extended PCI config space anyway.
Make the code accessing F3x180 F10h only and fall back to x4 syndromes on everything else.
--- drivers/edac/amd64_edac.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/edac/amd64_edac.c +12 -12
@@ -1958,20 +1958,20 @@ static int get_channel_from_ecc_syndromeu32 value =0 ;int err_sym =0 ; -amd64_read_pci_cfg (pvt->misc_f3_ctl,0x180 , &value); +if (boot_cpu_data.x86 ==0x10 ) { -/* F3x180[EccSymbolSize]=1, x8 symbols */ -if (boot_cpu_data.x86 ==0x10 && - boot_cpu_data.x86_model >7 && - value &BIT (25 )) { - err_sym =decode_syndrome (syndrome, x8_vectors, -ARRAY_SIZE (x8_vectors),8 ); -return map_err_sym_to_channel (err_sym,8 ); - }else { - err_sym =decode_syndrome (syndrome, x4_vectors, -ARRAY_SIZE (x4_vectors),4 ); -return map_err_sym_to_channel (err_sym,4 ); +amd64_read_pci_cfg (pvt->misc_f3_ctl,0x180 , &value); + +/* F3x180[EccSymbolSize]=1 => x8 symbols */ +if (boot_cpu_data.x86_model >7 && + value &BIT (25 )) { + err_sym =decode_syndrome (syndrome, x8_vectors, +ARRAY_SIZE (x8_vectors),8 ); +return map_err_sym_to_channel (err_sym,8 ); + } } + err_sym =decode_syndrome (syndrome, x4_vectors,ARRAY_SIZE (x4_vectors),4 ); +return map_err_sym_to_channel (err_sym,4 ); }/*
PATCH 69/140 perf: Resurrect flat callchains
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
commit 97aa1052739c6a06cb6b0467dbf410613d20bc97 upstream.
Initialize the callchain radix tree root correctly.
When we walk through the parents, we must stop after the root, but since it wasn't well initialized, its parent pointer was random.
Also the number of hits was random because uninitialized, hence it was part of the callchain while the root doesn't contain anything.
This fixes segfaults and percentages followed by empty callchains while running:
perf report -g flat
--- tools/perf/util/callchain.h | 3 +++ 1 file changed, 3 insertions(+)
tools/perf/util/callchain.h +3 -0
@@ -48,6 +48,9 @@ static inline void callchain_init(structINIT_LIST_HEAD (&node->brothers);INIT_LIST_HEAD (&node->children);INIT_LIST_HEAD (&node->val); + + node->parent =NULL ; + node->hit =0 ; }static inline u64 cumul_hits (struct callchain_node *node)
PATCH 70/140 x86: Send a SIGTRAP for user icebp traps
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
commit a1e80fafc9f0742a1776a0490258cb64912411b0 upstream.
Before we had a generic breakpoint layer, x86 used to send a sigtrap for any debug event that happened in userspace, except if it was caused by lazy dr7 switches.
Currently we only send such signal for single step or breakpoint events.
However, there are three other kind of debug exceptions:
- debug register access detected: trigger an exception if the next instruction touches the debug registers. We don't use it.
- task switch, but we don't use tss.
- icebp/int01 trap. This instruction (0xf1) is undocumented and generates an int 1 exception. Unlike single step through TF flag, it doesn't set the single step origin of the exception in dr6.
icebp then used to be reported in userspace using trap signals but this have been incidentally broken with the new breakpoint code. Reenable this. Since this is the only debug event that doesn't set anything in dr6, this is all we have to check.
This fixes a regression in Wine where World Of Warcraft got broken as it uses this for software protection checks purposes. And probably other apps do.
--- arch/x86/kernel/traps.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/kernel/traps.c +10 -1
@@ -529,11 +529,20 @@ asmlinkage __kprobes struct pt_regs *syn dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) {struct task_struct *tsk = current; +int user_icebp =0 ;unsigned long dr6;int si_code;get_debugreg (dr6,6 ); +/* +* If dr6 has no reason to give us about the origin of this trap, +* then it's very likely the result of an icebp/int01 trap. +* User wants a sigtrap for that. +*/ +if (!(dr6 & ~0xffff0ff0 ) &&user_mode (regs)) + user_icebp =1 ; +/* Catch kmemcheck conditions first of all! */ if ((dr6 &DR_STEP ) &&kmemcheck_trap (regs))return ;
@@ -575,7 +584,7 @@ dotraplinkage void __kprobes do_debug(st regs->flags &= ~X86_EFLAGS_TF ; } si_code =get_si_code (tsk->thread.debugreg6); -if (tsk->thread.debugreg6 & (DR_STEP |DR_TRAP_BITS )) +if (tsk->thread.debugreg6 & (DR_STEP |DR_TRAP_BITS ) || user_icebp)send_sigtrap (tsk, regs, error_code, si_code);preempt_conditional_cli (regs);
Re: [070/140] x86: Send a SIGTRAP for user icebp traps
Quoted 8 lines · On Fri, 30 Jul 2010 10:30:35 -0700 Greg KH <[email protected]> wrote:
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
commit
a1e80fafc9f0742a1776a0490258cb64912411b0upstream.
This backport will not work. Instead of fixing up the context of this patch to make it apply, commit 40f9249a73f6c251adea492b1c3d19d39e2a9bda ("x86/debug: Clear reserved bits of DR6 in do_debug()") should be applied first, followed by an unmodified version of this commit.
Re: [070/140] x86: Send a SIGTRAP for user icebp traps
Quoted 9 lines · Chuck Ebbert
Quoted 6 lines · On Fri, 30 Jul 2010 10:30:35 -0700 Greg KH <[email protected]> wrote:
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
Quoted 7 lines
Quoted 2 lines
commit
a1e80fafc9f0742a1776a0490258cb64912411b0upstream.This backport will not work. Instead of fixing up the context of this patch to make it apply, commit
40f9249a73f6c251adea492b1c3d19d39e2a9bda("x86/debug: Clear reserved bits of DR6 indo_debug()") should be applied first, followed by an unmodified version of this commit.
It works because the 2.6.33 backport is slightly different from the 2.6.34 one. We are dealing with (dr6 & ~0xffff0ff0) rather than dr6.
Backporting the commit you describe seemed too invasive and risky for me, so I preferred to use that mask to ignore the dr6 reserved bits while checking the icebp origin, only.
Thanks.
PATCH 71/140 x86: Fix vsyscall on gcc 4.5 with -Os
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andi Kleen <[email protected]>
commit 124482935fb7fb9303c8a8ab930149c6a93d9910 upstream.
This fixes the -Os breaks with gcc 4.5 bug. rdtsc_barrier needs to be force inlined, otherwise user space will jump into kernel space and kill init.
This also addresses http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
I believe.
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/system.h +1 -1
@@ -451,7 +451,7 @@ void stop_this_cpu(void *dummy);* * (Could use an alternative three way for this if there was one.) */ -static inline void rdtsc_barrier (void ) +static __always_inline void rdtsc_barrier(void) {alternative (ASM_NOP3 ,"mfence" ,X86_FEATURE_MFENCE_RDTSC );alternative (ASM_NOP3 ,"lfence" ,X86_FEATURE_LFENCE_RDTSC );
PATCH 72/140 x86, Calgary: Increase max PHB number
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darrick J. Wong <[email protected]>
commit 499a00e92dd9a75395081f595e681629eb1eebad upstream.
Newer systems (x3950M2) can have 48 PHBs per chassis and 8 chassis, so bump the limits up and provide an explanation of the requirements for each class.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/pci-calgary_64.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
arch/x86/kernel/pci-calgary_64.c +10 -5
@@ -103,11 +103,16 @@ int use_calgary __read_mostly = 0;#define PMR_SOFTSTOPFAULT 0x40000000#define PMR_HARDSTOP 0x20000000 -#define MAX_NUM_OF_PHBS 8/* how many PHBs in total? */ -#define MAX_NUM_CHASSIS 8/* max number of chassis */ -/* MAX_PHB_BUS_NUM is the maximal possible dev->bus->number */ -#define MAX_PHB_BUS_NUM (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) -#define PHBS_PER_CALGARY 4 +/* +* The maximum PHB bus number. +* x3950M2 (rare): 8 chassis, 48 PHBs per chassis = 384 +* x3950M2: 4 chassis, 48 PHBs per chassis = 192 +* x3950 (PCIE): 8 chassis, 32 PHBs per chassis = 256 +* x3950 (PCIX): 8 chassis, 16 PHBs per chassis = 128 +*/ +#define MAX_PHB_BUS_NUM 384 + +#define PHBS_PER_CALGARY 4/* register offsets in Calgary's internal register space */ static const unsigned long tar_offsets[] = {
PATCH 73/140 x86, Calgary: Limit the max PHB number to 256
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darrick J. Wong <[email protected]>
commit d596043d71ff0d7b3d0bead19b1d68c55f003093 upstream.
The x3950 family can have as many as 256 PCI buses in a single system, so change the limits to the maximum. Since there can only be 256 PCI buses in one domain, we no longer need the BUG_ON check.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/pci-calgary_64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/pci-calgary_64.c +1 -3
@@ -110,7 +110,7 @@ int use_calgary __read_mostly = 0;* x3950 (PCIE): 8 chassis, 32 PHBs per chassis = 256 * x3950 (PCIX): 8 chassis, 16 PHBs per chassis = 128 */ -#define MAX_PHB_BUS_NUM 384 +#define MAX_PHB_BUS_NUM 256#define PHBS_PER_CALGARY 4
@@ -1056,8 +1056,6 @@ static int __init calgary_init_one(strucstruct iommu_table *tbl;int ret; -BUG_ON (dev->bus->number >=MAX_PHB_BUS_NUM ); - bbar =busno_to_bbar (dev->bus->number); ret =calgary_setup_tar (dev, bbar);if (ret)
PATCH 74/140 sched: Prevent compiler from optimising the sched_avg_update() loop
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Will Deacon <[email protected]>
commit 0d98bb2656e9bd2dfda2d089db1fe1dbdab41504 upstream.
GCC 4.4.1 on ARM has been observed to replace the while loop in sched_avg_update with a call to uldivmod, resulting in the following build failure at link-time:
kernel/built-in.o: In function `sched_avg_update':
kernel/sched.c:1261: undefined reference to __aeabi_uldivmod' kernel/sched.c:1261: undefined reference to __aeabi_uldivmod'
make: *** [.tmp_vmlinux1] Error 1
This patch introduces a fake data hazard to the loop body to prevent the compiler optimising the loop away.
--- kernel/sched.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/sched.c +6 -0
@@ -1259,6 +1259,12 @@ static void sched_avg_update(struct rq *s64 period =sched_avg_period ();while ((s64)(rq->clock - rq->age_stamp) > period) { +/* +* Inline assembly required to prevent the compiler +* optimising this loop into a divmod call. +* See __iter_div_u64_rem() for another example of this. +*/ + asm("" :"+rm" (rq->age_stamp)); rq->age_stamp += period; rq->rt_avg /=2 ; }
PATCH 75/140 sched: Fix over-scheduling bug
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex,Shi <[email protected]>
commit 3c93717cfa51316e4dbb471e7c0f9d243359d5f8 upstream.
Commit e70971591 ("sched: Optimize unused cgroup configuration") introduced an imbalanced scheduling bug.
If we do not use CGROUP, function update_h_load won't update h_load. When the system has a large number of tasks far more than logical CPU number, the incorrect cfs_rq[cpu]->h_load value will cause load_balance() to pull too many tasks to the local CPU from the busiest CPU. So the busiest CPU keeps going in a round robin. That will hurt performance.
The issue was found originally by a scientific calculation workload that developed by Yanmin. With that commit, the workload performance drops about 40%.
CPU before after
00 : 2 : 7 01 : 1 : 7 02 : 11 : 6 03 : 12 : 7 04 : 6 : 6 05 : 11 : 7 06 : 10 : 6 07 : 12 : 7 08 : 11 : 6 09 : 12 : 6 10 : 1 : 6 11 : 1 : 6 12 : 6 : 6 13 : 2 : 6 14 : 2 : 6 15 : 1 : 6
LKML-Reference: <1276754893.9452.5442.camel@debian>
--- kernel/sched.c | 3 --- 1 file changed, 3 deletions(-)
kernel/sched.c +0 -3
@@ -1719,9 +1719,6 @@ static void update_shares_locked(structstatic void update_h_load (long cpu) { -if (root_task_group_empty ()) -return ; -walk_tg_tree (tg_load_down, tg_nop, (void *)cpu); }
PATCH 76/140 genirq: Deal with desc->set_type() changing desc->chip
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 4673247562e39a17e09440fa1400819522ccd446 upstream.
The set_type() function can change the chip implementation when the trigger mode changes. That might result in using an non-initialized irq chip when called from __setup_irq() or when called via set_irq_type() on an already enabled irq.
The set_irq_type() function should not be called on an enabled irq, but because we forgot to put a check into it, we have a bunch of users which grew the habit of doing that and it never blew up as the function is serialized via desc->lock against all users of desc->chip and they never hit the non-initialized irq chip issue.
The easy fix for the __setup_irq() issue would be to move the irq_chip_set_defaults(desc->chip) call after the trigger setting to make sure that a chip change is covered.
But as we have already users, which do the type setting after request_irq(), the safe fix for now is to call irq_chip_set_defaults() from __irq_set_trigger() when desc->set_type() changed the irq chip.
It needs a deeper analysis whether we should refuse to change the chip on an already enabled irq, but that'd be a large scale change to fix all the existing users. So that's neither stable nor 2.6.35 material.
--- kernel/irq/manage.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/irq/manage.c +3 -0
@@ -436,6 +436,9 @@ int __irq_set_trigger(struct irq_desc *d/* note that IRQF_TRIGGER_MASK == IRQ_TYPE_SENSE_MASK */ desc->status &= ~(IRQ_LEVEL |IRQ_TYPE_SENSE_MASK ); desc->status |= flags; + +if (chip != desc->chip) +irq_chip_set_defaults (desc->chip); }return ret;
PATCH 77/140 cfq: Dont allow queue merges for queues that have no process references
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Moyer <[email protected]>
commit c10b61f0910466b4b99c266a7d76ac4390743fb5 upstream.
Hi,
A user reported a kernel bug when running a particular program that did the following:
created 32 threads
- each thread took a mutex, grabbed a global offset, added a buffer size to that offset, released the lock
- read from the given offset in the file
- created a new thread to do the same
- exited
The result is that cfq's close cooperator logic would trigger, as the threads were issuing I/O within the mean seek distance of one another. This workload managed to routinely trigger a use after free bug when walking the list of merge candidates for a particular cfqq (cfqq->new_cfqq). The logic used for merging queues looks like this:
static void cfq_setup_merge(struct cfq_queue *cfqq, struct cfq_queue *new_cfqq)
{
int process_refs, new_process_refs;
struct cfq_queue *__cfqq;
/* Avoid a circular list and skip interim queue merges */
while ((__cfqq = new_cfqq->new_cfqq)) {
if (__cfqq == cfqq)
return;
new_cfqq = __cfqq;
}
process_refs = cfqq_process_refs(cfqq);
/*
* If the process for the cfqq has gone away, there is no
* sense in merging the queues.
*/
if (process_refs == 0)
return;
/*
* Merge in the direction of the lesser amount of work.
*/
new_process_refs = cfqq_process_refs(new_cfqq);
if (new_process_refs >= process_refs) {
cfqq->new_cfqq = new_cfqq;
atomic_add(process_refs, &new_cfqq->ref);
} else {
new_cfqq->new_cfqq = cfqq;
atomic_add(new_process_refs, &cfqq->ref);
}
}When a merge candidate is found, we add the process references for the queue with less references to the queue with more. The actual merging of queues happens when a new request is issued for a given cfqq. In the case of the test program, it only does a single pread call to read in 1MB, so the actual merge never happens.
Normally, this is fine, as when the queue exits, we simply drop the references we took on the other cfqqs in the merge chain:
/*
* If this queue was scheduled to merge with another queue, be
* sure to drop the reference taken on that queue (and others in
* the merge chain). See cfq_setup_merge and cfq_merge_cfqqs.
*/
__cfqq = cfqq->new_cfqq;
while (__cfqq) {
if (__cfqq == cfqq) {
WARN(1, "cfqq->new_cfqq loop detected\n");
break;
}
next = __cfqq->new_cfqq;
cfq_put_queue(__cfqq);
__cfqq = next;
}However, there is a hole in this logic. Consider the following (and keep in mind that each I/O keeps a reference to the cfqq):
q1->new_cfqq = q2 // q2 now has 2 process referencesq3->new_cfqq = q2 // q2 now has 3 process references
// the process associated with q2 exits
// q2 now has 2 process references
// queue 1 exits, drops its reference on q2
// q2 now has 1 process reference
// q3 exits, so has 0 process references, and hence drops its references // to q2, which leaves q2 also with 0 process references
q4 comes along and wants to merge with q3
q3->new_cfqq still points at q2! We follow that link and end up at an already freed cfqq.
So, the fix is to not follow a merge chain if the top-most queue does not have a process reference, otherwise any queue in the chain could be already freed. I also changed the logic to disallow merging with a queue that does not have any process references. Previously, we did this check for one of the merge candidates, but not the other. That doesn't really make sense.
Without the attached patch, my system would BUG within a couple of seconds of running the reproducer program. With the patch applied, my system ran the program for over an hour without issues.
This addresses the following bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=16217
Thanks a ton to Phil Carns for providing the bug report and an excellent reproducer.
[ Note for stable: this applies to 2.6.32/33/34 ].
--- block/cfq-iosched.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
block/cfq-iosched.c +11 -2
@@ -1934,6 +1934,15 @@ static void cfq_setup_merge(struct cfq_qint process_refs, new_process_refs;struct cfq_queue *__cfqq; +/* +* If there are no process references on the new_cfqq, then it is +* unsafe to follow the ->new_cfqq chain as other cfqq's in the +* chain may have dropped their last reference (not just their +* last process reference). +*/ +if (!cfqq_process_refs (new_cfqq)) +return ; +/* Avoid a circular list and skip interim queue merges */ while ((__cfqq = new_cfqq->new_cfqq)) {if (__cfqq == cfqq)
@@ -1942,17 +1951,17 @@ static void cfq_setup_merge(struct cfq_q } process_refs =cfqq_process_refs (cfqq); + new_process_refs =cfqq_process_refs (new_cfqq);/* * If the process for the cfqq has gone away, there is no * sense in merging the queues. */ -if (process_refs ==0 ) +if (process_refs ==0 || new_process_refs ==0 )return ;/* * Merge in the direction of the lesser amount of work. */ - new_process_refs =cfqq_process_refs (new_cfqq);if (new_process_refs >= process_refs) { cfqq->new_cfqq = new_cfqq;atomic_add (process_refs, &new_cfqq->ref);
PATCH 78/140 serial: cpm_uart: implement the cpm_uart_early_write() function for console poll
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dongdong Deng <[email protected]>
commit 8cd774ad30c22b9d89823f1f05d845f4cdaba9e8 upstream.
The cpm_uart_early_write() function which was used for console poll isn't implemented in the cpm uart driver.
Implementing this function both fixes the build when CONFIG_CONSOLE_POLL is set and allows kgdboc to work via the cpm uart.
--- drivers/serial/cpm_uart/cpm_uart_core.c | 143 +++++++++++++++++--------------- 1 file changed, 79 insertions(+), 64 deletions(-)
drivers/serial/cpm_uart/cpm_uart_core.c +79 -64
@@ -930,6 +930,83 @@ static void cpm_uart_config_port(struct } } +#if defined(CONFIG_CONSOLE_POLL ) || defined(CONFIG_SERIAL_CPM_CONSOLE ) +/* +* Write a string to the serial port +* Note that this is called with interrupts already disabled +*/ +static void cpm_uart_early_write (struct uart_cpm_port *pinfo, +const char *string,u_int count) +{ +unsigned int i; +cbd_t __iomem *bdp, *bdbase; +unsigned char *cpm_outp_addr; + +/* Get the address of the host memory buffer. +*/ + bdp = pinfo->tx_cur; + bdbase = pinfo->tx_bd_base; + +/* +* Now, do each character. This is not as bad as it looks +* since this is a holding FIFO and not a transmitting FIFO. +* We could add the complexity of filling the entire transmit +* buffer, but we would just wait longer between accesses...... +*/ +for (i =0 ; i < count; i++, string++) { +/* Wait for transmitter fifo to empty. +* Ready indicates output is ready, and xmt is doing +* that, not that it is ready for us to send. +*/ +while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) + ; + +/* Send the character out. +* If the buffer address is in the CPM DPRAM, don't +* convert it. +*/ + cpm_outp_addr =cpm2cpu_addr (in_be32 (&bdp->cbd_bufaddr), + pinfo); + *cpm_outp_addr = *string; + +out_be16 (&bdp->cbd_datlen,1 ); +setbits16 (&bdp->cbd_sc,BD_SC_READY ); + +if (in_be16 (&bdp->cbd_sc) &BD_SC_WRAP ) + bdp = bdbase; +else + bdp++; + +/* if a LF, also do CR... */ +if (*string ==10 ) { +while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) + ; + + cpm_outp_addr =cpm2cpu_addr (in_be32 (&bdp->cbd_bufaddr), + pinfo); + *cpm_outp_addr =13 ; + +out_be16 (&bdp->cbd_datlen,1 ); +setbits16 (&bdp->cbd_sc,BD_SC_READY ); + +if (in_be16 (&bdp->cbd_sc) &BD_SC_WRAP ) + bdp = bdbase; +else + bdp++; + } + } + +/* +* Finally, Wait for transmitter & holding register to empty +* and restore the IER +*/ +while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) + ; + + pinfo->tx_cur = bdp; +} +#endif +#ifdef CONFIG_CONSOLE_POLL /* Serial polling routines for writing and reading from the uart while * in an interrupt or debug context.
@@ -999,7 +1076,7 @@ static void cpm_put_poll_char(struct uarstatic char ch[2 ]; ch[0 ] = (char )c; - cpm_uart_early_write(pinfo->port.line, ch, 1); + cpm_uart_early_write(pinfo, ch, 1); }#endif /* CONFIG_CONSOLE_POLL */
@@ -1130,9 +1207,6 @@ static void cpm_uart_console_write(struc u_int count) {struct uart_cpm_port *pinfo = &cpm_uart_ports[co->index]; -unsigned int i; -cbd_t __iomem *bdp, *bdbase; -unsigned char *cp;unsigned long flags;int nolock = oops_in_progress;
@@ -1142,66 +1216,7 @@ static void cpm_uart_console_write(strucspin_lock_irqsave (&pinfo->port.lock, flags); } -/* Get the address of the host memory buffer. -*/ - bdp = pinfo->tx_cur; - bdbase = pinfo->tx_bd_base; - -/* -* Now, do each character. This is not as bad as it looks -* since this is a holding FIFO and not a transmitting FIFO. -* We could add the complexity of filling the entire transmit -* buffer, but we would just wait longer between accesses...... -*/ -for (i =0 ; i < count; i++, s++) { -/* Wait for transmitter fifo to empty. -* Ready indicates output is ready, and xmt is doing -* that, not that it is ready for us to send. -*/ -while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) - ; - -/* Send the character out. -* If the buffer address is in the CPM DPRAM, don't -* convert it. -*/ - cp =cpm2cpu_addr (in_be32 (&bdp->cbd_bufaddr), pinfo); - *cp = *s; - -out_be16 (&bdp->cbd_datlen,1 ); -setbits16 (&bdp->cbd_sc,BD_SC_READY ); - -if (in_be16 (&bdp->cbd_sc) &BD_SC_WRAP ) - bdp = bdbase; -else - bdp++; - -/* if a LF, also do CR... */ -if (*s ==10 ) { -while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) - ; - - cp =cpm2cpu_addr (in_be32 (&bdp->cbd_bufaddr), pinfo); - *cp =13 ; - -out_be16 (&bdp->cbd_datlen,1 ); -setbits16 (&bdp->cbd_sc,BD_SC_READY ); - -if (in_be16 (&bdp->cbd_sc) &BD_SC_WRAP ) - bdp = bdbase; -else - bdp++; - } - } - -/* -* Finally, Wait for transmitter & holding register to empty -* and restore the IER -*/ -while ((in_be16 (&bdp->cbd_sc) &BD_SC_READY ) !=0 ) - ; - - pinfo->tx_cur = bdp; +cpm_uart_early_write (pinfo, s, count);if (unlikely (nolock)) {local_irq_restore (flags);
PATCH 79/140 rtc: fix ds1388 time corruption
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joakim Tjernlund <[email protected]>
commit 96fc3a45ea073136566f3c2676cad52f8b39a7df upstream.
The ds1307 driver misreads the ds1388 registers when checking for 12 or 24 hour mode. Instead of checking the hour register it reads the minute register. Therefore the driver thinks minutes >= 40 has the 12HR bit set and resets the minute register by zeroing the high bits. This results in minutes are reset to 0-9, jumping back in time 40 or 50 minutes. The time jump is also written back to the RTC.
--- drivers/rtc/rtc-ds1307.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-ds1307.c +2 -2
@@ -775,7 +775,7 @@ static int __devinit ds1307_probe(struct read_rtc:/* read RTC registers */ - tmp = ds1307->read_block_data (ds1307->client,0 ,8 , buf); + tmp = ds1307->read_block_data (ds1307->client, ds1307->offset,8 , buf);if (tmp !=8 ) {pr_debug ("read error %d\n" , tmp); err = -EIO ;
@@ -860,7 +860,7 @@ read_rtc:if (ds1307->regs[DS1307_REG_HOUR ] &DS1307_BIT_PM ) tmp +=12 ;i2c_smbus_write_byte_data (client, -DS1307_REG_HOUR , + ds1307->offset +DS1307_REG_HOUR ,bin2bcd (tmp)); }
PATCH 80/140 ahci,ata_generic: let ata_generic handle new MBP w/ MCP89
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit c6353b4520788e34098bbf61c73fb9618ca7fdd6 upstream.
For yet unknown reason, MCP89 on MBP 7,1 doesn't work w/ ahci under linux but the controller doesn't require explicit mode setting and works fine with ata_generic. Make ahci ignore the controller on MBP 7,1 and let ata_generic take it for now.
Reported in bko#15923.
https://bugzilla.kernel.org/show_bug.cgi?id=15923
NVIDIA is investigating why ahci mode doesn't work.
--- drivers/ata/ahci.c | 10 ++++++++++ drivers/ata/ata_generic.c | 6 ++++++ include/linux/pci_ids.h | 1 + 3 files changed, 17 insertions(+)
drivers/ata/ahci.c +10 -0
@@ -3037,6 +3037,16 @@ static int ahci_init_one(struct pci_devif (pdev->vendor ==PCI_VENDOR_ID_MARVELL && !marvell_enable)return -ENODEV ; +/* +* For some reason, MCP89 on MacBook 7,1 doesn't work with +* ahci, use ata_generic instead. +*/ +if (pdev->vendor ==PCI_VENDOR_ID_NVIDIA && + pdev->device ==PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA && + pdev->subsystem_vendor ==PCI_VENDOR_ID_APPLE && + pdev->subsystem_device ==0xcb89 ) +return -ENODEV ; +/* Promise's PDC42819 is a SAS/SATA controller that has an AHCI mode. * At the moment, we can only use the AHCI mode. Let the users know * that for SAS drives they're out of luck.
drivers/ata/ata_generic.c +6 -0
@@ -168,6 +168,12 @@ static struct pci_device_id ata_generic[ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561), }, { PCI_DEVICE(PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558), }, { PCI_DEVICE(PCI_VENDOR_ID_CENATEK,PCI_DEVICE_ID_CENATEK_IDE), }, + /* + * For some reason, MCP89 on MacBook 7,1 doesn't work with + * ahci, use ata_generic instead. + */ + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA, + PCI_VENDOR_ID_APPLE, 0xcb89, }, #if !defined(CONFIG_PATA_TOSHIBA) && !defined(CONFIG_PATA_TOSHIBA_MODULE) { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), }, { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), },
include/linux/pci_ids.h +1 -0
@@ -1262,6 +1262,7 @@#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_SMBUS 0x07D8#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS 0x0AA2 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA 0x0D85#define PCI_VENDOR_ID_IMS 0x10e0#define PCI_DEVICE_ID_IMS_TT128 0x9128
PATCH 81/140 ethtool: Fix potential kernel buffer overflow in ETHTOOL_GRXCLSRLALL
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit db048b69037e7fa6a7d9e95a1271a50dc08ae233 upstream.
On a 32-bit machine, info.rule_cnt >= 0x40000000 leads to integer overflow and the buffer may be smaller than needed. Since ETHTOOL_GRXCLSRLALL is unprivileged, this can presumably be used for at least denial of service.
--- net/core/ethtool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/core/ethtool.c +3 -2
@@ -237,8 +237,9 @@ static int ethtool_get_rxnfc(struct net_if (info.cmd ==ETHTOOL_GRXCLSRLALL ) {if (info.rule_cnt >0 ) { - rule_buf =kmalloc (info.rule_cnt *sizeof (u32), -GFP_USER ); +if (info.rule_cnt <=KMALLOC_MAX_SIZE /sizeof (u32)) + rule_buf =kmalloc (info.rule_cnt *sizeof (u32), +GFP_USER );if (!rule_buf)return -ENOMEM ; }
PATCH 82/140 powerpc: Fix logic error in fixup_irqs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit 3cd8519248e9e17d982c6fab0f1a89bca6feb49a upstream.
When SPARSE_IRQ is set, irq_to_desc() can
return NULL. While the code here has a
check for NULL, it's not really correct.
Fix it by separating the check for it.
This fixes CPU hot unplug for me.
--- arch/powerpc/kernel/irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/kernel/irq.c +4 -1
@@ -247,7 +247,10 @@ void fixup_irqs(cpumask_t map)cpumask_t mask; desc =irq_to_desc (irq); -if (desc && desc->status &IRQ_PER_CPU ) +if (!desc) +continue ; + +if (desc->status &IRQ_PER_CPU )continue ;cpumask_and (&mask, desc->affinity, &map);
PATCH 83/140 powerpc/cpm: Reintroduce global spi_pram struct (fixes build issue)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Vorontsov <[email protected]>
commit 56825c88ff438f4dbb51a44591cc29e707fe783a upstream.
spi_t was removed in commit 644b2a680ccc51a9ec4d6beb12e9d47d2dee98e2 ("powerpc/cpm: Remove SPI defines and spi structs"), the commit assumed that spi_t isn't used anywhere outside of the spi_mpc8xxx driver. But it appears that the struct is needed for micropatch code. So, let's reintroduce the struct.
Fixes the following build issue:
CC arch/powerpc/sysdev/micropatch.o
micropatch.c: In function 'cpm_load_patch':
micropatch.c:629: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token micropatch.c:629: error: 'spp' undeclared (first use in this function) micropatch.c:629: error: (Each undeclared identifier is reported only once micropatch.c:629: error: for each function it appears in.)
--- arch/powerpc/include/asm/cpm.h | 24 ++++++++++++++++++++++++ arch/powerpc/sysdev/micropatch.c | 7 ++++--- drivers/spi/spi_mpc8xxx.c | 22 ---------------------- 3 files changed, 28 insertions(+), 25 deletions(-)
arch/powerpc/include/asm/cpm.h +24 -0
@@ -7,6 +7,30 @@#include <linux/of.h> /* +* SPI Parameter RAM common to QE and CPM. +*/ +struct spi_pram { +__be16 rbase;/* Rx Buffer descriptor base address */ +__be16 tbase;/* Tx Buffer descriptor base address */ +u8 rfcr;/* Rx function code */ +u8 tfcr;/* Tx function code */ +__be16 mrblr;/* Max receive buffer length */ +__be32 rstate;/* Internal */ +__be32 rdp;/* Internal */ +__be16 rbptr;/* Internal */ +__be16 rbc;/* Internal */ +__be32 rxtmp;/* Internal */ +__be32 tstate;/* Internal */ +__be32 tdp;/* Internal */ +__be16 tbptr;/* Internal */ +__be16 tbc;/* Internal */ +__be32 txtmp;/* Internal */ +__be32 res;/* Tx temp. */ +__be16 rpbase;/* Relocation pointer (CPM1 only) */ +__be16 res1;/* Reserved */ +}; + +/* * USB Controller pram common to QE and CPM. */ struct usb_ctlr {
arch/powerpc/sysdev/micropatch.c +4 -3
@@ -16,6 +16,7 @@#include <asm/page.h> #include <asm/pgtable.h> #include <asm/8xx_immap.h> +#include <asm/cpm.h> #include <asm/cpm1.h> /*
@@ -626,7 +627,7 @@ cpm_load_patch(cpm8xx_t *cp)volatile uint *dp;/* Dual-ported RAM. */ volatile cpm8xx_t *commproc;volatile iic_t *iip; -volatile spi_t *spp; +volatile struct spi_pram *spp;volatile smc_uart_t *smp;int i;
@@ -668,8 +669,8 @@ cpm_load_patch(cpm8xx_t *cp)/* Put SPI above the IIC, also 32-byte aligned. */ i = (RPBASE +sizeof (iic_t) +31 ) & ~31 ; - spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI ]; - spp->spi_rpbase = i; + spp = (struct spi_pram *)&commproc->cp_dparam[PROFF_SPI ]; + spp->rpbase = i;# if defined(CONFIG_I2C_SPI_UCODE_PATCH ) commproc->cp_cpmcr1 =0x802a ;
drivers/spi/spi_mpc8xxx.c +0 -22
@@ -65,28 +65,6 @@ struct mpc8xxx_spi_reg {__be32 receive; }; -/* SPI Parameter RAM */ -struct spi_pram { -__be16 rbase;/* Rx Buffer descriptor base address */ -__be16 tbase;/* Tx Buffer descriptor base address */ -u8 rfcr;/* Rx function code */ -u8 tfcr;/* Tx function code */ -__be16 mrblr;/* Max receive buffer length */ -__be32 rstate;/* Internal */ -__be32 rdp;/* Internal */ -__be16 rbptr;/* Internal */ -__be16 rbc;/* Internal */ -__be32 rxtmp;/* Internal */ -__be32 tstate;/* Internal */ -__be32 tdp;/* Internal */ -__be16 tbptr;/* Internal */ -__be16 tbc;/* Internal */ -__be32 txtmp;/* Internal */ -__be32 res;/* Tx temp. */ -__be16 rpbase;/* Relocation pointer (CPM1 only) */ -__be16 res1;/* Reserved */ -}; -/* SPI Controller mode register definitions */ #define SPMODE_LOOP (1 << 30)#define SPMODE_CI_INACTIVEHIGH (1 << 29)
PATCH 84/140 powerpc/cpm1: Fix build with various CONFIG_*_UCODE_PATCH combinations
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Vorontsov <[email protected]>
commit 2069a6ae19a34d96cc9cb284eb645b165138e03f upstream.
Warnings are treated as errors for arch/powerpc code, so build fails with CONFIG_I2C_SPI_UCODE_PATCH=y:
CC arch/powerpc/sysdev/micropatch.o
cc1: warnings being treated as errors arch/powerpc/sysdev/micropatch.c: In function 'cpm_load_patch':
arch/powerpc/sysdev/micropatch.c:630: warning: unused variable 'smp' make[1]: *** [arch/powerpc/sysdev/micropatch.o] Error 1
And with CONFIG_USB_SOF_UCODE_PATCH=y:
CC arch/powerpc/sysdev/micropatch.o
cc1: warnings being treated as errors arch/powerpc/sysdev/micropatch.c: In function 'cpm_load_patch':
arch/powerpc/sysdev/micropatch.c:629: warning: unused variable 'spp' arch/powerpc/sysdev/micropatch.c:628: warning: unused variable 'iip' make[1]: *** [arch/powerpc/sysdev/micropatch.o] Error 1
This patch fixes these issues by introducing proper #ifdefs.
--- arch/powerpc/sysdev/micropatch.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/powerpc/sysdev/micropatch.c +5 -0
@@ -626,9 +626,14 @@ cpm_load_patch(cpm8xx_t *cp) {volatile uint *dp;/* Dual-ported RAM. */ volatile cpm8xx_t *commproc; +#if defined(CONFIG_I2C_SPI_UCODE_PATCH ) || \ + defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH )volatile iic_t *iip;volatile struct spi_pram *spp; +#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH volatile smc_uart_t *smp; +#endif +#endif int i; commproc = cp;
PATCH 85/140 sdhci-s3c: add missing remove function
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marek Szyprowski <[email protected]>
commit 9d51a6b2487724e8713cd2794cf09ffeee5f6932 upstream.
System will crash sooner or later once the memory with the code of the s3c-sdhci.ko module is reused for something else. I really have no idea how the lack of remove function went unnoticed into the mainline code.
--- drivers/mmc/host/sdhci-s3c.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/mmc/host/sdhci-s3c.c +20 -0
@@ -372,6 +372,26 @@ static int __devinit sdhci_s3c_probe(str static int __devexit sdhci_s3c_remove(struct platform_device *pdev) { +struct sdhci_host *host =platform_get_drvdata (pdev); +struct sdhci_s3c *sc =sdhci_priv (host); +int ptr; + +sdhci_remove_host (host,1 ); + +for (ptr =0 ; ptr <3 ; ptr++) { +clk_disable (sc->clk_bus[ptr]); +clk_put (sc->clk_bus[ptr]); + } +clk_disable (sc->clk_io); +clk_put (sc->clk_io); + +iounmap (host->ioaddr); +release_resource (sc->ioarea); +kfree (sc->ioarea); + +sdhci_free_host (host); +platform_set_drvdata (pdev,NULL ); +return 0 ; }
PATCH 86/140 edac: mpc85xx: fix MPC85xx dependency
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Vorontsov <[email protected]>
commit 1cd8521e7d77def75fdb1cb35ecd135385e4be4f upstream.
Since commit 5753c082f66eca5be81f6bda85c1718c5eea6ada ("powerpc/85xx:Kconfig cleanup"), there is no MPC85xx Kconfig symbol anymore, so the driver became non-selectable.
This patch fixes the issue by switching to PPC_85xx symbol.
--- drivers/edac/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/Kconfig +1 -1
@@ -196,7 +196,7 @@ config EDAC_I5100 config EDAC_MPC85XX tristate "Freescale MPC83xx / MPC85xx" - depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx) + depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx) help Support for error detection and correction on the Freescale MPC8349, MPC8560, MPC8540, MPC8548
PATCH 87/140 ASoC: Remove duplicate AUX definition from WM8776
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit 3c0709396df0869786f83e4b2d2d687c70ee886d upstream.
--- sound/soc/codecs/wm8776.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/codecs/wm8776.c +0 -1
@@ -93,7 +93,6 @@ SOC_DAPM_SINGLE("Bypass Switch", WM8776_static const struct snd_soc_dapm_widget wm8776_dapm_widgets[] = {SND_SOC_DAPM_INPUT ("AUX" ), -SND_SOC_DAPM_INPUT ("AUX" ),SND_SOC_DAPM_INPUT ("AIN1" ),SND_SOC_DAPM_INPUT ("AIN2" ),
PATCH 88/140 x86: Fix x2apic preenabled system with kexec
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yinghai Lu <[email protected]>
commit fd19dce7ac07973f700b0f13fb7f94b951414a4c upstream.
Found one x2apic system kexec loop test failed
when CONFIG_NMI_WATCHDOG=y (old) or CONFIG_LOCKUP_DETECTOR=y (current tip)
first kernel can kexec second kernel, but second kernel can not kexec third one.
it can be duplicated on another system with BIOS preenabled x2apic. First kernel can not kexec second kernel.
It turns out, when kernel boot with pre-enabled x2apic, it will not execute disable_local_APIC on shutdown path.
when init_apic_mappings() is called in setup_arch, it will skip setting of apic_phys when x2apic_mode is set. ( x2apic_mode is much early check_x2apic()) Then later, disable_local_APIC() will bail out early because !apic_phys.
So check !x2apic_mode in x2apic_mode in disable_local_APIC with !apic_phys.
another solution could be updating init_apic_mappings() to set apic_phys even for preenabled x2apic system. Actually even for x2apic system, that lapic address is mapped already in early stage.
BTW: is there any x2apic preenabled system with apicid of boot cpu > 255?
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/apic.c +1 -1
@@ -920,7 +920,7 @@ void disable_local_APIC(void)unsigned int value;/* APIC hasn't been mapped yet */ -if (!apic_phys) +if (!x2apic_mode && !apic_phys)return ;clear_local_APIC ();
PATCH 89/140 IPoIB: Fix world-writable child interface control sysfs attributes
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Or Gerlitz <[email protected]>
commit 7a52b34b07122ff5f45258d47f260f8a525518f0 upstream.
Sumeet Lahorani <[email protected]> reported that the IPoIB child entries are world-writable; however we don't want ordinary users to be able to create and destroy child interfaces, so fix them to be writable only by root.
--- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -2
@@ -1163,7 +1163,7 @@ static ssize_t create_child(struct devicreturn ret ? ret : count; } -static DEVICE_ATTR(create_child, S_IWUGO, NULL, create_child); +static DEVICE_ATTR(create_child, S_IWUSR, NULL, create_child); static ssize_t delete_child(struct device *dev, struct device_attribute *attr,
@@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct devicreturn ret ? ret : count; } -static DEVICE_ATTR(delete_child, S_IWUGO, NULL, delete_child); +static DEVICE_ATTR(delete_child, S_IWUSR, NULL, delete_child);int ipoib_add_pkey_attr (struct net_device *dev) {
PATCH 90/140 Input: i8042 - add Gigabyte Spring Peak to dmi_noloop_table
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kamal Mostafa <[email protected]>
commit 3e1bbc8d5018a05c0793c8a32b777a1396eb4414 upstream.
Gigabyte "Spring Peak" notebook indicates wrong chassis-type, tripping up i8042 and breaking the touchpad. Add this model to i8042_dmi_noloop_table[] to resolve.
--- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -166,6 +166,13 @@ static const struct dmi_system_id __init }, }, { +/* Gigabyte Spring Peak - defines wrong chassis type */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"GIGABYTE" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"), + }, + }, + { .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
PATCH 91/140 Input: twl40300-keypad - fix handling of "all ground" rows
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 3fea60261e73dbf4a51130d40cafcc8465b0f2c3 upstream.
The Nokia RX51 board code (arch/arm/mach-omap2/board-rx51-peripherals.c) defines a key map for the matrix keypad keyboard. The hardware seems to use all of the 8 rows and 8 columns of the keypad, although not all possible locations are used.
The TWL4030 supports keypads with at most 8 rows and 8 columns. Most keys are defined with a row and column number between 0 and 7, except
KEY(0xff, 2, KEY_F9),
KEY(0xff, 4, KEY_F10),
KEY(0xff, 5, KEY_F11),which represent keycodes that should be emitted when entire row is connected to the ground. since the driver handles this case as if we had an extra column in the key matrix. Unfortunately we do not allocate enough space and end up owerwriting some random memory.
--- arch/arm/mach-omap2/board-rx51-peripherals.c | 17 ++++++++++++++--- drivers/input/keyboard/twl4030_keypad.c | 17 +++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +14 -3
@@ -147,6 +147,10 @@ static void __init rx51_add_gpio_keys(vo#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ static int board_keymap[] = { +/* +* Note that KEY(x, 8, KEY_XXX) entries represent "entrire row +* connected to the ground" matrix state. +*/ KEY (0 ,0 ,KEY_Q ),KEY (0 ,1 ,KEY_O ),KEY (0 ,2 ,KEY_P ),
@@ -154,6 +158,7 @@ static int board_keymap[] = {KEY (0 ,4 ,KEY_BACKSPACE ),KEY (0 ,6 ,KEY_A ),KEY (0 ,7 ,KEY_S ), +KEY (1 ,0 ,KEY_W ),KEY (1 ,1 ,KEY_D ), KEY(1, 2, KEY_F),
@@ -162,6 +167,7 @@ static int board_keymap[] = {KEY (1 ,5 ,KEY_J ),KEY (1 ,6 ,KEY_K ),KEY (1 ,7 ,KEY_L ), +KEY (2 ,0 ,KEY_E ),KEY (2 ,1 ,KEY_DOT ), KEY(2, 2, KEY_UP),
@@ -169,6 +175,8 @@ static int board_keymap[] = {KEY (2 ,5 ,KEY_Z ),KEY (2 ,6 ,KEY_X ),KEY (2 ,7 ,KEY_C ), +KEY (2 ,8 ,KEY_F9 ), +KEY (3 ,0 ,KEY_R ),KEY (3 ,1 ,KEY_V ), KEY(3, 2, KEY_B),
@@ -177,20 +185,23 @@ static int board_keymap[] = {KEY (3 ,5 ,KEY_SPACE ),KEY (3 ,6 ,KEY_SPACE ),KEY (3 ,7 ,KEY_LEFT ), +KEY (4 ,0 ,KEY_T ),KEY (4 ,1 ,KEY_DOWN ),KEY (4 ,2 ,KEY_RIGHT ),KEY (4 ,4 ,KEY_LEFTCTRL ),KEY (4 ,5 ,KEY_RIGHTALT ),KEY (4 ,6 ,KEY_LEFTSHIFT ), +KEY (4 ,8 ,KEY_10 ), +KEY (5 ,0 ,KEY_Y ), +KEY (5 ,8 ,KEY_11 ), +KEY (6 ,0 ,KEY_U ), +KEY (7 ,0 ,KEY_I ),KEY (7 ,1 ,KEY_F7 ), KEY(7, 2, KEY_F8), -KEY (0xff ,2 ,KEY_F9 ), -KEY (0xff ,4 ,KEY_F10 ), - KEY(0xff, 5, KEY_F11), }; static struct matrix_keymap_data board_map_data = {
drivers/input/keyboard/twl4030_keypad.c +11 -6
@@ -50,8 +50,12 @@*/ #define TWL4030_MAX_ROWS 8/* TWL4030 hard limit */ #define TWL4030_MAX_COLS 8 -#define TWL4030_ROW_SHIFT 3 -#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS * TWL4030_MAX_COLS) +/* +* Note that we add space for an extra column so that we can handle +* row lines connected to the gnd (see twl4030_col_xlate()). +*/ +#define TWL4030_ROW_SHIFT 4 +#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS << TWL4030_ROW_SHIFT)struct twl4030_keypad {unsigned short keymap[TWL4030_KEYMAP_SIZE ];
@@ -181,7 +185,7 @@ static int twl4030_read_kp_matrix_state(return ret; } -static int twl4030_is_in_ghost_state (struct twl4030_keypad *kp,u16 *key_state) +static bool twl4030_is_in_ghost_state (struct twl4030_keypad *kp,u16 *key_state) {int i;u16 check =0 ;
@@ -190,12 +194,12 @@ static int twl4030_is_in_ghost_state(stru16 col = key_state[i];if ((col & check) &&hweight16 (col) >1 ) -return 1 ; +return true; check |= col; } -return 0 ; +return false; }static void twl4030_kp_scan (struct twl4030_keypad *kp,bool release_all)
@@ -224,7 +228,8 @@ static void twl4030_kp_scan(struct twl40if (!changed)continue ; -for (col =0 ; col < kp->n_cols; col++) { +/* Extra column handles "all gnd" rows */ +for (col =0 ; col < kp->n_cols +1 ; col++) {int code;if (!(changed & (1 << col)))
PATCH 92/140 ARM: 6201/1: RealView: Do not use outer_sync() on ARM11MPCore boards with L220
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Catalin Marinas <[email protected]>
commit 2503a5ecd86c002506001eba432c524ea009fe7f upstream.
RealView boards with certain revisions of the L220 cache controller (ARM11* processors only) may have issues (hardware deadlock) with the recent changes to the mb() barrier implementation (DSB followed by an L2 cache sync). The patch redefines the RealView ARM11MPCore mandatory barriers without the outer_sync() call.
--- arch/arm/mach-realview/Kconfig | 2 ++ arch/arm/mach-realview/include/mach/barriers.h | 8 ++++++++ 2 files changed, 10 insertions(+)
arch/arm/mach-realview/Kconfig +2 -0
@@ -18,6 +18,7 @@ config REALVIEW_EB_ARM11MP bool "Support ARM11MPCore tile" depends on MACH_REALVIEW_EB select CPU_V6 + select ARCH_HAS_BARRIERS if SMP help Enable support for the ARM11MPCore tile on the Realview platform.
@@ -35,6 +36,7 @@ config MACH_REALVIEW_PB11MP select CPU_V6 select ARM_GIC select HAVE_PATA_PLATFORM + select ARCH_HAS_BARRIERS if SMP help Include support for the ARM(R) RealView MPCore Platform Baseboard. PB11MPCore is a platform with an on-board ARM11MPCore and has
arch/arm/mach-realview/include/mach/barriers.h new file +8 -0
@@ -0,0 +1,8 @@ +/* +* Barriers redefined for RealView ARM11MPCore platforms with L220 cache +* controller to work around hardware errata causing the outer_sync() +* operation to deadlock the system. +*/ +#define mb () dsb() +#define rmb () dmb() +#define wmb () mb()
PATCH 93/140 ARM: 6226/1: fix kprobe bug in ldr instruction emulation
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nicolas Pitre <[email protected]>
commit 0ebe25f90cd99bb1bcf622ec8a841421d48380d6 upstream.
From: Bin Yang <[email protected]>
--- arch/arm/kernel/kprobes-decode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/kernel/kprobes-decode.c +3 -2
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct {insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0 ];kprobe_opcode_t insn = p->opcode; +long ppc = (long )p->addr +8 ;union reg_pair fnr;int rd = (insn >>12 ) &0xf ;int rn = (insn >>16 ) &0xf ;int rm = insn &0xf ;long rdv; -long rnv = regs->uregs[rn]; -long rmv = regs->uregs[rm];/* rm/rmv may be invalid, don't care. */ +long rnv = (rn ==15 ) ? ppc : regs->uregs[rn]; +long rmv = (rm ==15 ) ? ppc : regs->uregs[rm];long cpsr = regs->ARM_cpsr; fnr.dr =insnslot_llret_3arg_rflags (rnv,0 , rmv, cpsr, i_fn);
PATCH 94/140 x86: Do not try to disable hpet if it hasnt been initialized before
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stefano Stabellini <[email protected]>
commit ff4878089e1eaeac79d57878ad4ea32910fb4037 upstream.
hpet_disable is called unconditionally on machine reboot if hpet support is compiled in the kernel.hpet_disable only checks if the machine is hpet capable but doesn't make sure that hpet has been initialized.
[ tglx: Made it a one liner and removed the redundant hpet_address check ]
LKML-Reference: <alpine.DEB.2.00.1007211726240.22235@kaball-desktop>
--- arch/x86/kernel/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/hpet.c +1 -1
@@ -958,7 +958,7 @@ fs_initcall(hpet_late_init);void hpet_disable (void ) { -if (is_hpet_capable ()) { +if (is_hpet_capable () && hpet_virt_address) {unsigned int cfg =hpet_readl (HPET_CFG );if (hpet_legacy_int_enabled) {
PATCH 95/140 USB: obey the sysfs power/wakeup setting
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 48826626263d4a61d06fd8c5805da31f925aefa0 upstream.
This patch (as1403) is a partial reversion of an earlier change (commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e "USB: fix remote wakeup settings during system sleep"). After hearing from a user, I realized that remote wakeup should be enabled during system sleep whenever userspace allows it, and not only if a driver requests it too.
Indeed, there could be a device with no driver, that does nothing but generate a wakeup request when the user presses a button. Such a device should be allowed to do its job.
The problem fixed by the earlier patch -- device generating a wakeup request for no reason, causing system suspend to abort -- was also addressed by a later patch ("USB: don't enable remote wakeup by default", accepted but not yet merged into mainline). The device won't be able to generate the bogus wakeup requests because it will be disabled for remote wakeup by default. Hence this reversion will not re-introduce any old problems.
--- drivers/usb/core/driver.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/usb/core/driver.c +2 -13
@@ -1790,9 +1790,6 @@ int usb_external_resume_device(struct usstatic void choose_wakeup (struct usb_device *udev,pm_message_t msg) { -int w, i; -struct usb_interface *intf; -/* Remote wakeup is needed only when we actually go to sleep. * For things like FREEZE and QUIESCE, if the device is already * autosuspended then its current wakeup setting is okay.
@@ -1802,18 +1799,10 @@ static void choose_wakeup(struct usb_devreturn ; } -/* If remote wakeup is permitted, see whether any interface drivers +/* Allow remote wakeup if it is enabled, even if no interface drivers * actually want it. */ - w =0 ; -if (device_may_wakeup (&udev->dev) && udev->actconfig) { -for (i =0 ; i < udev->actconfig->desc.bNumInterfaces; i++) { - intf = udev->actconfig->interface[i]; - w |= intf->needs_remote_wakeup; - } - } - - udev->do_remote_wakeup = w; + udev->do_remote_wakeup =device_may_wakeup (&udev->dev); }int usb_suspend (struct device *dev,pm_message_t msg)
PATCH 96/140 USB: g_serial: dont set low_latency flag
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Povey <[email protected]>
commit 44a0c0190b500ee6bcfc0976fe540f65dee2cd67 upstream.
No longer set low_latency flag as it causes this warning backtrace:
WARNING: at kernel/mutex.c:207 __mutex_lock_slowpath+0x6c/0x288()
Fix associated locking and wakeups.
--- drivers/usb/gadget/u_serial.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/usb/gadget/u_serial.c +2 -13
@@ -535,17 +535,11 @@ recycle:list_move (&req->list, &port->read_pool); } -/* Push from tty to ldisc; this is immediate with low_latency, and -* may trigger callbacks to this driver ... so drop the spinlock. +/* Push from tty to ldisc; without low_latency set this is handled by +* a workqueue, so we won't get callbacks and can hold port_lock */ if (tty && do_push) { -spin_unlock_irq (&port->port_lock);tty_flip_buffer_push (tty); -wake_up_interruptible (&tty->read_wait); -spin_lock_irq (&port->port_lock); - -/* tty may have been closed */ - tty = port->port_tty; }
@@ -783,11 +777,6 @@ static int gs_open(struct tty_struct *tt port->open_count =1 ; port->openclose = false; -/* low_latency means ldiscs work in tasklet context, without -* needing a workqueue schedule ... easier to keep up. -*/ - tty->low_latency =1 ; -/* if connected, start the I/O stream */ if (port->port_usb) {struct gserial *gser = port->port_usb;
PATCH 97/140 USB: g_serial: fix tty cleanup on unload
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jon Povey <[email protected]>
commit b23097b793081358a6d943263c91bae4c955c4e3 upstream.
Call put_tty_driver() in cleanup function, to fix Oops when trying to open gadget serial char device after module unload.
--- drivers/usb/gadget/u_serial.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/u_serial.c +1 -0
@@ -1183,6 +1183,7 @@ void gserial_cleanup(void) n_ports =0 ;tty_unregister_driver (gs_tty_driver); +put_tty_driver (gs_tty_driver); gs_tty_driver =NULL ;pr_debug ("%s: cleaned up ttyGS* support\n" , __func__);
PATCH 98/140 USB: ehci-mxc: bail out on transceiver problems
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfram Sang <[email protected]>
commit 4c9715de52b9b6256bf1e9510917111a47b0c176 upstream.
The old code registered the hcd even if there were no transceivers detected, leading to oopses like this if we try to probe a non-existant ULPI:
[ 2.730000] mxc-ehci mxc-ehci.0: unable to init transceiver [ 2.740000] timeout polling for ULPI device [ 2.740000] timeout polling for ULPI device [ 2.750000] mxc-ehci mxc-ehci.0: unable to enable vbus on transceiver [ 2.750000] mxc-ehci mxc-ehci.0: Freescale On-Chip EHCI Host Controller [ 2.760000] mxc-ehci mxc-ehci.0: new USB bus registered, assigned bus number 2 [ 2.770000] Unhandled fault: external abort on non-linefetch (0x808) at 0xc4876184 [ 2.770000] Internal error: : 808 [#1] PREEMPT [ 2.770000] last sysfs file: [ 2.770000] Modules linked in: [ 2.770000] CPU: 0 Not tainted (2.6.33.5 #5) [ 2.770000] PC is at ehci_hub_control+0x4d4/0x8f8 [ 2.770000] LR is at ehci_mxc_setup+0xbc/0xdc [ 2.770000] pc : [<c0196dfc>] lr : [<c019bc8c>] psr: 00000093 [ 2.770000] sp : c3815e40 ip : 00000001 fp : 60000013 [ 2.770000] r10: c4876184 r9 : 00000000 r8 : c3814000 [ 2.770000] r7 : c391d2cc r6 : 00000001 r5 : 00000001 r4 : 00000000 [ 2.770000] r3 : 80000000 r2 : 00000007 r1 : 80000000 r0 : c4876184 [ 2.770000] Flags: nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 2.770000] Control: 0005317f Table: a0004000 DAC: 00000017 [ 2.770000] Process swapper (pid: 1, stack limit = 0xc3814270)
...
--- drivers/usb/host/ehci-mxc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-mxc.c +10 -3
@@ -207,10 +207,17 @@ static int ehci_mxc_drv_probe(struct pla/* Initialize the transceiver */ if (pdata->otg) { pdata->otg->io_priv = hcd->regs +ULPI_VIEWPORT_OFFSET ; -if (otg_init (pdata->otg) !=0 ) -dev_err (dev,"unable to init transceiver\n" ); -else if (otg_set_vbus (pdata->otg,1 ) !=0 ) + ret =otg_init (pdata->otg); +if (ret) { +dev_err (dev,"unable to init transceiver, probably missing\n" ); + ret = -ENODEV ; + goto err_add; + } + ret =otg_set_vbus (pdata->otg,1 ); +if (ret) {dev_err (dev,"unable to enable vbus on transceiver\n" ); + goto err_add; + } } priv->hcd = hcd;
Re: [098/140] USB: ehci-mxc: bail out on transceiver problems
Quoted 33 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfram Sang <[email protected]>
commit
4c9715de52b9b6256bf1e9510917111a47b0c176upstream.The old code registered the hcd even if there were no transceivers detected, leading to oopses like this if we try to probe a non-existant ULPI:
[ 2.730000] mxc-ehci mxc-ehci.0: unable to init transceiver [ 2.740000] timeout polling for ULPI device [ 2.740000] timeout polling for ULPI device [ 2.750000] mxc-ehci mxc-ehci.0: unable to enable vbus on transceiver [ 2.750000] mxc-ehci mxc-ehci.0: Freescale On-Chip EHCI Host Controller [ 2.760000] mxc-ehci mxc-ehci.0: new USB bus registered, assigned bus number 2 [ 2.770000] Unhandled fault: external abort on non-linefetch (0x808) at 0xc4876184 [ 2.770000] Internal error: : 808 [#1] PREEMPT [ 2.770000] last sysfs file: [ 2.770000] Modules linked in: [ 2.770000] CPU: 0 Not tainted (2.6.33.5 #5) [ 2.770000] PC is at ehci_hub_control+0x4d4/0x8f8 [ 2.770000] LR is at ehci_mxc_setup+0xbc/0xdc [ 2.770000] pc : [<c0196dfc>] lr : [<c019bc8c>] psr: 00000093 [ 2.770000] sp : c3815e40 ip : 00000001 fp : 60000013 [ 2.770000] r10: c4876184 r9 : 00000000 r8 : c3814000 [ 2.770000] r7 : c391d2cc r6 : 00000001 r5 : 00000001 r4 : 00000000 [ 2.770000] r3 : 80000000 r2 : 00000007 r1 : 80000000 r0 : c4876184 [ 2.770000] Flags: nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 2.770000] Control: 0005317f Table: a0004000 DAC: 00000017 [ 2.770000] Process swapper (pid: 1, stack limit = 0xc3814270)
Quoted 6 lines
...
Signed-off-by Wolfram Sang <[email protected]>Cc Sascha Hauer <[email protected]>Acked-by Daniel Mack <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Daniel mentioned that this patch could cause a "regression" with boards which have hardware problems in form of a floating chip select (originating from the reference design!). For such boards, the probing might now fail, leaving the boards without USB, while it worked before (although it only worked because of ignoring the actual problem).
I can't make my mind if it is better to fix the potential OOPS or to keep those boards working for older kernels. I just wanted to mention it, so this is issue won't be overlooked.
Regards,
Wolfram
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [098/140] USB: ehci-mxc: bail out on transceiver problems
Quoted 47 lines · Wolfram Sang
Quoted 33 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wolfram Sang <[email protected]>
commit
4c9715de52b9b6256bf1e9510917111a47b0c176upstream.The old code registered the hcd even if there were no transceivers detected, leading to oopses like this if we try to probe a non-existant ULPI:
[ 2.730000] mxc-ehci mxc-ehci.0: unable to init transceiver [ 2.740000] timeout polling for ULPI device [ 2.740000] timeout polling for ULPI device [ 2.750000] mxc-ehci mxc-ehci.0: unable to enable vbus on transceiver [ 2.750000] mxc-ehci mxc-ehci.0: Freescale On-Chip EHCI Host Controller [ 2.760000] mxc-ehci mxc-ehci.0: new USB bus registered, assigned bus number 2 [ 2.770000] Unhandled fault: external abort on non-linefetch (0x808) at 0xc4876184 [ 2.770000] Internal error: : 808 [#1] PREEMPT [ 2.770000] last sysfs file: [ 2.770000] Modules linked in: [ 2.770000] CPU: 0 Not tainted (2.6.33.5 #5) [ 2.770000] PC is at ehci_hub_control+0x4d4/0x8f8 [ 2.770000] LR is at ehci_mxc_setup+0xbc/0xdc [ 2.770000] pc : [<c0196dfc>] lr : [<c019bc8c>] psr: 00000093 [ 2.770000] sp : c3815e40 ip : 00000001 fp : 60000013 [ 2.770000] r10: c4876184 r9 : 00000000 r8 : c3814000 [ 2.770000] r7 : c391d2cc r6 : 00000001 r5 : 00000001 r4 : 00000000 [ 2.770000] r3 : 80000000 r2 : 00000007 r1 : 80000000 r0 : c4876184 [ 2.770000] Flags: nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 2.770000] Control: 0005317f Table: a0004000 DAC: 00000017 [ 2.770000] Process swapper (pid: 1, stack limit = 0xc3814270)Quoted 6 lines
...
Signed-off-by Wolfram Sang <[email protected]>Cc Sascha Hauer <[email protected]>Acked-by Daniel Mack <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Daniel mentioned that this patch could cause a "regression" with boards which have hardware problems in form of a floating chip select (originating from the reference design!). For such boards, the probing might now fail, leaving the boards without USB, while it worked before (although it only worked because of ignoring the actual problem).
Quoted 3 lines
I can't make my mind if it is better to fix the potential OOPS or to keep those boards working for older kernels. I just wanted to mention it, so this is issue won't be overlooked.
Odd. Well, I'd rather match what the newer kernels do here, so I'll keep it for now unless someone objects.
thanks,
greg k-h
Re: [098/140] USB: ehci-mxc: bail out on transceiver problems
Quoted 7 lines · Greg KH
Quoted 6 lines · Wolfram Sang
Daniel mentioned that this patch could cause a "regression" with boards which have hardware problems in form of a floating chip select (originating from the reference design!). For such boards, the probing might now fail, leaving the boards without USB, while it worked before (although it only worked because of ignoring the actual problem).
Quoted 6 lines
Quoted 3 lines
I can't make my mind if it is better to fix the potential OOPS or to keep those boards working for older kernels. I just wanted to mention it, so this is issue won't be overlooked.
Odd. Well, I'd rather match what the newer kernels do here, so I'll keep it for now unless someone objects.
Yep, I was about to write the same thing. Let's see what it breaks and fix up the mess afterwards :)
Thanks,
Daniel
PATCH 99/140 USB: option: add support for 1da5:4518
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?=C3=96mer=20Sezgin=20Ugurlu?= <[email protected]>
commit 646d90e2b925578abef5c45853e0b166b6a450bf upstream.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -316,6 +316,7 @@ static int option_resume(struct usb_ser#define QISDA_PRODUCT_H21_4512 0x4512#define QISDA_PRODUCT_H21_4523 0x4523#define QISDA_PRODUCT_H20_4515 0x4515 +#define QISDA_PRODUCT_H20_4518 0x4518#define QISDA_PRODUCT_H20_4519 0x4519/* TLAYTECH PRODUCTS */
@@ -836,6 +837,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, + { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) }, { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
PATCH 100/140 USB: Add PID for Sierra 250U to drivers/usb/serial/sierra.c
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: august huber <[email protected]>
commit 9d72c81d657340e54a260a3b621f4a9f5b33829c upstream.
Add VID/PID for Sierra Wireless 250U USB dongle to sierra.c Allows use of 3G radio only
--- drivers/usb/serial/sierra.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/sierra.c +1 -0
@@ -244,6 +244,7 @@ static struct usb_device_id id_table [] { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ + { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U *//* Sierra Wireless C597 */ { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },/* Sierra Wireless T598 */
PATCH 101/140 USB: ftdi_sio: support for Signalyzer tools based on FTDI chips
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Colin Leitner <[email protected]>
commit 77dbd74e16b566e9d5eeb4be18ae3ee7d5902bd3 upstream.
ftdi_sio: support for Signalyzer tools based on FTDI chips
This patch adds support for the Xverve Signalyzers.
--- drivers/usb/serial/ftdi_sio.c | 8 ++++++++ drivers/usb/serial/ftdi_sio_ids.h | 9 +++++++++ 2 files changed, 17 insertions(+)
drivers/usb/serial/ftdi_sio.c +8 -0
@@ -743,6 +743,14 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { }, /* Optional parameter entry */ { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +9 -0
@@ -1024,3 +1024,12 @@#define MJSG_SR_RADIO_PID 0x9379#define MJSG_XM_RADIO_PID 0x937A#define MJSG_HD_RADIO_PID 0x937C + +/* +* Xverve Signalyzer tools (http://www.signalyzer.com/) +*/ +#define XVERVE_SIGNALYZER_ST_PID 0xBCA0 +#define XVERVE_SIGNALYZER_SLITE_PID 0xBCA1 +#define XVERVE_SIGNALYZER_SH2_PID 0xBCA2 +#define XVERVE_SIGNALYZER_SH4_PID 0xBCA4 +
PATCH 102/140 USB: option: Add support for AMOI Skypephone S2
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dennis Jansen <[email protected]>
commit 7595931c986f50b1e197ce7b881563e36a7d041e upstream.
usbserial: Add AMOI Skypephone S2 support.
This patch adds support for the AMOI Skypephone S2 to the usbserial module.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -226,6 +226,7 @@ static int option_resume(struct usb_ser#define AMOI_PRODUCT_H01 0x0800#define AMOI_PRODUCT_H01A 0x7002#define AMOI_PRODUCT_H02 0x0802 +#define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407#define DELL_VENDOR_ID 0x413C
@@ -504,6 +505,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, + { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) }, { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
PATCH 103/140 USB: adds Artisman USB dongle to list of quirky devices
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paul Mortier <[email protected]>
commit 47f19c0eedb377ad1ee8114f464d001ec5f96a69 upstream.
When an attempt is made to read the interface strings of the Artisman Watchdog USB dongle (idVendor:idProduct 04b4:0526) an error is written to the dmesg log (uhci_result_common: failed with status 440000) and the dongle resets itself, resulting in a disconnect/reconnect loop.
Adding the dongle to the list of devices in quirks.c, with the same quirk Alan Stern's previous patch for the Saitek Cyborg Gold 3D joystick, stops the device from resetting and allows it to be used with no problems.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_qu/* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Artisman Watchdog Dongle */ + { USB_DEVICE(0x04b4, 0x0526), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, + /* Roland SC-8820 */ { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
PATCH 104/140 USB: sisusbvga: Fix for USB 3.0
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Oliver Neukum <[email protected]>
commit 20a12f007feee1cfa761b431047271d1141d8031 upstream.
Super speed is also fast enough to let sisusbvga operate. Therefor expand the checks.
--- drivers/usb/misc/sisusbvga/sisusb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb.c +3 -2
@@ -2435,7 +2435,8 @@ sisusb_open(struct inode *inode, struct }if (!sisusb->devinit) { -if (sisusb->sisusb_dev->speed ==USB_SPEED_HIGH ) { +if (sisusb->sisusb_dev->speed ==USB_SPEED_HIGH || + sisusb->sisusb_dev->speed ==USB_SPEED_SUPER ) {if (sisusb_init_gfxdevice (sisusb,0 )) {mutex_unlock (&sisusb->lock);dev_err (&sisusb->sisusb_dev->dev,"Failed to initialize device\n" );
@@ -3167,7 +3168,7 @@ static int sisusb_probe(struct usb_inter sisusb->present =1 ; -if (dev->speed ==USB_SPEED_HIGH ) { +if (dev->speed ==USB_SPEED_HIGH || dev->speed ==USB_SPEED_SUPER ) {int initscreen =1 ;#ifdef INCL_SISUSB_CON if (sisusb_first_vc > 0 &&
PATCH 105/140 USB: add quirk for Broadcom BT dongle
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Oliver Neukum <[email protected]>
commit 63ab71deae67b031045bb28bf8cff45180089f8f upstream.
This device needs to be reset when resuming
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -68,6 +68,9 @@ static const struct usb_device_id usb_qu/* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, + /* Broadcom BCM92035DGROM BT dongle */ + { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Action Semiconductor flash disk */ { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255 },
PATCH 106/140 USB: FTDI: Add support for the RT System VX-7 radio programming cable
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Corey Minyard <[email protected]>
commit fcc6cb789c77ffee31710eec64efeb25f2124f7a upstream.
RT Systems has put out bunch of ham radio cables based on the FT232RL chip. Each cable type has a unique PID, this adds one for the Yaesu VX-7 radios.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -697,6 +697,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -703,6 +703,12 @@#define TELLDUS_TELLSTICK_PID 0x0C30/* RF control dongle 433 MHz using FT232RL */ /* +* RT Systems programming cables for various ham radios +*/ +#define RTSYSTEMS_VID 0x2100/* Vendor ID */ +#define RTSYSTEMS_SERIAL_VX7_PID 0x9e52/* Serial converter for VX-7 Radios using FT232RL */ + +/* * Bayer Ascensia Contour blood glucose meter USB-converter cable. * http://winglucofacts.com/cables/ */
PATCH 107/140 ethtool: Fix potential user buffer overflow for ETHTOOL_{G, S}RXFH
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
commit bf988435bd5b53529f4408a8efb1f433f6ddfda9 upstream.
struct ethtool_rxnfc was originally defined in 2.6.27 for the ETHTOOL_{G,S}RXFH command with only the cmd, flow_type and data fields. It was then extended in 2.6.30 to support various additional commands. These commands should have been defined to use a new structure, but it is too late to change that now.
Since user-space may still be using the old structure definition for the ETHTOOL_{G,S}RXFH commands, and since they do not need the additional fields, only copy the originally defined fields to and from user-space.
--- include/linux/ethtool.h | 2 ++ net/core/ethtool.c | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-)
include/linux/ethtool.h +2 -0
@@ -358,6 +358,8 @@ struct ethtool_rxnfc {__u32 flow_type;/* The rx flow hash value or the rule DB size */ __u64 data; +/* The following fields are not valid and must not be used for +* the ETHTOOL_{G,X}RXFH commands. */ struct ethtool_rx_flow_spec fs;__u32 rule_cnt;__u32 rule_locs[0 ];
net/core/ethtool.c +29 -9
@@ -209,22 +209,34 @@ static int ethtool_get_drvinfo(struct nereturn 0 ; } -static int ethtool_set_rxnfc (struct net_device *dev,void __user *useraddr) +static int ethtool_set_rxnfc (struct net_device *dev, +u32 cmd,void __user *useraddr) { -struct ethtool_rxnfc cmd; +struct ethtool_rxnfc info; +size_t info_size =sizeof (info);if (!dev->ethtool_ops->set_rxnfc)return -EOPNOTSUPP ; -if (copy_from_user (&cmd, useraddr,sizeof (cmd))) +/* struct ethtool_rxnfc was originally defined for +* ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data +* members. User-space might still be using that +* definition. */ +if (cmd ==ETHTOOL_SRXFH ) + info_size = (offsetof(struct ethtool_rxnfc , data) + +sizeof (info.data)); + +if (copy_from_user (&info, useraddr, info_size))return -EFAULT ; -return dev->ethtool_ops->set_rxnfc (dev, &cmd); +return dev->ethtool_ops->set_rxnfc (dev, &info); } -static int ethtool_get_rxnfc (struct net_device *dev,void __user *useraddr) +static int ethtool_get_rxnfc (struct net_device *dev, +u32 cmd,void __user *useraddr) {struct ethtool_rxnfc info; +size_t info_size =sizeof (info);const struct ethtool_ops *ops = dev->ethtool_ops;int ret;void *rule_buf =NULL ;
@@ -232,7 +244,15 @@ static int ethtool_get_rxnfc(struct net_if (!ops->get_rxnfc)return -EOPNOTSUPP ; -if (copy_from_user (&info, useraddr,sizeof (info))) +/* struct ethtool_rxnfc was originally defined for +* ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data +* members. User-space might still be using that +* definition. */ +if (cmd ==ETHTOOL_GRXFH ) + info_size = (offsetof(struct ethtool_rxnfc , data) + +sizeof (info.data)); + +if (copy_from_user (&info, useraddr, info_size))return -EFAULT ;if (info.cmd ==ETHTOOL_GRXCLSRLALL ) {
@@ -250,7 +270,7 @@ static int ethtool_get_rxnfc(struct net_ goto err_out; ret = -EFAULT ; -if (copy_to_user (useraddr, &info,sizeof (info))) +if (copy_to_user (useraddr, &info, info_size)) goto err_out;if (rule_buf) {
@@ -1095,12 +1115,12 @@ int dev_ethtool(struct net *net, structcase ETHTOOL_GRXCLSRLCNT :case ETHTOOL_GRXCLSRULE :case ETHTOOL_GRXCLSRLALL : - rc =ethtool_get_rxnfc (dev, useraddr); + rc =ethtool_get_rxnfc (dev, ethcmd, useraddr);break ;case ETHTOOL_SRXFH :case ETHTOOL_SRXCLSRLDEL :case ETHTOOL_SRXCLSRLINS : - rc =ethtool_set_rxnfc (dev, useraddr); + rc =ethtool_set_rxnfc (dev, ethcmd, useraddr);break ;case ETHTOOL_GGRO : rc =ethtool_get_gro (dev, useraddr);
PATCH 108/140 KVM: MMU: Remove user access when allowing kernel access to gpte.w=0 page
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
If cr0.wp=0, we have to allow the guest kernel access to a page with pte.w=0. We do that by setting spte.w=1, since the host cr0.wp must remain set so the host can write protect pages. Once we allow write access, we must remove user access otherwise we mistakenly allow the user to write the page.
--- arch/x86/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu.c +3 -0
@@ -1849,6 +1849,9 @@ static int set_spte(struct kvm_vcpu *vcp spte |=PT_WRITABLE_MASK ; +if (!tdp_enabled && !(pte_access &ACC_WRITE_MASK )) + spte &= ~PT_USER_MASK ; +/* * Optimization: for pte sync, if spte was writable the hash * lookup is unnecessary (and expensive). Write protection
PATCH 109/140 KVM: SVM: Handle MCEs early in the vmexit process
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
This patch moves handling of the MC vmexits to an earlier point in the vmexit. The handle_exit function is too late because the vcpu might alreadry have changed its physical cpu.
--- arch/x86/kvm/svm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
arch/x86/kvm/svm.c +14 -1
@@ -1255,7 +1255,7 @@ static int nm_interception(struct vcpu_sreturn 1 ; } -static int mc_interception (struct vcpu_svm *svm) +static void svm_handle_mce (struct vcpu_svm *svm) {/* * On an #MC intercept the MCE handler is not called automatically in
@@ -1265,6 +1265,11 @@ static int mc_interception(struct vcpu_s "int $0x12\n");/* not sure if we ever come back to this point */ +return ; +} + +static int mc_interception (struct vcpu_svm *svm) +{return 1 ; }
@@ -2820,6 +2825,14 @@ static void svm_vcpu_run(struct kvm_vcpu vcpu->arch.regs_avail &= ~(1 <<VCPU_EXREG_PDPTR ); vcpu->arch.regs_dirty &= ~(1 <<VCPU_EXREG_PDPTR ); } + +/* +* We need to handle MC intercepts here before the vcpu has a chance to +* change the physical cpu +*/ +if (unlikely (svm->vmcb->control.exit_code == +SVM_EXIT_EXCP_BASE +MC_VECTOR )) +svm_handle_mce (svm); }#undef R
PATCH 110/140 KVM: SVM: Implement workaround for Erratum 383
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
This patch implements a workaround for AMD erratum 383 into KVM. Without this erratum fix it is possible for a guest to kill the host machine. This patch implements the suggested workaround for hypervisors which will be published by the next revision guide update.
[jan: fix overflow warning on i386]
[xiao: fix unused variable warning]
--- arch/x86/include/asm/msr-index.h | 1 arch/x86/kvm/svm.c | 81 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -107,6 +107,7 @@#define MSR_AMD64_PATCH_LOADER 0xc0010020#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140#define MSR_AMD64_OSVW_STATUS 0xc0010141 +#define MSR_AMD64_DC_CFG 0xc0011022#define MSR_AMD64_IBSFETCHCTL 0xc0011030#define MSR_AMD64_IBSFETCHLINAD 0xc0011031#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
arch/x86/kvm/svm.c +81 -0
113 lines not on this page · raw message
PATCH 111/140 KVM: MMU: invalidate and flush on spte small->large page size change
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
Always invalidate spte and flush TLBs when changing page size, to make sure different sized translations for the same address are never cached in a CPU's TLB.
Currently the only case where this occurs is when a non-leaf spte pointer is overwritten by a leaf, large spte entry. This can happen after dirty logging is disabled on a memslot, for example.
Noticed by Andrea.
KVM-Stable-Tag
--- arch/x86/kvm/mmu.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kvm/mmu.c +2 -0
@@ -1907,6 +1907,8 @@ static void mmu_set_spte(struct kvm_vcpu child =page_header (pte &PT64_BASE_ADDR_MASK );mmu_page_remove_parent_pte (child, sptep); +__set_spte (sptep, shadow_trap_nonpresent_pte); +kvm_flush_remote_tlbs (vcpu->kvm); }else if (pfn !=spte_to_pfn (*sptep)) {pgprintk ("hfn old %lx new %lx\n" ,spte_to_pfn (*sptep), pfn);
PATCH 112/140 KVM: read apic->irr with ioapic lock held
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
Read ioapic->irr inside ioapic->lock protected section.
KVM-Stable-Tag
(cherry picked from comit 07dc7263b99e4ddad2b4c69765a428ccb7d48938)
--- virt/kvm/ioapic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
virt/kvm/ioapic.c +2 -1
@@ -177,12 +177,13 @@ static int ioapic_deliver(struct kvm_ioaint kvm_ioapic_set_irq (struct kvm_ioapic *ioapic,int irq,int level) { -u32 old_irr = ioapic->irr; +u32 old_irr;u32 mask =1 << irq;union kvm_ioapic_redirect_entry entry;int ret =1 ;mutex_lock (&ioapic->lock); + old_irr = ioapic->irr;if (irq >=0 && irq <IOAPIC_NUM_PINS ) { entry = ioapic->redirtbl[irq]; level ^= entry.fields.polarity;
PATCH 113/140 futex: futex_find_get_task remove credentails check
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michal Hocko <[email protected]>
commit 7a0ea09ad5352efce8fe79ed853150449903b9f5 upstream.
futex_find_get_task is currently used (through lookup_pi_state) from two contexts, futex_requeue and futex_lock_pi_atomic. None of the paths looks it needs the credentials check, though. Different (e)uids shouldn't matter at all because the only thing that is important for shared futex is the accessibility of the shared memory.
The credentail check results in glibc assert failure or process hang (if glibc is compiled without assert support) for shared robust pthread mutex with priority inheritance if a process tries to lock already held lock owned by a process with a different euid:
pthread_mutex_lock.c:312: __pthread_mutex_lock_full: Assertion `(-(e)) != 3 || !robust' failed.
The problem is that futex_lock_pi_atomic which is called when we try to lock already held lock checks the current holder (tid is stored in the futex value) to get the PI state. It uses lookup_pi_state which in turn gets task struct from futex_find_get_task. ESRCH is returned either when the task is not found or if credentials check fails.
futex_lock_pi_atomic simply returns if it gets ESRCH. glibc code, however, doesn't expect that robust lock returns with ESRCH because it should get either success or owner died.
--- kernel/futex.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
kernel/futex.c +4 -13
@@ -429,20 +429,11 @@ static void free_pi_state(struct futex_pstatic struct task_struct *futex_find_get_task (pid_t pid) {struct task_struct *p; -const struct cred *cred =current_cred (), *pcred;rcu_read_lock (); p =find_task_by_vpid (pid); -if (!p) { - p =ERR_PTR (-ESRCH ); - }else { - pcred =__task_cred (p); -if (cred->euid != pcred->euid && - cred->euid != pcred->uid) - p =ERR_PTR (-ESRCH ); -else -get_task_struct (p); - } +if (p) +get_task_struct (p);rcu_read_unlock ();
@@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_hif (!pid)return -ESRCH ; p =futex_find_get_task (pid); -if (IS_ERR (p)) -return PTR_ERR (p); +if (!p) +return -ESRCH ;/* * We need to look at the task state flags to figure out,
PATCH 114/140 PM / x86: Save/restore MISC_ENABLE register
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ondrej Zary <[email protected]>
commit 85a0e7539781dad4bfcffd98e72fa9f130f4e40d upstream.
Save/restore MISC_ENABLE register on suspend/resume.
This fixes OOPS (invalid opcode) on resume from STR on Asus P4P800-VM, which wakes up with MWAIT disabled.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15385
--- arch/x86/include/asm/suspend_32.h | 2 ++ arch/x86/include/asm/suspend_64.h | 2 ++ arch/x86/power/cpu.c | 4 ++++ 3 files changed, 8 insertions(+)
arch/x86/include/asm/suspend_32.h +2 -0
@@ -15,6 +15,8 @@ static inline int arch_prepare_suspend(vstruct saved_context {u16 es, fs, gs, ss;unsigned long cr0, cr2, cr3, cr4; +u64 misc_enable; +bool misc_enable_saved;struct desc_ptr gdt;struct desc_ptr idt;u16 ldt;
arch/x86/include/asm/suspend_64.h +2 -0
@@ -27,6 +27,8 @@ struct saved_context {u16 ds, es, fs, gs, ss;unsigned long gs_base, gs_kernel_base, fs_base;unsigned long cr0, cr2, cr3, cr4, cr8; +u64 misc_enable; +bool misc_enable_saved;unsigned long efer;u16 gdt_pad;u16 gdt_limit;
arch/x86/power/cpu.c +4 -0
@@ -105,6 +105,8 @@ static void __save_processor_state(struc ctxt->cr4 =read_cr4 (); ctxt->cr8 =read_cr8 ();#endif + ctxt->misc_enable_saved = !rdmsrl_safe (MSR_IA32_MISC_ENABLE , + &ctxt->misc_enable); }/* Needed by apm.c */
@@ -152,6 +154,8 @@ static void fix_processor_context(void)*/ static void __restore_processor_state (struct saved_context *ctxt) { +if (ctxt->misc_enable_saved) +wrmsrl (MSR_IA32_MISC_ENABLE , ctxt->misc_enable);/* * control registers */
PATCH 115/140 ACPI: skip checking BM_STS if the BIOS doesnt ask for it
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Len Brown <[email protected]>
commit 718be4aaf3613cf7c2d097f925abc3d3553c0605 upstream.
It turns out that there is a bit in the _CST for Intel FFH C3 that tells the OS if we should be checking BM_STS or not.
Linux has been unconditionally checking BM_STS.
If the chip-set is configured to enable BM_STS,
it can retard or completely prevent entry into
deep C-states -- as illustrated by turbostat:
http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/
ref: Intel Processor Vendor-Specific ACPI Interface Specification table 4 "_CST FFH GAS Field Encoding"
Bit 1: Set to 1 if OSPM should use Bus Master avoidance for this C-state
https://bugzilla.kernel.org/show_bug.cgi?id=15886
--- arch/x86/kernel/acpi/cstate.c | 9 +++++++++ drivers/acpi/processor_idle.c | 2 +- include/acpi/processor.h | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-)
arch/x86/kernel/acpi/cstate.c +9 -0
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsi percpu_entry->states[cx->index].eax = cx->address; percpu_entry->states[cx->index].ecx =MWAIT_ECX_INTERRUPT_BREAK ; } + +/* +* For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, +* then we should skip checking BM_STS for this C-state. +* ref: "Intel Processor Vendor-Specific ACPI Interface Specification" +*/ +if ((c->x86_vendor ==X86_VENDOR_INTEL ) && !(reg->access_size &0x2 )) + cx->bm_sts_skip =1 ; +return retval; }EXPORT_SYMBOL_GPL (acpi_processor_ffh_cstate_probe);
drivers/acpi/processor_idle.c +1 -1
@@ -954,7 +954,7 @@ static int acpi_idle_enter_bm(struct cpuif (acpi_idle_suspend)return (acpi_idle_enter_c1 (dev, state)); -if (acpi_idle_bm_check ()) { +if (!cx->bm_sts_skip &&acpi_idle_bm_check ()) {if (dev->safe_state) { dev->last_state = dev->safe_state;return dev->safe_state->enter (dev, dev->safe_state);
include/acpi/processor.h +2 -1
@@ -48,7 +48,7 @@ struct acpi_power_register {u8 space_id;u8 bit_width;u8 bit_offset; -u8 reserved; +u8 access_size;u64 address; } __attribute__ ((packed));
@@ -74,6 +74,7 @@ struct acpi_processor_cx {u32 power;u32 usage;u64 time; +u8 bm_sts_skip;struct acpi_processor_cx_policy promotion;struct acpi_processor_cx_policy demotion;char desc[ACPI_CX_DESC_LEN ];
PATCH 116/140 ACPI: Unconditionally set SCI_EN on resume
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Garrett <[email protected]>
commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 upstream.
The ACPI spec tells us that the firmware will reenable SCI_EN on resume. Reality disagrees in some cases. The ACPI spec tells us that the only way to set SCI_EN is via an SMM call.
https://bugzilla.kernel.org/show_bug.cgi?id=13745 shows us that doing so may break machines. Tracing the ACPI calls made by Windows shows that it unconditionally sets SCI_EN on resume with a direct register write, and therefore the overwhelming probability is that everything is fine with this behaviour.
--- arch/x86/kernel/acpi/sleep.c | 2 drivers/acpi/sleep.c | 157 ------------------------------------------- include/linux/acpi.h | 1 3 files changed, 2 insertions(+), 158 deletions(-)
arch/x86/kernel/acpi/sleep.c +0 -2
@@ -162,8 +162,6 @@ static int __init acpi_sleep_setup(char#endif if (strncmp (str,"old_ordering" ,12 ) ==0 )acpi_old_suspend_ordering (); -if (strncmp (str,"sci_force_enable" ,16 ) ==0 ) -acpi_set_sci_en_on_resume (); str =strchr (str,',' );if (str !=NULL ) str +=strspn (str,", \t" );
drivers/acpi/sleep.c +2 -155
193 lines not on this page · raw message
include/linux/acpi.h +0 -1
@@ -251,7 +251,6 @@ int acpi_check_mem_region(resource_size_void __init acpi_no_s4_hw_signature (void );void __init acpi_old_suspend_ordering (void );void __init acpi_s4_no_nvs (void ); -void __init acpi_set_sci_en_on_resume (void );#endif /* CONFIG_PM_SLEEP */ struct acpi_osc_context {
PATCH 117/140 libertas/sdio: 8686: set ECSI bit for 1-bit transfers
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Mack <[email protected]>
commit 8a64c0f6b7ec7f758c4ef445e49f479e27fa2236 upstream.
When operating in 1-bit mode, SDAT1 is used as dedicated interrupt line. However, the 8686 will only drive this line when the ECSI bit is set in the CCCR_IF register.
Thanks to Alagu Sankar for pointing me in the right direction.
--- drivers/net/wireless/libertas/if_sdio.c | 22 ++++++++++++++++++++++ include/linux/mmc/sdio.h | 2 ++ 2 files changed, 24 insertions(+)
drivers/net/wireless/libertas/if_sdio.c +22 -0
@@ -34,6 +34,8 @@#include <linux/mmc/card.h> #include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_ids.h> +#include <linux/mmc/sdio.h> +#include <linux/mmc/host.h> #include "host.h" #include "decl.h"
@@ -942,6 +944,7 @@ static int if_sdio_probe(struct sdio_funint ret, i;unsigned int model;struct if_sdio_packet *packet; +struct mmc_host *host = func->card->host;lbs_deb_enter (LBS_DEB_SDIO );
@@ -1022,6 +1025,25 @@ static int if_sdio_probe(struct sdio_funif (ret) goto disable; +/* For 1-bit transfers to the 8686 model, we need to enable the +* interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 +* bit to allow access to non-vendor registers. */ +if ((card->model ==IF_SDIO_MODEL_8686 ) && + (host->caps &MMC_CAP_SDIO_IRQ ) && + (host->ios.bus_width ==MMC_BUS_WIDTH_1 )) { +u8 reg; + + func->card->quirks |=MMC_QUIRK_LENIENT_FN0 ; + reg =sdio_f0_readb (func,SDIO_CCCR_IF , &ret); +if (ret) + goto release_int; + + reg |=SDIO_BUS_ECSI ; +sdio_f0_writeb (func, reg,SDIO_CCCR_IF , &ret); +if (ret) + goto release_int; + } + card->ioport =sdio_readb (func,IF_SDIO_IOPORT , &ret);if (ret) goto release_int;
include/linux/mmc/sdio.h +2 -0
@@ -94,6 +94,8 @@#define SDIO_BUS_WIDTH_1BIT 0x00#define SDIO_BUS_WIDTH_4BIT 0x02 +#define SDIO_BUS_ECSI 0x20/* Enable continuous SPI interrupt */ +#define SDIO_BUS_SCSI 0x40/* Support continuous SPI interrupt */ #define SDIO_BUS_CD_DISABLE 0x80/* disable pull-up on DAT3 (pin 1) */
PATCH 118/140 dm9000: fix "BUG: spinlock recursion"
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Baruch Siach <[email protected]>
commit 380fefb2ddabd4cd5f14dbe090481f0544e65078 upstream.
dm9000_set_rx_csum and dm9000_hash_table are called from atomic context (in dm9000_init_dm9000), and from non-atomic context (via ethtool_ops and net_device_ops respectively). This causes a spinlock recursion BUG. Fix this by renaming these functions to *_unlocked for the atomic context, and make the original functions locking wrappers for use in the non-atomic context.
--- drivers/net/dm9000.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-)
drivers/net/dm9000.c +27 -11
@@ -475,17 +475,13 @@ static uint32_t dm9000_get_rx_csum(strucreturn dm->rx_csum; } -static int dm9000_set_rx_csum (struct net_device *dev,uint32_t data) +static int dm9000_set_rx_csum_unlocked (struct net_device *dev,uint32_t data) {board_info_t *dm =to_dm9000_board (dev); -unsigned long flags;if (dm->can_csum) { dm->rx_csum = data; - -spin_lock_irqsave (&dm->lock, flags);iow (dm,DM9000_RCSR , dm->rx_csum ?RCSR_CSUM :0 ); -spin_unlock_irqrestore (&dm->lock, flags);return 0 ; }
@@ -493,6 +489,19 @@ static int dm9000_set_rx_csum(struct netreturn -EOPNOTSUPP ; } +static int dm9000_set_rx_csum (struct net_device *dev,uint32_t data) +{ +board_info_t *dm =to_dm9000_board (dev); +unsigned long flags; +int ret; + +spin_lock_irqsave (&dm->lock, flags); + ret =dm9000_set_rx_csum_unlocked (dev, data); +spin_unlock_irqrestore (&dm->lock, flags); + +return ret; +} +static int dm9000_set_tx_csum (struct net_device *dev,uint32_t data) {board_info_t *dm =to_dm9000_board (dev);
@@ -721,7 +730,7 @@ static unsigned char dm9000_type_to_char* Set DM9000 multicast address */ static void -dm9000_hash_table (struct net_device *dev) +dm9000_hash_table_unlocked (struct net_device *dev) {board_info_t *db =netdev_priv (dev);struct dev_mc_list *mcptr = dev->mc_list;
@@ -730,12 +739,9 @@ dm9000_hash_table(struct net_device *devu32 hash_val;u16 hash_table[4 ];u8 rcr =RCR_DIS_LONG |RCR_DIS_CRC |RCR_RXEN ; -unsigned long flags;dm9000_dbg (db,1 ,"entering %s\n" , __func__); -spin_lock_irqsave (&db->lock, flags); -for (i =0 , oft =DM9000_PAR ; i <6 ; i++, oft++)iow (db, oft, dev->dev_addr[i]);
@@ -765,6 +771,16 @@ dm9000_hash_table(struct net_device *dev }iow (db,DM9000_RCR , rcr); +} + +static void +dm9000_hash_table (struct net_device *dev) +{ +board_info_t *db =netdev_priv (dev); +unsigned long flags; + +spin_lock_irqsave (&db->lock, flags); +dm9000_hash_table_unlocked (dev);spin_unlock_irqrestore (&db->lock, flags); }
@@ -784,7 +800,7 @@ dm9000_init_dm9000(struct net_device *de db->io_mode =ior (db,DM9000_ISR ) >>6 ;/* ISR bit7:6 keeps I/O mode */ /* Checksum mode */ -dm9000_set_rx_csum (dev, db->rx_csum); +dm9000_set_rx_csum_unlocked (dev, db->rx_csum);/* GPIO0 on pre-activate PHY */ iow (db,DM9000_GPR ,0 );/* REG_1F bit0 activate phyxcer */
@@ -811,7 +827,7 @@ dm9000_init_dm9000(struct net_device *deiow (db,DM9000_ISR ,ISR_CLR_STATUS );/* Clear interrupt status */ /* Set address filter table */ -dm9000_hash_table (dev); +dm9000_hash_table_unlocked (dev); imr =IMR_PAR |IMR_PTM |IMR_PRM ;if (db->type !=TYPE_DM9000E )
PATCH 119/140 firmware_class: fix memory leak - free allocated pages
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Woodhouse <[email protected]>
commit dd336c554d8926c3348a2d5f2a5ef5597f6d1a06 upstream.
fix memory leak introduced by the patch 6e03a201bbe:
firmware: speed up request_firmware()
1. vfree won't release pages there were allocated explicitly and mapped using vmap. The memory has to be vunmap-ed and the pages needs to be freed explicitly
2. page array is moved into the 'struct firmware' so that we can free it from release_firmware() and not only in fw_dev_release()
The fix doesn't break the firmware load speed.
--- drivers/base/firmware_class.c | 26 ++++++++++++++++++++------ include/linux/firmware.h | 1 + 2 files changed, 21 insertions(+), 6 deletions(-)
drivers/base/firmware_class.c +20 -6
@@ -125,6 +125,17 @@ static ssize_t firmware_loading_show(strreturn sprintf (buf,"%d\n" , loading); } +static void firmware_free_data (const struct firmware *fw) +{ +int i; +vunmap (fw->data); +if (fw->pages) { +for (i =0 ; i <PFN_UP (fw->size); i++) +__free_page (fw->pages[i]); +kfree (fw->pages); + } +} +/* Some architectures don't have PAGE_KERNEL_RO */ #ifndef PAGE_KERNEL_RO #define PAGE_KERNEL_RO PAGE_KERNEL
@@ -157,21 +168,21 @@ static ssize_t firmware_loading_store(stmutex_unlock (&fw_lock);break ; } -vfree (fw_priv->fw->data); - fw_priv->fw->data =NULL ; +firmware_free_data (fw_priv->fw); +memset (fw_priv->fw,0 ,sizeof (struct firmware )); +/* If the pages are not owned by 'struct firmware' */ for (i =0 ; i < fw_priv->nr_pages; i++)__free_page (fw_priv->pages[i]);kfree (fw_priv->pages); fw_priv->pages =NULL ; fw_priv->page_array_size =0 ; fw_priv->nr_pages =0 ; - fw_priv->fw->size =0 ;set_bit (FW_STATUS_LOADING , &fw_priv->status);mutex_unlock (&fw_lock);break ;case 0 :if (test_bit (FW_STATUS_LOADING , &fw_priv->status)) { -vfree (fw_priv->fw->data); +vunmap (fw_priv->fw->data); fw_priv->fw->data =vmap (fw_priv->pages, fw_priv->nr_pages,0 ,PAGE_KERNEL_RO );
@@ -179,7 +190,10 @@ static ssize_t firmware_loading_store(stdev_err (dev,"%s: vmap() failed\n" , __func__); goto err; } -/* Pages will be freed by vfree() */ +/* Pages are now owned by 'struct firmware' */ + fw_priv->fw->pages = fw_priv->pages; + fw_priv->pages =NULL ; + fw_priv->page_array_size =0 ; fw_priv->nr_pages =0 ;complete (&fw_priv->completion);
@@ -572,7 +586,7 @@ release_firmware(const struct firmware *if (fw->data == builtin->data) goto free_fw; } -vfree (fw->data); +firmware_free_data (fw); free_fw:kfree (fw); }
include/linux/firmware.h +1 -0
@@ -12,6 +12,7 @@struct firmware {size_t size;const u8 *data; +struct page **pages; };struct device ;
PATCH 120/140 revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrej Gelenberg <[email protected]>
commit accd846698439ba18250e8fd5681af280446b853 upstream.
395913d0b1db37092ea3d9d69b832183b1dd84c5 ("[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)") is not needed, because there is no rwsem lock in cpufreq_ondemand and cpufreq_conservative anymore. Lock should not be released until the work done.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=1594
--- drivers/cpufreq/cpufreq.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/cpufreq/cpufreq.c +1 -10
@@ -1765,17 +1765,8 @@ static int __cpufreq_set_policy(struct cdprintk ("governor switch\n" );/* end old governor */ -if (data->governor) { -/* -* Need to release the rwsem around governor -* stop due to lock dependency between -* cancel_delayed_work_sync and the read lock -* taken in the delayed work handler. -*/ -unlock_policy_rwsem_write (data->cpu); +if (data->governor)__cpufreq_governor (data,CPUFREQ_GOV_STOP ); -lock_policy_rwsem_write (data->cpu); - }/* start new governor */ data->governor = policy->governor;
PATCH 121/140 ALSA: Echoaudio, fix Guru Meditation #00000005.48454C50
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Giuliano Pochini <[email protected]>
commit b721e68bdc5b39c51bf6a1469f8d3663fbe03243 upstream.
This patch fixes a division by zero error in the irq handler.
There is a small window between the hw_params() callback and when runtime->frame_bits is set by ALSA middle layer. When another substream is already running, if an interrupt is delivered during that window the irq handler calls pcm_pointer() which does a division by zero. The patch below makes the irq handler skip substreams that are initialized but not started yet. Cc to Clemens Ladisch because he proposed an alternate fix.
For more information, please read the original thread in the linux-kernel mailing list: http://lkml.org/lkml/2010/2/2/187
--- sound/pci/echoaudio/echoaudio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/echoaudio/echoaudio.c +3 -1
@@ -1821,7 +1821,9 @@ static irqreturn_t snd_echo_interrupt(in/* The hardware doesn't tell us which substream caused the irq, thus we have to check all running substreams. */ for (ss =0 ; ss <DSP_MAXPIPES ; ss++) { -if ((substream = chip->substream[ss])) { + substream = chip->substream[ss]; +if (substream && ((struct audiopipe *)substream->runtime-> + private_data)->state ==PIPE_STATE_STARTED ) { period =pcm_pointer (substream) / substream->runtime->period_size;if (period != chip->last_period[ss]) {
PATCH 122/140 V4L/DVB: dvb-core: Fix ULE decapsulation bug
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ang Way Chuang <[email protected]>
commit 5c331fc8c19e181bffab46e9d18e1637cdc47170 upstream.
Fix ULE decapsulation bug when less than 4 bytes of ULE SNDU is packed into the remaining bytes of a MPEG2-TS frame
ULE (Unidirectional Lightweight Encapsulation RFC 4326) decapsulation code has a bug that incorrectly treats ULE SNDU packed into the remaining 2 or 3 bytes of a MPEG2-TS frame as having invalid pointer field on the subsequent MPEG2-TS frame.
--- drivers/media/dvb/dvb-core/dvb_net.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/media/dvb/dvb-core/dvb_net.c +11 -1
@@ -350,6 +350,7 @@ static void dvb_net_ule( struct net_deviconst u8 *ts, *ts_end, *from_where =NULL ;u8 ts_remain =0 , how_much =0 , new_ts =1 ;struct ethhdr *ethh =NULL ; +bool error = false;#ifdef ULE_DEBUG /* The code inside ULE_DEBUG keeps a history of the last 100 TS cells processed. */
@@ -459,10 +460,16 @@ static void dvb_net_ule( struct net_devi/* Drop partly decoded SNDU, reset state, resync on PUSI. */ if (priv->ule_skb) { -dev_kfree_skb ( priv->ule_skb ); + error = true; +dev_kfree_skb (priv->ule_skb); + } + +if (error || priv->ule_sndu_remain) { dev->stats.rx_errors++; dev->stats.rx_frame_errors++; + error = false; } +reset_ule (priv); priv->need_pusi =1 ;continue ;
@@ -534,6 +541,7 @@ static void dvb_net_ule( struct net_devi from_where +=2 ; } + priv->ule_sndu_remain = priv->ule_sndu_len +2 ;/* * State of current TS: * ts_remain (remaining bytes in the current TS cell)
@@ -543,6 +551,7 @@ static void dvb_net_ule( struct net_devi*/ switch (ts_remain) {case 1 : + priv->ule_sndu_remain--; priv->ule_sndu_type = from_where[0 ] <<8 ; priv->ule_sndu_type_1 =1 ;/* first byte of ule_type is set. */ ts_remain -=1 ; from_where +=1 ;
@@ -556,6 +565,7 @@ static void dvb_net_ule( struct net_devidefault :/* complete ULE header is present in current TS. */ /* Extract ULE type field. */ if (priv->ule_sndu_type_1) { + priv->ule_sndu_type_1 =0 ; priv->ule_sndu_type |= from_where[0 ]; from_where +=1 ;/* points to payload start. */ ts_remain -=1 ;
PATCH 123/140 V4L/DVB: FusionHDTV: Use quick reads for I2C IR device probing
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit 806b07c29b711aaf90c81d2a19711607769f8246 upstream.
IR support on FusionHDTV cards is broken since kernel 2.6.31. One side effect of the switch to the standard binding model for IR I2C devices was to let i2c-core do the probing instead of the ir-kbd-i2c driver. There is a slight difference between the two probe methods: i2c-core uses 0-byte writes, while the ir-kbd-i2c was using 0-byte reads. As some IR I2C devices only support reads, the new probe method fails to detect them.
For now, revert to letting the driver do the probe, using 0-byte reads. In the future, i2c-core will be extended to let callers of i2c_new_probed_device() provide a custom probing function.
--- drivers/media/video/cx23885/cx23885-i2c.c | 12 +++++++++++- drivers/media/video/cx88/cx88-i2c.c | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-)
drivers/media/video/cx23885/cx23885-i2c.c +11 -1
@@ -365,7 +365,17 @@ int cx23885_i2c_register(struct cx23885_memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); -i2c_new_probed_device (&bus->i2c_adap, &info, addr_list); +/* +* We can't call i2c_new_probed_device() because it uses +* quick writes for probing and the IR receiver device only +* replies to reads. +*/ +if (i2c_smbus_xfer (&bus->i2c_adap, addr_list[0 ],0 , +I2C_SMBUS_READ ,0 ,I2C_SMBUS_QUICK , +NULL ) >=0 ) { + info.addr = addr_list[0 ]; +i2c_new_device (&bus->i2c_adap, &info); + } }return bus->i2c_rc;
drivers/media/video/cx88/cx88-i2c.c +15 -1
@@ -188,10 +188,24 @@ int cx88_i2c_init(struct cx88_core *core0x18 ,0x6b ,0x71 , I2C_CLIENT_END }; +const unsigned short *addrp;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); -i2c_new_probed_device (&core->i2c_adap, &info, addr_list); +/* +* We can't call i2c_new_probed_device() because it uses +* quick writes for probing and at least some R receiver +* devices only reply to reads. +*/ +for (addrp = addr_list; *addrp !=I2C_CLIENT_END ; addrp++) { +if (i2c_smbus_xfer (&core->i2c_adap, *addrp,0 , +I2C_SMBUS_READ ,0 , +I2C_SMBUS_QUICK ,NULL ) >=0 ) { + info.addr = *addrp; +i2c_new_device (&core->i2c_adap, &info); +break ; + } + } }return core->i2c_rc; }
PATCH 124/140 forcedeth: fix tx limit2 flag check
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ayaz Abdulla <[email protected]>
commit 5c659322a904a7cc0265e7b183372b9bdebec6db upstream.
This is a fix for bug 572201 @ bugs.debian.org
This patch fixes the TX_LIMIT feature flag. The previous logic check for TX_LIMIT2 also took into account a device that only had TX_LIMIT set.
--- drivers/net/forcedeth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/forcedeth.c +1 -1
@@ -5900,7 +5900,7 @@ static int __devinit nv_probe(struct pci/* Limit the number of tx's outstanding for hw bug */ if (id->driver_data &DEV_NEED_TX_LIMIT ) { np->tx_limit =1 ; -if ((id->driver_data &DEV_NEED_TX_LIMIT2 ) && +if (((id->driver_data &DEV_NEED_TX_LIMIT2 ) ==DEV_NEED_TX_LIMIT2 ) && pci_dev->revision >=0xA2 ) np->tx_limit =0 ; }
PATCH 125/140 staging: rtl8192su: add Support for Belkin F5D8053 v6
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Airlie <[email protected]>
commit d615da093eb0f691a73a754589e2a4a24a6f1ca7 upstream.
Please find attached a patch which adds the device ID for the Belkin F5D8053 v6 to the rtl8192su driver. I've tested this in 2.6.34-rc3 (Ubuntu 9.10 amd64) and the network adapter is working flawlessly.
--- drivers/staging/rtl8192su/r8192U_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8192su/r8192U_core.c +1 -0
@@ -118,6 +118,7 @@ static struct usb_device_id rtl8192_usb_ {USB_DEVICE(0x07aa, 0x0043)},/* Belkin */ {USB_DEVICE(0x050d, 0x805E)}, + {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 *//* Sitecom */ {USB_DEVICE(0x0df6, 0x0031)}, {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */
PATCH 126/140 MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shane McDonald <[email protected]>
commit 95e8f634d7a3ea5af40ec3fa42c8a152fd3a0624 upstream.
In the FPU emulator code of the MIPS, the Cause bits of the FCSR register are not currently writeable by the ctc1 instruction. In odd corner cases, this can cause problems. For example, a case existed where a divide-by-zero exception was generated by the FPU, and the signal handler attempted to restore the FPU registers to their state before the exception occurred. In this particular setup, writing the old value to the FCSR register would cause another divide-by-zero exception to occur immediately. The solution is to change the ctc1 instruction emulator code to allow the Cause bits of the FCSR register to be writeable. This is the behaviour of the hardware that the code is emulating.
This problem was found by Shane McDonald, but the credit for the fix goes to Kevin Kissell. In Kevin's words:
I submit that the bug is indeed in that ctc_op: case of the emulator. The Cause bits (17:12) are supposed to be writable by that instruction, but the CTC1 emulation won't let them be updated by the instruction. I think that actually if you just completely removed lines 387-388 [...] things would work a good deal better. At least, it would be a more accurate emulation of the architecturally defined FPU. If I wanted to be really, really pedantic (which I sometimes do), I'd also protect the reserved bits that aren't necessarily writable.
To: [email protected]
To: [email protected]
To: [email protected]
Patchwork: http://patchwork.linux-mips.org/patch/1205/
---
--- arch/mips/include/asm/mipsregs.h | 9 ++++++++- arch/mips/math-emu/cp1emu.c | 15 +++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-)
arch/mips/include/asm/mipsregs.h +8 -1
@@ -135,6 +135,12 @@#define FPU_CSR_COND7 0x80000000/* $fcc7 */ /* +* Bits 18 - 20 of the FPU Status Register will be read as 0, +* and should be written as zero. +*/ +#define FPU_CSR_RSVD 0x001c0000 + +/* * X the exception cause indicator * E the exception enable * S the sticky/flag bit
@@ -161,7 +167,8 @@#define FPU_CSR_UDF_S 0x00000008#define FPU_CSR_INE_S 0x00000004 -/* rounding mode */ +/* Bits 0 and 1 of FPU Status Register specify the rounding mode */ +#define FPU_CSR_RM 0x00000003#define FPU_CSR_RN 0x0/* nearest */ #define FPU_CSR_RZ 0x1/* towards zero */ #define FPU_CSR_RU 0x2/* towards +Infinity */
arch/mips/math-emu/cp1emu.c +11 -4
@@ -78,6 +78,9 @@ DEFINE_PER_CPU(struct mips_fpu_emulator_#define FPCREG_RID 0/* $0 = revision id */ #define FPCREG_CSR 31/* $31 = csr */ +/* Determine rounding mode from the RM bits of the FCSR */ +#define modeindex (v) ((v) & FPU_CSR_RM) +/* Convert Mips rounding mode (0..3) to IEEE library modes. */ static const unsigned char ieee_rm[4 ] = { [FPU_CSR_RN ] =IEEE754_RN ,
@@ -384,10 +387,14 @@ static int cop1Emulate(struct pt_regs *x (void *) (xcp->cp0_epc), MIPSInst_RT(ir), value);#endif - value &= (FPU_CSR_FLUSH |FPU_CSR_ALL_E |FPU_CSR_ALL_S |0x03 ); - ctx->fcr31 &= ~(FPU_CSR_FLUSH |FPU_CSR_ALL_E |FPU_CSR_ALL_S |0x03 ); -/* convert to ieee library modes */ - ctx->fcr31 |= (value & ~0x3 ) | ieee_rm[value &0x3 ]; + +/* +* Don't write reserved bits, +* and convert to ieee library modes +*/ + ctx->fcr31 = (value & + ~(FPU_CSR_RSVD |FPU_CSR_RM )) | + ieee_rm[modeindex (value)]; }if ((ctx->fcr31 >>5 ) & ctx->fcr31 &FPU_CSR_ALL_E ) {return SIGFPE ;
PATCH 127/140 V4L/DVB: budget: Select correct frontends
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit d46b36e7f927772bb72524dc9f1e384e3cb4a975 upstream.
Update the Kconfig selections to match the code.
--- drivers/media/dvb/ttpci/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/dvb/ttpci/Kconfig +3 -2
@@ -68,13 +68,14 @@ config DVB_BUDGET select DVB_VES1820 if !DVB_FE_CUSTOMISE select DVB_L64781 if !DVB_FE_CUSTOMISE select DVB_TDA8083 if !DVB_FE_CUSTOMISE - select DVB_TDA10021 if !DVB_FE_CUSTOMISE - select DVB_TDA10023 if !DVB_FE_CUSTOMISE select DVB_S5H1420 if !DVB_FE_CUSTOMISE select DVB_TDA10086 if !DVB_FE_CUSTOMISE select DVB_TDA826X if !DVB_FE_CUSTOMISE select DVB_LNBP21 if !DVB_FE_CUSTOMISE select DVB_TDA1004X if !DVB_FE_CUSTOMISE + select DVB_ISL6423 if !DVB_FE_CUSTOMISE + select DVB_STV090x if !DVB_FE_CUSTOMISE + select DVB_STV6110x if !DVB_FE_CUSTOMISE help Support for simple SAA7146 based DVB cards (so called Budget- or Nova-PCI cards) without onboard MPEG2 decoder, and without
PATCH 128/140 3c503: Fix IRQ probing
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit b0cf4dfb7cd21556efd9a6a67edcba0840b4d98d upstream.
The driver attempts to select an IRQ for the NIC automatically by testing which of the supported IRQs are available and then probing each available IRQ with probe_irq_{on,off}(). There are obvious race conditions here, besides which:
1. The test for availability is done by passing a NULL handler, which now always returns -EINVAL, thus the device cannot be opened:
<http://bugs.debian.org/566522>
2. probe_irq_off() will report only the first ISA IRQ handled, potentially leading to a false negative.
There was another bug that meant it ignored all error codes from request_irq() except -EBUSY, so it would 'succeed' despite this (possibly causing conflicts with other ISA devices). This was fixed by ab08999d6029bb2c79c16be5405d63d2bedbdfea 'WARNING: some request_irq() failures ignored in el2_open()', which exposed bug 1.
This patch:
1. Replaces the use of probe_irq_{on,off}() with a real interrupt handler
2. Adds a delay before checking the interrupt-seen flag
3. Disables interrupts on all failure paths
4. Distinguishes error codes from the second request_irq() call, consistently with the first
Compile-tested only.
--- drivers/net/3c503.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-)
drivers/net/3c503.c +30 -12
@@ -380,6 +380,12 @@ out:return retval; } +static irqreturn_t el2_probe_interrupt (int irq,void *seen) +{ + *(bool *)seen = true; +return IRQ_HANDLED ; +} +static int el2_open (struct net_device *dev) {
@@ -391,23 +397,35 @@ el2_open(struct net_device *dev)outb (EGACFR_NORM ,E33G_GACFR );/* Enable RAM and interrupts. */ do { - retval =request_irq (*irqp,NULL ,0 ,"bogus" , dev); -if (retval >=0 ) { +bool seen; + + retval =request_irq (*irqp, el2_probe_interrupt,0 , + dev->name, &seen); +if (retval == -EBUSY ) +continue ; +if (retval <0 ) + goto err_disable; +/* Twinkle the interrupt, and check if it's seen. */ -unsigned long cookie =probe_irq_on (); + seen = false; +smp_wmb ();outb_p (0x04 << ((*irqp ==9 ) ?2 : *irqp),E33G_IDCFR );outb_p (0x00 ,E33G_IDCFR ); -if (*irqp ==probe_irq_off (cookie) &&/* It's a good IRQ line! */ - ((retval =request_irq (dev->irq = *irqp, - eip_interrupt,0 , - dev->name, dev)) ==0 )) -break ; - }else { -if (retval != -EBUSY ) -return retval; - } +msleep (1 ); +free_irq (*irqp, el2_probe_interrupt); +if (!seen) +continue ; + + retval =request_irq (dev->irq = *irqp, eip_interrupt,0 , + dev->name, dev); +if (retval == -EBUSY ) +continue ; +if (retval <0 ) + goto err_disable; }while (*++irqp); +if (*irqp ==0 ) { + err_disable:outb (EGACFR_IRQOFF ,E33G_GACFR );/* disable interrupts. */ return -EAGAIN ; }
PATCH 129/140 cxgb3: fix linkup issue
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hiroshi Shimamoto <[email protected]>
commit 9441cad99b4b09d6b627351c2d282833868c116c upstream.
I encountered an issue that not to link up on cxgb3 fabric. I bisected and found that this regression was introduced by 0f07c4ee8c800923ae7918c231532a9256233eed.
Correct to pass phy_addr to cphy_init() at t3_xaui_direct_phy_prep().
--- drivers/net/cxgb3/ael1002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cxgb3/ael1002.c +1 -1
@@ -934,7 +934,7 @@ static struct cphy_ops xaui_direct_ops =int t3_xaui_direct_phy_prep (struct cphy *phy,struct adapter *adapter,int phy_addr,const struct mdio_ops *mdio_ops) { -cphy_init (phy, adapter,MDIO_PRTAD_NONE , &xaui_direct_ops, mdio_ops, +cphy_init (phy, adapter, phy_addr, &xaui_direct_ops, mdio_ops, SUPPORTED_10000baseT_Full |SUPPORTED_AUI |SUPPORTED_TP ,"10GBASE-CX4" );return 0 ;
PATCH 130/140 mac80211: fix supported rates IE if AP doesnt give us its rates
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 76f273640134f3eb8257179cd5b3bc6ba5fe4a96 upstream.
If AP do not provide us supported rates before assiociation, send all rates we are supporting instead of empty information element.
v1 -> v2: Add comment.
--- net/mac80211/mlme.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
net/mac80211/mlme.c +11 -6
@@ -270,12 +270,6 @@ static void ieee80211_send_assoc(structif (wk->bss->wmm_used) wmm =1 ; -/* get all rates supported by the device and the AP as -* some APs don't like getting a superset of their rates -* in the association request (e.g. D-Link DAP 1353 in -* b-only mode) */ - rates_len =ieee80211_compatible_rates (wk->bss, sband, &rates); -if ((wk->bss->cbss.capability &WLAN_CAPABILITY_SPECTRUM_MGMT ) && (local->hw.flags &IEEE80211_HW_SPECTRUM_MGMT )) capab |=WLAN_CAPABILITY_SPECTRUM_MGMT ;
@@ -310,6 +304,17 @@ static void ieee80211_send_assoc(struct *pos++ = wk->ssid_len;memcpy (pos, wk->ssid, wk->ssid_len); +if (wk->bss->supp_rates_len) { +/* get all rates supported by the device and the AP as +* some APs don't like getting a superset of their rates +* in the association request (e.g. D-Link DAP 1353 in +* b-only mode) */ + rates_len =ieee80211_compatible_rates (wk->bss, sband, &rates); + }else { + rates = ~0 ; + rates_len = sband->n_bitrates; + } +/* add all rates which were marked to be used above */ supp_rates_len = rates_len;if (supp_rates_len >8 )
PATCH 131/140 V4L/DVB: uvcvideo: Add support for unbranded Arkmicro 18ec:3290 webcams
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Laurent Pinchart <[email protected]>
commit 1e4d05bc95a0fe2972c5c91ed45466587d07cd2c upstream.
The camera requires the PROBE_DEF quirk. Add a corresponding entry in the device IDs list.
--- drivers/media/video/uvc/uvc_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/media/video/uvc/uvc_driver.c +9 -0
@@ -2123,6 +2123,15 @@ static struct usb_device_id uvc_ids[] = .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_QUIRK_PROBE_MINMAX }, +/* Arkmicro unbranded */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x18ec, + .idProduct = 0x3290, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_QUIRK_PROBE_DEF }, /* Bodelin ProScopeHR */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |USB_DEVICE_ID_MATCH_DEV_HI
PATCH 132/140 V4L/DVB: uvcvideo: Add support for Packard Bell EasyNote MX52 integrated webcam
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Laurent Pinchart <[email protected]>
commit f129b03ba272c86c42ad476684caa0d6109cb383 upstream.
The camera requires the STREAM_NO_FID quirk. Add a corresponding entry in the device IDs list.
--- drivers/media/video/uvc/uvc_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/media/video/uvc/uvc_driver.c +9 -0
@@ -2059,6 +2059,15 @@ static struct usb_device_id uvc_ids[] = .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_QUIRK_STREAM_NO_FID }, +/* Syntek (Packard Bell EasyNote MX52 */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x174f, + .idProduct = 0x8a12, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_QUIRK_STREAM_NO_FID }, /* Syntek (Asus F9SG) */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
PATCH 133/140 V4L/DVB: uvcvideo: Add support for V4L2_PIX_FMT_Y16
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Laurent Pinchart <[email protected]>
commit 61421206833a4085d9bdf35b2b84cd9a67dfdfac upstream.
The Miricle 307K (17dc:0202) camera reports a 16-bit greyscale format, support it in the driver.
--- drivers/media/video/uvc/uvc_driver.c | 7 ++++++- drivers/media/video/uvc/uvcvideo.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/media/video/uvc/uvc_driver.c +6 -1
@@ -84,11 +84,16 @@ static struct uvc_format_desc uvc_fmts[] .fcc = V4L2_PIX_FMT_UYVY, }, { - .name = "Greyscale", + .name = "Greyscale (8-bit)", .guid = UVC_GUID_FORMAT_Y800, .fcc = V4L2_PIX_FMT_GREY, }, { + .name = "Greyscale (16-bit)", + .guid = UVC_GUID_FORMAT_Y16, + .fcc = V4L2_PIX_FMT_Y16, + }, + { .name = "RGB Bayer", .guid = UVC_GUID_FORMAT_BY8, .fcc = V4L2_PIX_FMT_SBGGR8,
drivers/media/video/uvc/uvcvideo.h +3 -1
@@ -128,11 +128,13 @@ struct uvc_xu_control {#define UVC_GUID_FORMAT_Y800 \ { 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_Y16 \ + { 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_BY8 \ { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} -/* ------------------------------------------------------------------------ * Driver specific constants. */
PATCH 134/140 iwlagn: verify flow id in compressed BA packet
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shanyu Zhao <[email protected]>
commit b561e8274f75831ee87e4ea378cbb1f9f050a51a upstream.
The flow id (scd_flow) in a compressed BA packet should match the txq_id of the queue from which the aggregated packets were sent. However, in some hardware like the 1000 series, sometimes the flow id is 0 for the txq_id (10 to 19). This can cause the annoying message:
[ 2213.306191] iwlagn 0000:01:00.0: Received BA when not expected [ 2213.310178] iwlagn 0000:01:00.0: Read index for DMA queue txq id (0),
index 5, is out of range [0-256] 7 7.
And even worse, if agg->wait_for_ba is true when the bad BA is arriving, this can cause system hang due to NULL pointer dereference because the code is operating in a wrong tx queue!
--- drivers/net/wireless/iwlwifi/iwl-tx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/iwlwifi/iwl-tx.c +5 -0
@@ -1553,6 +1553,11 @@ void iwl_rx_reply_compressed_ba(struct i sta_id = ba_resp->sta_id; tid = ba_resp->tid; agg = &priv->stations[sta_id].tid[tid].agg; +if (unlikely (agg->txq_id != scd_flow)) { +IWL_ERR (priv,"BA scd_flow %d does not match txq_id %d\n" , + scd_flow, agg->txq_id); +return ; + }/* Find index just before block-ack window */ index =iwl_queue_dec_wrap (ba_resp_scd_ssn &0xff , txq->q.n_bd);
PATCH 135/140 kbuild: Fix modpost segfault
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Krzysztof Halasa <[email protected]>
commit 1c938663d58b5b2965976a6f54cc51b5d6f691aa upstream.
Quoted 4 lines · Alan
program:
/home/alan/GitTrees/linux-2.6-mid-ref/scripts/mod/modpost-o Module.symvers -S vmlinux.oProgram received signal SIGSEGV, Segmentation fault.
It just hit me.
It's the offset calculation in reloc_location() which overflows:
return (void *)elf->hdr + sechdrs[section].sh_offset +
(r->r_offset - sechdrs[section].sh_addr);E.g. for the first rodata r entry:r->r_offset < sechdrs[section].sh_addr
and the expression in the parenthesis produces 0xFFFFFFE0 or something equally wise.
--- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mod/modpost.c +1 -1
@@ -1318,7 +1318,7 @@ static unsigned int *reloc_location(struint section = sechdr->sh_info;return (void *)elf->hdr + sechdrs[section].sh_offset + - (r->r_offset - sechdrs[section].sh_addr); + r->r_offset - sechdrs[section].sh_addr; }static int addend_386_rel (struct elf_info *elf,Elf_Shdr *sechdr,Elf_Rela *r)
PATCH 136/140 Fix spinaphore down_spin()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tony Luck <[email protected]>
commit b70f4e85bfc4d7000036355b714a92d5c574f1be upstream.
Typo in down_spin() meant it only read the low 32 bits of the "serve" value, instead of the full 64 bits. This results in the system hanging when the values in ticket/serve get larger than 32-bits. A big enough system running the right test can hit this in a just a few hours.
Broken since 883a3acf5b0d4782ac35981227a0d094e8b44850
[IA64] Re-implement spinaphores using ticket lock concepts
Reported via IRC by Bjorn Helgaas
--- arch/ia64/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/mm/tlb.c +1 -1
@@ -120,7 +120,7 @@ static inline void down_spin(struct spinia64_invala ();for (;;) { - asmvolatile ("ld4.c.nc %0=[%1]" :"=r" (serve) :"r" (&ss->serve) :"memory" ); + asmvolatile ("ld8.c.nc %0=[%1]" :"=r" (serve) :"r" (&ss->serve) :"memory" );if (time_before (t, serve))return ;cpu_relax ();
PATCH 137/140 ecryptfs: Bugfix for error related to ecryptfs_hash_buckets
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andre Osterhues <[email protected]>
commit a6f80fb7b5986fda663d94079d3bba0937a6b6ff upstream.
The function ecryptfs_uid_hash wrongly assumes that the second parameter to hash_long() is the number of hash buckets instead of the number of hash bits. This patch fixes that and renames the variable ecryptfs_hash_buckets to ecryptfs_hash_bits to make it clearer.
--- fs/ecryptfs/messaging.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/ecryptfs/messaging.c +9 -8
@@ -30,9 +30,9 @@ static struct mutex ecryptfs_msg_ctx_lisstatic struct hlist_head *ecryptfs_daemon_hash;struct mutex ecryptfs_daemon_hash_mux; -static int ecryptfs_hash_buckets; +static int ecryptfs_hash_bits;#define ecryptfs_uid_hash (uid) \ - hash_long((unsigned long)uid, ecryptfs_hash_buckets) + hash_long((unsigned long)uid, ecryptfs_hash_bits)static u32 ecryptfs_msg_counter;static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -485,18 +485,19 @@ int ecryptfs_init_messaging(void) }mutex_init (&ecryptfs_daemon_hash_mux);mutex_lock (&ecryptfs_daemon_hash_mux); - ecryptfs_hash_buckets =1 ; -while (ecryptfs_number_of_users >> ecryptfs_hash_buckets) - ecryptfs_hash_buckets++; + ecryptfs_hash_bits =1 ; +while (ecryptfs_number_of_users >> ecryptfs_hash_bits) + ecryptfs_hash_bits++; ecryptfs_daemon_hash =kmalloc ((sizeof (struct hlist_head ) - * ecryptfs_hash_buckets),GFP_KERNEL ); + * (1 << ecryptfs_hash_bits)), +GFP_KERNEL );if (!ecryptfs_daemon_hash) { rc = -ENOMEM ;printk (KERN_ERR "%s: Failed to allocate memory\n" , __func__);mutex_unlock (&ecryptfs_daemon_hash_mux); goto out; } -for (i =0 ; i < ecryptfs_hash_buckets; i++) +for (i =0 ; i < (1 << ecryptfs_hash_bits); i++)INIT_HLIST_HEAD (&ecryptfs_daemon_hash[i]);mutex_unlock (&ecryptfs_daemon_hash_mux); ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
@@ -553,7 +554,7 @@ void ecryptfs_release_messaging(void)int i;mutex_lock (&ecryptfs_daemon_hash_mux); -for (i =0 ; i < ecryptfs_hash_buckets; i++) { +for (i =0 ; i < (1 << ecryptfs_hash_bits); i++) {int rc; hlist_for_each_entry(daemon, elem,
PATCH 138/140 ath5k: initialize ah->ah_current_channel
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Copeland <[email protected]>
commit b6855772f4a22c4fbdd4fcaceff5c8a527035123 upstream.
ath5k assumes ah_current_channel is always a valid pointer in several places, but a newly created interface may not have a channel. To avoid null pointer dereferences, set it up to point to the first available channel until later reconfigured.
This fixes the following oops:
$ rmmod ath5k $ insmod ath5k $ iw phy0 set distance 11000
BUG: unable to handle kernel NULL pointer dereference at 00000006 IP: [<d0a1ff24>] ath5k_hw_set_coverage_class+0x74/0x1b0 [ath5k] *pde = 00000000 Oops: 0000 [#1] last sysfs file: /sys/devices/pci0000:00/0000:00:0e.0/ieee80211/phy0/index Modules linked in: usbhid option usb_storage usbserial usblp evdev lm90
scx200_acb i2c_algo_bit i2c_dev i2c_core via_rhine ohci_hcd ne2k_pci 8390 leds_alix2 xt_IMQ imq nf_nat_tftp nf_conntrack_tftp nf_nat_irc nf_cc
Pid: 1597, comm: iw Not tainted (2.6.32.14 #8)
EIP: 0060:[<d0a1ff24>] EFLAGS: 00010296 CPU: 0
EIP is at ath5k_hw_set_coverage_class+0x74/0x1b0 [ath5k]
EAX: 000000c2 EBX: 00000000 ECX: ffffffff EDX: c12d2080
ESI: 00000019 EDI: cf8c0000 EBP: d0a30edc ESP: cfa09bf4
DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
Process iw (pid: 1597, ti=cfa09000 task=cf88a000 task.ti=cfa09000)
Stack: d0a34f35 d0a353f8 d0a30edc 000000fe cf8c0000 00000000 1900063d cfa8c9e0 <0> cfa8c9e8 cfa8c0c0 cfa8c000 d0a27f0c 199d84b4 cfa8c200 00000010 d09bfdc7 <0> 00000000 00000000 ffffffff d08e0d28 cf9263c0 00000001 cfa09cc4 00000000 Call Trace: [<d0a27f0c>] ? ath5k_hw_attach+0xc8c/0x3c10 [ath5k] [<d09bfdc7>] ? __ieee80211_request_smps+0x1347/0x1580 [mac80211] [<d08e0d28>] ? nl80211_send_scan_start+0x7b8/0x4520 [cfg80211] [<c10f5db9>] ? nla_parse+0x59/0xc0 [<c11ca8d9>] ? genl_rcv_msg+0x169/0x1a0 [<c11ca770>] ? genl_rcv_msg+0x0/0x1a0 [<c11c7e68>] ? netlink_rcv_skb+0x38/0x90 [<c11c9649>] ? genl_rcv+0x19/0x30 [<c11c7c03>] ? netlink_unicast+0x1b3/0x220 [<c11c893e>] ? netlink_sendmsg+0x26e/0x290 [<c11a409e>] ? sock_sendmsg+0xbe/0xf0 [<c1032780>] ? autoremove_wake_function+0x0/0x50 [<c104d846>] ? __alloc_pages_nodemask+0x106/0x530 [<c1074933>] ? do_lookup+0x53/0x1b0 [<c10766f9>] ? __link_path_walk+0x9b9/0x9e0 [<c11acab0>] ? verify_iovec+0x50/0x90 [<c11a42b1>] ? sys_sendmsg+0x1e1/0x270 [<c1048e50>] ? find_get_page+0x10/0x50 [<c104a96f>] ? filemap_fault+0x5f/0x370 [<c1059159>] ? __do_fault+0x319/0x370 [<c11a55b4>] ? sys_socketcall+0x244/0x290 [<c101962c>] ? do_page_fault+0x1ec/0x270 [<c1019440>] ? do_page_fault+0x0/0x270 [<c1002ae5>] ? syscall_call+0x7/0xb Code: 00 b8 fe 00 00 00 b9 f8 53 a3 d0 89 5c 24 14 89 7c 24 10 89 44 24
0c 89 6c 24 08 89 4c 24 04 c7 04 24 35 4f a3 d0 e8 7c 30 60 f0 <0f> b7 43 06 ba 06 00 00 00 a8 10 75 0e 83 e0 20 83 f8 01 19 d2
EIP: [<d0a1ff24>] ath5k_hw_set_coverage_class+0x74/0x1b0 [ath5k] SS:ESP 0068:cfa09bf4
CR2: 0000000000000006
---[ end trace 54f73d6b10ceb87b ]---
--- drivers/net/wireless/ath/ath5k/attach.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath5k/attach.c +1 -0
@@ -123,6 +123,7 @@ int ath5k_hw_attach(struct ath5k_softc * ah->ah_cw_min =AR5K_TUNE_CWMIN ; ah->ah_limit_tx_retries =AR5K_INIT_TX_RETRY ; ah->ah_software_retry = false; + ah->ah_current_channel = &sc->channels[0 ];/* * Find the mac version
PATCH 139/140 Input: RX51 keymap - fix recent compile breakage
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 2e65a2075cc740b485ab203430bdf3459d5551b6 upstream.
Commit 3fea60261e73 ("Input: twl40300-keypad - fix handling of "all ground" rows") broke compilation as I managed to use non-existent keycodes.
--- arch/arm/mach-omap2/board-rx51-peripherals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +2 -2
@@ -192,10 +192,10 @@ static int board_keymap[] = {KEY (4 ,4 ,KEY_LEFTCTRL ),KEY (4 ,5 ,KEY_RIGHTALT ),KEY (4 ,6 ,KEY_LEFTSHIFT ), -KEY (4 ,8 ,KEY_10 ), +KEY (4 ,8 ,KEY_F10 ),KEY (5 ,0 ,KEY_Y ), -KEY (5 ,8 ,KEY_11 ), +KEY (5 ,8 ,KEY_F11 ), KEY(6, 0, KEY_U),
PATCH 140/140 V4L/DVB (13830): uvcvideo: add another YUYV format GUID for iSight cameras
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Ritz <[email protected]>
commit 68f194e027ecfbbc8d5515bc40787e542eed59e9 upstream.
For some unknown reason, on a MacBookPro5,3 the iSight sometimes report a different video format GUID. This patch add the other (wrong) GUID to the format table, making the iSight work always w/o other problems.
What it should report: 32595559-0000-0010-8000-00aa00389b71 What it often reports: 32595559-0000-0010-8000-000000389b71
--- drivers/media/video/uvc/uvc_driver.c | 5 +++++ drivers/media/video/uvc/uvcvideo.h | 3 +++ 2 files changed, 8 insertions(+)
drivers/media/video/uvc/uvc_driver.c +5 -0
@@ -59,6 +59,11 @@ static struct uvc_format_desc uvc_fmts[] .fcc = V4L2_PIX_FMT_YUYV, }, { + .name = "YUV 4:2:2 (YUYV)", + .guid = UVC_GUID_FORMAT_YUY2_ISIGHT, + .fcc = V4L2_PIX_FMT_YUYV, + }, + { .name = "YUV 4:2:0 (NV12)", .guid = UVC_GUID_FORMAT_NV12, .fcc = V4L2_PIX_FMT_NV12,
drivers/media/video/uvc/uvcvideo.h +3 -0
@@ -113,6 +113,9 @@ struct uvc_xu_control {#define UVC_GUID_FORMAT_YUY2 \ { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_YUY2_ISIGHT \ + { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_NV12 \ { 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}