Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[058/143] Staging: rtl8192su: Clean up in case of an error in module initialisation

71 views
Skip to first unread message

Greg KH

unread,
May 5, 2011, 8:30:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 9a3dfa0555130952517b9a9c3918729495aa709a upstream.

Currently various resources may be leaked in case of an error.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---
drivers/staging/rtl8192su/r8192U_core.c | 43 ++++++++++++++++++++++++++------
1 file changed, 36 insertions(+), 7 deletions(-)

--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -959,10 +959,11 @@ static int proc_get_stats_rx(char *page,
return len;
}

-void rtl8192_proc_module_init(void)
+int rtl8192_proc_module_init(void)
{
RT_TRACE(COMP_INIT, "Initializing proc filesystem");
rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net);
+ return rtl8192_proc ? 0 : -ENOMEM;
}


@@ -7564,35 +7565,63 @@ static int __init rtl8192_usb_module_ini
ret = ieee80211_crypto_init();
if (ret) {
printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret);
- return ret;
+ goto fail_crypto;
}

ret = ieee80211_crypto_tkip_init();
if (ret) {
printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n",
ret);
- return ret;
+ goto fail_crypto_tkip;
}

ret = ieee80211_crypto_ccmp_init();
if (ret) {
printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n",
ret);
- return ret;
+ goto fail_crypto_ccmp;
}

ret = ieee80211_crypto_wep_init();
if (ret) {
printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret);
- return ret;
+ goto fail_crypto_wep;
}

printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN cards\n");
printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n");
RT_TRACE(COMP_INIT, "Initializing module");
RT_TRACE(COMP_INIT, "Wireless extensions version %d", WIRELESS_EXT);
- rtl8192_proc_module_init();
- return usb_register(&rtl8192_usb_driver);
+
+ ret = rtl8192_proc_module_init();
+ if (ret) {
+ pr_err("rtl8192_proc_module_init() failed %d\n", ret);
+ goto fail_proc;
+ }
+
+ ret = usb_register(&rtl8192_usb_driver);
+ if (ret) {
+ pr_err("usb_register() failed %d\n", ret);
+ goto fail_usb;
+ }
+
+ return 0;
+
+fail_usb:
+ rtl8192_proc_module_remove();
+fail_proc:
+ ieee80211_crypto_wep_exit();
+fail_crypto_wep:
+ ieee80211_crypto_ccmp_exit();
+fail_crypto_ccmp:
+ ieee80211_crypto_tkip_exit();
+fail_crypto_tkip:
+ ieee80211_crypto_deinit();
+fail_crypto:
+#ifdef CONFIG_IEEE80211_DEBUG
+ ieee80211_debug_exit();
+#endif
+ return ret;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Greg KH

unread,
May 5, 2011, 8:30:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Hagen Paul Pfeifer <ha...@jauu.net>

commit 9e8342971d44ce86d8567047f5366fc1c06a75ed upstream.

Function argument len was redeclarated within the
function. This patch fix the redeclaration of symbol 'len'.

Signed-off-by: Hagen Paul Pfeifer <ha...@jauu.net>
Signed-off-by: David S. Miller <da...@davemloft.net>
[Adjusted to apply to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

net/econet/af_econet.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -447,15 +447,15 @@ static int econet_sendmsg(struct kiocb *
iov[0].iov_len = size;
for (i = 0; i < msg->msg_iovlen; i++) {
void __user *base = msg->msg_iov[i].iov_base;
- size_t len = msg->msg_iov[i].iov_len;
+ size_t iov_len = msg->msg_iov[i].iov_len;
/* Check it now since we switch to KERNEL_DS later. */
- if (!access_ok(VERIFY_READ, base, len)) {
+ if (!access_ok(VERIFY_READ, base, iov_len)) {
mutex_unlock(&econet_mutex);
return -EFAULT;
}
iov[i+1].iov_base = base;
- iov[i+1].iov_len = len;
- size += len;
+ iov[i+1].iov_len = iov_len;
+ size += iov_len;
}

/* Get a skbuff (no data, just holds our cb information) */

Greg KH

unread,
May 5, 2011, 8:30:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Guennadi Liakhovetski <g.liakh...@gmx.de>

commit e476a5a41ad67d0e2b4a652820c49a3923eb936b upstream.

Fix unbalanced call to sdio_release_host() on the error path.

Signed-off-by: Guennadi Liakhovetski <g.liakh...@gmx.de>
Acked-by: Larry Finger <Larry....@lwfinger.net>
Signed-off-by: John W. Linville <linv...@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
Signed-off-by: Andi Kleen <a...@linux.intel.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/wireless/b43/sdio.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -162,6 +162,7 @@ static int b43_sdio_probe(struct sdio_fu
err_free_ssb:
kfree(sdio);
err_disable_func:
+ sdio_claim_host(func);
sdio_disable_func(func);
err_release_host:
sdio_release_host(func);

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Zachary Amsden <zam...@redhat.com>

(backported from commit 1d5f066e0b63271b67eac6d3752f8aa96adcbddb)


Kernel time, which advances in discrete steps may progress much slower
than TSC. As a result, when kvmclock is adjusted to a new base, the
apparent time to the guest, which runs at a much higher, nsec scaled
rate based on the current TSC, may have already been observed to have
a larger value (kernel_ns + scaled tsc) than the value to which we are
setting it (kernel_ns + 0).

We must instead compute the clock as potentially observed by the guest
for kernel_ns to make sure it does not go backwards.

Signed-off-by: Zachary Amsden <zam...@redhat.com>
Signed-off-by: Marcelo Tosatti <mtos...@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/714335

Signed-off-by: Serge E. Hallyn <serge....@canonical.com>
Reviewed-by: Stefan Bader <stefan...@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
arch/x86/include/asm/kvm_host.h | 3 ++
arch/x86/kvm/x86.c | 47 +++++++++++++++++++++++++++++++++++++---
2 files changed, 47 insertions(+), 3 deletions(-)

--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -357,6 +357,9 @@ struct kvm_vcpu_arch {
struct page *time_page;

bool singlestep; /* guest is single stepped by KVM */
+ u64 last_guest_tsc;
+ u64 last_kernel_ns;
+
bool nmi_pending;
bool nmi_injected;

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -47,6 +47,7 @@
#include <asm/desc.h>
#include <asm/mtrr.h>
#include <asm/mce.h>
+#include <asm/pvclock.h>

#define MAX_IO_MSRS 256
#define CR0_RESERVED_BITS \
@@ -633,6 +634,8 @@ static void kvm_write_guest_time(struct
struct kvm_vcpu_arch *vcpu = &v->arch;
void *shared_kaddr;
unsigned long this_tsc_khz;
+ s64 kernel_ns, max_kernel_ns;
+ u64 tsc_timestamp;

if ((!vcpu->time_page))
return;
@@ -646,15 +649,51 @@ static void kvm_write_guest_time(struct

/* Keep irq disabled to prevent changes to the clock */
local_irq_save(flags);
- kvm_get_msr(v, MSR_IA32_TSC, &vcpu->hv_clock.tsc_timestamp);
+ kvm_get_msr(v, MSR_IA32_TSC, &tsc_timestamp);
ktime_get_ts(&ts);
monotonic_to_bootbased(&ts);
+ kernel_ns = timespec_to_ns(&ts);
local_irq_restore(flags);

+ /*
+ * Time as measured by the TSC may go backwards when resetting the base
+ * tsc_timestamp. The reason for this is that the TSC resolution is
+ * higher than the resolution of the other clock scales. Thus, many
+ * possible measurments of the TSC correspond to one measurement of any
+ * other clock, and so a spread of values is possible. This is not a
+ * problem for the computation of the nanosecond clock; with TSC rates
+ * around 1GHZ, there can only be a few cycles which correspond to one
+ * nanosecond value, and any path through this code will inevitably
+ * take longer than that. However, with the kernel_ns value itself,
+ * the precision may be much lower, down to HZ granularity. If the
+ * first sampling of TSC against kernel_ns ends in the low part of the
+ * range, and the second in the high end of the range, we can get:
+ *
+ * (TSC - offset_low) * S + kns_old > (TSC - offset_high) * S + kns_new
+ *
+ * As the sampling errors potentially range in the thousands of cycles,
+ * it is possible such a time value has already been observed by the
+ * guest. To protect against this, we must compute the system time as
+ * observed by the guest and ensure the new system time is greater.
+ */
+ max_kernel_ns = 0;
+ if (vcpu->hv_clock.tsc_timestamp && vcpu->last_guest_tsc) {
+ max_kernel_ns = vcpu->last_guest_tsc -
+ vcpu->hv_clock.tsc_timestamp;
+ max_kernel_ns = pvclock_scale_delta(max_kernel_ns,
+ vcpu->hv_clock.tsc_to_system_mul,
+ vcpu->hv_clock.tsc_shift);
+ max_kernel_ns += vcpu->last_kernel_ns;
+ }
+
+ if (max_kernel_ns > kernel_ns)
+ kernel_ns = max_kernel_ns;
+
/* With all the info we got, fill in the values */

- vcpu->hv_clock.system_time = ts.tv_nsec +
- (NSEC_PER_SEC * (u64)ts.tv_sec) + v->kvm->arch.kvmclock_offset;
+ vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
+ vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
+ vcpu->last_kernel_ns = kernel_ns;

/*
* The interface expects us to write an even number signaling that the
@@ -3695,6 +3734,8 @@ static int vcpu_enter_guest(struct kvm_v
kvm_x86_ops->prepare_guest_switch(vcpu);
kvm_load_guest_fpu(vcpu);

+ kvm_get_msr(vcpu, MSR_IA32_TSC, &vcpu->arch.last_guest_tsc);
+
local_irq_disable();

clear_bit(KVM_REQ_KICK, &vcpu->requests);

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

[bwh: This is only applicable to 2.6.32. Phonet was fixed upstream to
work with multiple net namespaces.]

This should really fix the OOPS when doing:

unshare(CLONE_NEWNET);
exit(0);

while the phonet module is loaded.

Signed-off-by: Rémi Denis-Courmont <remi.deni...@nokia.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

net/phonet/pn_dev.c | 3 +++
1 file changed, 3 insertions(+)

--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -225,6 +225,9 @@ static int phonet_device_notify(struct n
{
struct net_device *dev = arg;

+ if (!net_eq(dev_net(dev), &init_net))
+ return 0;
+
switch (what) {
case NETDEV_REGISTER:
if (dev->type == ARPHRD_PHONET)

Greg KH

unread,
May 5, 2011, 8:30:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 46814e08d80f87449b5adb3d549a3cae6f9f8148 upstream.

My conversion of tehuti to use request_firmware() was confused about
the filename of the firmware blob. Change the driver to match the
blob.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: Andy Gospodarek <an...@greyhouse.net>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/tehuti.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -324,7 +324,7 @@ static int bdx_fw_load(struct bdx_priv *
ENTER;
master = READ_REG(priv, regINIT_SEMAPHORE);
if (!READ_REG(priv, regINIT_STATUS) && master) {
- rc = request_firmware(&fw, "tehuti/firmware.bin", &priv->pdev->dev);
+ rc = request_firmware(&fw, "tehuti/bdx.bin", &priv->pdev->dev);
if (rc)
goto out;
bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size);
@@ -2524,4 +2524,4 @@ module_exit(bdx_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(BDX_DRV_DESC);
-MODULE_FIRMWARE("tehuti/firmware.bin");
+MODULE_FIRMWARE("tehuti/bdx.bin");

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Dmitry Torokhov <dmitry....@gmail.com>

commit a083632eaf6231162b33e40561cfec6a9c156945 upstream.

Apparently there are Elantech touchpads that report non-zero in the 2nd byte
of their signature. Adjust the detection routine so that if 2nd byte is
zero and 3rd byte contains value that is not a valid report rate, we still
assume that signature is valid.

Tested-by: Eric Piel <eric...@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dt...@mail.ru>
[bwh: Adjust context for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/input/mouse/elantech.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -574,6 +574,24 @@ static struct attribute_group elantech_a
.attrs = elantech_attrs,
};

+static bool elantech_is_signature_valid(const unsigned char *param)
+{
+ static const unsigned char rates[] = { 200, 100, 80, 60, 40, 20, 10 };
+ int i;
+
+ if (param[0] == 0)
+ return false;
+
+ if (param[1] == 0)
+ return true;
+
+ for (i = 0; i < ARRAY_SIZE(rates); i++)
+ if (param[2] == rates[i])
+ return false;
+
+ return true;
+}
+
/*
* Use magic knock to detect Elantech touchpad
*/
@@ -617,7 +635,7 @@ int elantech_detect(struct psmouse *psmo
pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
param[0], param[1], param[2]);

- if (param[0] == 0 || param[1] != 0) {
+ if (!elantech_is_signature_valid(param)) {
if (!force_elantech) {
pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
return -1;

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Sachin Prabhu <spr...@redhat.com>

commit 1574dff8996ab1ed92c09012f8038b5566fce313 upstream.

An open on a NFS4 share using the O_CREAT flag on an existing file for
which we have permissions to open but contained in a directory with no
write permissions will fail with EACCES.

A tcpdump shows that the client had set the open mode to UNCHECKED which
indicates that the file should be created if it doesn't exist and
encountering an existing flag is not an error. Since in this case the
file exists and can be opened by the user, the NFS server is wrong in
attempting to check create permissions on the parent directory.

The patch adds a conditional statement to check for create permissions
only if the file doesn't exist.

Signed-off-by: Sachin S. Prabhu <spr...@redhat.com>
Signed-off-by: J. Bruce Fields <bfi...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
fs/nfsd/vfs.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1379,7 +1379,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
goto out;
if (!(iap->ia_valid & ATTR_MODE))
iap->ia_mode = 0;
- err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE);
+ err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC);
if (err)
goto out;

@@ -1401,6 +1401,13 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
if (IS_ERR(dchild))
goto out_nfserr;

+ /* If file doesn't exist, check for permissions to create one */
+ if (!dchild->d_inode) {
+ err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE);
+ if (err)
+ goto out;
+ }
+
err = fh_compose(resfhp, fhp->fh_export, dchild, fhp);
if (err)
goto out;

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Trond Myklebust <Trond.M...@netapp.com>

commit 27dc1cd3ad9300f81e1219e5fc305d91d85353f8 upstream.

If the call to nfs_wcc_update_inode() results in an attribute update, we
need to ensure that the inode's attr_gencount gets bumped too, otherwise
we are not protected against races with other GETATTR calls.

Signed-off-by: Trond Myklebust <Trond.M...@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
fs/nfs/inode.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)

--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -861,9 +861,10 @@ out:
return ret;
}

-static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
+static unsigned long nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);
+ unsigned long ret = 0;

if ((fattr->valid & NFS_ATTR_FATTR_PRECHANGE)
&& (fattr->valid & NFS_ATTR_FATTR_CHANGE)
@@ -871,25 +872,32 @@ static void nfs_wcc_update_inode(struct
nfsi->change_attr = fattr->change_attr;
if (S_ISDIR(inode->i_mode))
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
+ ret |= NFS_INO_INVALID_ATTR;
}
/* If we have atomic WCC data, we may update some attributes */
if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME)
&& (fattr->valid & NFS_ATTR_FATTR_CTIME)
- && timespec_equal(&inode->i_ctime, &fattr->pre_ctime))
- memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
+ && timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) {
+ memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
+ ret |= NFS_INO_INVALID_ATTR;
+ }

if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME)
&& (fattr->valid & NFS_ATTR_FATTR_MTIME)
&& timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) {
- memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
- if (S_ISDIR(inode->i_mode))
- nfsi->cache_validity |= NFS_INO_INVALID_DATA;
+ memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
+ if (S_ISDIR(inode->i_mode))
+ nfsi->cache_validity |= NFS_INO_INVALID_DATA;
+ ret |= NFS_INO_INVALID_ATTR;
}
if ((fattr->valid & NFS_ATTR_FATTR_PRESIZE)
&& (fattr->valid & NFS_ATTR_FATTR_SIZE)
&& i_size_read(inode) == nfs_size_to_loff_t(fattr->pre_size)
- && nfsi->npages == 0)
- i_size_write(inode, nfs_size_to_loff_t(fattr->size));
+ && nfsi->npages == 0) {
+ i_size_write(inode, nfs_size_to_loff_t(fattr->size));
+ ret |= NFS_INO_INVALID_ATTR;
+ }
+ return ret;
}

/**
@@ -1183,7 +1191,7 @@ static int nfs_update_inode(struct inode
| NFS_INO_REVAL_PAGECACHE);

/* Do atomic weak cache consistency updates */
- nfs_wcc_update_inode(inode, fattr);
+ invalid |= nfs_wcc_update_inode(inode, fattr);

/* More cache consistency checks */
if (fattr->valid & NFS_ATTR_FATTR_CHANGE) {

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jie Yang <jie....@atheros.com>

commit 678b77e265f6d66f1e68f3d095841c44ba5ab112 upstream.

remove duplicate atl1c_get_tpd, it may cause hardware to send wrong packets.

Signed-off-by: Jie Yang <jie....@atheros.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Cc: Willy Tarreau <w...@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/net/atl1c/atl1c_main.c | 2 --
1 file changed, 2 deletions(-)

--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -1976,8 +1976,6 @@ static void atl1c_tx_map(struct atl1c_ad
else {
use_tpd = atl1c_get_tpd(adapter, type);
memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
- use_tpd = atl1c_get_tpd(adapter, type);
- memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
}
buffer_info = atl1c_get_tx_buffer(adapter, use_tpd);
buffer_info->length = buf_len - mapped_len;

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Zachary Amsden <zam...@redhat.com>

(backported from commit 28e4639adf0c9f26f6bb56149b7ab547bf33bb95)

If preempted after kvmclock values are updated, but before hardware
virtualization is entered, the last tsc time as read by the guest is
never set. It underflows the next time kvmclock is updated if there
has not yet been a successful entry / exit into hardware virt.

Fix this by simply setting last_tsc to the newly read tsc value so
that any computed nsec advance of kvmclock is nulled.

Signed-off-by: Zachary Amsden <zam...@redhat.com>
Signed-off-by: Marcelo Tosatti <mtos...@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/714335

Signed-off-by: Serge E. Hallyn <serge....@canonical.com>
Reviewed-by: Stefan Bader <stefan...@canonical.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
arch/x86/kvm/x86.c | 1 +


1 file changed, 1 insertion(+)

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -694,6 +694,7 @@ static void kvm_write_guest_time(struct
vcpu->hv_clock.tsc_timestamp = tsc_timestamp;


vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;

vcpu->last_kernel_ns = kernel_ns;
+ vcpu->last_guest_tsc = tsc_timestamp;



/*
* The interface expects us to write an even number signaling that the

Greg KH

unread,
May 5, 2011, 8:30:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jason Conti <jason...@gmail.com>

commit a6756da9eace8b4af73e9dea43f1fc2889224c94 upstream.

This patch fixes a very serious off-by-one bug in
the driver, which could leave the device in an
unresponsive state.

The problem was that the extra_len variable [used to
reserve extra scratch buffer space for the firmware]
was left uninitialized. Because p54_assign_address
later needs the value to reserve additional space,
the resulting frame could be to big for the small
device's memory window and everything would
immediately come to a grinding halt.

Reference: https://bugs.launchpad.net/bugs/722185

Acked-by: Christian Lamparter <chun...@googlemail.com>
Signed-off-by: Jason Conti <jason...@gmail.com>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/net/wireless/p54/txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -703,7 +703,7 @@ int p54_tx_80211(struct ieee80211_hw *de
struct p54_tx_info *p54info;
struct p54_hdr *hdr;
struct p54_tx_data *txhdr;
- unsigned int padding, len, extra_len;
+ unsigned int padding, len, extra_len = 0;
int i, j, ridx;
u16 hdr_flags = 0, aid = 0;
u8 rate, queue = 0, crypt_offset = 0;

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Zachary Amsden <zam...@redhat.com>

(cherry-picked from commit 347bb4448c2155eb2310923ccaa4be5677649003)

The scale_delta function for shift / multiply with 31-bit
precision moves to a common header so it can be used by both
kernel and kvm module.

Signed-off-by: Zachary Amsden <zam...@redhat.com>
Signed-off-by: Marcelo Tosatti <mtos...@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/714335

Signed-off-by: Serge E. Hallyn <serge....@canonical.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

arch/x86/include/asm/pvclock.h | 38 ++++++++++++++++++++++++++++++++++++++
arch/x86/kernel/pvclock.c | 3 ++-
2 files changed, 40 insertions(+), 1 deletion(-)

--- a/arch/x86/include/asm/pvclock.h
+++ b/arch/x86/include/asm/pvclock.h
@@ -12,4 +12,42 @@ void pvclock_read_wallclock(struct pvclo
struct timespec *ts);
void pvclock_resume(void);

+/*
+ * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
+ * yielding a 64-bit result.
+ */
+static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
+{
+ u64 product;
+#ifdef __i386__
+ u32 tmp1, tmp2;
+#endif
+
+ if (shift < 0)
+ delta >>= -shift;
+ else
+ delta <<= shift;
+
+#ifdef __i386__
+ __asm__ (
+ "mul %5 ; "
+ "mov %4,%%eax ; "
+ "mov %%edx,%4 ; "
+ "mul %5 ; "
+ "xor %5,%5 ; "
+ "add %4,%%eax ; "
+ "adc %5,%%edx ; "
+ : "=A" (product), "=r" (tmp1), "=r" (tmp2)
+ : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
+#elif defined(__x86_64__)
+ __asm__ (
+ "mul %%rdx ; shrd $32,%%rdx,%%rax"
+ : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
+#else
+#error implement me!
+#endif
+
+ return product;
+}
+
#endif /* _ASM_X86_PVCLOCK_H */
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -74,7 +74,8 @@ static inline u64 scale_delta(u64 delta,
static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow)
{
u64 delta = native_read_tsc() - shadow->tsc_timestamp;
- return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
+ return pvclock_scale_delta(delta, shadow->tsc_to_nsec_mul,
+ shadow->tsc_shift);
}

/*

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: James Bottomley <James.B...@HansenPartnership.com>

commit 4a5fa3590f09999f6db41bc386bce40848fa9f63 upstream.

Slub makes assumptions about page_to_nid() which are violated by
DISCONTIGMEM and !NUMA. This violation results in a panic because
page_to_nid() can be non-zero for pages in the discontiguous ranges and
this leads to a null return by get_node(). The assertion by the
maintainer is that DISCONTIGMEM should only be allowed when NUMA is also
defined. However, at least six architectures: alpha, ia64, m32r, m68k,
mips, parisc violate this. The panic is a regression against slab, so
just mark slub broken in the problem configuration to prevent users
reporting these panics.

Acked-by: David Rientjes <rien...@google.com>
Acked-by: Pekka Enberg <pen...@kernel.org>
Signed-off-by: James Bottomley <James.B...@suse.de>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
init/Kconfig | 1 +


1 file changed, 1 insertion(+)

--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1028,6 +1028,7 @@ config SLAB
per cpu and per node queues.

config SLUB
+ depends on BROKEN || NUMA || !DISCONTIGMEM
bool "SLUB (Unqueued Allocator)"
help
SLUB is a slab allocator that minimizes cache line usage

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Bruce Allan <bruce....@intel.com>

commit 627c8a041f7aaaea93c766f69bd61d952a277586 upstream.

Reset the PHY before first accessing it. Doing so, ensure that the PHY is
in a known good state before we read/write PHY registers. This fixes a
driver probe failure.

Signed-off-by: Bruce Allan <bruce....@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey....@intel.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

[Backported to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/e1000e/ich8lan.c | 11 +++++++++++
1 file changed, 11 insertions(+)

--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -274,6 +274,16 @@ static s32 e1000_init_phy_params_pchlan(
phy->ops.write_phy_reg_locked = e1000_write_phy_reg_hv_locked;
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;

+ /*
+ * Reset the PHY before any acccess to it. Doing so, ensures that
+ * the PHY is in a known good state before we read/write PHY registers.
+ * The generic reset is sufficient here, because we haven't determined
+ * the PHY type yet.
+ */
+ ret_val = e1000e_phy_hw_reset_generic(hw);
+ if (ret_val)
+ goto out;
+
phy->id = e1000_phy_unknown;
e1000e_get_phy_id(hw);
phy->type = e1000e_get_phy_type_from_id(phy->id);
@@ -287,6 +297,7 @@ static s32 e1000_init_phy_params_pchlan(
phy->ops.commit_phy = e1000e_phy_sw_reset;
}

+ out:
return ret_val;

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jeff Layton <jla...@redhat.com>

commit 26c4c170731f00008f4317a2888a0a07ac99d90d upstream.

On a remount, the VFS layer will clear the MS_SYNCHRONOUS bit on the
assumption that the flags on the mount syscall will have it set if the
remounted fs is supposed to keep it.

In the case of "noac" though, MS_SYNCHRONOUS is implied. A remount of
such a mount will lose the MS_SYNCHRONOUS flag since "sync" isn't part
of the mount options.

Reported-by: Max Matveev <ma...@redhat.com>
Signed-off-by: Jeff Layton <jla...@redhat.com>
Signed-off-by: Trond Myklebust <Trond.M...@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
fs/nfs/super.c | 9 +++++++++
1 file changed, 9 insertions(+)

--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1925,6 +1925,15 @@ nfs_remount(struct super_block *sb, int
if (error < 0)
goto out;

+ /*
+ * noac is a special case. It implies -o sync, but that's not
+ * necessarily reflected in the mtab options. do_remount_sb
+ * will clear MS_SYNCHRONOUS if -o sync wasn't specified in the
+ * remount options, so we have to explicitly reset it.
+ */
+ if (data->flags & NFS_MOUNT_NOAC)
+ *flags |= MS_SYNCHRONOUS;
+
/* compare new mount options with old ones */
error = nfs_compare_remount_data(nfss, data);
out:

Greg KH

unread,
May 5, 2011, 8:30:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Bart Hartgers <bart.h...@gmail.com>

commit a55ab496ea9c820b7192c15ef1fbf3291edfe638 upstream.

When writing a disc on certain lite-on dvd-writers (also rebadged
as optiarc/LG/...) connected to a vt6420, the ATAPI CDB ends
up in the datastream and on the disc, causing silent corruption.
Delaying between sending the CDB and starting DMA seems to
prevent this.

I do not know if there are burners that do not suffer from
this, but the patch should be safe for those as well.

There are many reports of this issue, but AFAICT no solution was
found before. For example:
http://lkml.indiana.edu/hypermail/linux/kernel/0802.3/0561.html

Signed-off-by: Bart Hartgers <bart.h...@gmail.com>
Signed-off-by: Jeff Garzik <jga...@redhat.com>
[bwh: Remove version bump for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/ata/sata_via.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -40,6 +40,8 @@
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>

@@ -80,6 +82,7 @@ static int vt8251_scr_write(struct ata_l
static void svia_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
static void svia_noop_freeze(struct ata_port *ap);
static int vt6420_prereset(struct ata_link *link, unsigned long deadline);
+static void vt6420_bmdma_start(struct ata_queued_cmd *qc);
static int vt6421_pata_cable_detect(struct ata_port *ap);
static void vt6421_set_pio_mode(struct ata_port *ap, struct ata_device *adev);
static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev);
@@ -121,6 +124,7 @@ static struct ata_port_operations vt6420
.inherits = &svia_base_ops,
.freeze = svia_noop_freeze,
.prereset = vt6420_prereset,
+ .bmdma_start = vt6420_bmdma_start,
};

static struct ata_port_operations vt6421_pata_ops = {
@@ -377,6 +381,17 @@ static int vt6420_prereset(struct ata_li
return 0;
}

+static void vt6420_bmdma_start(struct ata_queued_cmd *qc)
+{
+ struct ata_port *ap = qc->ap;
+ if ((qc->tf.command == ATA_CMD_PACKET) &&
+ (qc->scsicmd->sc_data_direction == DMA_TO_DEVICE)) {
+ /* Prevents corruption on some ATAPI burners */
+ ata_sff_pause(ap);
+ }
+ ata_bmdma_start(qc);
+}
+
static int vt6421_pata_cable_detect(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

Greg KH

unread,
May 5, 2011, 8:30:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <seg...@openwall.com>

commit b522f02184b413955f3bc952e3776ce41edc6355 upstream.

page_count is copied from userspace. agp_allocate_memory() tries to
check whether this number is too big, but doesn't take into account the
wrap case. Also agp_create_user_memory() doesn't check whether
alloc_size is calculated from num_agp_pages variable without overflow.
This may lead to allocation of too small buffer with following buffer
overflow.

Another problem in agp code is not addressed in the patch - kernel memory
exhaustion (AGPIOC_RESERVE and AGPIOC_ALLOCATE ioctls). It is not checked
whether requested pid is a pid of the caller (no check in agpioc_reserve_wrap()).
Each allocation is limited to 16KB, though, there is no per-process limit.
This might lead to OOM situation, which is not even solved in case of the
caller death by OOM killer - the memory is allocated for another (faked) process.

Signed-off-by: Vasiliy Kulikov <seg...@openwall.com>
Signed-off-by: Dave Airlie <air...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/char/agp/generic.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -123,6 +123,9 @@ static struct agp_memory *agp_create_use
struct agp_memory *new;
unsigned long alloc_size = num_agp_pages*sizeof(struct page *);

+ if (INT_MAX/sizeof(struct page *) < num_agp_pages)
+ return NULL;
+
new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
if (new == NULL)
return NULL;
@@ -242,11 +245,14 @@ struct agp_memory *agp_allocate_memory(s
int scratch_pages;
struct agp_memory *new;
size_t i;
+ int cur_memory;

if (!bridge)
return NULL;

- if ((atomic_read(&bridge->current_memory_agp) + page_count) > bridge->max_memory_agp)
+ cur_memory = atomic_read(&bridge->current_memory_agp);
+ if ((cur_memory + page_count > bridge->max_memory_agp) ||
+ (cur_memory + page_count < page_count))
return NULL;

if (type >= AGP_USER_TYPES) {

Greg KH

unread,
May 5, 2011, 8:30:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Romain Francoise <rom...@orebokech.com>

commit 2fdc1c8093255f9da877d7b9ce3f46c2098377dc upstream.

When a network namespace is created (via CLONE_NEWNET), the loopback
interface is automatically added to the new namespace, triggering a
printk in ipv6_add_dev() if CONFIG_IPV6_PRIVACY is set.

This is problematic for applications which use CLONE_NEWNET as
part of a sandbox, like Chromium's suid sandbox or recent versions of
vsftpd. On a busy machine, it can lead to thousands of useless
"lo: Disabled Privacy Extensions" messages appearing in dmesg.

It's easy enough to check the status of privacy extensions via the
use_tempaddr sysctl, so just removing the printk seems like the most
sensible solution.

Signed-off-by: Romain Francoise <rom...@orebokech.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

net/ipv6/addrconf.c | 3 ---
1 file changed, 3 deletions(-)

--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -407,9 +407,6 @@ static struct inet6_dev * ipv6_add_dev(s
dev->type == ARPHRD_TUNNEL6 ||
dev->type == ARPHRD_SIT ||
dev->type == ARPHRD_NONE) {
- printk(KERN_INFO
- "%s: Disabled Privacy Extensions\n",
- dev->name);
ndev->cnf.use_tempaddr = -1;
} else {
in6_dev_hold(ndev);

Greg KH

unread,
May 5, 2011, 8:30:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jim Bos <jim...@xs4all.nl>

commit 6b4e81db2552bad04100e7d5ddeed7e848f53b48 upstream.

More recent GCC caused the i8k driver to stop working, on Slackware
compiler was upgraded from gcc-4.4.4 to gcc-4.5.1 after which it didn't
work anymore, meaning the driver didn't load or gave total nonsensical
output.

As it turned out the asm(..) statement forgot to mention it modifies the
*regs variable.

Credits to Andi Kleen and Andreas Schwab for providing the fix.

Signed-off-by: Jim Bos <jim...@xs4all.nl>
Cc: Andi Kleen <an...@firstfloor.org>
Cc: Andreas Schwab <sch...@linux-m68k.org>
Signed-off-by: Linus Torvalds <torv...@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/char/i8k.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -141,7 +141,7 @@ static int i8k_smm(struct smm_regs *regs
"lahf\n\t"
"shrl $8,%%eax\n\t"
"andl $1,%%eax\n"
- :"=a"(rc)
+ :"=a"(rc), "+m" (*regs)
: "a"(regs)
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
#else
@@ -166,7 +166,8 @@ static int i8k_smm(struct smm_regs *regs
"movl %%edx,0(%%eax)\n\t"
"lahf\n\t"
"shrl $8,%%eax\n\t"
- "andl $1,%%eax\n":"=a"(rc)
+ "andl $1,%%eax\n"
+ :"=a"(rc), "+m" (*regs)
: "a"(regs)
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
#endif

Greg KH

unread,
May 5, 2011, 8:30:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Gertjan van Wingerde <gwin...@gmail.com>

commit d24deb2580823ab0b8425790c6f5d18e2ff749d8 upstream.

Add a definition of the amount of TX headroom reserved by mac80211 itself
for its own purposes. Also add BUILD_BUG_ON to validate the value.
This define can then be used by drivers to request additional TX headroom
in the most efficient manner.

Signed-off-by: Gertjan van Wingerde <gwin...@gmail.com>
Acked-by: Johannes Berg <joha...@sipsolutions.net>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

[bwh: Adjust context for 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

include/net/mac80211.h | 6 ++++++
net/mac80211/main.c | 2 ++
2 files changed, 8 insertions(+)

--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1700,6 +1700,12 @@ void ieee80211_rx(struct ieee80211_hw *h
*/
void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);

+/*
+ * The TX headroom reserved by mac80211 for its own tx_status functions.
+ * This is enough for the radiotap header.
+ */
+#define IEEE80211_TX_STATUS_HEADROOM 13
+
/**
* ieee80211_tx_status - transmit status callback
*
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -859,6 +859,8 @@ int ieee80211_register_hw(struct ieee802
* and we need some headroom for passing the frame to monitor
* interfaces, but never both at the same time.
*/
+ BUILD_BUG_ON(IEEE80211_TX_STATUS_HEADROOM !=
+ sizeof(struct ieee80211_tx_status_rtap_hdr));
local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
sizeof(struct ieee80211_tx_status_rtap_hdr));

Greg KH

unread,
May 5, 2011, 8:30:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Peter Zijlstra <pet...@infradead.org>

commit b433c3d4549ae74935b585115f076c6fb7bc48fe upstream.

Ilya reported that on a very slow machine he could reliably
reproduce a race between forking init and kthreadd. We first
fork init so that it obtains pid-1, however since the scheduler
is already fully running at this point it can preempt and run
the init thread before we spawn and set kthreadd_task.

The init thread can then attempt spawning kthreads without
kthreadd being present which results in an OOPS.

Reported-by: Ilya Loginov <islo...@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zi...@chello.nl>
Acked-by: Linus Torvalds <torv...@linux-foundation.org>
LKML-Reference: <1277736661.3561.110.camel@laptop>
Signed-off-by: Ingo Molnar <mi...@elte.hu>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

init/main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

--- a/init/main.c
+++ b/init/main.c
@@ -407,16 +407,24 @@ static void __init setup_command_line(ch
* gcc-3.4 accidentally inlines this function, so use noinline.
*/

+static __initdata DECLARE_COMPLETION(kthreadd_done);
+
static noinline void __init_refok rest_init(void)
__releases(kernel_lock)
{
int pid;

rcu_scheduler_starting();
+ /*
+ * We need to spawn init first so that it obtains pid-1, however
+ * the init task will end up wanting to create kthreads, which, if
+ * we schedule it before we create kthreadd, will OOPS.
+ */
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
numa_default_policy();
pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
+ complete(&kthreadd_done);
unlock_kernel();

/*
@@ -841,6 +849,10 @@ static noinline int init_post(void)

static int __init kernel_init(void * unused)
{
+ /*
+ * Wait until kthreadd is all set-up.
+ */
+ wait_for_completion(&kthreadd_done);
lock_kernel();

/*

Greg KH

unread,
May 5, 2011, 8:40:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <sgru...@redhat.com>

commit b25026981aecde3685dd0e45ad980fff9f528daa upstream.

Since

commit a120e912eb51e347f36c71b60a1d13af74d30e83
Author: Stanislaw Gruszka <sgru...@redhat.com>
Date: Fri Feb 19 15:47:33 2010 -0800

iwlwifi: sanity check before counting number of tfds can be free

we use skb->data after calling ieee80211_tx_status_irqsafe(), which
could free skb instantly.

On current kernels I do not observe practical problems related with
bug, but on 2.6.35.y it cause random system hangs when stressing
wireless link.

Signed-off-by: Stanislaw Gruszka <sgru...@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi...@intel.com>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/net/wireless/iwlwifi/iwl-tx.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -1088,11 +1088,15 @@ int iwl_tx_queue_reclaim(struct iwl_priv
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {

tx_info = &txq->txb[txq->q.read_ptr];
- ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
+
+ if (WARN_ON_ONCE(tx_info->skb == NULL))
+ continue;

hdr = (struct ieee80211_hdr *)tx_info->skb[0]->data;
- if (hdr && ieee80211_is_data_qos(hdr->frame_control))
+ if (ieee80211_is_data_qos(hdr->frame_control))
nfreed++;
+
+ ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
tx_info->skb[0] = NULL;

if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)

Greg KH

unread,
May 5, 2011, 8:40:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <bhutc...@solarflare.com>

commit ee9c5cfad29c8a13199962614b9b16f1c4137ac9 upstream.

niu_get_ethtool_tcam_all() assumes that its output buffer is the right
size, and warns before returning if it is not. However, the output
buffer size is under user control and ETHTOOL_GRXCLSRLALL is an
unprivileged ethtool command. Therefore this is at least a local
denial-of-service vulnerability.

Change it to check before writing each entry and to return an error if
the buffer is already full.

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutc...@solarflare.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

[Adjusted to apply to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/niu.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)

--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7315,33 +7315,28 @@ static int niu_get_ethtool_tcam_all(stru
struct niu_parent *parent = np->parent;
struct niu_tcam_entry *tp;
int i, idx, cnt;
- u16 n_entries;
unsigned long flags;
-
+ int ret = 0;

/* put the tcam size here */
nfc->data = tcam_get_size(np);

niu_lock_parent(np, flags);
- n_entries = nfc->rule_cnt;
for (cnt = 0, i = 0; i < nfc->data; i++) {
idx = tcam_get_index(np, i);
tp = &parent->tcam[idx];
if (!tp->valid)
continue;
+ if (cnt == nfc->rule_cnt) {
+ ret = -EMSGSIZE;
+ break;
+ }
rule_locs[cnt] = i;
cnt++;
}
niu_unlock_parent(np, flags);

- if (n_entries != cnt) {
- /* print warning, this should not happen */
- pr_info(PFX "niu%d: %s In niu_get_ethtool_tcam_all, "
- "n_entries[%d] != cnt[%d]!!!\n\n",
- np->parent->index, np->dev->name, n_entries, cnt);
- }
-
- return 0;
+ return ret;
}

static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,

Greg KH

unread,
May 5, 2011, 8:40:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Tejun Heo <hte...@gmail.com>

commit 729a6a300e628a48cf12bac93a964a535e83cd1d upstream.

ata_pio_sectors() expects buffer for each sector to be contained in a
single page; otherwise, it ends up overrunning the first page. This
is achieved by setting queue DMA alignment. If sector_size is smaller
than PAGE_SIZE and all buffers are sector_size aligned, buffer for
each sector is always contained in a single page.

This wasn't applied to ATAPI devices but IDENTIFY_PACKET is executed
as ATA_PROT_PIO and thus uses ata_pio_sectors(). Newer versions of
udev issue IDENTIFY_PACKET with unaligned buffer triggering the
problem and causing oops.

This patch fixes the problem by setting sdev->sector_size to
ATA_SECT_SIZE on ATATPI devices and always setting DMA alignment to
sector_size. While at it, add a warning for the unlikely but still
possible scenario where sector_size is larger than PAGE_SIZE, in which
case the alignment wouldn't be enough.

Signed-off-by: Tejun Heo <t...@kernel.org>
Reported-by: John Stanley <jpsin...@verizon.net>
Tested-by: John Stanley <jpsin...@verizon.net>
Signed-off-by: Jeff Garzik <jga...@redhat.com>
Signed-off-by: Jonathan Liu <net...@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/ata/libata-scsi.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)

--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1099,13 +1099,13 @@ static int ata_scsi_dev_config(struct sc
/* configure max sectors */
blk_queue_max_sectors(sdev->request_queue, dev->max_sectors);

+ sdev->sector_size = ATA_SECT_SIZE;
+
if (dev->class == ATA_DEV_ATAPI) {
struct request_queue *q = sdev->request_queue;
void *buf;

- /* set the min alignment and padding */
- blk_queue_update_dma_alignment(sdev->request_queue,
- ATA_DMA_PAD_SZ - 1);
+ /* set DMA padding */
blk_queue_update_dma_pad(sdev->request_queue,
ATA_DMA_PAD_SZ - 1);

@@ -1119,12 +1119,24 @@ static int ata_scsi_dev_config(struct sc

blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
} else {
- /* ATA devices must be sector aligned */
- blk_queue_update_dma_alignment(sdev->request_queue,
- ATA_SECT_SIZE - 1);
sdev->manage_start_stop = 1;
}

+ /*
+ * ata_pio_sectors() expects buffer for each sector to not cross
+ * page boundary. Enforce it by requiring buffers to be sector
+ * aligned, which works iff sector_size is not larger than
+ * PAGE_SIZE. ATAPI devices also need the alignment as
+ * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
+ */
+ if (sdev->sector_size > PAGE_SIZE)
+ ata_dev_printk(dev, KERN_WARNING,
+ "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
+ sdev->sector_size);
+
+ blk_queue_update_dma_alignment(sdev->request_queue,
+ sdev->sector_size - 1);
+
if (dev->flags & ATA_DFLAG_AN)
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);

Greg KH

unread,
May 5, 2011, 8:40:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 4d9ef89dee13e964ea8b064d82ff55cf36209237 upstream.

The dts-installed variable is initialised using a wildcard path that
will be expanded relative to the build directory. Use the existing
variable dtstree to generate an absolute wildcard path that will work
when building in a separate directory.

Reported-by: Gerhard Pircher <gerhard...@gmx.net>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Tested-by: Gerhard Pircher <gerhard...@gmx.net> [against 2.6.32]
Signed-off-by: Benjamin Herrenschmidt <be...@kernel.crashing.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

arch/powerpc/boot/Makefile | 2 +-


1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -364,7 +364,7 @@ INSTALL := install
extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
-dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
+dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))

all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)

Greg KH

unread,
May 5, 2011, 8:40:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ondrej Zary <li...@rainbow-software.org>

commit 75f64dd54a185150ebfc45e99351c890d4a2252f upstream.

HW crypto in rt2500usb does not seem to support keys with different ciphers,
which breaks TKIP+AES mode. Fall back to software encryption to fix it.

This should fix long-standing problems with rt2500usb and WPA, such as:
http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=4&t=4834
https://bugzilla.redhat.com/show_bug.cgi?id=484888

Also tested that it does not break WEP, TKIP-only and AES-only modes.

Signed-off-by: Ondrej Zary <li...@rainbow-software.org>
Acked-by: Gertjan van Wingerde <gwin...@gmail.com>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

[bwh: Adjust context for 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/wireless/rt2x00/rt2500usb.c | 10 ++++++++++
1 file changed, 10 insertions(+)

--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -347,6 +347,7 @@ static int rt2500usb_config_key(struct r
int timeout;
u32 mask;
u16 reg;
+ enum cipher curr_cipher;

if (crypto->cmd == SET_KEY) {
/*
@@ -357,6 +358,7 @@ static int rt2500usb_config_key(struct r
mask = TXRX_CSR0_KEY_ID.bit_mask;

rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
+ curr_cipher = rt2x00_get_field16(reg, TXRX_CSR0_ALGORITHM);
reg &= mask;

if (reg && reg == mask)
@@ -365,6 +367,14 @@ static int rt2500usb_config_key(struct r
reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);

key->hw_key_idx += reg ? ffz(reg) : 0;
+ /*
+ * Hardware requires that all keys use the same cipher
+ * (e.g. TKIP-only, AES-only, but not TKIP+AES).
+ * If this is not the first key, compare the cipher with the
+ * first one and fall back to SW crypto if not the same.
+ */
+ if (key->hw_key_idx > 0 && crypto->cipher != curr_cipher)
+ return -EOPNOTSUPP;

/*
* The encryption key doesn't fit within the CSR cache,

Greg KH

unread,
May 5, 2011, 8:40:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: FUJITA Tomonori <fujita....@lab.ntt.co.jp>

commit bb789d01620e5d36081b22edb6fb71cf55ff043c upstream.

scsi_dma_map() returns -1 if an error occurred (zero means that the
command has no data). So the following current code can't catch an
error:

sges_left = scsi_dma_map(scmd);
if (!sges_left) {
sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
" failed: request for %d bytes!\n", scsi_bufflen(scmd));
return -ENOMEM;
}

Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Acked-by: "Kashyap Desai" <Kashya...@lsi.com>
Signed-off-by: James Bottomley <James.B...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 ++--


1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -945,7 +945,7 @@ _scsih_build_scatter_gather(struct MPT2S
u32 chain_offset;
u32 chain_length;
u32 chain_flags;
- u32 sges_left;
+ int sges_left;
u32 sges_in_segment;
u32 sgl_flags;
u32 sgl_flags_last_element;
@@ -966,7 +966,7 @@ _scsih_build_scatter_gather(struct MPT2S

sg_scmd = scsi_sglist(scmd);
sges_left = scsi_dma_map(scmd);
- if (!sges_left) {
+ if (sges_left < 0) {
sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
" failed: request for %d bytes!\n", scsi_bufflen(scmd));
return -ENOMEM;

Greg KH

unread,
May 5, 2011, 8:40:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Felipe Balbi <ba...@ti.com>

commit ec95d35a6bd0047f05fe8a21e6c52f8bb418da55 upstream.

MUSB is a non-standard host implementation which
can handle all speeds with the same core. We need
to set has_tt flag after commit
d199c96d41d80a567493e12b8e96ea056a1350c1 (USB: prevent
buggy hubs from crashing the USB stack) in order for
MUSB HCD to continue working.

Signed-off-by: Felipe Balbi <ba...@ti.com>
Cc: Alan Stern <st...@rowland.harvard.edu>
Tested-by: Michael Jones <michae...@matrix-vision.de>
Tested-by: Alexander Holler <hol...@ahsoftware.de>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/usb/musb/musb_core.c | 1 +


1 file changed, 1 insertion(+)

--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1792,6 +1792,7 @@ allocate_instance(struct device *dev,
INIT_LIST_HEAD(&musb->out_bulk);

hcd->uses_new_polling = 1;
+ hcd->has_tt = 1;

musb->vbuserr_retry = VBUSERR_RETRY_COUNT;
musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON;

Greg KH

unread,
May 5, 2011, 8:40:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ralf Baechle <ra...@linux-mips.org>

commit 3b9c6c11f519718d618f5d7c9508daf78b207f6f upstream.

This only matters for ISA devices with a 24-bit DMA limit or for devices
with a 32-bit DMA limit on systems with ZONE_DMA32 enabled. The latter
currently only affects 32-bit PCI cards on Sibyte-based systems with more
than 1GB RAM installed.

Signed-off-by: Ralf Baechle <ra...@linux-mips.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

arch/mips/mm/dma-default.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)

--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -43,27 +43,39 @@ static inline int cpu_is_noncoherent_r10

static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
{
+ gfp_t dma_flag;
+
/* ignore region specifiers */
gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);

-#ifdef CONFIG_ZONE_DMA
+#ifdef CONFIG_ISA
if (dev == NULL)
- gfp |= __GFP_DMA;
- else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
- gfp |= __GFP_DMA;
+ dma_flag = __GFP_DMA;
else
#endif
-#ifdef CONFIG_ZONE_DMA32
+#if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA)
if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
- gfp |= __GFP_DMA32;
+ dma_flag = __GFP_DMA;
+ else if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
+ dma_flag = __GFP_DMA32;
+ else
+#endif
+#if defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_ZONE_DMA)
+ if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
+ dma_flag = __GFP_DMA32;
+ else
+#endif
+#if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32)
+ if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
+ dma_flag = __GFP_DMA;
else
#endif
- ;
+ dma_flag = 0;

/* Don't invoke OOM killer */
gfp |= __GFP_NORETRY;

- return gfp;
+ return gfp | dma_flag;
}

void *dma_alloc_noncoherent(struct device *dev, size_t size,

Greg KH

unread,
May 5, 2011, 8:40:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jeff Mahoney <je...@suse.com>

commit 25cca5352712561fba97bd37c495593d641c1d39 upstream.

This patch removes D-Link DGE-550T PCI ID (1186:4000) from the ipg
driver. The ipg driver is for IP2000-based cards and the DGE-550T is
a DL2000-based card. The driver loads and works for a few moments, but
once a real workload is applied it stops operating. The ipg driver
claimed this ID since it was introduced in 2.6.24 and it's forced many
users to blacklist it.

The correct driver for this hardware is the dl2k driver, which has been
claiming this PCI ID since the 2.4 days.

Signed-off-by: Jeff Mahoney <je...@suse.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/ipg.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -88,7 +88,6 @@ static const char *ipg_brand_name[] = {
"Sundance Technology ST2021 based NIC",
"Tamarack Microelectronics TC9020/9021 based NIC",
"Tamarack Microelectronics TC9020/9021 based NIC",
- "D-Link NIC",
"D-Link NIC IP1000A"
};

@@ -97,8 +96,7 @@ static struct pci_device_id ipg_pci_tbl[
{ PCI_VDEVICE(SUNDANCE, 0x2021), 1 },
{ PCI_VDEVICE(SUNDANCE, 0x1021), 2 },
{ PCI_VDEVICE(DLINK, 0x9021), 3 },
- { PCI_VDEVICE(DLINK, 0x4000), 4 },
- { PCI_VDEVICE(DLINK, 0x4020), 5 },
+ { PCI_VDEVICE(DLINK, 0x4020), 4 },
{ 0, }
};

Greg KH

unread,
May 5, 2011, 8:40:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: James Chapman <jcha...@katalix.com>

commit c3259c8a7060d480e8eb2166da0a99d6879146b4 upstream.

This patch fixes UDP socket refcnt bugs in the pppol2tp driver.

A bug can cause a kernel stack trace when a tunnel socket is closed.

A way to reproduce the issue is to prepare the UDP socket for L2TP (by
opening a tunnel pppol2tp socket) and then close it before any L2TP
sessions are added to it. The sequence is

Create UDP socket
Create tunnel pppol2tp socket to prepare UDP socket for L2TP
pppol2tp_connect: session_id=0, peer_session_id=0
L2TP SCCRP control frame received (tunnel_id==0)
pppol2tp_recv_core: sock_hold()
pppol2tp_recv_core: sock_put
L2TP ZLB control frame received (tunnel_id=nnn)
pppol2tp_recv_core: sock_hold()
pppol2tp_recv_core: sock_put
Close tunnel management socket
pppol2tp_release: session_id=0, peer_session_id=0
Close UDP socket
udp_lib_close: BUG

The addition of sock_hold() in pppol2tp_connect() solves the problem.

For data frames, two sock_put() calls were added to plug a refcnt leak
per received data frame. The ref that is grabbed at the top of
pppol2tp_recv_core() must always be released, but this wasn't done for
accepted data frames or data frames discarded because of bad UDP
checksums. This leak meant that any UDP socket that had passed L2TP
data traffic (i.e. L2TP data frames, not just L2TP control frames)
using pppol2tp would not be released by the kernel.

WARNING: at include/net/sock.h:435 udp_lib_unhash+0x117/0x120()
Pid: 1086, comm: openl2tpd Not tainted 2.6.33-rc1 #8
Call Trace:
[<c119e9b7>] ? udp_lib_unhash+0x117/0x120
[<c101b871>] ? warn_slowpath_common+0x71/0xd0
[<c119e9b7>] ? udp_lib_unhash+0x117/0x120
[<c101b8e3>] ? warn_slowpath_null+0x13/0x20
[<c119e9b7>] ? udp_lib_unhash+0x117/0x120
[<c11598a7>] ? sk_common_release+0x17/0x90
[<c11a5e33>] ? inet_release+0x33/0x60
[<c11577b0>] ? sock_release+0x10/0x60
[<c115780f>] ? sock_close+0xf/0x30
[<c106e542>] ? __fput+0x52/0x150
[<c106b68e>] ? filp_close+0x3e/0x70
[<c101d2e2>] ? put_files_struct+0x62/0xb0
[<c101eaf7>] ? do_exit+0x5e7/0x650
[<c1081623>] ? mntput_no_expire+0x13/0x70
[<c106b68e>] ? filp_close+0x3e/0x70
[<c101eb8a>] ? do_group_exit+0x2a/0x70
[<c101ebe1>] ? sys_exit_group+0x11/0x20
[<c10029b0>] ? sysenter_do_call+0x12/0x26

Signed-off-by: James Chapman <jcha...@katalix.com>


Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/pppol2tp.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -756,6 +756,7 @@ static int pppol2tp_recv_core(struct soc

/* Try to dequeue as many skbs from reorder_q as we can. */
pppol2tp_recv_dequeue(session);
+ sock_put(sock);

return 0;

@@ -772,6 +773,7 @@ discard_bad_csum:
UDP_INC_STATS_USER(&init_net, UDP_MIB_INERRORS, 0);
tunnel->stats.rx_errors++;
kfree_skb(skb);
+ sock_put(sock);

return 0;

@@ -1658,6 +1660,7 @@ static int pppol2tp_connect(struct socke
if (tunnel_sock == NULL)
goto end;

+ sock_hold(tunnel_sock);
tunnel = tunnel_sock->sk_user_data;
} else {
tunnel = pppol2tp_tunnel_find(sock_net(sk), sp->pppol2tp.s_tunnel);

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Bernhard Froemel <fro...@vmars.tuwien.ac.at>

commit 872bad55e2d3fcc13e1e8770a3b200f0c6ca5126 upstream.

This patch adds generic support for the MacBook Pro 6 family
based on the 6,2 model.

[ryd...@euromail.se: patch cleanup]
Signed-off-by: Bernhard Froemel <fro...@vmars.tuwien.ac.at>
Signed-off-by: Henrik Rydberg <ryd...@euromail.se>
Signed-off-by: Jean Delvare <kh...@linux-fr.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hwmon/applesmc.c | 10 ++++++++++


1 file changed, 10 insertions(+)

--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -155,6 +155,10 @@ static const char *temperature_sensors_s
/* Set 20: MacBook Pro 5,4 */
{ "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TN0D",
"TN0P", "TTF0", "Th2H", "Ts0P", "Ts0S", NULL },
+/* Set 21: MacBook Pro 6,2 */
+ { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", "TC0P", "TC1C", "TG0D",
+ "TG0P", "TG0T", "TMCD", "TP0P", "TPCD", "Th1H", "Th2H", "Tm0P",
+ "Ts0P", "Ts0S", NULL },
};

/* List of keys used to read/write fan speeds */
@@ -1371,6 +1375,8 @@ static __initdata struct dmi_match_data
{ .accelerometer = 1, .light = 1, .temperature_set = 19 },
/* MacBook Pro 5,4: accelerometer, backlight and temperature set 20 */
{ .accelerometer = 1, .light = 1, .temperature_set = 20 },
+/* MacBook Pro 6,2: accelerometer, backlight and temperature set 21 */
+ { .accelerometer = 1, .light = 1, .temperature_set = 21 },
};

/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
@@ -1392,6 +1398,10 @@ static __initdata struct dmi_system_id a
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,3") },
&applesmc_dmi_data[19]},
+ { applesmc_dmi_match, "Apple MacBook Pro 6", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro6") },
+ &applesmc_dmi_data[21]},
{ applesmc_dmi_match, "Apple MacBook Pro 5", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5") },

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <m...@redhat.com>

commit 751386507701010831d72c522171753d2cd903d2 upstream.

This makes it possible to build perf statically, by
performing:

make LDFLAGS=-static

Since static libraries are only searched in the order they are
specified, move library list from LDFLAGS to EXTLIBS, so that
they are put at the end of linker command line.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Frederic Weisbecker <fwei...@gmail.com>
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>
LKML-Reference: <2009102915...@redhat.com>
[ v2: resolved conflicts ]
Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -145,6 +145,8 @@ all::
# Define NO_EXTERNAL_GREP if you don't want "perf grep" to ever call
# your external grep (e.g., if your system lacks grep, if its grep is
# broken, or spawning external process is slower than built-in grep perf has).
+#
+# Define LDFLAGS=-static to build a static binary.

PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
@$(SHELL_PATH) util/PERF-VERSION-GEN
@@ -208,7 +210,7 @@ ifndef PERF_DEBUG
endif

CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
-LDFLAGS = -lpthread -lrt -lelf -lm
+EXTLIBS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= strip
@@ -433,12 +435,12 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
endif

-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
endif

-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
- ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+ ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
BASIC_CFLAGS += -DLIBELF_NO_MMAP
endif
else
@@ -448,20 +450,20 @@ endif
ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE
else
- has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd > /dev/null 2>&1 && echo y")
+ has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd > /dev/null 2>&1 && echo y")

ifeq ($(has_bfd),y)
EXTLIBS += -lbfd
else
- has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
+ has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty > /dev/null 2>&1 && echo y")
ifeq ($(has_bfd_iberty),y)
EXTLIBS += -lbfd -liberty
else
- has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
+ has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
ifeq ($(has_bfd_iberty_z),y)
EXTLIBS += -lbfd -liberty -lz
else
- has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -liberty > /dev/null 2>&1 && echo y")
+ has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty > /dev/null 2>&1 && echo y")
ifeq ($(has_cplus_demangle),y)
EXTLIBS += -liberty
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Hannes Reinecke <ha...@suse.de>

commit 6c71dcb28ff9b63b814a0b76a256f5dae08d3e0d upstream.

This patch fixes the request setup code for mode selects. I got the fixes from
Hannes Reinecke while trying to hunt down some problems and merged it
into one patch. I am sending it because Hannes is busy with other things.

The patch fixes:
- setting of the length for mode selects.
- setting of the data direction for mode select 10.

Signed-off-by: Hannes Reinecke <ha...@suse.de>
Signed-off-by: Mike Christie <mich...@cs.wisc.edu>
Signed-off-by: James Bottomley <James.B...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/scsi/device_handler/scsi_dh_emc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -272,7 +272,7 @@ static struct request *get_req(struct sc
int len = 0;

rq = blk_get_request(sdev->request_queue,
- (cmd == MODE_SELECT) ? WRITE : READ, GFP_NOIO);
+ (cmd != INQUIRY) ? WRITE : READ, GFP_NOIO);
if (!rq) {
sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed");
return NULL;
@@ -286,14 +286,17 @@ static struct request *get_req(struct sc
len = sizeof(short_trespass);
rq->cmd_flags |= REQ_RW;
rq->cmd[1] = 0x10;
+ rq->cmd[4] = len;
break;
case MODE_SELECT_10:
len = sizeof(long_trespass);
rq->cmd_flags |= REQ_RW;
rq->cmd[1] = 0x10;
+ rq->cmd[8] = len;
break;
case INQUIRY:
len = CLARIION_BUFFER_SIZE;
+ rq->cmd[4] = len;
memset(buffer, 0, len);
break;
default:
@@ -301,7 +304,6 @@ static struct request *get_req(struct sc
break;
}

- rq->cmd[4] = len;
rq->cmd_type = REQ_TYPE_BLOCK_PC;
rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
REQ_FAILFAST_DRIVER;

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Edgar (gimli) Hucek <gi...@dark-green.com>

commit 87232dd49aeb6b7d1af291edca8bd129a82ef4b5 upstream.

This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the alsa
sound system.

Signed-off-by: Edgar (gimli) Hucek <gi...@dark-green.com>
Signed-off-by: Takashi Iwai <ti...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

sound/pci/hda/patch_cirrus.c | 1 +


1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1090,6 +1090,7 @@ static const char *cs420x_models[CS420X_

static struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),
+ SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Larry Finger <Larry....@lwfinger.net>

commit 9f2a0fac625bcef9c579bcf0b0c904ab1a56e7c4 upstream.

On module removal, the sdio version of b43 generates the following warning:

[ 851.560519] ------------[ cut here ]------------
[ 851.560531] WARNING: at drivers/mmc/core/core.c:237 mmc_wait_for_cmd+0x88/0x90()
[ 851.560534] Hardware name: 20552PG
[ 851.560536] Modules linked in: b43(-) ssb mmc_block binfmt_misc rfcomm sco bnep ppdev l2cap ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp kvm_intel kvm arc4 iwlagn snd_hda_codec_conexant snd_hda_intel snd_hda_codec iwlcore snd_hwdep snd_pcm thinkpad_acpi mac80211 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq r852 joydev snd_timer sm_common pcmcia nand snd_seq_device cfg80211 sdhci_pci btusb psmouse tpm_tis yenta_socket nand_ids lp snd pcmcia_rsrc nand_ecc bluetooth sdhci tpm pcmcia_core parport mtd snd_page_alloc serio_raw tpm_bios soundcore nvram led_class sha256_generic aes_i586 aes_generic dm_crypt i915 drm_kms_helper drm ahci intel_agp i2c_algo_bit intel_gtt e1000e libahci video agpgart output
[ 851.560620] Pid: 2504, comm: rmmod Not tainted 2.6.36-titan0+ #1
[ 851.560622] Call Trace:
[ 851.560631] [<c014a102>] warn_slowpath_common+0x72/0xa0
[ 851.560636] [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90
[ 851.560641] [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90
[ 851.560645] [<c014a152>] warn_slowpath_null+0x22/0x30
[ 851.560649] [<c04d94c8>] mmc_wait_for_cmd+0x88/0x90
[ 851.560655] [<c0401585>] ? device_release+0x25/0x80
[ 851.560660] [<c04df210>] mmc_io_rw_direct_host+0xa0/0x150
[ 851.560665] [<c04df370>] mmc_io_rw_direct+0x30/0x40
[ 851.560669] [<c04e06e7>] sdio_disable_func+0x37/0xa0
[ 851.560683] [<f8dfcb80>] b43_sdio_remove+0x30/0x50 [b43]
[ 851.560687] [<c04df8cc>] sdio_bus_remove+0x1c/0x60
[ 851.560692] [<c016d39f>] ? blocking_notifier_call_chain+0x1f/0x30
[ 851.560697] [<c0404991>] __device_release_driver+0x51/0xb0
[ 851.560701] [<c0404a7f>] driver_detach+0x8f/0xa0
[ 851.560705] [<c0403c83>] bus_remove_driver+0x63/0xa0
[ 851.560709] [<c0405039>] driver_unregister+0x49/0x80
[ 851.560713] [<c0405039>] ? driver_unregister+0x49/0x80
[ 851.560718] [<c04dfad7>] sdio_unregister_driver+0x17/0x20
[ 851.560727] [<f8dfcb42>] b43_sdio_exit+0x12/0x20 [b43]
[ 851.560734] [<f8dfe76f>] b43_exit+0x17/0x3c [b43]
[ 851.560740] [<c017fb8d>] sys_delete_module+0x13d/0x200
[ 851.560747] [<c01fd7d2>] ? do_munmap+0x212/0x300
[ 851.560752] [<c010311f>] sysenter_do_call+0x12/0x28
[ 851.560757] ---[ end trace 31e14488072d2f7d ]---
[ 851.560759] ------------[ cut here ]------------

The warning is caused by b43 not claiming the device before calling
sdio_disable_func().

Signed-off-by: Larry Finger <Larry....@lwfinger.net>
Reported-by: Arnd Hannemann <ar...@arndnet.de>
Tested-by: Arnd Hannemann <ar...@arndnet.de>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
Signed-off-by: Andi Kleen <a...@linux.intel.com>
---
drivers/net/wireless/b43/sdio.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/net/wireless/b43/sdio.c
+++ b/drivers/net/wireless/b43/sdio.c
@@ -174,7 +174,9 @@ static void b43_sdio_remove(struct sdio_
struct b43_sdio *sdio = sdio_get_drvdata(func);

ssb_bus_unregister(&sdio->ssb);
+ sdio_claim_host(func);
sdio_disable_func(func);
+ sdio_release_host(func);
kfree(sdio);
sdio_set_drvdata(func, NULL);

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Steven Rostedt <sros...@redhat.com>

commit 60d526f7fa6246b8e32d5b45610d625a5608d988 upstream.

When using gdb to debug perf, it is practically impossible to
use when perf is compiled with -O6. For developers, this patch
adds the DEBUG feature to the make command line so that a
developer can easily remove the optimization flag.

LKML-Reference: <1255590330.8392.446.camel@twins>
Signed-off-by: Steven Rostedt <ros...@goodmis.org>
Cc: Peter Zijlstra <pet...@infradead.org>


Cc: Frederic Weisbecker <fwei...@gmail.com>
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>

LKML-Reference: <200910202320...@goodmis.org>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -200,7 +200,14 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wol
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement

-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+ifeq ("$(origin DEBUG)", "command line")
+ PERF_DEBUG = $(DEBUG)
+endif
+ifndef PERF_DEBUG
+ CFLAGS_OPTIMIZE = -O6
+endif
+
+CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
LDFLAGS = -lpthread -lrt -lelf -lm


ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Justin P. Mattock <justin...@gmail.com>

commit e1741712e85cec8004c7eeeea81186618f78eff1 upstream.

Add the iMac9,1 and the MacBookPro2,2 temperature sensors to hwmon
driver applesmc to fix kernel bug #14429:
https://bugzilla.kernel.org/show_bug.cgi?id=14429

Signed-off-by: Justin P. Mattock <justin...@gmail.com>
Acked-by: Nicolas Boichat <nic...@boichat.ch>
Signed-off-by: Jean Delvare <kh...@linux-fr.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hwmon/applesmc.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -142,6 +142,12 @@ static const char *temperature_sensors_s
"TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S",
"TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S",
NULL },
+/* Set 17: iMac 9,1 */
+ { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TH0P", "TL0P",
+ "TN0D", "TN0H", "TN0P", "TO0P", "Tm0P", "Tp0P", NULL },
+/* Set 18: MacBook Pro 2,2 */
+ { "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "TM0P", "TTF0",
+ "Th0H", "Th1H", "Tm0P", "Ts0P", NULL },


};

/* List of keys used to read/write fan speeds */

@@ -1350,6 +1356,10 @@ static __initdata struct dmi_match_data
{ .accelerometer = 1, .light = 1, .temperature_set = 15 },
/* MacPro3,1: temperature set 16 */
{ .accelerometer = 0, .light = 0, .temperature_set = 16 },
+/* iMac 9,1: light sensor only, temperature set 17 */
+ { .accelerometer = 0, .light = 0, .temperature_set = 17 },
+/* MacBook Pro 2,2: accelerometer, backlight and temperature set 18 */
+ { .accelerometer = 1, .light = 1, .temperature_set = 18 },


};

/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".

@@ -1375,6 +1385,10 @@ static __initdata struct dmi_system_id a
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3") },
&applesmc_dmi_data[9]},
+ { applesmc_dmi_match, "Apple MacBook Pro 2,2", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple Computer, Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2") },
+ &applesmc_dmi_data[18]},
{ applesmc_dmi_match, "Apple MacBook Pro", {
DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") },
@@ -1415,6 +1429,10 @@ static __initdata struct dmi_system_id a
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
&applesmc_dmi_data[4]},
+ { applesmc_dmi_match, "Apple iMac 9,1", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1") },
+ &applesmc_dmi_data[17]},
{ applesmc_dmi_match, "Apple iMac 8", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") },

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Kyle McMartin <ky...@mcmartin.ca>

commit d11c7addfe0fa501cb54c824c0fac3481d527433 upstream.

For Fedora, I want to force perf to link against libiberty.a for
cplus_demangle, rather than libbfd.a for bfd_demangle due to licensing insanity
on binutils. (libiberty is LGPL2, libbfd is GPL3.)

If we just rely on autodetection, we'll end up with libbfd linked against us,
since they're both in binutils-static in the buildroot.

Cc: Ingo Molnar <mi...@elte.hu>
LKML-Reference: <2010051020...@bombadil.infradead.org>
Signed-off-by: Kyle McMartin <ky...@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 3 +++


1 file changed, 3 insertions(+)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -450,6 +450,9 @@ endif



ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE

+else ifdef HAVE_CPLUS_DEMANGLE
+ EXTLIBS += -liberty
+ BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
else
has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jesse Brandeburg <jesse.br...@intel.com>

commit e508be174ad36b0cf9b324cd04978c2b13c21502 upstream.

Several users report issues with 32-bit adapters when plugged
into PCI slots in machines with >= 4GB ram. In particular AMD
systems with HyperTransport to PCI bridges seem to trigger the
issue, but it isn't limited to only them.

This issue is not easily reproducible here, yet still continues
to occur in the field. For e1000 on PCI devices, just disable DMA
addresses over the 4GB boundary when in PCI (not PCI-X) mode, to
prevent the issue from continuing to pop up. The performance
impact for this is negligible.

The code was refactored to move the init of the hw struct to its
own function. This allows the init to be called very early in
probe, which then allows using hw-> members for this fix.

A slight refactor to the DMA mask code was done for minor
correctness based on the instructions in DMA-API-HOWTO.

Signed-off-by: Jesse Brandeburg <jesse.br...@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey....@intel.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/e1000/e1000_main.c | 162 +++++++++++++++++++++++------------------
1 file changed, 92 insertions(+), 70 deletions(-)

--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -790,6 +790,70 @@ static const struct net_device_ops e1000
};

/**
+ * e1000_init_hw_struct - initialize members of hw struct
+ * @adapter: board private struct
+ * @hw: structure used by e1000_hw.c
+ *
+ * Factors out initialization of the e1000_hw struct to its own function
+ * that can be called very early at init (just after struct allocation).
+ * Fields are initialized based on PCI device information and
+ * OS network device settings (MTU size).
+ * Returns negative error codes if MAC type setup fails.
+ */
+static int e1000_init_hw_struct(struct e1000_adapter *adapter,
+ struct e1000_hw *hw)
+{
+ struct pci_dev *pdev = adapter->pdev;
+
+ /* PCI config space info */
+ hw->vendor_id = pdev->vendor;
+ hw->device_id = pdev->device;
+ hw->subsystem_vendor_id = pdev->subsystem_vendor;
+ hw->subsystem_id = pdev->subsystem_device;
+ hw->revision_id = pdev->revision;
+
+ pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
+
+ hw->max_frame_size = adapter->netdev->mtu +
+ ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
+ hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
+
+ /* identify the MAC */
+ if (e1000_set_mac_type(hw)) {
+ DPRINTK(PROBE, ERR, "Unknown MAC Type\n");
+ return -EIO;
+ }
+
+ switch (hw->mac_type) {
+ default:
+ break;
+ case e1000_82541:
+ case e1000_82547:
+ case e1000_82541_rev_2:
+ case e1000_82547_rev_2:
+ hw->phy_init_script = 1;
+ break;
+ }
+
+ e1000_set_media_type(hw);
+ e1000_get_bus_info(hw);
+
+ hw->wait_autoneg_complete = false;
+ hw->tbi_compatibility_en = true;
+ hw->adaptive_ifs = true;
+
+ /* Copper options */
+
+ if (hw->media_type == e1000_media_type_copper) {
+ hw->mdix = AUTO_ALL_MODES;
+ hw->disable_polarity_correction = false;
+ hw->master_slave = E1000_MASTER_SLAVE;
+ }
+
+ return 0;
+}
+
+/**
* e1000_probe - Device Initialization Routine
* @pdev: PCI device information struct
* @ent: entry in e1000_pci_tbl
@@ -826,22 +890,6 @@ static int __devinit e1000_probe(struct
if (err)
return err;

- if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
- !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
- pci_using_dac = 1;
- } else {
- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
- if (err) {
- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
- if (err) {
- E1000_ERR("No usable DMA configuration, "
- "aborting\n");
- goto err_dma;
- }
- }
- pci_using_dac = 0;
- }
-
err = pci_request_selected_regions(pdev, bars, e1000_driver_name);
if (err)
goto err_pci_reg;
@@ -882,6 +930,32 @@ static int __devinit e1000_probe(struct
}
}

+ /* make ready for any if (hw->...) below */
+ err = e1000_init_hw_struct(adapter, hw);
+ if (err)
+ goto err_sw_init;
+
+ /*
+ * there is a workaround being applied below that limits
+ * 64-bit DMA addresses to 64-bit hardware. There are some
+ * 32-bit adapters that Tx hang when given 64-bit DMA addresses
+ */
+ pci_using_dac = 0;
+ if ((hw->bus_type == e1000_bus_type_pcix) &&
+ !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
+ /*
+ * according to DMA-API-HOWTO, coherent calls will always
+ * succeed if the set call did
+ */
+ pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+ pci_using_dac = 1;
+ } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
+ pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
+ } else {
+ E1000_ERR("No usable DMA configuration, aborting\n");
+ goto err_dma;
+ }
+
netdev->netdev_ops = &e1000_netdev_ops;
e1000_set_ethtool_ops(netdev);
netdev->watchdog_timeo = 5 * HZ;
@@ -956,8 +1030,6 @@ static int __devinit e1000_probe(struct
if (!is_valid_ether_addr(netdev->perm_addr))
DPRINTK(PROBE, ERR, "Invalid MAC Address\n");

- e1000_get_bus_info(hw);
-
init_timer(&adapter->tx_fifo_stall_timer);
adapter->tx_fifo_stall_timer.function = &e1000_82547_tx_fifo_stall;
adapter->tx_fifo_stall_timer.data = (unsigned long)adapter;
@@ -1070,6 +1142,7 @@ err_eeprom:
iounmap(hw->flash_address);
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
+err_dma:
err_sw_init:
iounmap(hw->hw_addr);
err_ioremap:
@@ -1077,7 +1150,6 @@ err_ioremap:
err_alloc_etherdev:
pci_release_selected_regions(pdev, bars);
err_pci_reg:
-err_dma:
pci_disable_device(pdev);
return err;
}
@@ -1129,62 +1201,12 @@ static void __devexit e1000_remove(struc
* @adapter: board private structure to initialize
*
* e1000_sw_init initializes the Adapter private data structure.
- * Fields are initialized based on PCI device information and
- * OS network device settings (MTU size).
+ * e1000_init_hw_struct MUST be called before this function
**/

static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
{
- struct e1000_hw *hw = &adapter->hw;
- struct net_device *netdev = adapter->netdev;
- struct pci_dev *pdev = adapter->pdev;
-
- /* PCI config space info */
-
- hw->vendor_id = pdev->vendor;
- hw->device_id = pdev->device;
- hw->subsystem_vendor_id = pdev->subsystem_vendor;
- hw->subsystem_id = pdev->subsystem_device;
- hw->revision_id = pdev->revision;
-
- pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
-
adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
- hw->max_frame_size = netdev->mtu +
- ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
- hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
-
- /* identify the MAC */
-
- if (e1000_set_mac_type(hw)) {
- DPRINTK(PROBE, ERR, "Unknown MAC Type\n");
- return -EIO;
- }
-
- switch (hw->mac_type) {
- default:
- break;
- case e1000_82541:
- case e1000_82547:
- case e1000_82541_rev_2:
- case e1000_82547_rev_2:
- hw->phy_init_script = 1;
- break;
- }
-
- e1000_set_media_type(hw);
-
- hw->wait_autoneg_complete = false;
- hw->tbi_compatibility_en = true;
- hw->adaptive_ifs = true;
-
- /* Copper options */
-
- if (hw->media_type == e1000_media_type_copper) {
- hw->mdix = AUTO_ALL_MODES;
- hw->disable_polarity_correction = false;
- hw->master_slave = E1000_MASTER_SLAVE;
- }

adapter->num_tx_queues = 1;
adapter->num_rx_queues = 1;

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Eric Dumazet <eric.d...@gmail.com>

commit 9915672d41273f5b77f1b3c29b391ffb7732b84b upstream.

Vegard Nossum found a unix socket OOM was possible, posting an exploit
program.

My analysis is we can eat all LOWMEM memory before unix_gc() being
called from unix_release_sock(). Moreover, the thread blocked in
unix_gc() can consume huge amount of time to perform cleanup because of
huge working set.

One way to handle this is to have a sensible limit on unix_tot_inflight,
tested from wait_for_unix_gc() and to force a call to unix_gc() if this
limit is hit.

This solves the OOM and also reduce overall latencies, and should not
slowdown normal workloads.

Reported-by: Vegard Nossum <vegard...@gmail.com>
Signed-off-by: Eric Dumazet <eric.d...@gmail.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

net/unix/garbage.c | 7 +++++++
1 file changed, 7 insertions(+)

--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -269,9 +269,16 @@ static void inc_inflight_move_tail(struc
}

static bool gc_in_progress = false;
+#define UNIX_INFLIGHT_TRIGGER_GC 16000

void wait_for_unix_gc(void)
{
+ /*
+ * If number of inflight sockets is insane,
+ * force a garbage collect right now.
+ */
+ if (unix_tot_inflight > UNIX_INFLIGHT_TRIGGER_GC && !gc_in_progress)
+ unix_gc();
wait_event(unix_gc_wait, gc_in_progress == false);

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Maxim Levitsky <maximl...@gmail.com>

commit 4c2ef25fe0b847d2ae818f74758ddb0be1c27d8e upstream.

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change the
behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk, without
the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen, Therefore
if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
suspend, the removal will be detected as soon as userspace is unfrozen,
again at the moment it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

[ak...@linux-foundation.org: clean up function prototype]
[ak...@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
[ak...@linux-foundation.org: coding-style fixes]
Signed-off-by: Maxim Levitsky <maximl...@gmail.com>
Cc: David Brownell <dav...@pacbell.net>
Cc: Alan Stern <st...@rowland.harvard.edu>
Cc: <linu...@vger.kernel.org>
Signed-off-by: Andrew Morton <ak...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torv...@linux-foundation.org>
[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/mmc/core/core.c | 81 ++++++++++++++++++++++++++++++++---------------
drivers/mmc/core/host.c | 4 ++
include/linux/mmc/host.h | 3 +
3 files changed, 63 insertions(+), 25 deletions(-)

--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1041,6 +1041,17 @@ void mmc_rescan(struct work_struct *work
container_of(work, struct mmc_host, detect.work);
u32 ocr;
int err;
+ unsigned long flags;
+
+ spin_lock_irqsave(&host->lock, flags);
+
+ if (host->rescan_disable) {
+ spin_unlock_irqrestore(&host->lock, flags);
+ return;
+ }
+
+ spin_unlock_irqrestore(&host->lock, flags);
+

mmc_bus_get(host);

@@ -1247,18 +1258,6 @@ int mmc_suspend_host(struct mmc_host *ho
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->suspend)
err = host->bus_ops->suspend(host);
- if (err == -ENOSYS || !host->bus_ops->resume) {
- /*
- * We simply "remove" the card in this case.
- * It will be redetected on resume.
- */
- if (host->bus_ops->remove)
- host->bus_ops->remove(host);
- mmc_claim_host(host);
- mmc_detach_bus(host);
- mmc_release_host(host);
- err = 0;
- }
}
mmc_bus_put(host);

@@ -1288,28 +1287,60 @@ int mmc_resume_host(struct mmc_host *hos
printk(KERN_WARNING "%s: error %d during resume "
"(card was removed?)\n",
mmc_hostname(host), err);
- if (host->bus_ops->remove)
- host->bus_ops->remove(host);
- mmc_claim_host(host);
- mmc_detach_bus(host);
- mmc_release_host(host);
- /* no need to bother upper layers */
err = 0;
}
}
mmc_bus_put(host);

- /*
- * We add a slight delay here so that resume can progress
- * in parallel.
- */
- mmc_detect_change(host, 1);
-
return err;
}
-
EXPORT_SYMBOL(mmc_resume_host);

+/* Do the card removal on suspend if card is assumed removeable
+ * Do that in pm notifier while userspace isn't yet frozen, so we will be able
+ to sync the card.
+*/
+int mmc_pm_notify(struct notifier_block *notify_block,
+ unsigned long mode, void *unused)
+{
+ struct mmc_host *host = container_of(
+ notify_block, struct mmc_host, pm_notify);
+ unsigned long flags;
+
+
+ switch (mode) {
+ case PM_HIBERNATION_PREPARE:
+ case PM_SUSPEND_PREPARE:
+
+ spin_lock_irqsave(&host->lock, flags);
+ host->rescan_disable = 1;
+ spin_unlock_irqrestore(&host->lock, flags);
+ cancel_delayed_work_sync(&host->detect);
+
+ if (!host->bus_ops || host->bus_ops->suspend)
+ break;
+
+ mmc_claim_host(host);
+
+ if (host->bus_ops->remove)
+ host->bus_ops->remove(host);
+
+ mmc_detach_bus(host);
+ mmc_release_host(host);
+ break;
+
+ case PM_POST_SUSPEND:
+ case PM_POST_HIBERNATION:
+
+ spin_lock_irqsave(&host->lock, flags);
+ host->rescan_disable = 0;
+ spin_unlock_irqrestore(&host->lock, flags);
+ mmc_detect_change(host, 0);
+


+ }
+
+ return 0;
+}

#endif

static int __init mmc_init(void)
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -16,6 +16,7 @@
#include <linux/idr.h>
#include <linux/pagemap.h>
#include <linux/leds.h>
+#include <linux/suspend.h>

#include <linux/mmc/host.h>

@@ -84,6 +85,7 @@ struct mmc_host *mmc_alloc_host(int extr
init_waitqueue_head(&host->wq);
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
INIT_DELAYED_WORK_DEFERRABLE(&host->disable, mmc_host_deeper_disable);
+ host->pm_notify.notifier_call = mmc_pm_notify;

/*
* By default, hosts do not support SGIO or large requests.
@@ -132,6 +134,7 @@ int mmc_add_host(struct mmc_host *host)
#endif

mmc_start_host(host);
+ register_pm_notifier(&host->pm_notify);

return 0;
}
@@ -148,6 +151,7 @@ EXPORT_SYMBOL(mmc_add_host);
*/
void mmc_remove_host(struct mmc_host *host)
{
+ unregister_pm_notifier(&host->pm_notify);
mmc_stop_host(host);

#ifdef CONFIG_DEBUG_FS
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -120,6 +120,7 @@ struct mmc_host {
unsigned int f_min;
unsigned int f_max;
u32 ocr_avail;
+ struct notifier_block pm_notify;

#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */
@@ -177,6 +178,7 @@ struct mmc_host {

/* Only used with MMC_CAP_DISABLE */
int enabled; /* host is enabled */
+ int rescan_disable; /* disable card detection */
int nesting_cnt; /* "enable" nesting count */
int en_dis_recurs; /* detect recursion */
unsigned int disable_delay; /* disable delay in msecs */
@@ -249,6 +251,7 @@ int mmc_card_can_sleep(struct mmc_host *
int mmc_host_enable(struct mmc_host *host);
int mmc_host_disable(struct mmc_host *host);
int mmc_host_lazy_disable(struct mmc_host *host);
+int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *);

static inline void mmc_set_disable_delay(struct mmc_host *host,
unsigned int disable_delay)

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael Cree <mc...@orcon.net.nz>

commit 5d7bdab75cd56d2bdc0986ae5546be3b09fea70a upstream.

Some architectures (e.g. Alpha) do not support the
-fstack-protector-all compiler option and the use of the option
with -Werror causes the compiler to abort and the build fails.

Test that the compiler supports -fstack-protector-all before
inclusion in CFLAGS.

Signed-off-by: Michael Cree <mc...@orcon.net.nz>
Cc: Richard Henderson <r...@twiddle.net>
Cc: Ivan Kokshaysky <i...@jurassic.park.msu.ru>


Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>

LKML-Reference: <20091111074302.GA3728@omega>
Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -207,7 +207,7 @@ ifndef PERF_DEBUG
CFLAGS_OPTIMIZE = -O6
endif

-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)


LDFLAGS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)

@@ -261,6 +261,9 @@ PTHREAD_LIBS = -lpthread
# explicitly what architecture to check for. Fix this up for yours..
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__

+ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
+ CFLAGS := $(CFLAGS) -fstack-protector-all
+endif


### --- END CONFIGURATION SECTION ---

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Gertjan van Wingerde <gwin...@gmail.com>

commit 7a4a77b7771164d61ce702a588067d1e1d66db7c upstream.

Current rt2x00 drivers may result in a "ieee80211_tx_status: headroom too
small" error message when a frame needs to be properly aligned before
transmitting it.
This is because the space needed to ensure proper alignment isn't
requested from mac80211.
Fix this by adding sufficient amount of alignment space to the amount
of headroom requested for TX frames.

Reported-by: David Ellingsworth <da...@identd.dyndns.org>


Signed-off-by: Gertjan van Wingerde <gwin...@gmail.com>

Acked-by: Ivo van Doorn <ivd...@gmail.com>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/wireless/rt2x00/rt2x00.h | 6 ++++++
drivers/net/wireless/rt2x00/rt2x00dev.c | 12 +++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -112,6 +112,12 @@
( ((unsigned long)((__skb)->data + (__header))) & 3 )

/*
+ * Constants for extra TX headroom for alignment purposes.
+ */
+#define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */
+#define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */
+
+/*
* Standard timing and size defines.
* These values should follow the ieee80211 specifications.
*/
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2
/*
* Initialize extra TX headroom required.
*/
- rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom;
+ rt2x00dev->hw->extra_tx_headroom =
+ max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM,
+ rt2x00dev->ops->extra_tx_headroom);
+
+ /*
+ * Take TX headroom required for alignment into account.
+ */
+ if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
+ rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE;
+ else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
+ rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;

/*
* Register HW.

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Edgar (gimli) Hucek <gi...@dark-green.com>

commit bd760e1e5b34351e0705705e5163cb89c1316d71 upstream.

Add support for the MacBookAir3,1 and MacBookAir3,2 to the mbp-nvidia-bl
driver.

Signed-off-by: Edgar (gimli) Hucek <gi...@dark-green.com>

Acked-by: Richard Purdie <rpu...@linux.intel.com>


Signed-off-by: Andrew Morton <ak...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torv...@linux-foundation.org>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/video/backlight/mbp_nvidia_bl.c | 18 ++++++++++++++++++


1 file changed, 18 insertions(+)

--- a/drivers/video/backlight/mbp_nvidia_bl.c
+++ b/drivers/video/backlight/mbp_nvidia_bl.c
@@ -272,6 +272,24 @@ static const struct dmi_system_id __init
},
.driver_data = (void *)&nvidia_chipset_data,
},
+ {
+ .callback = mbp_dmi_match,
+ .ident = "MacBookAir 3,1",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3,1"),
+ },
+ .driver_data = (void *)&nvidia_chipset_data,
+ },
+ {
+ .callback = mbp_dmi_match,
+ .ident = "MacBookAir 3,2",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3,2"),
+ },
+ .driver_data = (void *)&nvidia_chipset_data,
+ },
{ }
};

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Arnaldo Carvalho de Melo <ac...@redhat.com>

commit 1703f2c321a8a531c393e137a82602e16c6061cb upstream.

At least on Debian PARISC64, using:

acme@parisc:~/git/linux-2.6-tip$ gcc -v
Using built-in specs.
Target: hppa-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.3.4-6' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --disable-libssp --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu Thread model: posix gcc version 4.3.4 (Debian 4.3.4-6)

there are issues about using 'gcc -o /dev/null':

/usr/bin/ld: final link failed: File truncated
collect2: ld returned 1 exit status

So we test that and use /dev/null in environments where it
works, while using an .INTERMEDIATE file on those where it can't
be used, so that the .perf.dev.null file can be used instead and
then deleted when make exits.

Researched-with: Kyle McMartin <ky...@mcmartin.ca>
Researched-with: Mauro Carvalho Chehab <mch...@redhat.com>


Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>

Cc: Frédéric Weisbecker <fwei...@gmail.com>
Cc: Mike Galbraith <efa...@gmx.de>


Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>

LKML-Reference: <1263293910-8484-2-...@infradead.org>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -258,7 +258,13 @@ else
QUIET_STDERR = ">/dev/null 2>&1"
endif

-ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
+BITBUCKET = "/dev/null"
+
+ifneq ($(shell sh -c "(echo '\#include <stdio.h>'; echo 'int main(void) { return puts(\"hi\"); }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y)
+ BITBUCKET = .perf.dev.null
+endif
+
+ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y)
CFLAGS := $(CFLAGS) -fstack-protector-all
endif

@@ -430,12 +436,12 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
endif

-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
endif

-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
- ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)


BASIC_CFLAGS += -DLIBELF_NO_MMAP
endif
else

@@ -445,20 +451,20 @@ endif


ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE

else
- has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
+ has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")



ifeq ($(has_bfd),y)
EXTLIBS += -lbfd
else

- has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
+ has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")


ifeq ($(has_bfd_iberty),y)
EXTLIBS += -lbfd -liberty
else

- has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
+ has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")


ifeq ($(has_bfd_iberty_z),y)
EXTLIBS += -lbfd -liberty -lz
else

- has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
+ has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")


ifeq ($(has_cplus_demangle),y)
EXTLIBS += -liberty
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE

@@ -706,7 +712,7 @@ export TAR INSTALL DESTDIR SHELL_PATH

SHELL = $(SHELL_PATH)

-all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS
+all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS
ifneq (,$X)
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
endif
@@ -1009,6 +1015,11 @@ clean:
.PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS
.PHONY: .FORCE-PERF-BUILD-OPTIONS

+.perf.dev.null:
+ touch .perf.dev.null
+
+.INTERMEDIATE: .perf.dev.null
+
### Make sure built-ins do not have dups and listed in perf.c
#
check-builtins::

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Edgar (gimli) Hucek <gi...@dark-green.com>

commit 3e3ede7dda2d77d2cbec608e663b6a6ace501bfc upstream.

Adding the new MacBookAir3,1(2) to btusb.

Output without the patch and btusb loaded :

T: Bus=03 Lev=02 Prnt=03 Port=02 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=05ac ProdID=821b Rev= 0.34
S: Manufacturer=Apple Inc.
S: Product=Bluetooth USB Host Controller
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 32 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 32 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 64 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 64 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=83(I) Atr=01(Isoc) MxPS= 64 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 64 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=84(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Output with the patch and btusb loaded :

T: Bus=03 Lev=02 Prnt=03 Port=02 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=05ac ProdID=821b Rev= 0.34
S: Manufacturer=Apple Inc.
S: Product=Bluetooth USB Host Controller
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 32 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 32 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 64 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 64 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 64 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 64 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=84(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Signed-off-by: Edgar (gimli) Hucek <gi...@dark-green.com>

Acked-by: Marcel Holtmann <mar...@holtmann.org>
Signed-off-by: Gustavo F. Padovan <pad...@profusion.mobi>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/bluetooth/btusb.c | 3 +++


1 file changed, 3 insertions(+)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -68,6 +68,9 @@ static struct usb_device_id btusb_table[
/* Apple MacBookPro6,2 */
{ USB_DEVICE(0x05ac, 0x8218) },

+ /* Apple MacBookAir3,1, MacBookAir3,2 */
+ { USB_DEVICE(0x05ac, 0x821b) },
+
/* Apple MacBookPro8,2 */
{ USB_DEVICE(0x05ac, 0x821a) },

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Takashi Iwai <ti...@suse.de>

commit f46119b73425df9d1e05c5d5e909a993d95b0218 upstream.

Reference: Novell bnc#645066
https://bugzilla.novell.com/show_bug.cgi?id=645066

Signed-off-by: Takashi Iwai <ti...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

sound/pci/hda/patch_cirrus.c | 1 +
1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1091,6 +1091,7 @@ static const char *cs420x_models[CS420X_


static struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),

SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),

+ SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),


SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),

{} /* terminator */
};

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Rezwanul Kabir <Rezwanu...@dell.com>

commit 410d44c74cf9942e3055d5b7d73953fac8efbacb upstream.

This is to support Precision M4500 and others.

Signed-off-by: Rezwanul Kabir <Rezwanu...@dell.com>
Signed-off-by: Matthew Garrett <m...@redhat.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/platform/x86/dell-laptop.c | 7 +++++++


1 file changed, 7 insertions(+)

--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -72,6 +72,12 @@ static const struct dmi_system_id __init
},
},
{
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /*Laptop*/
+ },
+ },
+ {
.ident = "Dell Computer Corporation",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
@@ -404,4 +410,5 @@ MODULE_AUTHOR("Matthew Garrett <mjg@redh
MODULE_DESCRIPTION("Dell laptop driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("dmi:*svnDellInc.:*:ct8:*");
+MODULE_ALIAS("dmi:*svnDellInc.:*:ct9:*");
MODULE_ALIAS("dmi:*svnDellComputerCorporation.:*:ct8:*");

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Nobuhiro Iwamatsu <iwam...@nigauri.org>

commit 9c047157a20521cd525527947b13b950d168d2e6 upstream.

Bluetooth controller of MacbookPro 6,2 does not work.
Because Device Class of these controllers was set 255 (Vendor Sepecific Class).

T: Bus=01 Lev=03 Prnt=03 Port=02 Cnt=03 Dev#= 8 Spd=12 MxCh= 0


D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1

P: Vendor=05ac ProdID=8218 Rev=00.22


S: Manufacturer=Apple Inc.
S: Product=Bluetooth USB Host Controller

C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Signed-off-by: Nobuhiro Iwamatsu <iwam...@nigauri.org>


Acked-by: Marcel Holtmann <mar...@holtmann.org>
Signed-off-by: Gustavo F. Padovan <pad...@profusion.mobi>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -62,6 +62,9 @@ static struct usb_device_id btusb_table[
/* Apple iMac11,1 */
{ USB_DEVICE(0x05ac, 0x8215) },

+ /* Apple MacBookPro6,2 */
+ { USB_DEVICE(0x05ac, 0x8218) },
+


/* Apple MacBookPro8,2 */
{ USB_DEVICE(0x05ac, 0x821a) },

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Randy Dunlap <randy....@oracle.com>

commit 1abc7f5500fff8422f34826a006648d8741d83d3 upstream.

Check for libelf headers and glibc headers separately so that
the error message correctly identifies which package
installation is missing/needed.

Signed-off-by: Randy Dunlap <randy....@oracle.com>
Cc: pau...@samba.org
Cc: a.p.zi...@chello.nl
Cc: efa...@gmx.de
Cc: fwei...@gmail.com
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>
LKML-Reference: <4ADBCCE8...@oracle.com>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -423,12 +423,16 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
endif

+ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+endif
+
ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)


BASIC_CFLAGS += -DLIBELF_NO_MMAP
endif
else

- msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
+ msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
endif

ifdef NO_DEMANGLE

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Phil Blundell <ph...@gnu.org>

commit a27e13d370415add3487949c60810e36069a23a6 upstream.

Don't declare variable sized array of iovecs on the stack since this
could cause stack overflow if msg->msgiovlen is large. Instead, coalesce
the user-supplied data into a new buffer and use a single iovec for it.

Signed-off-by: Phil Blundell <ph...@gnu.org>


Signed-off-by: David S. Miller <da...@davemloft.net>

[Adjusted to apply to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

net/econet/af_econet.c | 62 ++++++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 31 deletions(-)

--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -30,6 +30,7 @@
#include <linux/wireless.h>
#include <linux/skbuff.h>
#include <linux/udp.h>
+#include <linux/vmalloc.h>
#include <net/sock.h>
#include <net/inet_common.h>
#include <linux/stat.h>
@@ -275,12 +276,12 @@ static int econet_sendmsg(struct kiocb *
#endif
#ifdef CONFIG_ECONET_AUNUDP
struct msghdr udpmsg;
- struct iovec iov[msg->msg_iovlen+1];
+ struct iovec iov[2];
struct aunhdr ah;
struct sockaddr_in udpdest;
__kernel_size_t size;
- int i;
mm_segment_t oldfs;
+ char *userbuf;
#endif

/*
@@ -318,17 +319,17 @@ static int econet_sendmsg(struct kiocb *
}
}

- if (len + 15 > dev->mtu) {
- mutex_unlock(&econet_mutex);
- return -EMSGSIZE;
- }
-
if (dev->type == ARPHRD_ECONET) {
/* Real hardware Econet. We're not worthy etc. */
#ifdef CONFIG_ECONET_NATIVE
unsigned short proto = 0;
int res;

+ if (len + 15 > dev->mtu) {
+ mutex_unlock(&econet_mutex);
+ return -EMSGSIZE;
+ }
+
dev_hold(dev);

skb = sock_alloc_send_skb(sk, len+LL_ALLOCATED_SPACE(dev),
@@ -404,6 +405,11 @@ static int econet_sendmsg(struct kiocb *
return -ENETDOWN; /* No socket - can't send */
}

+ if (len > 32768) {
+ err = -E2BIG;
+ goto error;
+ }
+
/* Make up a UDP datagram and hand it off to some higher intellect. */

memset(&udpdest, 0, sizeof(udpdest));
@@ -435,36 +441,26 @@ static int econet_sendmsg(struct kiocb *

/* tack our header on the front of the iovec */
size = sizeof(struct aunhdr);
- /*
- * XXX: that is b0rken. We can't mix userland and kernel pointers
- * in iovec, since on a lot of platforms copy_from_user() will
- * *not* work with the kernel and userland ones at the same time,
- * regardless of what we do with set_fs(). And we are talking about
- * econet-over-ethernet here, so "it's only ARM anyway" doesn't
- * apply. Any suggestions on fixing that code? -- AV
- */
iov[0].iov_base = (void *)&ah;
iov[0].iov_len = size;
- for (i = 0; i < msg->msg_iovlen; i++) {
- void __user *base = msg->msg_iov[i].iov_base;
- size_t iov_len = msg->msg_iov[i].iov_len;
- /* Check it now since we switch to KERNEL_DS later. */
- if (!access_ok(VERIFY_READ, base, iov_len)) {
- mutex_unlock(&econet_mutex);
- return -EFAULT;
- }
- iov[i+1].iov_base = base;
- iov[i+1].iov_len = iov_len;
- size += iov_len;
+
+ userbuf = vmalloc(len);
+ if (userbuf == NULL) {
+ err = -ENOMEM;
+ goto error;
}

+ iov[1].iov_base = userbuf;
+ iov[1].iov_len = len;
+ err = memcpy_fromiovec(userbuf, msg->msg_iov, len);
+ if (err)
+ goto error_free_buf;
+
/* Get a skbuff (no data, just holds our cb information) */
if ((skb = sock_alloc_send_skb(sk, 0,
msg->msg_flags & MSG_DONTWAIT,
- &err)) == NULL) {
- mutex_unlock(&econet_mutex);
- return err;
- }
+ &err)) == NULL)
+ goto error_free_buf;

eb = (struct ec_cb *)&skb->cb;

@@ -480,7 +476,7 @@ static int econet_sendmsg(struct kiocb *
udpmsg.msg_name = (void *)&udpdest;
udpmsg.msg_namelen = sizeof(udpdest);
udpmsg.msg_iov = &iov[0];
- udpmsg.msg_iovlen = msg->msg_iovlen + 1;
+ udpmsg.msg_iovlen = 2;
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags=0;
@@ -488,9 +484,13 @@ static int econet_sendmsg(struct kiocb *
oldfs = get_fs(); set_fs(KERNEL_DS); /* More privs :-) */
err = sock_sendmsg(udpsock, &udpmsg, size);
set_fs(oldfs);
+
+error_free_buf:
+ vfree(userbuf);
#else
err = -EPROTOTYPE;
#endif
+ error:
mutex_unlock(&econet_mutex);

return err;

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <m...@redhat.com>

commit 7baed9af4bf0d7850045e36d19a43a2c76872b62 upstream.

Make standard error show up on console when V=2 is set.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>

Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>

Cc: Frederic Weisbecker <fwei...@gmail.com>


Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>

LKML-Reference: <20091122112...@redhat.com>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -2,6 +2,7 @@
all::

# Define V=1 to have a more verbose compile.
+# Define V=2 to have an even more verbose compile.
#
# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
# or vsnprintf() return -1 instead of number of characters which would
@@ -263,7 +264,7 @@ PTHREAD_LIBS = -lpthread


# explicitly what architecture to check for. Fix this up for yours..
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__

-ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
+ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)


CFLAGS := $(CFLAGS) -fstack-protector-all
endif

@@ -408,6 +409,11 @@ BUILTIN_OBJS += builtin-trace.o

PERFLIBS = $(LIB_FILE)

+ifeq ($(V), 2)
+ QUIET_STDERR = ">/dev/null"
+else
+ QUIET_STDERR = ">/dev/null 2>&1"
+endif
#
# Platform specific tweaks
#
@@ -435,12 +441,12 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
endif

-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)


msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);

endif

-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
- ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)


BASIC_CFLAGS += -DLIBELF_NO_MMAP
endif
else

@@ -450,20 +456,20 @@ endif


ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE
else

- has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd > /dev/null 2>&1 && echo y")
+ has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")



ifeq ($(has_bfd),y)
EXTLIBS += -lbfd
else

- has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty > /dev/null 2>&1 && echo y")
+ has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")


ifeq ($(has_bfd_iberty),y)
EXTLIBS += -lbfd -liberty
else

- has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
+ has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")


ifeq ($(has_bfd_iberty_z),y)
EXTLIBS += -lbfd -liberty -lz
else

- has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty > /dev/null 2>&1 && echo y")
+ has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")


ifeq ($(has_cplus_demangle),y)
EXTLIBS += -liberty
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <m...@redhat.com>

commit b197c7ef7169bd5f11fb9d803b322d0daef7e256 upstream.

On error, suggest installing static libraries
along with shared libraries.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Frederic Weisbecker <fwei...@gmail.com>
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>

LKML-Reference: <20091122131...@redhat.com>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -442,7 +442,7 @@ ifeq ($(uname_S),Darwin)
endif



ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)

- msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+ msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
endif



ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)

@@ -474,7 +474,7 @@ else


EXTLIBS += -liberty
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE

else
- msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
+ msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
BASIC_CFLAGS += -DNO_DEMANGLE
endif
endif

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <m...@redhat.com>

commit 81516c5fc83a13a1d12f466aa7e14f5fd62a63ce upstream.

gcc with no flags typically is a sane default for systems to
use, and looking at the running kernel is probably broken for
cross-builds anyway, so let's not do this. Add EXTRA_CFLAGS so
that users can override default gcc mode if they want to.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>

Acked-by: Arjan van de Ven <ar...@infradead.org>


Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Frederic Weisbecker <fwei...@gmail.com>
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>

LKML-Reference: <20091122121...@redhat.com>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -148,6 +148,8 @@ all::


# broken, or spawning external process is slower than built-in grep perf has).

#


# Define LDFLAGS=-static to build a static binary.

+#
+# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.

PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
@$(SHELL_PATH) util/PERF-VERSION-GEN
@@ -160,20 +162,6 @@ uname_R := $(shell sh -c 'uname -r 2>/de
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')

-#
-# Add -m32 for cross-builds:
-#
-ifdef NO_64BIT
- MBITS := -m32
-else
- #
- # If we're on a 64-bit kernel, use -m64:
- #
- ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
- MBITS := -m64
- endif
-endif
-
# CFLAGS and LDFLAGS are for the users to override from the command line.

#
@@ -210,7 +198,7 @@ ifndef PERF_DEBUG
CFLAGS_OPTIMIZE = -O6
endif

-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
EXTLIBS = -lpthread -lrt -lelf -lm


ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)

Greg KH

unread,
May 5, 2011, 8:50:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Vince Weaver <vwea...@eecs.utk.edu>

commit 4e7d7c6018567fa03f387d06602d4145c75ebbe0 upstream.

I've found the following patch is necessary to enable line-in on
my MacBookPro 5,3 machine. With the patch applied I've successfully
recorded audio from the line-in jack. This is based on the existing
5,5 support.

Signed-off-by: Vince Weaver <vwea...@eecs.utk.edu>
Signed-off-by: Takashi Iwai <ti...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

sound/pci/hda/patch_cirrus.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -65,6 +65,7 @@ struct cs_spec {

/* available models */
enum {
+ CS420X_MBP53,
CS420X_MBP55,
CS420X_IMAC27,
CS420X_AUTO,
@@ -833,7 +834,8 @@ static void cs_automute(struct hda_codec
AC_VERB_SET_PIN_WIDGET_CONTROL,
hp_present ? 0 : PIN_OUT);
}
- if (spec->board_config == CS420X_MBP55 ||
+ if (spec->board_config == CS420X_MBP53 ||
+ spec->board_config == CS420X_MBP55 ||
spec->board_config == CS420X_IMAC27) {
unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0,
@@ -1079,6 +1081,7 @@ static int cs_parse_auto_config(struct h
}

static const char *cs420x_models[CS420X_MODELS] = {
+ [CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27",
[CS420X_AUTO] = "auto",
@@ -1086,6 +1089,7 @@ static const char *cs420x_models[CS420X_




static struct snd_pci_quirk cs420x_cfg_tbl[] = {

+ SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),


SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),

SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
{} /* terminator */

@@ -1096,6 +1100,20 @@ struct cs_pincfg {
u32 val;
};

+static struct cs_pincfg mbp53_pincfgs[] = {
+ { 0x09, 0x012b4050 },
+ { 0x0a, 0x90100141 },
+ { 0x0b, 0x90100140 },
+ { 0x0c, 0x018b3020 },
+ { 0x0d, 0x90a00110 },
+ { 0x0e, 0x400000f0 },
+ { 0x0f, 0x01cbe030 },
+ { 0x10, 0x014be060 },
+ { 0x12, 0x400000f0 },
+ { 0x15, 0x400000f0 },
+ {} /* terminator */
+};
+
static struct cs_pincfg mbp55_pincfgs[] = {
{ 0x09, 0x012b4030 },
{ 0x0a, 0x90100121 },
@@ -1125,6 +1143,7 @@ static struct cs_pincfg imac27_pincfgs[]
};

static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
+ [CS420X_MBP53] = mbp53_pincfgs,
[CS420X_MBP55] = mbp55_pincfgs,
[CS420X_IMAC27] = imac27_pincfgs,
};
@@ -1157,6 +1176,7 @@ static int patch_cs420x(struct hda_codec

switch (spec->board_config) {
case CS420X_IMAC27:
+ case CS420X_MBP53:
case CS420X_MBP55:
/* GPIO1 = headphones */
/* GPIO3 = speakers */

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Mike Christie <mich...@cs.wisc.edu>

commit 5738d4449c1baf05e8345684d12371f76296473d upstream.

blk_get_request sets the cmd_flags, so we should not and do not
need to set them. If we did set them to a different value then
it can cause a oops in the elevator code.

Signed-off-by: Mike Christie <mich...@cs.wisc.edu>
Signed-off-by: James Bottomley <James.B...@suse.de>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/scsi/device_handler/scsi_dh_emc.c | 2 --
1 file changed, 2 deletions(-)

--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -284,13 +284,11 @@ static struct request *get_req(struct sc
switch (cmd) {
case MODE_SELECT:
len = sizeof(short_trespass);
- rq->cmd_flags |= REQ_RW;


rq->cmd[1] = 0x10;

rq->cmd[4] = len;
break;
case MODE_SELECT_10:
len = sizeof(long_trespass);

- rq->cmd_flags |= REQ_RW;


rq->cmd[1] = 0x10;

rq->cmd[8] = len;
break;

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Erik Andren <erik....@gmail.com>

commit cb6a7937f4328a267e0806680ade500ed2c3c01a upstream.

The Latitude C640 has another variation of dell in its DMI vendor entry.
Add it to the whitelist in order to enjoy the sweet fruits of software
backlight toggling.

Signed-off-by: Erik Andren <erik....@gmail.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/platform/x86/dell-laptop.c | 8 ++++++++
1 file changed, 8 insertions(+)

--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -71,6 +71,13 @@ static const struct dmi_system_id __init
DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
},
},
+ {


+ .ident = "Dell Computer Corporation",

+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+ DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
+ },
+ },
{ }
};

@@ -397,3 +404,4 @@ MODULE_AUTHOR("Matthew Garrett <mjg@redh


MODULE_DESCRIPTION("Dell laptop driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("dmi:*svnDellInc.:*:ct8:*");

+MODULE_ALIAS("dmi:*svnDellComputerCorporation.:*:ct8:*");

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ron Murray <rj...@rjmx.net>

commit 60abe78279568a7109db2bcbc71131766a91c2e5 upstream.

Please add support for Microsoft MN-120 PCMCIA network card. It's an
old card, I know, but adding support is very easy. You just need to
get tulip_core.c to recognise its vendor/device ID.

Patch for kernel 2.6.32.4 (and many previous) attached.

.....Ron Murray

Signed-off-by: Ron Murray <rj...@rjmx.net>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/tulip/tulip_core.c | 1 +


1 file changed, 1 insertion(+)

--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -249,6 +249,7 @@ static struct pci_device_id tulip_pci_tb
{ 0x17B3, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ 0x10b7, 0x9300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, /* 3Com 3CSOHO100B-TX */
{ 0x14ea, 0xab08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, /* Planex FNW-3602-TX */
+ { 0x1414, 0x0001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, /* Microsoft MN-120 */
{ 0x1414, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ } /* terminate list */

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Rusty Russell <ru...@rustcorp.com.au>

commit 58eba97d0774c69b1cf3e5a8ac74419409d1abbf upstream.

virtio net will never try to overflow the TX ring, so the only reason
add_buf may fail is out of memory. Thus, we can not stop the
device until some request completes - there's no guarantee anything
at all is outstanding.

Make the error message clearer as well: error here does not
indicate queue full.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>

Signed-off-by: Rusty Russell <ru...@rustcorp.com.au>


Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/virtio_net.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -525,7 +525,6 @@ static netdev_tx_t start_xmit(struct sk_
struct virtnet_info *vi = netdev_priv(dev);
int capacity;

-again:
/* Free up any pending old buffers before queueing new ones. */
free_old_xmit_skbs(vi);

@@ -534,14 +533,20 @@ again:

/* This can happen with OOM and indirect buffers. */
if (unlikely(capacity < 0)) {
- netif_stop_queue(dev);
- dev_warn(&dev->dev, "Unexpected full queue\n");
- if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
- vi->svq->vq_ops->disable_cb(vi->svq);
- netif_start_queue(dev);
- goto again;
+ if (net_ratelimit()) {
+ if (likely(capacity == -ENOMEM)) {
+ dev_warn(&dev->dev,
+ "TX queue failure: out of memory\n");
+ } else {
+ dev->stats.tx_fifo_errors++;
+ dev_warn(&dev->dev,
+ "Unexpected TX queue failure: %d\n",
+ capacity);
+ }
}
- return NETDEV_TX_BUSY;
+ dev->stats.tx_dropped++;
+ kfree_skb(skb);
+ return NETDEV_TX_OK;
}
vi->svq->vq_ops->kick(vi->svq);

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Henrik Rydberg <ryd...@euromail.se>

commit 405eaa1c1d045cdd872802fc515f638573984880 upstream.

This patch adds generic support for the MacBook Pro 7 family
based on the 7,1 model.

Signed-off-by: Henrik Rydberg <ryd...@euromail.se>
Signed-off-by: Jean Delvare <kh...@linux-fr.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hwmon/applesmc.c | 9 +++++++++
1 file changed, 9 insertions(+)

--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -159,6 +159,9 @@ static const char *temperature_sensors_s
{ "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", "TC0P", "TC1C", "TG0D",
"TG0P", "TG0T", "TMCD", "TP0P", "TPCD", "Th1H", "Th2H", "Tm0P",
"Ts0P", "Ts0S", NULL },
+/* Set 22: MacBook Pro 7,1 */
+ { "TB0T", "TB1T", "TB2T", "TC0D", "TC0P", "TN0D", "TN0P", "TN0S",
+ "TN1D", "TN1F", "TN1G", "TN1S", "Th1H", "Ts0P", "Ts0S", NULL },


};

/* List of keys used to read/write fan speeds */

@@ -1377,6 +1380,8 @@ static __initdata struct dmi_match_data
{ .accelerometer = 1, .light = 1, .temperature_set = 20 },
/* MacBook Pro 6,2: accelerometer, backlight and temperature set 21 */
{ .accelerometer = 1, .light = 1, .temperature_set = 21 },
+/* MacBook Pro 7,1: accelerometer, backlight and temperature set 22 */
+ { .accelerometer = 1, .light = 1, .temperature_set = 22 },


};

/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".

@@ -1390,6 +1395,10 @@ static __initdata struct dmi_system_id a
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir") },
&applesmc_dmi_data[7]},
+ { applesmc_dmi_match, "Apple MacBook Pro 7", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro7") },
+ &applesmc_dmi_data[22]},
{ applesmc_dmi_match, "Apple MacBook Pro 5,4", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4") },

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Pavel Roskin <pro...@gnu.org>

commit b59a52f12e483b79e7d32da7ec30dcf3b2e0210b upstream.

Use rt2x00dev->ops->extra_tx_headroom, not rt2x00dev->hw->extra_tx_headroom
in the tx code, as the later may include other headroom not to be used in
the chipset driver.

Signed-off-by: Pavel Roskin <pro...@gnu.org>


Signed-off-by: Gertjan van Wingerde <gwin...@gmail.com>

Acked-by: Ivo van Doorn <IvD...@gmail.com>


Signed-off-by: John W. Linville <linv...@tuxdriver.com>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -103,7 +103,7 @@ void rt2x00queue_map_txskb(struct rt2x00
* is also mapped to the DMA so it can be used for transfering
* additional descriptor information to the hardware.
*/
- skb_push(skb, rt2x00dev->hw->extra_tx_headroom);
+ skb_push(skb, rt2x00dev->ops->extra_tx_headroom);

skbdesc->skb_dma =
dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
@@ -111,7 +111,7 @@ void rt2x00queue_map_txskb(struct rt2x00
/*
* Restore data pointer to original location again.
*/
- skb_pull(skb, rt2x00dev->hw->extra_tx_headroom);
+ skb_pull(skb, rt2x00dev->ops->extra_tx_headroom);

skbdesc->flags |= SKBDESC_DMA_MAPPED_TX;
}
@@ -133,7 +133,7 @@ void rt2x00queue_unmap_skb(struct rt2x00
* by the driver, but it was actually mapped to DMA.
*/
dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma,
- skb->len + rt2x00dev->hw->extra_tx_headroom,
+ skb->len + rt2x00dev->ops->extra_tx_headroom,
DMA_TO_DEVICE);
skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX;

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Neil Horman <nho...@tuxdriver.com>

commit b30532515f0a62bfe17207ab00883dd262497006 upstream.

Recently reported oops:

kernel BUG at net/core/skbuff.c:813!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/devices/virtual/net/bond0/broadcast
CPU 8
Modules linked in: sit tunnel4 cpufreq_ondemand acpi_cpufreq freq_table bonding
ipv6 dm_mirror dm_region_hash dm_log cdc_ether usbnet mii serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support shpchp ioatdma i7core_edac edac_core bnx2
ixgbe dca mdio sg ext4 mbcache jbd2 sd_mod crc_t10dif mptsas mptscsih mptbase
scsi_transport_sas dm_mod [last unloaded: microcode]

Modules linked in: sit tunnel4 cpufreq_ondemand acpi_cpufreq freq_table bonding
ipv6 dm_mirror dm_region_hash dm_log cdc_ether usbnet mii serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support shpchp ioatdma i7core_edac edac_core bnx2
ixgbe dca mdio sg ext4 mbcache jbd2 sd_mod crc_t10dif mptsas mptscsih mptbase
scsi_transport_sas dm_mod [last unloaded: microcode]
Pid: 0, comm: swapper Not tainted 2.6.32-71.el6.x86_64 #1 BladeCenter HS22
-[7870AC1]-
RIP: 0010:[<ffffffff81405b16>] [<ffffffff81405b16>]
pskb_expand_head+0x36/0x1e0
RSP: 0018:ffff880028303b70 EFLAGS: 00010202
RAX: 0000000000000002 RBX: ffff880c6458ec80 RCX: 0000000000000020
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880c6458ec80
RBP: ffff880028303bc0 R08: ffffffff818a6180 R09: ffff880c6458ed64
R10: ffff880c622b36c0 R11: 0000000000000400 R12: 0000000000000000
R13: 0000000000000180 R14: ffff880c622b3000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff880028300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00000038653452a4 CR3: 0000000001001000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff8806649c2000, task ffff880c64f16ab0)
Stack:
ffff880028303bc0 ffffffff8104fff9 000000000000001c 0000000100000000
<0> ffff880000047d80 ffff880c6458ec80 000000000000001c ffff880c6223da00
<0> ffff880c622b3000 0000000000000000 ffff880028303c10 ffffffff81407f7a
Call Trace:
<IRQ>
[<ffffffff8104fff9>] ? __wake_up_common+0x59/0x90
[<ffffffff81407f7a>] __pskb_pull_tail+0x2aa/0x360
[<ffffffffa0244530>] bond_arp_rcv+0x2c0/0x2e0 [bonding]
[<ffffffff814a0857>] ? packet_rcv+0x377/0x440
[<ffffffff8140f21b>] netif_receive_skb+0x2db/0x670
[<ffffffff8140f788>] napi_skb_finish+0x58/0x70
[<ffffffff8140fc89>] napi_gro_receive+0x39/0x50
[<ffffffffa01286eb>] ixgbe_clean_rx_irq+0x35b/0x900 [ixgbe]
[<ffffffffa01290f6>] ixgbe_clean_rxtx_many+0x136/0x240 [ixgbe]
[<ffffffff8140fe53>] net_rx_action+0x103/0x210
[<ffffffff81073bd7>] __do_softirq+0xb7/0x1e0
[<ffffffff810d8740>] ? handle_IRQ_event+0x60/0x170
[<ffffffff810142cc>] call_softirq+0x1c/0x30
[<ffffffff81015f35>] do_softirq+0x65/0xa0
[<ffffffff810739d5>] irq_exit+0x85/0x90
[<ffffffff814cf915>] do_IRQ+0x75/0xf0
[<ffffffff81013ad3>] ret_from_intr+0x0/0x11
<EOI>
[<ffffffff8101bc01>] ? mwait_idle+0x71/0xd0
[<ffffffff814cd80a>] ? atomic_notifier_call_chain+0x1a/0x20
[<ffffffff81011e96>] cpu_idle+0xb6/0x110
[<ffffffff814c17c8>] start_secondary+0x1fc/0x23f

Resulted from bonding driver registering packet handlers via dev_add_pack and
then trying to call pskb_may_pull. If another packet handler (like for AF_PACKET
sockets) gets called first, the delivered skb will have a user count > 1, which
causes pskb_may_pull to BUG halt when it does its skb_shared check. Fix this by
calling skb_share_check prior to the may_pull call sites in the bonding driver
to clone the skb when needed. Tested by myself and the reported successfully.

Signed-off-by: Neil Horman <nho...@tuxdriver.com>
CC: Andy Gospodarek <an...@greyhouse.net>
CC: Jay Vosburgh <fu...@us.ibm.com>
CC: "David S. Miller" <da...@davemloft.net>
Signed-off-by: Jay Vosburgh <fu...@us.ibm.com>
Signed-off-by: Andy Gospodarek <an...@greyhouse.net>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/bonding/bond_3ad.c | 4 ++++
drivers/net/bonding/bond_alb.c | 4 ++++
drivers/net/bonding/bond_main.c | 4 ++++
3 files changed, 12 insertions(+)

--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2451,6 +2451,10 @@ int bond_3ad_lacpdu_recv(struct sk_buff
if (!(dev->flags & IFF_MASTER))
goto out;

+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ goto out;
+
if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
goto out;

--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -370,6 +370,10 @@ static int rlb_arp_recv(struct sk_buff *
goto out;
}

+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ goto out;
+
if (!pskb_may_pull(skb, arp_hdr_len(bond_dev)))
goto out;

--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2692,6 +2692,10 @@ static int bond_arp_rcv(struct sk_buff *
if (!slave || !slave_do_arp_validate(bond, slave))
goto out_unlock;

+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ goto out_unlock;
+
if (!pskb_may_pull(skb, arp_hdr_len(dev)))
goto out_unlock;

Greg KH

unread,
May 5, 2011, 8:50:04 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Eric Dumazet <eric.d...@gmail.com>

commit 25888e30319f8896fc656fc68643e6a078263060 upstream.

Its easy to eat all kernel memory and trigger NMI watchdog, using an
exploit program that queues unix sockets on top of others.

lkml ref : http://lkml.org/lkml/2010/11/25/8

This mechanism is used in applications, one choice we have is to have a
recursion limit.

Other limits might be needed as well (if we queue other types of files),
since the passfd mechanism is currently limited by socket receive queue
sizes only.

Add a recursion_level to unix socket, allowing up to 4 levels.

Each time we send an unix socket through sendfd mechanism, we copy its
recursion level (plus one) to receiver. This recursion level is cleared
when socket receive queue is emptied.

Reported-by: Марк Коренберг <socke...@gmail.com>
Signed-off-by: Eric Dumazet <eric.d...@gmail.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

include/net/af_unix.h | 2 ++
net/unix/af_unix.c | 37 ++++++++++++++++++++++++++++++++-----
net/unix/garbage.c | 2 +-
3 files changed, 35 insertions(+), 6 deletions(-)

--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -10,6 +10,7 @@ extern void unix_inflight(struct file *f
extern void unix_notinflight(struct file *fp);
extern void unix_gc(void);
extern void wait_for_unix_gc(void);
+extern struct sock *unix_get_socket(struct file *filp);

#define UNIX_HASH_SIZE 256

@@ -56,6 +57,7 @@ struct unix_sock {
spinlock_t lock;
unsigned int gc_candidate : 1;
unsigned int gc_maybe_cycle : 1;
+ unsigned char recursion_level;
wait_queue_head_t peer_wait;
};
#define unix_sk(__sk) ((struct unix_sock *)__sk)
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1325,9 +1325,25 @@ static void unix_destruct_fds(struct sk_
sock_wfree(skb);
}

+#define MAX_RECURSION_LEVEL 4
+
static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
{
int i;
+ unsigned char max_level = 0;
+ int unix_sock_count = 0;
+
+ for (i = scm->fp->count - 1; i >= 0; i--) {
+ struct sock *sk = unix_get_socket(scm->fp->fp[i]);
+
+ if (sk) {
+ unix_sock_count++;
+ max_level = max(max_level,
+ unix_sk(sk)->recursion_level);
+ }
+ }
+ if (unlikely(max_level > MAX_RECURSION_LEVEL))
+ return -ETOOMANYREFS;

/*
* Need to duplicate file references for the sake of garbage
@@ -1338,10 +1354,12 @@ static int unix_attach_fds(struct scm_co
if (!UNIXCB(skb).fp)
return -ENOMEM;

- for (i = scm->fp->count-1; i >= 0; i--)
- unix_inflight(scm->fp->fp[i]);
+ if (unix_sock_count) {
+ for (i = scm->fp->count - 1; i >= 0; i--)
+ unix_inflight(scm->fp->fp[i]);
+ }
skb->destructor = unix_destruct_fds;
- return 0;
+ return max_level;
}

/*
@@ -1363,6 +1381,7 @@ static int unix_dgram_sendmsg(struct kio
struct sk_buff *skb;
long timeo;
struct scm_cookie tmp_scm;
+ int max_level = 0;

if (NULL == siocb->scm)
siocb->scm = &tmp_scm;
@@ -1403,8 +1422,9 @@ static int unix_dgram_sendmsg(struct kio
memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
if (siocb->scm->fp) {
err = unix_attach_fds(siocb->scm, skb);
- if (err)
+ if (err < 0)
goto out_free;
+ max_level = err + 1;
}
unix_get_secdata(siocb->scm, skb);

@@ -1485,6 +1505,8 @@ restart:
}

skb_queue_tail(&other->sk_receive_queue, skb);
+ if (max_level > unix_sk(other)->recursion_level)
+ unix_sk(other)->recursion_level = max_level;
unix_state_unlock(other);
other->sk_data_ready(other, len);
sock_put(other);
@@ -1515,6 +1537,7 @@ static int unix_stream_sendmsg(struct ki
int sent = 0;
struct scm_cookie tmp_scm;
bool fds_sent = false;
+ int max_level = 0;

if (NULL == siocb->scm)
siocb->scm = &tmp_scm;
@@ -1579,10 +1602,11 @@ static int unix_stream_sendmsg(struct ki
/* Only send the fds in the first buffer */
if (siocb->scm->fp && !fds_sent) {
err = unix_attach_fds(siocb->scm, skb);
- if (err) {
+ if (err < 0) {
kfree_skb(skb);
goto out_err;
}
+ max_level = err + 1;
fds_sent = true;
}

@@ -1599,6 +1623,8 @@ static int unix_stream_sendmsg(struct ki
goto pipe_err_free;

skb_queue_tail(&other->sk_receive_queue, skb);
+ if (max_level > unix_sk(other)->recursion_level)
+ unix_sk(other)->recursion_level = max_level;
unix_state_unlock(other);
other->sk_data_ready(other, size);
sent += size;
@@ -1827,6 +1853,7 @@ static int unix_stream_recvmsg(struct ki
unix_state_lock(sk);
skb = skb_dequeue(&sk->sk_receive_queue);
if (skb == NULL) {
+ unix_sk(sk)->recursion_level = 0;
if (copied >= target)
goto unlock;

--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -97,7 +97,7 @@ static DECLARE_WAIT_QUEUE_HEAD(unix_gc_w
unsigned int unix_tot_inflight;


-static struct sock *unix_get_socket(struct file *filp)
+struct sock *unix_get_socket(struct file *filp)
{
struct sock *u_sock = NULL;
struct inode *inode = filp->f_path.dentry->d_inode;

Greg KH

unread,
May 5, 2011, 8:50:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: David Woodhouse <David.W...@intel.com>

commit 2d9e667efdfb4e986074d98e7d9a424003c7c43b upstream.

Certain revisions of this chipset appear to be broken. There is a shadow
GTT which mirrors the real GTT but contains pre-translated physical
addresses, for performance reasons. When a GTT update happens, the
translations are done once and the resulting physical addresses written
back to the shadow GTT.

Except sometimes, the physical address is actually written back to the
_real_ GTT, not the shadow GTT. Thus we start to see faults when that
physical address is fed through translation again.

Signed-off-by: David Woodhouse <David.W...@intel.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/pci/intel-iommu.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -382,7 +382,7 @@ int dmar_disabled = 0;
int dmar_disabled = 1;
#endif /*CONFIG_DMAR_DEFAULT_ON*/

-static int __initdata dmar_map_gfx = 1;
+static int dmar_map_gfx = 1;
static int dmar_forcedac;
static int intel_iommu_strict;

@@ -3741,6 +3741,12 @@ static void __devinit quirk_iommu_rwbf(s
*/
printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
rwbf_quirk = 1;
+
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */
+ if (dev->revision == 0x07) {
+ printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
+ dmar_map_gfx = 0;
+ }
}

DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Nobuhiro Iwamatsu <iwam...@nigauri.org>

commit 3cd01976e702ccaffb907727caff4f8789353599 upstream.

Bluetooth controller of MacbookPro 7,1 does not work.


Because Device Class of these controllers was set 255 (Vendor Sepecific Class).

T: Bus=04 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0


D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1

P: Vendor=05ac ProdID=8213 Rev=01.86


S: Manufacturer=Apple Inc.
S: Product=Bluetooth USB Host Controller

S: SerialNumber=5C5948C81B99


C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA

I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb


I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)

Signed-off-by: Nobuhiro Iwamatsu <iwam...@nigauri.org>
Acked-by: Marcel Holtmann <mar...@holtmann.org>
Signed-off-by: Gustavo F. Padovan <pad...@profusion.mobi>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[
/* Generic Bluetooth USB device */
{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },

+ /* Apple MacBookPro 7,1 */
+ { USB_DEVICE(0x05ac, 0x8213) },
+


/* Apple iMac11,1 */
{ USB_DEVICE(0x05ac, 0x8215) },

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Arnaldo Carvalho de Melo <ac...@redhat.com>

commit 830395188fae5f4028fa3c38ab1b031aae18a64c upstream.

QUIET_STDERR is used when detecting if -fstack-protector-all can
be used.

Noticed while building the perf tools on a Debian PARISC64
machine.

Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>
Cc: Frédéric Weisbecker <fwei...@gmail.com>
Cc: Mike Galbraith <efa...@gmx.de>

Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>

LKML-Reference: <1263293910-8484-1-...@infradead.org>


Signed-off-by: Ingo Molnar <mi...@elte.hu>
[bwh: Backport to 2.6.32]

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

tools/perf/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -252,6 +252,12 @@ PTHREAD_LIBS = -lpthread


# explicitly what architecture to check for. Fix this up for yours..
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__

+ifeq ($(V), 2)
+ QUIET_STDERR = ">/dev/null"
+else
+ QUIET_STDERR = ">/dev/null 2>&1"
+endif

+


ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
CFLAGS := $(CFLAGS) -fstack-protector-all
endif

@@ -397,11 +403,6 @@ BUILTIN_OBJS += builtin-trace.o

PERFLIBS = $(LIB_FILE)

-ifeq ($(V), 2)
- QUIET_STDERR = ">/dev/null"
-else
- QUIET_STDERR = ">/dev/null 2>&1"
-endif


#
# Platform specific tweaks
#

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Michael Müller <mueller...@alice-dsl.net>

commit 84e2f037ce9672d0fb118e3e82cecfe6122ace3f upstream.

This patch introduces support for DVB-T for the following dibcom
based card: Elgato EyeTV Diversity (USB-ID: 0fd9:0011)

Support for the Elgato silver IR remote is added too (set parameter
dvb_usb_dib0700_ir_proto=0)

[w.s...@pengutronix.de: rebased to current linuxtv-master]
Signed-off-by: Michael Müller <mueller...@alice-dsl.net>
Signed-off-by: Wolfram Sang <w.s...@pengutronix.de>
Signed-off-by: Patrick Boettcher <pboet...@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mch...@redhat.com>
[bwh: Adjust context and numbering for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/media/dvb/dvb-usb/dib0700_devices.c | 46 ++++++++++++++++++++++++++--
drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1
2 files changed, 45 insertions(+), 2 deletions(-)

--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -874,6 +874,43 @@ static struct dvb_usb_rc_key dib0700_rc_
{ 0x1d37, KEY_RECORD },
{ 0x1d3b, KEY_GOTO },
{ 0x1d3d, KEY_POWER },
+
+ /* Key codes for the Elgato EyeTV Diversity silver remote,
+ set dvb_usb_dib0700_ir_proto=0 */
+ { 0x4501, KEY_POWER },
+ { 0x4502, KEY_MUTE },
+ { 0x4503, KEY_1 },
+ { 0x4504, KEY_2 },
+ { 0x4505, KEY_3 },
+ { 0x4506, KEY_4 },
+ { 0x4507, KEY_5 },
+ { 0x4508, KEY_6 },
+ { 0x4509, KEY_7 },
+ { 0x450a, KEY_8 },
+ { 0x450b, KEY_9 },
+ { 0x450c, KEY_LAST },
+ { 0x450d, KEY_0 },
+ { 0x450e, KEY_ENTER },
+ { 0x450f, KEY_RED },
+ { 0x4510, KEY_CHANNELUP },
+ { 0x4511, KEY_GREEN },
+ { 0x4512, KEY_VOLUMEDOWN },
+ { 0x4513, KEY_OK },
+ { 0x4514, KEY_VOLUMEUP },
+ { 0x4515, KEY_YELLOW },
+ { 0x4516, KEY_CHANNELDOWN },
+ { 0x4517, KEY_BLUE },
+ { 0x4518, KEY_LEFT }, /* Skip backwards */
+ { 0x4519, KEY_PLAYPAUSE },
+ { 0x451a, KEY_RIGHT }, /* Skip forward */
+ { 0x451b, KEY_REWIND },
+ { 0x451c, KEY_L }, /* Live */
+ { 0x451d, KEY_FASTFORWARD },
+ { 0x451e, KEY_STOP }, /* 'Reveal' for Teletext */
+ { 0x451f, KEY_MENU }, /* KEY_TEXT for Teletext */
+ { 0x4540, KEY_RECORD }, /* Font 'Size' for Teletext */
+ { 0x4541, KEY_SCREEN }, /* Full screen toggle, 'Hold' for Teletext */
+ { 0x4542, KEY_SELECT }, /* Select video input, 'Select' for Teletext */
};

/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
@@ -1861,6 +1898,7 @@ struct usb_device_id dib0700_usb_id_tabl
{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) },
{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) },
{ USB_DEVICE(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD) },
+ { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DIVERSITY) },
{ 0 } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
@@ -2173,7 +2211,7 @@ struct dvb_usb_device_properties dib0700
}
},

- .num_device_descs = 6,
+ .num_device_descs = 7,
.devices = {
{ "DiBcom STK7070PD reference design",
{ &dib0700_usb_id_table[17], NULL },
@@ -2199,7 +2237,11 @@ struct dvb_usb_device_properties dib0700
{ "Sony PlayTV",
{ &dib0700_usb_id_table[44], NULL },
{ NULL },
- }
+ },
+ { "Elgato EyeTV Diversity",
+ { &dib0700_usb_id_table[64], NULL },
+ { NULL },
+ },
},
.rc_interval = DEFAULT_RC_INTERVAL,
.rc_key_map = dib0700_rc_keys,
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -271,6 +271,7 @@
#define USB_PID_TELESTAR_STARSTICK_2 0x8000
#define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807
#define USB_PID_SONY_PLAYTV 0x0003
+#define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011
#define USB_PID_ELGATO_EYETV_DTT 0x0021
#define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020
#define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000

Greg KH

unread,
May 5, 2011, 8:50:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Oskar Schirmer <os...@scara.com>

commit a7851ce73b9fdef53f251420e6883cf4f3766534 upstream.

cifs_root_iget allocates full_path through
cifs_build_path_to_root, but fails to kfree it upon
cifs_get_inode_info* failure.

Make all failure exit paths traverse clean up
handling at the end of the function.

Signed-off-by: Oskar Schirmer <os...@scara.com>
Signed-off-by: Andi Kleen <a...@linux.intel.com>
Reviewed-by: Jesper Juhl <j...@chaosbits.net>
Signed-off-by: Steve French <sfr...@us.ibm.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/cifs/inode.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -688,8 +688,10 @@ struct inode *cifs_root_iget(struct supe
rc = cifs_get_inode_info(&inode, full_path, NULL, sb,
xid, NULL);

- if (!inode)
- return ERR_PTR(-ENOMEM);
+ if (!inode) {
+ inode = ERR_PTR(rc);
+ goto out;
+ }

if (rc && cifs_sb->tcon->ipc) {
cFYI(1, ("ipc connection - fake read inode"));
@@ -700,13 +702,11 @@ struct inode *cifs_root_iget(struct supe
inode->i_uid = cifs_sb->mnt_uid;
inode->i_gid = cifs_sb->mnt_gid;
} else if (rc) {
- kfree(full_path);
- _FreeXid(xid);
iget_failed(inode);
- return ERR_PTR(rc);
+ inode = ERR_PTR(rc);
}

-
+out:
kfree(full_path);
/* can not call macro FreeXid here since in a void func
* TODO: This is no longer true

Greg KH

unread,
May 5, 2011, 8:50:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Bruce Rogers <bro...@novell.com>

commit 3e9d08ec0a68f6faf718d5a7e050fe5ca0ba004f upstream.

Under harsh testing conditions, including low memory, the guest would
stop receiving packets. With this patch applied we no longer see any
problems in the driver while performing these tests for extended periods
of time.

Make sure napi is scheduled subsequent to each napi_enable.

Signed-off-by: Bruce Rogers <bro...@novell.com>
Signed-off-by: Olaf Kirch <ok...@suse.de>
Signed-off-by: Rusty Russell <ru...@rustcorp.com.au>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/virtio_net.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)

--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -391,6 +391,20 @@ static void skb_recv_done(struct virtque
}
}

+static void virtnet_napi_enable(struct virtnet_info *vi)
+{
+ napi_enable(&vi->napi);
+
+ /* If all buffers were filled by other side before we napi_enabled, we
+ * won't get another interrupt, so process any outstanding packets
+ * now. virtnet_poll wants re-enable the queue, so we disable here.
+ * We synchronize against interrupts via NAPI_STATE_SCHED */
+ if (napi_schedule_prep(&vi->napi)) {
+ vi->rvq->vq_ops->disable_cb(vi->rvq);
+ __napi_schedule(&vi->napi);
+ }
+}
+
static void refill_work(struct work_struct *work)
{
struct virtnet_info *vi;
@@ -399,7 +413,7 @@ static void refill_work(struct work_stru
vi = container_of(work, struct virtnet_info, refill.work);
napi_disable(&vi->napi);
still_empty = !try_fill_recv(vi, GFP_KERNEL);
- napi_enable(&vi->napi);
+ virtnet_napi_enable(vi);

/* In theory, this can happen: if we don't get any buffers in
* we will *never* try to fill again. */
@@ -591,16 +605,7 @@ static int virtnet_open(struct net_devic
{


struct virtnet_info *vi = netdev_priv(dev);

- napi_enable(&vi->napi);
-
- /* If all buffers were filled by other side before we napi_enabled, we
- * won't get another interrupt, so process any outstanding packets
- * now. virtnet_poll wants re-enable the queue, so we disable here.
- * We synchronize against interrupts via NAPI_STATE_SCHED */
- if (napi_schedule_prep(&vi->napi)) {
- vi->rvq->vq_ops->disable_cb(vi->rvq);
- __napi_schedule(&vi->napi);
- }
+ virtnet_napi_enable(vi);
return 0;

Greg KH

unread,
May 5, 2011, 8:50:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Edgar (gimli) Hucek <gi...@dark-green.com>

commit 99b9f758bbc904f22faffcf4d83205f4a5e7bc0c upstream.

This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the hid
driver.

Signed-off-by: Edgar (gimli) Hucek <gi...@dark-green.com>

Signed-off-by: Jiri Kosina <jko...@suse.cz>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hid/hid-apple.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
drivers/hid/hid-core.c | 12 ++++++++++++
drivers/hid/hid-ids.h | 6 ++++++
3 files changed, 60 insertions(+), 4 deletions(-)

--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -53,6 +53,27 @@ struct apple_key_translation {
u8 flags;
};

+static const struct apple_key_translation macbookair_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_ENTER, KEY_INSERT },
+ { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
+ { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY },
+ { KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY },
+ { KEY_F4, KEY_DASHBOARD, APPLE_FLAG_FKEY },
+ { KEY_F6, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY },
+ { KEY_F7, KEY_PLAYPAUSE, APPLE_FLAG_FKEY },
+ { KEY_F8, KEY_NEXTSONG, APPLE_FLAG_FKEY },
+ { KEY_F9, KEY_MUTE, APPLE_FLAG_FKEY },
+ { KEY_F10, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY },
+ { KEY_F11, KEY_VOLUMEUP, APPLE_FLAG_FKEY },
+ { KEY_F12, KEY_EJECTCD, APPLE_FLAG_FKEY },
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { KEY_LEFT, KEY_HOME },
+ { KEY_RIGHT, KEY_END },
+ { }
+};
+
static const struct apple_key_translation apple_fn_keys[] = {
{ KEY_BACKSPACE, KEY_DELETE },
{ KEY_ENTER, KEY_INSERT },
@@ -151,10 +172,15 @@ static int hidinput_apple_event(struct h
if (fnmode) {
int do_translate;

- trans = apple_find_translation((hid->product < 0x21d ||
- hid->product >= 0x300) ?
- powerbook_fn_keys : apple_fn_keys,
- usage->code);
+ if(hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
+ hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) {
+ trans = apple_find_translation(macbookair_fn_keys, usage->code);
+ } else if (hid->product < 0x21d || hid->product >= 0x300) {
+ trans = apple_find_translation(powerbook_fn_keys, usage->code);
+ } else {
+ trans = apple_find_translation(apple_fn_keys, usage->code);
+ }
+
if (trans) {
if (test_bit(usage->code, asc->pressed_fn))
do_translate = 1;
@@ -431,6 +457,18 @@ static const struct hid_device_id apple_
.driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS),
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI),
+ .driver_data = APPLE_HAS_FN },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO),
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI),
+ .driver_data = APPLE_HAS_FN },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO),
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1287,6 +1287,12 @@ static const struct hid_device_id hid_bl
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
@@ -1705,6 +1711,12 @@ static const struct hid_device_id hid_mo
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ }
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -88,6 +88,12 @@
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236
#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237
#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238
+#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI 0x023f
+#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO 0x0240
+#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS 0x0241
+#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242
+#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243
+#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Gertjan van Wingerde <gwin...@gmail.com>

commit e6218cc47bd54710dc523e8c983ceddba625e3ae upstream.

Set the value of extra_tx_headroom in a central place, rather than in each
of the drivers. This is preparatory for taking alignment space into account
in the TX headroom requested by rt2x00.

Signed-off-by: Gertjan van Wingerde <gwin...@gmail.com>
Acked-by: Ivo van Doorn <IvD...@gmail.com>
Signed-off-by: John W. Linville <linv...@tuxdriver.com>

[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 3 +--
drivers/net/wireless/rt2x00/rt2500usb.c | 3 +--
drivers/net/wireless/rt2x00/rt2800usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00.h | 1 +
drivers/net/wireless/rt2x00/rt2x00dev.c | 5 +++++
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
8 files changed, 12 insertions(+), 8 deletions(-)

--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1431,7 +1431,6 @@ static int rt2400pci_probe_hw_mode(struc
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;
- rt2x00dev->hw->extra_tx_headroom = 0;

SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -1628,6 +1627,7 @@ static const struct rt2x00_ops rt2400pci
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = 0,
.rx = &rt2400pci_queue_rx,
.tx = &rt2400pci_queue_tx,
.bcn = &rt2400pci_queue_bcn,
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1732,8 +1732,6 @@ static int rt2500pci_probe_hw_mode(struc
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;

- rt2x00dev->hw->extra_tx_headroom = 0;
-
SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
rt2x00_eeprom_addr(rt2x00dev,
@@ -1927,6 +1925,7 @@ static const struct rt2x00_ops rt2500pci
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = 0,
.rx = &rt2500pci_queue_rx,
.tx = &rt2500pci_queue_tx,
.bcn = &rt2500pci_queue_bcn,
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1788,8 +1788,6 @@ static int rt2500usb_probe_hw_mode(struc
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;

- rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE;
-
SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
rt2x00_eeprom_addr(rt2x00dev,
@@ -1962,6 +1960,7 @@ static const struct rt2x00_ops rt2500usb
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = TXD_DESC_SIZE,
.rx = &rt2500usb_queue_rx,
.tx = &rt2500usb_queue_tx,
.bcn = &rt2500usb_queue_bcn,
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -2509,7 +2509,6 @@ static int rt2800usb_probe_hw_mode(struc
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;
- rt2x00dev->hw->extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE;

SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2858,6 +2857,7 @@ static const struct rt2x00_ops rt2800usb
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE,
.rx = &rt2800usb_queue_rx,
.tx = &rt2800usb_queue_tx,
.bcn = &rt2800usb_queue_bcn,
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -579,6 +579,7 @@ struct rt2x00_ops {
const unsigned int eeprom_size;
const unsigned int rf_size;
const unsigned int tx_queues;
+ const unsigned int extra_tx_headroom;
const struct data_queue_desc *rx;
const struct data_queue_desc *tx;
const struct data_queue_desc *bcn;
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -684,6 +684,11 @@ static int rt2x00lib_probe_hw(struct rt2
rt2x00dev->hw->queues = rt2x00dev->ops->tx_queues;

/*
+ * Initialize extra TX headroom required.
+ */
+ rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom;
+
+ /*
* Register HW.
*/
status = ieee80211_register_hw(rt2x00dev->hw);
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2550,7 +2550,6 @@ static int rt61pci_probe_hw_mode(struct
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;
- rt2x00dev->hw->extra_tx_headroom = 0;

SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2798,6 +2797,7 @@ static const struct rt2x00_ops rt61pci_o
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = 0,
.rx = &rt61pci_queue_rx,
.tx = &rt61pci_queue_tx,
.bcn = &rt61pci_queue_bcn,
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2068,7 +2068,6 @@ static int rt73usb_probe_hw_mode(struct
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_PS_NULLFUNC_STACK;
- rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE;

SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2311,6 +2310,7 @@ static const struct rt2x00_ops rt73usb_o
.eeprom_size = EEPROM_SIZE,
.rf_size = RF_SIZE,
.tx_queues = NUM_TX_QUEUES,
+ .extra_tx_headroom = TXD_DESC_SIZE,
.rx = &rt73usb_queue_rx,
.tx = &rt73usb_queue_tx,
.bcn = &rt73usb_queue_bcn,

Greg KH

unread,
May 5, 2011, 8:50:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 6f88a4403def422bd8e276ddf6863d6ac71435d2 upstream.

Filesystem rebalancing (BTRFS_IOC_BALANCE) affects the entire
filesystem and may run uninterruptibly for a long time. This does not
seem to be something that an unprivileged user should be able to do.

Reported-by: Aron Xu <happya...@gmail.com>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: Chris Mason <chris...@oracle.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/btrfs/volumes.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -21,6 +21,7 @@
#include <linux/blkdev.h>
#include <linux/random.h>
#include <linux/iocontext.h>
+#include <linux/capability.h>
#include <asm/div64.h>
#include "compat.h"
#include "ctree.h"
@@ -1900,6 +1901,9 @@ int btrfs_balance(struct btrfs_root *dev
if (dev_root->fs_info->sb->s_flags & MS_RDONLY)
return -EROFS;

+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
mutex_lock(&dev_root->fs_info->volume_mutex);
dev_root = dev_root->fs_info->dev_root;

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Henrik Rydberg <ryd...@euromail.se>

commit 4e4a99d32721800c061191027f18f780dcbd9e0b upstream.

The MacBookPro 5,3 model has two fans, whereas the 5,4 model has
only one. This patch adds explicit support for the 5,3 and 5,4 models.

Signed-off-by: Henrik Rydberg <ryd...@euromail.se>
Signed-off-by: Jean Delvare <kh...@linux-fr.org>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hwmon/applesmc.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -148,6 +148,13 @@ static const char *temperature_sensors_s
/* Set 18: MacBook Pro 2,2 */
{ "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "TM0P", "TTF0",
"Th0H", "Th1H", "Tm0P", "Ts0P", NULL },
+/* Set 19: Macbook Pro 5,3 */
+ { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TG0D",
+ "TG0F", "TG0H", "TG0P", "TG0T", "TN0D", "TN0P", "TTF0", "Th2H",
+ "Tm0P", "Ts0P", "Ts0S", NULL },
+/* Set 20: MacBook Pro 5,4 */
+ { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", "TC0F", "TC0P", "TN0D",
+ "TN0P", "TTF0", "Th2H", "Ts0P", "Ts0S", NULL },


};

/* List of keys used to read/write fan speeds */

@@ -1360,6 +1367,10 @@ static __initdata struct dmi_match_data
{ .accelerometer = 0, .light = 0, .temperature_set = 17 },
/* MacBook Pro 2,2: accelerometer, backlight and temperature set 18 */
{ .accelerometer = 1, .light = 1, .temperature_set = 18 },
+/* MacBook Pro 5,3: accelerometer, backlight and temperature set 19 */
+ { .accelerometer = 1, .light = 1, .temperature_set = 19 },
+/* MacBook Pro 5,4: accelerometer, backlight and temperature set 20 */
+ { .accelerometer = 1, .light = 1, .temperature_set = 20 },


};

/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".

@@ -1373,6 +1384,14 @@ static __initdata struct dmi_system_id a


DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir") },
&applesmc_dmi_data[7]},

+ { applesmc_dmi_match, "Apple MacBook Pro 5,4", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4") },
+ &applesmc_dmi_data[20]},
+ { applesmc_dmi_match, "Apple MacBook Pro 5,3", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,3") },
+ &applesmc_dmi_data[19]},
{ applesmc_dmi_match, "Apple MacBook Pro 5", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5") },

Greg KH

unread,
May 5, 2011, 8:50:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Rafael Avila de Espindola <rafael.e...@gmail.com>

commit 1a5ba2e9fc7999b8de2a71c7e7b9f58d752c05e4 upstream.

With the attached patch I am able to use the sound on a new IMac 27.
What works:

*) Internal speakers
*) Internal microphone
*) Headphone

I don't have an external mic or a SPDIF device to test the rest.

Signed-off-by: Rafael Avila de Espindola <rafael.e...@gmail.com>
Signed-off-by: Takashi Iwai <ti...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

Documentation/sound/alsa/HD-Audio-Models.txt | 1 +
sound/pci/hda/patch_cirrus.c | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)

--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -401,4 +401,5 @@ STAC9872
Cirrus Logic CS4206/4207
========================
mbp55 MacBook Pro 5,5
+ imac27 IMac 27 Inch
auto BIOS setup (default)
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -66,6 +66,7 @@ struct cs_spec {


/* available models */
enum {

CS420X_MBP55,
+ CS420X_IMAC27,
CS420X_AUTO,
CS420X_MODELS
};
@@ -832,7 +833,8 @@ static void cs_automute(struct hda_codec


AC_VERB_SET_PIN_WIDGET_CONTROL,
hp_present ? 0 : PIN_OUT);
}

- if (spec->board_config == CS420X_MBP55) {
+ if (spec->board_config == CS420X_MBP55 ||
+ spec->board_config == CS420X_IMAC27) {


unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0,

AC_VERB_SET_GPIO_DATA, gpio);
@@ -1078,12 +1080,14 @@ static int cs_parse_auto_config(struct h



static const char *cs420x_models[CS420X_MODELS] = {

[CS420X_MBP55] = "mbp55",
+ [CS420X_IMAC27] = "imac27",
[CS420X_AUTO] = "auto",
};




static struct snd_pci_quirk cs420x_cfg_tbl[] = {

SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),

+ SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
{} /* terminator */
};

@@ -1106,8 +1110,23 @@ static struct cs_pincfg mbp55_pincfgs[]
{} /* terminator */
};

+static struct cs_pincfg imac27_pincfgs[] = {
+ { 0x09, 0x012b4050 },
+ { 0x0a, 0x90100140 },
+ { 0x0b, 0x90100142 },


+ { 0x0c, 0x018b3020 },
+ { 0x0d, 0x90a00110 },
+ { 0x0e, 0x400000f0 },
+ { 0x0f, 0x01cbe030 },
+ { 0x10, 0x014be060 },

+ { 0x12, 0x01ab9070 },


+ { 0x15, 0x400000f0 },
+ {} /* terminator */
+};
+

static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
[CS420X_MBP55] = mbp55_pincfgs,
+ [CS420X_IMAC27] = imac27_pincfgs,
};

static void fix_pincfg(struct hda_codec *codec, int model)
@@ -1137,6 +1156,7 @@ static int patch_cs420x(struct hda_codec
fix_pincfg(codec, spec->board_config);

switch (spec->board_config) {
+ case CS420X_IMAC27:


case CS420X_MBP55:
/* GPIO1 = headphones */
/* GPIO3 = speakers */

Greg KH

unread,
May 5, 2011, 8:50:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Uwe Kleine-König <u.klein...@pengutronix.de>

commit 81ca03a0e2ea0207b2df80e0edcf4c775c07a505 upstream.

This fixes a build breakage introduced by commit 4c2ef25fe0b8 ("mmc: fix
all hangs related to mmc/sd card insert/removal during suspend/resume")

Cc: David Brownell <dav...@pacbell.net>
Cc: Alan Stern <st...@rowland.harvard.edu>
Cc: linu...@vger.kernel.org
Cc: Andrew Morton <ak...@linux-foundation.org>
Signed-off-by: Uwe Kleine-König <u.klein...@pengutronix.de>
Acked-by: Kukjin Kim <kgen...@samsung.com>
Acked-by: Maxim Levitsky <maximl...@gmail.com>
Acked-by: Randy Dunlap <randy....@oracle.com>
Signed-off-by: Linus Torvalds <torv...@linux-foundation.org>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/mmc/core/host.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -85,7 +85,9 @@ struct mmc_host *mmc_alloc_host(int extr
init_waitqueue_head(&host->wq);
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
INIT_DELAYED_WORK_DEFERRABLE(&host->disable, mmc_host_deeper_disable);
+#ifdef CONFIG_PM
host->pm_notify.notifier_call = mmc_pm_notify;
+#endif

/*
* By default, hosts do not support SGIO or large requests.

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
This is the start of the longterm review cycle for the 2.6.32.40 release.
There are 143 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.

Many thanks to Ben Hutchings for sending the large majority of these
patches to me for inclusion based on the patches in the Debian stable
kernel. I really appreciate it.

Responses should be made by Sunday, May 8, 2011, 00:01: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/longterm-review/patch-2.6.32.40-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

Documentation/sound/alsa/HD-Audio-Models.txt | 1 +
Documentation/usb/proc_usb_info.txt | 34 ++++--
Makefile | 2 +-
arch/arm/kernel/sys_oabi-compat.c | 2 +-
arch/m68k/mm/motorola.c | 2 +
arch/mips/mm/dma-default.c | 28 +++--
arch/parisc/mm/init.c | 4 +-
arch/powerpc/boot/Makefile | 2 +-
arch/x86/include/asm/kvm_host.h | 3 +
arch/x86/include/asm/pvclock.h | 38 ++++++
arch/x86/kernel/cpu/amd.c | 2 +-
arch/x86/kernel/pvclock.c | 3 +-
arch/x86/kvm/x86.c | 48 +++++++-
block/blk-sysfs.c | 4 +-
drivers/ata/libata-scsi.c | 24 +++-
drivers/ata/sata_via.c | 15 +++
drivers/bluetooth/btusb.c | 9 ++
drivers/char/agp/generic.c | 19 +++-
drivers/char/i8k.c | 7 +-
drivers/gpu/drm/radeon/atom.c | 6 +-
drivers/hid/hid-apple.c | 46 +++++++-
drivers/hid/hid-core.c | 12 ++
drivers/hid/hid-ids.h | 6 +
drivers/hwmon/applesmc.c | 66 +++++++++++
drivers/input/mouse/elantech.c | 142 +++++++++++++++--------
drivers/input/mouse/elantech.h | 8 +-
drivers/input/mouse/synaptics.c | 35 +++++-
drivers/input/mouse/synaptics.h | 4 +
drivers/input/xen-kbdfront.c | 12 ++-
drivers/media/dvb/b2c2/flexcop-pci.c | 2 +-
drivers/media/dvb/dvb-usb/dib0700_devices.c | 46 +++++++-
drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 +
drivers/mmc/core/core.c | 81 +++++++++----
drivers/mmc/core/host.c | 6 +
drivers/mmc/host/sdhci-pci.c | 1 +
drivers/mmc/host/sdhci.c | 9 ++-
drivers/net/atl1c/atl1c_main.c | 2 -
drivers/net/bnx2x_main.c | 27 +++--
drivers/net/bonding/bond_3ad.c | 4 +
drivers/net/bonding/bond_alb.c | 4 +
drivers/net/bonding/bond_main.c | 4 +
drivers/net/cxgb3/common.h | 8 +-
drivers/net/cxgb3/cxgb3_main.c | 25 +++--
drivers/net/e1000/e1000_main.c | 162 +++++++++++++++-----------
drivers/net/e1000e/ich8lan.c | 11 ++
drivers/net/igbvf/igbvf.h | 1 -
drivers/net/ipg.c | 4 +-
drivers/net/myri10ge/myri10ge.c | 4 +
drivers/net/netx-eth.c | 3 +
drivers/net/netxen/netxen_nic.h | 6 +
drivers/net/netxen/netxen_nic_init.c | 6 +-
drivers/net/netxen/netxen_nic_main.c | 4 +
drivers/net/niu.c | 17 +--
drivers/net/pcmcia/pcnet_cs.c | 7 +
drivers/net/pppol2tp.c | 3 +
drivers/net/spider_net.c | 1 +
drivers/net/tehuti.c | 4 +-
drivers/net/tokenring/tms380tr.c | 2 +
drivers/net/tulip/tulip_core.c | 1 +
drivers/net/virtio_net.c | 48 +++++---
drivers/net/wireless/ath/regd_common.h | 1 +
drivers/net/wireless/b43/sdio.c | 3 +
drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-tx.c | 8 +-
drivers/net/wireless/p54/txrx.c | 2 +-


drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 3 +-

drivers/net/wireless/rt2x00/rt2500usb.c | 13 ++-
drivers/net/wireless/rt2x00/rt2800usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00.h | 7 +
drivers/net/wireless/rt2x00/rt2x00dev.c | 15 +++
drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +-


drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-

drivers/pci/intel-iommu.c | 23 +++-
drivers/platform/x86/dell-laptop.c | 15 +++
drivers/s390/block/dasd_eckd.c | 2 +-
drivers/scsi/device_handler/scsi_dh_emc.c | 8 +-
drivers/scsi/mpt2sas/mpt2sas_ctl.c | 23 ++++-
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 +-
drivers/scsi/pmcraid.c | 3 +
drivers/scsi/scsi_sysfs.c | 16 ++--
drivers/serial/imx.c | 3 +-
drivers/staging/rtl8192su/r8192S_firmware.c | 5 +
drivers/staging/rtl8192su/r8192U_core.c | 120 ++++++++++++++-----
drivers/staging/rtl8192su/r819xU_cmdpkt.c | 6 +
drivers/staging/usbip/vhci_hcd.c | 2 +-
drivers/usb/core/devices.c | 10 +-
drivers/usb/core/hub.c | 15 ++-
drivers/usb/musb/musb_core.c | 1 +
drivers/video/backlight/mbp_nvidia_bl.c | 18 +++
fs/btrfs/volumes.c | 4 +
fs/cifs/inode.c | 12 +-
fs/gfs2/quota.c | 132 +++++++++++----------
fs/nfs/inode.c | 26 +++--
fs/nfs/nfs4proc.c | 43 +++++++-
fs/nfs/nfs4state.c | 4 +-
fs/nfs/super.c | 9 ++
fs/nfsd/vfs.c | 9 ++-
fs/partitions/ldm.c | 16 ++-
fs/partitions/osf.c | 12 ++-
fs/ubifs/recovery.c | 26 ++++
include/linux/mmc/host.h | 3 +
include/net/af_unix.h | 2 +
include/net/mac80211.h | 6 +
init/Kconfig | 1 +
init/main.c | 12 ++
net/can/bcm.c | 7 +-
net/econet/af_econet.c | 62 +++++-----
net/ipv4/ip_output.c | 9 +-
net/ipv6/addrconf.c | 3 -
net/mac80211/main.c | 2 +
net/phonet/pn_dev.c | 3 +
net/sunrpc/xprtsock.c | 28 ++++-
net/unix/af_unix.c | 53 ++++++++-
net/unix/garbage.c | 9 ++-
scripts/kconfig/conf.c | 2 +-
sound/pci/hda/patch_cirrus.c | 44 +++++++-
sound/ppc/tumbler.c | 9 ++-
sound/soc/codecs/wm_hubs.c | 8 +-
sound/synth/emux/emux_hwdep.c | 3 +
tools/perf/Makefile | 75 ++++++++----
122 files changed, 1542 insertions(+), 522 deletions(-)

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drose...@vsecurity.com>

commit 0f22072ab50cac7983f9660d33974b45184da4f9 upstream.

When CONFIG_OABI_COMPAT is set, the wrapper for semtimedop does not
bound the nsops argument. A sufficiently large value will cause an
integer overflow in allocation size, followed by copying too much data
into the allocated buffer. Fix this by restricting nsops to SEMOPM.
Untested.

Signed-off-by: Dan Rosenberg <drose...@vsecurity.com>
Signed-off-by: Russell King <rmk+k...@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
arch/arm/kernel/sys_oabi-compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -311,7 +311,7 @@ asmlinkage long sys_oabi_semtimedop(int
long err;
int i;

- if (nsops < 1)
+ if (nsops < 1 || nsops > SEMOPM)
return -EINVAL;
sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);
if (!sops)

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Florian Ragwitz <ra...@debian.org>

commit e938fbfd4a7ac829d48b767c4dc365535d5c4f97 upstream.

In older versions of the elantech hardware/firmware those bits always
were unset, so it didn't actually matter, but newer versions seem to
use those high bits for something else, screwing up the coordinates
we report to the input layer for those devices.

Signed-off-by: Florian Ragwitz <ra...@debian.org>
Signed-off-by: Dmitry Torokhov <dt...@mail.ru>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/input/mouse/elantech.c | 69 ++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 25 deletions(-)

--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -185,13 +185,17 @@ static void elantech_report_absolute_v1(
static int old_fingers;

if (etd->fw_version_maj == 0x01) {
- /* byte 0: D U p1 p2 1 p3 R L
- byte 1: f 0 th tw x9 x8 y9 y8 */
+ /*
+ * byte 0: D U p1 p2 1 p3 R L
+ * byte 1: f 0 th tw x9 x8 y9 y8
+ */
fingers = ((packet[1] & 0x80) >> 7) +
((packet[1] & 0x30) >> 4);
} else {
- /* byte 0: n1 n0 p2 p1 1 p3 R L
- byte 1: 0 0 0 0 x9 x8 y9 y8 */
+ /*
+ * byte 0: n1 n0 p2 p1 1 p3 R L
+ * byte 1: 0 0 0 0 x9 x8 y9 y8
+ */
fingers = (packet[0] & 0xc0) >> 6;
}

@@ -205,13 +209,15 @@ static void elantech_report_absolute_v1(

input_report_key(dev, BTN_TOUCH, fingers != 0);

- /* byte 2: x7 x6 x5 x4 x3 x2 x1 x0
- byte 3: y7 y6 y5 y4 y3 y2 y1 y0 */
+ /*
+ * byte 2: x7 x6 x5 x4 x3 x2 x1 x0
+ * byte 3: y7 y6 y5 y4 y3 y2 y1 y0
+ */
if (fingers) {
input_report_abs(dev, ABS_X,
((packet[1] & 0x0c) << 6) | packet[2]);
- input_report_abs(dev, ABS_Y, ETP_YMAX_V1 -
- (((packet[1] & 0x03) << 8) | packet[3]));
+ input_report_abs(dev, ABS_Y,
+ ETP_YMAX_V1 - (((packet[1] & 0x03) << 8) | packet[3]));
}

input_report_key(dev, BTN_TOOL_FINGER, fingers == 1);
@@ -250,34 +256,47 @@ static void elantech_report_absolute_v2(

switch (fingers) {
case 1:
- /* byte 1: x15 x14 x13 x12 x11 x10 x9 x8
- byte 2: x7 x6 x5 x4 x4 x2 x1 x0 */
- input_report_abs(dev, ABS_X, (packet[1] << 8) | packet[2]);
- /* byte 4: y15 y14 y13 y12 y11 y10 y8 y8
- byte 5: y7 y6 y5 y4 y3 y2 y1 y0 */
- input_report_abs(dev, ABS_Y, ETP_YMAX_V2 -
- ((packet[4] << 8) | packet[5]));
+ /*
+ * byte 1: . . . . . x10 x9 x8
+ * byte 2: x7 x6 x5 x4 x4 x2 x1 x0
+ */
+ input_report_abs(dev, ABS_X,
+ ((packet[1] & 0x07) << 8) | packet[2]);
+ /*
+ * byte 4: . . . . . . y9 y8
+ * byte 5: y7 y6 y5 y4 y3 y2 y1 y0
+ */
+ input_report_abs(dev, ABS_Y,
+ ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]));
break;

case 2:
- /* The coordinate of each finger is reported separately with
- a lower resolution for two finger touches */
- /* byte 0: . . ay8 ax8 . . . .
- byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 */
+ /*
+ * The coordinate of each finger is reported separately
+ * with a lower resolution for two finger touches:
+ * byte 0: . . ay8 ax8 . . . .
+ * byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
+ */
x1 = ((packet[0] & 0x10) << 4) | packet[1];
/* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */
y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]);
- /* byte 3: . . by8 bx8 . . . .
- byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 */
+ /*
+ * byte 3: . . by8 bx8 . . . .
+ * byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
+ */
x2 = ((packet[3] & 0x10) << 4) | packet[4];
/* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */
y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]);
- /* For compatibility with the X Synaptics driver scale up one
- coordinate and report as ordinary mouse movent */
+ /*
+ * For compatibility with the X Synaptics driver scale up
+ * one coordinate and report as ordinary mouse movent
+ */
input_report_abs(dev, ABS_X, x1 << 2);
input_report_abs(dev, ABS_Y, y1 << 2);
- /* For compatibility with the proprietary X Elantech driver
- report both coordinates as hat coordinates */
+ /*
+ * For compatibility with the proprietary X Elantech driver
+ * report both coordinates as hat coordinates
+ */
input_report_abs(dev, ABS_HAT0X, x1);
input_report_abs(dev, ABS_HAT0Y, y1);
input_report_abs(dev, ABS_HAT1X, x2);

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 41a38d9e632f7c9ec5ad8fc627567d97f4302c4a upstream.

The current code creates directories in procfs named after interfaces,
but doesn't handle renaming. This can result in name collisions and
consequent WARNINGs. It also means that the interface name cannot
reliably be used to remove the directory - in fact the current code
doesn't even try, and always uses "wlan0"!

Since the name of a proc_dir_entry is embedded in it, use that when
removing it.

Add a netdev notifier to catch interface renaming, and remove and
re-add the directory at this point.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/staging/rtl8192su/r8192U_core.c | 35 +++++++++++++++++++++++++++++---
1 file changed, 32 insertions(+), 3 deletions(-)

--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -25,6 +25,7 @@
*/

#include <linux/vmalloc.h>
+#include <linux/notifier.h>

#undef LOOP_TEST
#undef DUMP_RX
@@ -160,6 +161,8 @@ MODULE_PARM_DESC(channels," Channel bitm
static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id);
static void __devexit rtl8192_usb_disconnect(struct usb_interface *intf);
+static const struct net_device_ops rtl8192_netdev_ops;
+static struct notifier_block proc_netdev_notifier;

static struct usb_driver rtl8192_usb_driver = {
.name = RTL819xU_MODULE_NAME, /* Driver name */
@@ -961,14 +964,22 @@ static int proc_get_stats_rx(char *page,

int rtl8192_proc_module_init(void)
{
+ int ret;
+
RT_TRACE(COMP_INIT, "Initializing proc filesystem");
rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net);
- return rtl8192_proc ? 0 : -ENOMEM;
+ if (!rtl8192_proc)
+ return -ENOMEM;
+ ret = register_netdevice_notifier(&proc_netdev_notifier);
+ if (ret)
+ remove_proc_entry(RTL819xU_MODULE_NAME, init_net.proc_net);
+ return ret;
}


void rtl8192_proc_module_remove(void)
{
+ unregister_netdevice_notifier(&proc_netdev_notifier);
remove_proc_entry(RTL819xU_MODULE_NAME, init_net.proc_net);
}

@@ -996,8 +1007,7 @@ void rtl8192_proc_remove_one(struct net_
remove_proc_entry("registers-e", priv->dir_dev);
// remove_proc_entry("cck-registers",priv->dir_dev);
// remove_proc_entry("ofdm-registers",priv->dir_dev);
- //remove_proc_entry(dev->name, rtl8192_proc);
- remove_proc_entry("wlan0", rtl8192_proc);
+ remove_proc_entry(priv->dir_dev->name, rtl8192_proc);
priv->dir_dev = NULL;
}
}
@@ -1114,6 +1124,25 @@ void rtl8192_proc_init_one(struct net_de
dev->name);
}
}
+
+static int proc_netdev_event(struct notifier_block *this,
+ unsigned long event, void *ptr)
+{
+ struct net_device *net_dev = ptr;
+
+ if (net_dev->netdev_ops == &rtl8192_netdev_ops &&
+ event == NETDEV_CHANGENAME) {
+ rtl8192_proc_remove_one(net_dev);
+ rtl8192_proc_init_one(net_dev);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block proc_netdev_notifier = {
+ .notifier_call = proc_netdev_event,
+};
+
/****************************************************************************
-----------------------------MISC STUFF-------------------------
*****************************************************************************/

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Florian Ragwitz <ra...@debian.org>

commit f81bc788ff91d4efd4baf88b2c29713838caa8e5 upstream.

Apparently hardware vendors now ship elantech touchpads with different version
magic. This options allows for them to be tested easier with the current driver
in order to add their magic to the whitelist later.

Signed-off-by: Florian Ragwitz <ra...@debian.org>
Signed-off-by: Dmitry Torokhov <dt...@mail.ru>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/input/mouse/elantech.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -24,6 +24,10 @@
printk(KERN_DEBUG format, ##arg); \
} while (0)

+static bool force_elantech;
+module_param_named(force_elantech, force_elantech, bool, 0644);
+MODULE_PARM_DESC(force_elantech, "Force the Elantech PS/2 protocol extension to be used, 1 = enabled, 0 = disabled (default).");
+
/*
* Send a Synaptics style sliced query command
*/
@@ -595,8 +599,12 @@ int elantech_detect(struct psmouse *psmo
param[0], param[1], param[2]);

if (param[0] == 0 || param[1] != 0) {
- pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
- return -1;
+ if (!force_elantech) {
+ pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+ return -1;
+ }
+
+ pr_debug("elantech.c: Probably not a real Elantech touchpad. Enabling anyway due to force_elantech.\n");
}

if (set_properties) {

Greg KH

unread,
May 5, 2011, 9:00:01 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit b3ccbb24e8914973be0d2ee7b66e44cecaed9bf5 upstream.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: David S. Miller <da...@davemloft.net>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/tokenring/tms380tr.c | 2 ++


1 file changed, 2 insertions(+)

--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -1364,6 +1364,8 @@ static int tms380tr_reset_adapter(struct
return (-1);
}

+MODULE_FIRMWARE("tms380tr.bin");
+
/*
* Starts bring up diagnostics of token ring adapter and evaluates
* diagnostic results.

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Steven Whitehouse <swhi...@redhat.com>

commit 1e72c0f7c40e665d2ed40014750fdd2fa9968bcf upstream.

Both of these functions contained confusing and in one case
duplicate code. This patch adds a new check in do_glock()
so that we report -ENOENT if we are asked to sync a quota
entry which doesn't exist. Due to the previous patch this is
now reported correctly to userspace.

Also there are a few new comments, and I hope that the code
is easier to understand now.

Signed-off-by: Steven Whitehouse <swhi...@redhat.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/gfs2/quota.c | 82 +++++++++++++++++---------------------------------------
1 file changed, 26 insertions(+), 56 deletions(-)

--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -15,7 +15,7 @@
* fuzziness in the current usage value of IDs that are being used on different
* nodes in the cluster simultaneously. So, it is possible for a user on
* multiple nodes to overrun their quota, but that overrun is controlable.
- * Since quota tags are part of transactions, there is no need to a quota check
+ * Since quota tags are part of transactions, there is no need for a quota check
* program to be run on node crashes or anything like that.
*
* There are couple of knobs that let the administrator manage the quota
@@ -65,13 +65,6 @@
#define QUOTA_USER 1
#define QUOTA_GROUP 0

-struct gfs2_quota_host {
- u64 qu_limit;
- u64 qu_warn;
- s64 qu_value;
- u32 qu_ll_next;
-};
-
struct gfs2_quota_change_host {
u64 qc_change;
u32 qc_flags; /* GFS2_QCF_... */
@@ -617,33 +610,19 @@ static void do_qc(struct gfs2_quota_data
mutex_unlock(&sdp->sd_quota_mutex);
}

-static void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf)
-{
- const struct gfs2_quota *str = buf;
-
- qu->qu_limit = be64_to_cpu(str->qu_limit);
- qu->qu_warn = be64_to_cpu(str->qu_warn);
- qu->qu_value = be64_to_cpu(str->qu_value);
- qu->qu_ll_next = be32_to_cpu(str->qu_ll_next);
-}
-
-static void gfs2_quota_out(const struct gfs2_quota_host *qu, void *buf)
-{
- struct gfs2_quota *str = buf;
-
- str->qu_limit = cpu_to_be64(qu->qu_limit);
- str->qu_warn = cpu_to_be64(qu->qu_warn);
- str->qu_value = cpu_to_be64(qu->qu_value);
- str->qu_ll_next = cpu_to_be32(qu->qu_ll_next);
- memset(&str->qu_reserved, 0, sizeof(str->qu_reserved));
-}
-
/**
- * gfs2_adjust_quota
+ * gfs2_adjust_quota - adjust record of current block usage
+ * @ip: The quota inode
+ * @loc: Offset of the entry in the quota file
+ * @change: The amount of change to record
+ * @qd: The quota data
*
* This function was mostly borrowed from gfs2_block_truncate_page which was
* in turn mostly borrowed from ext3
+ *
+ * Returns: 0 or -ve on error
*/
+
static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
s64 change, struct gfs2_quota_data *qd)
{
@@ -655,8 +634,7 @@ static int gfs2_adjust_quota(struct gfs2
struct buffer_head *bh;
struct page *page;
void *kaddr;
- char *ptr;
- struct gfs2_quota_host qp;
+ struct gfs2_quota *qp;
s64 value;
int err = -EIO;

@@ -700,18 +678,13 @@ static int gfs2_adjust_quota(struct gfs2
gfs2_trans_add_bh(ip->i_gl, bh, 0);

kaddr = kmap_atomic(page, KM_USER0);
- ptr = kaddr + offset;
- gfs2_quota_in(&qp, ptr);
- qp.qu_value += change;
- value = qp.qu_value;
- gfs2_quota_out(&qp, ptr);
+ qp = kaddr + offset;
+ value = (s64)be64_to_cpu(qp->qu_value) + change;
+ qp->qu_value = cpu_to_be64(value);
+ qd->qd_qb.qb_value = qp->qu_value;
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
err = 0;
- qd->qd_qb.qb_magic = cpu_to_be32(GFS2_MAGIC);
- qd->qd_qb.qb_value = cpu_to_be64(value);
- ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_magic = cpu_to_be32(GFS2_MAGIC);
- ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_value = cpu_to_be64(value);
unlock:
unlock_page(page);
page_cache_release(page);
@@ -740,8 +713,7 @@ static int do_sync(unsigned int num_qd,

sort(qda, num_qd, sizeof(struct gfs2_quota_data *), sort_qd, NULL);
for (qx = 0; qx < num_qd; qx++) {
- error = gfs2_glock_nq_init(qda[qx]->qd_gl,
- LM_ST_EXCLUSIVE,
+ error = gfs2_glock_nq_init(qda[qx]->qd_gl, LM_ST_EXCLUSIVE,
GL_NOCACHE, &ghs[qx]);
if (error)
goto out;
@@ -796,8 +768,7 @@ static int do_sync(unsigned int num_qd,
qd = qda[x];
offset = qd2offset(qd);
error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync,
- (struct gfs2_quota_data *)
- qd);
+ (struct gfs2_quota_data *)qd);
if (error)
goto out_end_trans;

@@ -828,8 +799,7 @@ static int do_glock(struct gfs2_quota_da
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
struct gfs2_holder i_gh;
- struct gfs2_quota_host q;
- char buf[sizeof(struct gfs2_quota)];
+ struct gfs2_quota q;
int error;
struct gfs2_quota_lvb *qlvb;

@@ -853,22 +823,23 @@ restart:
if (error)
goto fail;

- memset(buf, 0, sizeof(struct gfs2_quota));
+ memset(&q, 0, sizeof(struct gfs2_quota));
pos = qd2offset(qd);
- error = gfs2_internal_read(ip, NULL, buf, &pos,
- sizeof(struct gfs2_quota));
+ error = gfs2_internal_read(ip, NULL, (char *)&q, &pos, sizeof(q));
if (error < 0)
goto fail_gunlock;
-
+ if ((error < sizeof(q)) && force_refresh) {
+ error = -ENOENT;
+ goto fail_gunlock;
+ }
gfs2_glock_dq_uninit(&i_gh);

- gfs2_quota_in(&q, buf);
qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb;
qlvb->qb_magic = cpu_to_be32(GFS2_MAGIC);
qlvb->__pad = 0;
- qlvb->qb_limit = cpu_to_be64(q.qu_limit);
- qlvb->qb_warn = cpu_to_be64(q.qu_warn);
- qlvb->qb_value = cpu_to_be64(q.qu_value);
+ qlvb->qb_limit = q.qu_limit;
+ qlvb->qb_warn = q.qu_warn;
+ qlvb->qb_value = q.qu_value;
qd->qd_qb = *qlvb;

if (gfs2_glock_is_blocking(qd->qd_gl)) {
@@ -1127,7 +1098,6 @@ int gfs2_quota_refresh(struct gfs2_sbd *
gfs2_glock_dq_uninit(&q_gh);

qd_put(qd);
-
return error;

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Takashi Iwai <ti...@suse.de>

commit 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7 upstream.

The new type of touchpads can be detected via a new query command
0x0c. The clickpad flags are in cap[0]:4 and cap[1]:0 bits.

When the device is detected, the driver now reports only the left
button as the supported buttons so that X11 driver can detect that
the device is Clickpad. A Clickpad device gives the button events
only as the middle button. The kernel driver morphs to the left
button. The real handling of Clickpad is done rather in X driver
side.

Signed-off-by: Takashi Iwai <ti...@suse.de>
Signed-off-by: Dmitry Torokhov <dt...@mail.ru>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/input/mouse/synaptics.c | 35 ++++++++++++++++++++++++++++++-----
drivers/input/mouse/synaptics.h | 4 ++++
2 files changed, 34 insertions(+), 5 deletions(-)

--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -135,7 +135,8 @@ static int synaptics_capability(struct p
if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap))
return -1;
priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
- priv->ext_cap = 0;
+ priv->ext_cap = priv->ext_cap_0c = 0;
+
if (!SYN_CAP_VALID(priv->capabilities))
return -1;

@@ -148,7 +149,7 @@ static int synaptics_capability(struct p
if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) {
if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
printk(KERN_ERR "Synaptics claims to have extended capabilities,"
- " but I'm not able to read them.");
+ " but I'm not able to read them.\n");
} else {
priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2];

@@ -160,6 +161,16 @@ static int synaptics_capability(struct p
priv->ext_cap &= 0xff0fff;
}
}
+
+ if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
+ printk(KERN_ERR "Synaptics claims to have extended capability 0x0c,"
+ " but I'm not able to read it.\n");
+ } else {
+ priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2];
+ }
+ }
+
return 0;
}

@@ -346,7 +357,15 @@ static void synaptics_parse_hw_state(uns
hw->left = (buf[0] & 0x01) ? 1 : 0;
hw->right = (buf[0] & 0x02) ? 1 : 0;

- if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /*
+ * Clickpad's button is transmitted as middle button,
+ * however, since it is primary button, we will report
+ * it as BTN_LEFT.
+ */
+ hw->left = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+
+ } else if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
if (hw->w == 2)
hw->scroll = (signed char)(buf[1]);
@@ -591,6 +610,12 @@ static void set_input_params(struct inpu

dev->absres[ABS_X] = priv->x_res;
dev->absres[ABS_Y] = priv->y_res;
+
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /* Clickpads report only left button */
+ __clear_bit(BTN_RIGHT, dev->keybit);
+ __clear_bit(BTN_MIDDLE, dev->keybit);
+ }
}

static void synaptics_disconnect(struct psmouse *psmouse)
@@ -689,10 +714,10 @@ int synaptics_init(struct psmouse *psmou

priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;

- printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n",
+ printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n",
SYN_ID_MODEL(priv->identity),
SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
- priv->model_id, priv->capabilities, priv->ext_cap);
+ priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);

set_input_params(psmouse->dev, priv);

--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -18,6 +18,7 @@
#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07
#define SYN_QUE_RESOLUTION 0x08
#define SYN_QUE_EXT_CAPAB 0x09
+#define SYN_QUE_EXT_CAPAB_0C 0x0c

/* synatics modes */
#define SYN_BIT_ABSOLUTE_MODE (1 << 7)
@@ -48,6 +49,8 @@
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
+#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
+#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100)

/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
@@ -96,6 +99,7 @@ struct synaptics_data {
unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */
unsigned long int ext_cap; /* Extended Capabilities */
+ unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */
unsigned long int identity; /* Identification */
int x_res; /* X resolution in units/mm */
int y_res; /* Y resolution in units/mm */

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Abhijith Das <ad...@redhat.com>

commit 8b4216018bdbfbb1b76150d202b15ee68c38e991 upstream.

HighMem pages on i686 do not get mapped to the buffer_heads and this was
causing a NULL pointer dereference when we were trying to memset page buffers
to zero.
We now use zero_user() that kmaps the page and directly manipulates page data.
This patch also fixes a boundary condition that was incorrect.

Signed-off-by: Abhi Das <ad...@redhat.com>
Signed-off-by: Steven Whitehouse <swhi...@redhat.com>
[Adjusted to apply to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/gfs2/quota.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -679,10 +679,8 @@ get_a_page:
if (!buffer_mapped(bh))
goto unlock_out;
/* If it's a newly allocated disk block for quota, zero it */
- if (buffer_new(bh)) {
- memset(bh->b_data, 0, bh->b_size);
- set_buffer_uptodate(bh);
- }
+ if (buffer_new(bh))
+ zero_user(page, pos - blocksize, bh->b_size);
}

if (PageUptodate(page))
@@ -708,7 +706,7 @@ get_a_page:

/* If quota straddles page boundary, we need to update the rest of the
* quota at the beginning of the next page */
- if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */
+ if ((offset + sizeof(struct gfs2_quota)) > PAGE_CACHE_SIZE) {
ptr = ptr + nbytes;
nbytes = sizeof(struct gfs2_quota) - nbytes;
offset = 0;

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Jovi Zhang <book...@gmail.com>

commit 43b7c3f051dea504afccc39bcb56d8e26c2e0b77 upstream.

this commit fix compilation warning as following:
linux-2.6/fs/nfs/nfs4proc.c:3265: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Jovi Zhang <book...@gmail.com>
Signed-off-by: Trond Myklebust <Trond.M...@netapp.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/nfs/nfs4proc.c | 2 +-


1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3142,7 +3142,7 @@ static int buf_to_pages_noslab(const voi
spages = pages;

do {
- len = min(PAGE_CACHE_SIZE, buflen);
+ len = min_t(size_t, PAGE_CACHE_SIZE, buflen);
newpage = alloc_page(GFP_KERNEL);

if (newpage == NULL)

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit 34336ec032878d1a32e7df881f16ce2145e53f83 upstream.

Replace run-time string formatting with preprocessor string
manipulation.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Acked-by: Divy Le Ray <di...@chelsio.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/cxgb3/common.h | 8 +++-----
drivers/net/cxgb3/cxgb3_main.c | 25 ++++++++++++++++---------
2 files changed, 19 insertions(+), 14 deletions(-)

--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -125,11 +125,9 @@ enum { /* adapter interrupt-maintaine
IRQ_NUM_STATS /* keep last */
};

-enum {
- TP_VERSION_MAJOR = 1,
- TP_VERSION_MINOR = 1,
- TP_VERSION_MICRO = 0
-};
+#define TP_VERSION_MAJOR 1
+#define TP_VERSION_MINOR 1
+#define TP_VERSION_MICRO 0

#define S_TP_VERSION_MAJOR 16
#define M_TP_VERSION_MAJOR 0xFF
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -44,6 +44,7 @@
#include <linux/rtnetlink.h>
#include <linux/firmware.h>
#include <linux/log2.h>
+#include <linux/stringify.h>
#include <asm/uaccess.h>

#include "common.h"
@@ -989,11 +990,21 @@ static int bind_qsets(struct adapter *ad
return err;
}

-#define FW_FNAME "cxgb3/t3fw-%d.%d.%d.bin"
-#define TPSRAM_NAME "cxgb3/t3%c_psram-%d.%d.%d.bin"
+#define FW_VERSION __stringify(FW_VERSION_MAJOR) "." \
+ __stringify(FW_VERSION_MINOR) "." __stringify(FW_VERSION_MICRO)
+#define FW_FNAME "cxgb3/t3fw-" FW_VERSION ".bin"
+#define TPSRAM_VERSION __stringify(TP_VERSION_MAJOR) "." \
+ __stringify(TP_VERSION_MINOR) "." __stringify(TP_VERSION_MICRO)
+#define TPSRAM_NAME "cxgb3/t3%c_psram-" TPSRAM_VERSION ".bin"
#define AEL2005_OPT_EDC_NAME "cxgb3/ael2005_opt_edc.bin"
#define AEL2005_TWX_EDC_NAME "cxgb3/ael2005_twx_edc.bin"
#define AEL2020_TWX_EDC_NAME "cxgb3/ael2020_twx_edc.bin"
+MODULE_FIRMWARE(FW_FNAME);
+MODULE_FIRMWARE("cxgb3/t3b_psram-" TPSRAM_VERSION ".bin");
+MODULE_FIRMWARE("cxgb3/t3c_psram-" TPSRAM_VERSION ".bin");
+MODULE_FIRMWARE(AEL2005_OPT_EDC_NAME);
+MODULE_FIRMWARE(AEL2005_TWX_EDC_NAME);
+MODULE_FIRMWARE(AEL2020_TWX_EDC_NAME);

static inline const char *get_edc_fw_name(int edc_idx)
{
@@ -1064,16 +1075,13 @@ int t3_get_edc_fw(struct cphy *phy, int
static int upgrade_fw(struct adapter *adap)
{
int ret;
- char buf[64];
const struct firmware *fw;
struct device *dev = &adap->pdev->dev;

- snprintf(buf, sizeof(buf), FW_FNAME, FW_VERSION_MAJOR,
- FW_VERSION_MINOR, FW_VERSION_MICRO);
- ret = request_firmware(&fw, buf, dev);
+ ret = request_firmware(&fw, FW_FNAME, dev);
if (ret < 0) {
dev_err(dev, "could not upgrade firmware: unable to load %s\n",
- buf);
+ FW_FNAME);
return ret;
}
ret = t3_load_fw(adap, fw->data, fw->size);
@@ -1117,8 +1125,7 @@ static int update_tpsram(struct adapter
if (!rev)
return 0;

- snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
- TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
+ snprintf(buf, sizeof(buf), TPSRAM_NAME, rev);

ret = request_firmware(&tpsram, buf, dev);
if (ret < 0) {

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Florian Schilhabel <florian.c....@googlemail.com>

commit 60b42de30ad6fb131dc8e9dbd11a8a9ea0ab394c upstream.

This patch removes some device-ids.
The list of unsupported devices was extracted from realteks driver package.
removed IDs are:
(0x0bda, 0x8192)
(0x0bda, 0x8709)
(0x07aa, 0x0043)
(0x050d, 0x805E)
(0x0df6, 0x0031)
(0x1740, 0x9201)
(0x2001, 0x3301)
(0x5a57, 0x0290)
These devices are _not_ rtl819su based.

Signed-off-by: Florian Schilhabel <florian.c....@googlemail.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/staging/rtl8192su/r8192U_core.c | 14 --------------
1 file changed, 14 deletions(-)

--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -114,22 +114,8 @@ u32 rt_global_debug_component = \
static struct usb_device_id rtl8192_usb_id_tbl[] = {
/* Realtek */
{USB_DEVICE(0x0bda, 0x8171)},
- {USB_DEVICE(0x0bda, 0x8192)},
- {USB_DEVICE(0x0bda, 0x8709)},
- /* Corega */
- {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 */
- /* EnGenius */
- {USB_DEVICE(0x1740, 0x9201)},
- /* Dlink */
- {USB_DEVICE(0x2001, 0x3301)},
- /* Zinwell */
- {USB_DEVICE(0x5a57, 0x0290)},
/* Guillemot */
{USB_DEVICE(0x06f8, 0xe031)},
//92SU

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Florian Schilhabel <florian.c....@googlemail.com>

commit 199ef62a287b429a8fa3b7dc5ae6b69f607bf324 upstream.

added 2 checks for skb == NULL.
plus cosmetics

Signed-off-by: Florian Schilhabel <florian.c....@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

[bwh: Remove cosmetic changes]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/staging/rtl8192su/r8192S_firmware.c | 5 +++++
drivers/staging/rtl8192su/r819xU_cmdpkt.c | 6 ++++++
2 files changed, 11 insertions(+)

--- a/drivers/staging/rtl8192su/r8192S_firmware.c
+++ b/drivers/staging/rtl8192su/r8192S_firmware.c
@@ -68,6 +68,11 @@ bool FirmwareDownloadCode(struct net_dev

/* Allocate skb buffer to contain firmware info and tx descriptor info. */
skb = dev_alloc_skb(frag_length);
+ if (skb == NULL) {
+ RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
+ __func__);
+ goto cmdsend_downloadcode_fail;
+ }
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));

tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
--- a/drivers/staging/rtl8192su/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192su/r819xU_cmdpkt.c
@@ -56,6 +56,12 @@ SendTxCommandPacket(

//Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
+ if (skb == NULL) {
+ RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
+ __func__);
+ rtStatus = false;
+ return rtStatus;
+ }
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Florian Schilhabel <florian.c....@googlemail.com>

commit 15d93ed070125d51693f102a0f94045dcaf30d9b upstream.

This patch adds some device ids.
The list of supported devices was extracted from realteks driver package.
(0x050d, 0x815F) and (0x0df6, 0x004b) are not in the official list of
supported devices and may not work correctly.
In case of problems with these, they should probably be removed from the list.

Signed-off-by: Florian Schilhabel <florian.c....@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

[bwh: Adjust context for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/staging/rtl8192su/r8192U_core.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)

--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -112,14 +112,30 @@ u32 rt_global_debug_component = \
#define CAM_CONTENT_COUNT 8



static struct usb_device_id rtl8192_usb_id_tbl[] = {

- /* Realtek */
- {USB_DEVICE(0x0bda, 0x8171)},
- {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 */
- {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */
- /* Guillemot */
- {USB_DEVICE(0x06f8, 0xe031)},
- //92SU
+ {USB_DEVICE(0x0bda, 0x8171)}, /* Realtek */
{USB_DEVICE(0x0bda, 0x8172)},
+ {USB_DEVICE(0x0bda, 0x8173)},
+ {USB_DEVICE(0x0bda, 0x8174)},
+ {USB_DEVICE(0x0bda, 0x8712)},
+ {USB_DEVICE(0x0bda, 0x8713)},
+ {USB_DEVICE(0x07aa, 0x0047)},
+ {USB_DEVICE(0x07d1, 0x3303)},
+ {USB_DEVICE(0x07d1, 0x3302)},
+ {USB_DEVICE(0x07d1, 0x3300)},
+ {USB_DEVICE(0x1740, 0x9603)},
+ {USB_DEVICE(0x1740, 0x9605)},
+ {USB_DEVICE(0x050d, 0x815F)},
+ {USB_DEVICE(0x06f8, 0xe031)},
+ {USB_DEVICE(0x7392, 0x7611)},
+ {USB_DEVICE(0x7392, 0x7612)},
+ {USB_DEVICE(0x7392, 0x7622)},
+ {USB_DEVICE(0x0DF6, 0x0045)},
+ {USB_DEVICE(0x0E66, 0x0015)},
+ {USB_DEVICE(0x0E66, 0x0016)},
+ {USB_DEVICE(0x0b05, 0x1786)},
+ /* these are not in the official list */
+ {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 */
+ {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */
{}
};

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Alan Stern <st...@rowland.harvard.edu>

commit 7aba8d014341341590ecb64050b7a026642a62eb upstream.

This patch (as1364) avoids enabling remote wakeup by default on all
non-root-hub USB devices. Individual drivers or userspace will have
to enable it wherever it is needed, such as for keyboards or network
interfaces. Note: This affects only system sleep, not autosuspend.

External hubs will continue to relay wakeup requests received from
downstream through their upstream port, even when remote wakeup is not
enabled for the hub itself. Disabling remote wakeup on a hub merely
prevents it from generating wakeup requests in response to connect,
disconnect, and overcurrent events.

Signed-off-by: Alan Stern <st...@rowland.harvard.edu>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/usb/core/hub.c | 1 -
1 file changed, 1 deletion(-)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1795,7 +1795,6 @@ int usb_new_device(struct usb_device *ud
* sysfs power/wakeup controls wakeup enabled/disabled
*/
device_init_wakeup(&udev->dev, 0);
- device_set_wakeup_enable(&udev->dev, 1);
}

err = usb_enumerate_device(udev); /* Read descriptors */

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: James Bottomley <James.B...@suse.de>

commit 86cbfb5607d4b81b1a993ff689bbd2addd5d3a9b upstream.

SCSI uses request_queue->queuedata == NULL as a signal that the queue
is dying. We set this state in the sdev release function. However,
this allows a small window where we release the last reference but
haven't quite got to this stage yet and so something will try to take
a reference in scsi_request_fn and oops. It's very rare, but we had a
report here, so we're pushing this as a bug fix

The actual fix is to set request_queue->queuedata to NULL in
scsi_remove_device() before we drop the reference. This causes
correct automatic rejects from scsi_request_fn as people who hold
additional references try to submit work and prevents anything from
getting a new reference to the sdev that way.

Signed-off-by: James Bottomley <James.B...@suse.de>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/scsi/scsi_sysfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -318,14 +318,8 @@ static void scsi_device_dev_release_user
kfree(evt);
}

- if (sdev->request_queue) {
- sdev->request_queue->queuedata = NULL;
- /* user context needed to free queue */
- scsi_free_queue(sdev->request_queue);
- /* temporary expedient, try to catch use of queue lock
- * after free of sdev */
- sdev->request_queue = NULL;
- }
+ /* NULL queue means the device can't be used */
+ sdev->request_queue = NULL;

scsi_target_reap(scsi_target(sdev));

@@ -925,6 +919,12 @@ void __scsi_remove_device(struct scsi_de
if (sdev->host->hostt->slave_destroy)
sdev->host->hostt->slave_destroy(sdev);
transport_destroy_device(dev);
+
+ /* cause the request function to reject all I/O requests */
+ sdev->request_queue->queuedata = NULL;
+
+ /* Freeing the queue signals to block that we're done */
+ scsi_free_queue(sdev->request_queue);
put_device(dev);

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Dhananjay Phadke <dhan...@netxen.com>

commit 7e8e5d9718744b817bfea6f020586d7035cc89f4 upstream.

Add MODULE_FIRMWARE hints for various firmware file types,
required by different chip revisions.

Signed-off-by: Dhananjay Phadke <dhan...@netxen.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
drivers/net/netxen/netxen_nic.h | 6 ++++++
drivers/net/netxen/netxen_nic_init.c | 6 +++++-
drivers/net/netxen/netxen_nic_main.c | 4 ++++
3 files changed, 15 insertions(+), 1 deletion(-)

--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -487,6 +487,12 @@ struct status_desc {
#define NX_P3_MN_ROMIMAGE 2
#define NX_FLASH_ROMIMAGE 3

+#define NX_P2_MN_ROMIMAGE_NAME "nxromimg.bin"
+#define NX_P3_CT_ROMIMAGE_NAME "nx3fwct.bin"
+#define NX_P3_MN_ROMIMAGE_NAME "nx3fwmn.bin"
+#define NX_UNIFIED_ROMIMAGE_NAME "phanfw.bin"
+#define NX_FLASH_ROMIMAGE_NAME "flash"
+
extern char netxen_nic_driver_name[];

/* Number of status descriptors to handle per interrupt */
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -673,7 +673,11 @@ netxen_need_fw_reset(struct netxen_adapt
}

static char *fw_name[] = {
- "nxromimg.bin", "nx3fwct.bin", "nx3fwmn.bin", "flash",
+ NX_P2_MN_ROMIMAGE_NAME,
+ NX_P3_CT_ROMIMAGE_NAME,
+ NX_P3_MN_ROMIMAGE_NAME,
+ NX_UNIFIED_ROMIMAGE_NAME,
+ NX_FLASH_ROMIMAGE_NAME,
};

int
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -38,6 +38,10 @@
MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(NETXEN_NIC_LINUX_VERSIONID);
+MODULE_FIRMWARE(NX_P2_MN_ROMIMAGE_NAME);
+MODULE_FIRMWARE(NX_P3_CT_ROMIMAGE_NAME);
+MODULE_FIRMWARE(NX_P3_MN_ROMIMAGE_NAME);
+MODULE_FIRMWARE(NX_UNIFIED_ROMIMAGE_NAME);

char netxen_nic_driver_name[] = "netxen_nic";
static char netxen_nic_driver_string[] = "NetXen Network Driver version "

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Éric Piel <eric...@tremplin-utc.net>

commit 7f29f17b57255b6395046805a98bc663ded63fb8 upstream.

According to the Dell/Ubuntu driver, what was previously observed as
"jumpy cursor" corresponds to the hardware sending incorrect data for
the first two reports of a one touch finger. So let's use the same
workaround as in the other driver. Also, detect another firmware
version with the same behaviour, as in the other driver.

Signed-off-by: Éric Piel <eric...@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dt...@mail.ru>
[bwh: Adjust for 2.6.32]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/input/mouse/elantech.c | 21 ++++++++++-----------
drivers/input/mouse/elantech.h | 7 ++++---
2 files changed, 14 insertions(+), 14 deletions(-)

--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -182,7 +182,6 @@ static void elantech_report_absolute_v1(
struct elantech_data *etd = psmouse->private;
unsigned char *packet = psmouse->packet;
int fingers;
- static int old_fingers;

if (etd->fw_version < 0x020000) {
/*
@@ -200,10 +199,13 @@ static void elantech_report_absolute_v1(
}

if (etd->jumpy_cursor) {
- /* Discard packets that are likely to have bogus coordinates */
- if (fingers > old_fingers) {
+ if (fingers != 1) {
+ etd->single_finger_reports = 0;
+ } else if (etd->single_finger_reports < 2) {
+ /* Discard first 2 reports of one finger, bogus */
+ etd->single_finger_reports++;
elantech_debug("elantech.c: discarding packet\n");
- goto discard_packet_v1;
+ return;
}
}

@@ -235,9 +237,6 @@ static void elantech_report_absolute_v1(
}

input_sync(dev);
-
- discard_packet_v1:
- old_fingers = fingers;
}

/*
@@ -733,14 +732,14 @@ int elantech_init(struct psmouse *psmous
etd->capabilities = param[0];

/*
- * This firmware seems to suffer from misreporting coordinates when
+ * This firmware suffers from misreporting coordinates when
* a touch action starts causing the mouse cursor or scrolled page
* to jump. Enable a workaround.
*/
- if (etd->fw_version == 0x020022) {
- pr_info("elantech.c: firmware version 2.0.34 detected, "
+ if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
+ pr_info("elantech.c: firmware version 2.0.34/2.6.0 detected, "
"enabling jumpy cursor workaround\n");
- etd->jumpy_cursor = 1;
+ etd->jumpy_cursor = true;
}

if (elantech_set_absolute_mode(psmouse)) {
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -100,10 +100,11 @@ struct elantech_data {
unsigned char reg_26;
unsigned char debug;
unsigned char capabilities;
- unsigned char paritycheck;
- unsigned char jumpy_cursor;
+ bool paritycheck;
+ bool jumpy_cursor;
unsigned char hw_version;
- unsigned int fw_version;
+ unsigned int fw_version;
+ unsigned int single_finger_reports;
unsigned char parity[256];
};

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Edgar Hucek <gi...@dark-green.com>

commit 132af03233b493101a53010383b5abb5b9ff1e51 upstream.

This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the

applesmc driver.

[ryd...@euromail.se: minor cleanup]
Signed-off-by: Edgar Hucek <gi...@dark-green.com>
Signed-off-by: Henrik Rydberg <ryd...@euromail.se>
Signed-off-by: Guenter Roeck <guente...@ericsson.com>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/hwmon/applesmc.c | 10 ++++++++++
1 file changed, 10 insertions(+)

--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -162,6 +162,10 @@ static const char *temperature_sensors_s
/* Set 22: MacBook Pro 7,1 */
{ "TB0T", "TB1T", "TB2T", "TC0D", "TC0P", "TN0D", "TN0P", "TN0S",
"TN1D", "TN1F", "TN1G", "TN1S", "Th1H", "Ts0P", "Ts0S", NULL },
+/* Set 23: MacBook Air 3,1 */
+ { "TB0T", "TB1T", "TB2T", "TC0D", "TC0E", "TC0P", "TC1E", "TCZ3",
+ "TCZ4", "TCZ5", "TG0E", "TG1E", "TG2E", "TGZ3", "TGZ4", "TGZ5",
+ "TH0F", "TH0O", "TM0P" },


};

/* List of keys used to read/write fan speeds */

@@ -1382,11 +1386,17 @@ static __initdata struct dmi_match_data
{ .accelerometer = 1, .light = 1, .temperature_set = 21 },
/* MacBook Pro 7,1: accelerometer, backlight and temperature set 22 */
{ .accelerometer = 1, .light = 1, .temperature_set = 22 },
+/* MacBook Air 3,1: accelerometer, backlight and temperature set 23 */
+ { .accelerometer = 0, .light = 0, .temperature_set = 23 },


};

/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".

* So we need to put "Apple MacBook Pro" before "Apple MacBook". */
static __initdata struct dmi_system_id applesmc_whitelist[] = {
+ { applesmc_dmi_match, "Apple MacBook Air 3", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3") },
+ &applesmc_dmi_data[23]},
{ applesmc_dmi_match, "Apple MacBook Air 2", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir2") },

Greg KH

unread,
May 5, 2011, 9:00:03 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Eric W. Biederman <ebie...@xmission.com>

commit a05d2ad1c1f391c7f514a1d1e09b5417968a7d07 upstream.

This fixes the following oops discovered by Dan Aloni:
> Anyway, the following is the output of the Oops that I got on the
> Ubuntu kernel on which I first detected the problem
> (2.6.37-12-generic). The Oops that followed will be more useful, I
> guess.

>[ 5594.669852] BUG: unable to handle kernel NULL pointer dereference
> at           (null)
> [ 5594.681606] IP: [<ffffffff81550b7b>] unix_dgram_recvmsg+0x1fb/0x420
> [ 5594.687576] PGD 2a05d067 PUD 2b951067 PMD 0
> [ 5594.693720] Oops: 0002 [#1] SMP
> [ 5594.699888] last sysfs file:

The bug was that unix domain sockets use a pseduo packet for
connecting and accept uses that psudo packet to get the socket.
In the buggy seqpacket case we were allowing unconnected
sockets to call recvmsg and try to receive the pseudo packet.

That is always wrong and as of commit 7361c36c5 the pseudo
packet had become enough different from a normal packet
that the kernel started oopsing.

Do for seqpacket_recv what was done for seqpacket_send in 2.5
and only allow it on connected seqpacket sockets.

Tested-by: Dan Aloni <d...@aloni.org>
Signed-off-by: Eric W. Biederman <ebie...@xmission.com>


Signed-off-by: David S. Miller <da...@davemloft.net>

Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>

---
net/unix/af_unix.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -503,6 +503,8 @@ static int unix_dgram_connect(struct soc
int, int);
static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,
struct msghdr *, size_t);
+static int unix_seqpacket_recvmsg(struct kiocb *, struct socket *,
+ struct msghdr *, size_t, int);

static const struct proto_ops unix_stream_ops = {
.family = PF_UNIX,
@@ -562,7 +564,7 @@ static const struct proto_ops unix_seqpa
.setsockopt = sock_no_setsockopt,
.getsockopt = sock_no_getsockopt,
.sendmsg = unix_seqpacket_sendmsg,
- .recvmsg = unix_dgram_recvmsg,
+ .recvmsg = unix_seqpacket_recvmsg,
.mmap = sock_no_mmap,
.sendpage = sock_no_sendpage,
};
@@ -1639,6 +1641,18 @@ static int unix_seqpacket_sendmsg(struct
return unix_dgram_sendmsg(kiocb, sock, msg, len);
}

+static int unix_seqpacket_recvmsg(struct kiocb *iocb, struct socket *sock,
+ struct msghdr *msg, size_t size,
+ int flags)
+{
+ struct sock *sk = sock->sk;
+
+ if (sk->sk_state != TCP_ESTABLISHED)
+ return -ENOTCONN;
+
+ return unix_dgram_recvmsg(iocb, sock, msg, size, flags);
+}
+
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
{
struct unix_sock *u = unix_sk(sk);

Greg KH

unread,
May 5, 2011, 9:00:02 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit a254dba37c5a372fc8b44ba29509ba052d4e859d upstream.

Reported-by: Carmen Cru <carme...@belgacom.net>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: Takashi Iwai <ti...@suse.de>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

sound/synth/emux/emux_hwdep.c | 3 +++
1 file changed, 3 insertions(+)

--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -128,6 +128,9 @@ snd_emux_init_hwdep(struct snd_emux *emu
strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME);
hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE;
hw->ops.ioctl = snd_emux_hwdep_ioctl;
+ /* The ioctl parameter types are compatible between 32- and
+ * 64-bit architectures, so use the same function. */
+ hw->ops.ioctl_compat = snd_emux_hwdep_ioctl;
hw->exclusive = 1;
hw->private_data = emu;
if ((err = snd_card_register(emu->card)) < 0)

Greg KH

unread,
May 5, 2011, 9:00:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Abhijith Das <ad...@redhat.com>

commit 7e619bc3e6252dc746f64ac3b486e784822e9533 upstream.

This is the upstream fix for this bug. This patch differs
from the RHEL5 fix (Red Hat bz #555754) which simply writes to the 8-byte
value field of the quota. In upstream quota code, we're
required to write the entire quota (88 bytes) which can be split
across a page boundary. We check for such quotas, and read/write
the two parts from/to the corresponding pages holding these parts.

With this patch, I don't see the bug anymore using the reproducer
in Red Hat bz 555754. I successfully ran a couple of simple tests/mounts/
umounts and it doesn't seem like this patch breaks anything else.

Signed-off-by: Abhi Das <ad...@redhat.com>
Signed-off-by: Steven Whitehouse <swhi...@redhat.com>

[Backported to 2.6.32 by dann frazier <da...@debian.org>]


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

fs/gfs2/quota.c | 62 +++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 48 insertions(+), 14 deletions(-)

--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -633,14 +633,29 @@ static int gfs2_adjust_quota(struct gfs2
unsigned blocksize, iblock, pos;


struct buffer_head *bh;
struct page *page;

- void *kaddr;
- struct gfs2_quota *qp;
- s64 value;
- int err = -EIO;
+ void *kaddr, *ptr;
+ struct gfs2_quota q, *qp;
+ int err, nbytes;

if (gfs2_is_stuffed(ip))
gfs2_unstuff_dinode(ip, NULL);
-
+


+ memset(&q, 0, sizeof(struct gfs2_quota));

+ err = gfs2_internal_read(ip, NULL, (char *)&q, &loc, sizeof(q));
+ if (err < 0)
+ return err;
+
+ err = -EIO;
+ qp = &q;
+ qp->qu_value = be64_to_cpu(qp->qu_value);
+ qp->qu_value += change;
+ qp->qu_value = cpu_to_be64(qp->qu_value);


+ qd->qd_qb.qb_value = qp->qu_value;

+
+ /* Write the quota into the quota file on disk */
+ ptr = qp;
+ nbytes = sizeof(struct gfs2_quota);
+get_a_page:
page = grab_cache_page(mapping, index);
if (!page)
return -ENOMEM;
@@ -662,7 +677,12 @@ static int gfs2_adjust_quota(struct gfs2
if (!buffer_mapped(bh)) {
gfs2_block_map(inode, iblock, bh, 1);
if (!buffer_mapped(bh))
- goto unlock;
+ goto unlock_out;
+ /* If it's a newly allocated disk block for quota, zero it */
+ if (buffer_new(bh)) {
+ memset(bh->b_data, 0, bh->b_size);
+ set_buffer_uptodate(bh);
+ }
}

if (PageUptodate(page))
@@ -672,20 +692,32 @@ static int gfs2_adjust_quota(struct gfs2
ll_rw_block(READ_META, 1, &bh);
wait_on_buffer(bh);
if (!buffer_uptodate(bh))
- goto unlock;
+ goto unlock_out;


}

gfs2_trans_add_bh(ip->i_gl, bh, 0);

kaddr = kmap_atomic(page, KM_USER0);

- qp = kaddr + offset;
- value = (s64)be64_to_cpu(qp->qu_value) + change;
- qp->qu_value = cpu_to_be64(value);
- qd->qd_qb.qb_value = qp->qu_value;
+ if (offset + sizeof(struct gfs2_quota) > PAGE_CACHE_SIZE)
+ nbytes = PAGE_CACHE_SIZE - offset;
+ memcpy(kaddr + offset, ptr, nbytes);
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
+ unlock_page(page);
+ page_cache_release(page);
+
+ /* If quota straddles page boundary, we need to update the rest of the
+ * quota at the beginning of the next page */
+ if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */
+ ptr = ptr + nbytes;
+ nbytes = sizeof(struct gfs2_quota) - nbytes;
+ offset = 0;
+ index++;
+ goto get_a_page;
+ }
err = 0;
-unlock:
+ return err;
+unlock_out:
unlock_page(page);
page_cache_release(page);
return err;
@@ -748,8 +780,10 @@ static int do_sync(unsigned int num_qd,
* rgrp since it won't be allocated during the transaction
*/
al->al_requested = 1;
- /* +1 in the end for block requested above for unstuffing */
- blocks = num_qd * data_blocks + RES_DINODE + num_qd + 1;
+ /* +3 in the end for unstuffing block, inode size update block
+ * and another block in case quota straddles page boundary and
+ * two blocks need to be updated instead of 1 */
+ blocks = num_qd * data_blocks + RES_DINODE + num_qd + 3;

if (nalloc)
al->al_requested += nalloc * (data_blocks + ind_blocks);

Greg KH

unread,
May 5, 2011, 9:00:05 PM5/5/11
to
2.6.32-longterm review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <b...@decadent.org.uk>

commit b9721d5a2fa00ad979c19a9511d43d2664d5381c upstream.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
Signed-off-by: David S. Miller <da...@davemloft.net>


Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---

drivers/net/myri10ge/myri10ge.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -264,6 +264,10 @@ static char *myri10ge_fw_unaligned = "my
static char *myri10ge_fw_aligned = "myri10ge_eth_z8e.dat";
static char *myri10ge_fw_rss_unaligned = "myri10ge_rss_ethp_z8e.dat";
static char *myri10ge_fw_rss_aligned = "myri10ge_rss_eth_z8e.dat";
+MODULE_FIRMWARE("myri10ge_ethp_z8e.dat");
+MODULE_FIRMWARE("myri10ge_eth_z8e.dat");
+MODULE_FIRMWARE("myri10ge_rss_ethp_z8e.dat");
+MODULE_FIRMWARE("myri10ge_rss_eth_z8e.dat");

static char *myri10ge_fw_name = NULL;
module_param(myri10ge_fw_name, charp, S_IRUGO | S_IWUSR);

It is loading more messages.
0 new messages