2.6.27.49-rc1 stable review
Subsystems (14)
cover 2.6.27.49-rc1 stable review
This is the start of the stable review cycle for the 2.6.27.49 release. There are 17 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by August 1, 2010, 18:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.27.49-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/x86/kernel/pci-calgary_64.c | 17 +++++++++------ drivers/char/agp/amd64-agp.c | 27 +++++++++++++---------- drivers/hwmon/coretemp.c | 32 +++++++++++++++++++++++++++- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +- drivers/net/bonding/bond_main.c | 1 + drivers/net/cpmac.c | 3 +- drivers/net/sky2.c | 19 ++++++++++++---- drivers/net/wireless/hostap/hostap_cs.c | 10 +++++++++ drivers/net/wireless/hostap/hostap_hw.c | 13 +++++++++++ drivers/net/wireless/hostap/hostap_wlan.h | 2 +- drivers/scsi/aacraid/commctrl.c | 4 +- fs/cifs/cifssmb.c | 16 ++++++++++++++ fs/cifs/sess.c | 10 +-------- fs/ecryptfs/messaging.c | 17 ++++++++------- include/math-emu/op-common.h | 2 +- net/ipv6/netfilter/ip6t_REJECT.c | 6 +++- scripts/mod/modpost.c | 2 +- 18 files changed, 133 insertions(+), 54 deletions(-)
PATCH 1/17 hwmon: (coretemp) Properly label the sensors
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit 3f4f09b4be35d38d6e2bf22c989443e65e70fc4c upstream.
Don't assume that CPU entry number and core ID always match. It worked in the simple cases (single CPU, no HT) but fails on multi-CPU systems.
--- drivers/hwmon/coretemp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/coretemp.c +5 -1
@@ -52,6 +52,7 @@ struct coretemp_data {struct mutex update_lock;const char *name;u32 id; +u16 core_id;char valid;/* zero until following fields are valid */ unsigned long last_updated;/* in jiffies */ int temp;
@@ -74,7 +75,7 @@ static ssize_t show_name(struct device *if (attr->index ==SHOW_NAME ) ret =sprintf (buf,"%s\n" , data->name);else /* show label */ - ret =sprintf (buf,"Core %d\n" , data->id); + ret =sprintf (buf,"Core %d\n" , data->core_id);return ret; }
@@ -216,6 +217,9 @@ static int __devinit coretemp_probe(stru } data->id = pdev->id; +#ifdef CONFIG_SMP + data->core_id = c->cpu_core_id; +#endif data->name ="coretemp" ;mutex_init (&data->update_lock);
PATCH 2/17 hwmon: (coretemp) Skip duplicate CPU entries
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit d883b9f0977269d519469da72faec6a7f72cb489 upstream.
On hyper-threaded CPUs, each core appears twice in the CPU list. Skip the second entry to avoid duplicate sensors.
--- drivers/hwmon/coretemp.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hwmon/coretemp.c +25 -1
@@ -317,6 +317,10 @@ struct pdev_entry {struct list_head list;struct platform_device *pdev;unsigned int cpu; +#ifdef CONFIG_SMP +u16 phys_proc_id; +u16 cpu_core_id; +#endif };static LIST_HEAD (pdev_list);
@@ -327,6 +331,22 @@ static int __cpuinit coretemp_device_addint err;struct platform_device *pdev;struct pdev_entry *pdev_entry; +#ifdef CONFIG_SMP +struct cpuinfo_x86 *c = &cpu_data (cpu); +#endif + +mutex_lock (&pdev_list_mutex); + +#ifdef CONFIG_SMP +/* Skip second HT entry of each core */ +list_for_each_entry (pdev_entry, &pdev_list, list) { +if (c->phys_proc_id == pdev_entry->phys_proc_id && + c->cpu_core_id == pdev_entry->cpu_core_id) { + err =0 ;/* Not an error */ + goto exit; + } + } +#endif pdev =platform_device_alloc (DRVNAME , cpu);if (!pdev) {
@@ -350,7 +370,10 @@ static int __cpuinit coretemp_device_add pdev_entry->pdev = pdev; pdev_entry->cpu = cpu; -mutex_lock (&pdev_list_mutex); +#ifdef CONFIG_SMP + pdev_entry->phys_proc_id = c->phys_proc_id; + pdev_entry->cpu_core_id = c->cpu_core_id; +#endif list_add_tail (&pdev_entry->list, &pdev_list);mutex_unlock (&pdev_list_mutex);
@@ -361,6 +384,7 @@ exit_device_free: exit_device_put:platform_device_put (pdev); exit: +mutex_unlock (&pdev_list_mutex);return err; }
PATCH 3/17 cifs: remove bogus first_time check in NTLMv2 session setup code
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit 8a224d489454b7457105848610cfebebdec5638d upstream.
This bug appears to be the result of a cut-and-paste mistake from the NTLMv1 code. The function to generate the MAC key was commented out, but not the conditional above it. The conditional then ended up causing the session setup key not to be copied to the buffer unless this was the first session on the socket, and that made all but the first NTLMv2 session setup fail.
Fix this by removing the conditional and all of the commented clutter that made it difficult to see.
--- fs/cifs/sess.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
fs/cifs/sess.c +1 -9
@@ -482,15 +482,7 @@ CIFS_SessSetup(unsigned int xid, struct/* calculate session key */ setup_ntlmv2_rsp (ses, v2_sess_key, nls_cp); -if (first_time)/* should this be moved into common code -with similar ntlmv2 path? */ -/* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key, -response BB FIXME, v2_sess_key); */ - -/* copy session key */ - -/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE); -bcc_ptr += LM2_SESS_KEY_SIZE; */ +/* FIXME: calculate MAC key */ memcpy (bcc_ptr, (char *)v2_sess_key,sizeof (struct ntlmv2_resp )); bcc_ptr +=sizeof (struct ntlmv2_resp );
PATCH 4/17 cifs: Fix a kernel BUG with remote OS/2 server (try #3)
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Jayaraman <[email protected]>
commit 6513a81e9325d712f1bfb9a1d7b750134e49ff18 upstream.
While chasing a bug report involving a OS/2 server, I noticed the server sets pSMBr->CountHigh to a incorrect value even in case of normal writes. This results in 'nbytes' being computed wrongly and triggers a kernel BUG at mm/filemap.c.
void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
BUG_ON(i->count < bytes); <--- BUG hereWhy the server is setting 'CountHigh' is not clear but only does so after writing 64k bytes. Though this looks like the server bug, the client side crash may not be acceptable.
The workaround is to mask off high 16 bits if the number of bytes written as returned by the server is greater than the bytes requested by the client as suggested by Jeff Layton.
--- fs/cifs/cifssmb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
fs/cifs/cifssmb.c +16 -0
@@ -1594,6 +1594,14 @@ CIFSSMBWrite(const int xid, struct cifsT *nbytes =le16_to_cpu (pSMBr->CountHigh); *nbytes = (*nbytes) <<16 ; *nbytes +=le16_to_cpu (pSMBr->Count); + +/* +* Mask off high 16 bits when bytes written as returned by the +* server is greater than bytes requested by the client. Some +* OS/2 servers are known to set incorrect CountHigh values. +*/ +if (*nbytes > count) + *nbytes &=0xFFFF ; }cifs_buf_release (pSMB);
@@ -1679,6 +1687,14 @@ CIFSSMBWrite2(const int xid, struct cifs *nbytes =le16_to_cpu (pSMBr->CountHigh); *nbytes = (*nbytes) <<16 ; *nbytes +=le16_to_cpu (pSMBr->Count); + +/* +* Mask off high 16 bits when bytes written as returned by the +* server is greater than bytes requested by the client. OS/2 +* servers are known to set incorrect CountHigh values. +*/ +if (*nbytes > count) + *nbytes &=0xFFFF ; }/* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */
PATCH 5/17 cpmac: do not leak struct net_device on phy_connect errors
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Florian Fainelli <[email protected]>
commit ed770f01360b392564650bf1553ce723fa46afec upstream.
If the call to phy_connect fails, we will return directly instead of freeing the previously allocated struct net_device.
--- drivers/net/cpmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/cpmac.c +2 -1
@@ -1174,7 +1174,8 @@ static int __devinit cpmac_probe(structif (netif_msg_drv (priv))printk (KERN_ERR "%s: Could not attach to PHY\n" , dev->name); -return PTR_ERR (priv->phy); + rc =PTR_ERR (priv->phy); + goto fail; }if ((rc =register_netdev (dev))) {
PATCH 6/17 sky2: enable rx/tx in sky2_phy_reinit()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Brandon Philips <[email protected]>
commit 38000a94a902e94ca8b5498f7871c6316de8957a upstream.
sky2_phy_reinit is called by the ethtool helpers sky2_set_settings, sky2_nway_reset and sky2_set_pauseparam when netif_running.
However, at the end of sky2_phy_init GM_GP_CTRL has GM_GPCR_RX_ENA and GM_GPCR_TX_ENA cleared. So, doing these commands causes the device to stop working:
$ ethtool -r eth0 $ ethtool -A eth0 autoneg off
Fix this issue by enabling Rx/Tx after running sky2_phy_init in sky2_phy_reinit.
--- drivers/net/sky2.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/net/sky2.c +14 -5
@@ -688,11 +688,24 @@ static void sky2_phy_power_down(struct ssky2_write8 (hw,B2_TST_CTRL1 ,TST_CFG_WRITE_OFF ); } +/* Enable Rx/Tx */ +static void sky2_enable_rx_tx (struct sky2_port *sky2) +{ +struct sky2_hw *hw = sky2->hw; +unsigned port = sky2->port; +u16 reg; + + reg =gma_read16 (hw, port,GM_GP_CTRL ); + reg |=GM_GPCR_RX_ENA |GM_GPCR_TX_ENA ; +gma_write16 (hw, port,GM_GP_CTRL , reg); +} +/* Force a renegotiation */ static void sky2_phy_reinit (struct sky2_port *sky2) {spin_lock_bh (&sky2->phy_lock);sky2_phy_init (sky2->hw, sky2->port); +sky2_enable_rx_tx (sky2);spin_unlock_bh (&sky2->phy_lock); }
@@ -1862,7 +1875,6 @@ static void sky2_link_up(struct sky2_por {struct sky2_hw *hw = sky2->hw;unsigned port = sky2->port; -u16 reg;static const char *fc_name[] = { [FC_NONE ] ="none" , [FC_TX ] ="tx" ,
@@ -1870,10 +1882,7 @@ static void sky2_link_up(struct sky2_por [FC_BOTH ] ="both" , }; -/* enable Rx/Tx */ - reg =gma_read16 (hw, port,GM_GP_CTRL ); - reg |=GM_GPCR_RX_ENA |GM_GPCR_TX_ENA ; -gma_write16 (hw, port,GM_GP_CTRL , reg); +sky2_enable_rx_tx (sky2);gm_phy_write (hw, port,PHY_MARV_INT_MASK ,PHY_M_DEF_MSK );
PATCH 7/17 math-emu: correct test for downshifting fraction in _FP_FROM_INT()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikael Pettersson <[email protected]>
commit f8324e20f8289dffc646d64366332e05eaacab25 upstream.
The kernel's math-emu code contains a macro _FP_FROM_INT() which is used to convert an integer to a raw normalized floating-point value. It does this basically in three steps:
1. Compute the exponent from the number of leading zero bits.
2. Downshift large fractions to put the MSB in the right position for normalized fractions.
3. Upshift small fractions to put the MSB in the right position.
There is an boundary error in step 2, causing a fraction with its MSB exactly one bit above the normalized MSB position to not be downshifted. This results in a non-normalized raw float, which when packed becomes a massively inaccurate representation for that input.
The impact of this depends on a number of arch-specific factors, but it is known to have broken emulation of FXTOD instructions on UltraSPARC III, which was originally reported as GCC bug 44631
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44631>.
Any arch which uses math-emu to emulate conversions from integers to same-size floats may be affected.
The fix is simple: the exponent comparison used to determine if the fraction should be downshifted must be "<=" not "<".
I'm sending a kernel module to test this as a reply to this message. There are also SPARC user-space test cases in the GCC bug entry.
--- include/math-emu/op-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/math-emu/op-common.h +1 -1
@@ -793,7 +793,7 @@ do { \ X##_e -= (_FP_W_TYPE_SIZE - rsize); \ X##_e = rsize - X##_e - 1; \ \ - if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \ + if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e) \ __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\ _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \
PATCH 8/17 hostap: Protect against initialization interrupt
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tim Gardner <[email protected]>
commit d6a574ff6bfb842bdb98065da053881ff527be46 upstream.
Use an irq spinlock to hold off the IRQ handler until enough early card init is complete such that the handler can run without faulting.
--- drivers/net/wireless/hostap/hostap_cs.c | 10 ++++++++++ drivers/net/wireless/hostap/hostap_hw.c | 13 +++++++++++++ drivers/net/wireless/hostap/hostap_wlan.h | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-)
drivers/net/wireless/hostap/hostap_cs.c +10 -0
@@ -557,6 +557,7 @@ static int prism2_config(struct pcmcia_dconfig_info_t conf;cistpl_cftable_entry_t dflt = {0 };struct hostap_cs_priv *hw_priv; +unsigned long flags;PDEBUG (DEBUG_FLOW ,"prism2_config()\n" );
@@ -688,6 +689,12 @@ static int prism2_config(struct pcmcia_d link->dev_node = &hw_priv->node;/* +* Make sure the IRQ handler cannot proceed until at least +* dev->base_addr is initialized. +*/ +spin_lock_irqsave (&local->irq_init_lock, flags); + +/* * Allocate an interrupt line. Note that this does not assign a * handler to the interrupt, unless the 'Handler' member of the * irq structure is initialized.
@@ -712,6 +719,8 @@ static int prism2_config(struct pcmcia_d dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; +spin_unlock_irqrestore (&local->irq_init_lock, flags); +/* Finally, report what we've done */ printk (KERN_INFO "%s: index 0x%02x: " , dev_info, link->conf.ConfigIndex);
@@ -742,6 +751,7 @@ static int prism2_config(struct pcmcia_dreturn ret; cs_failed: +spin_unlock_irqrestore (&local->irq_init_lock, flags);cs_error (link, last_fn, last_ret); failed:
drivers/net/wireless/hostap/hostap_hw.c +13 -0
@@ -2631,6 +2631,18 @@ static irqreturn_t prism2_interrupt(int iface =netdev_priv (dev); local = iface->local; +/* Detect early interrupt before driver is fully configued */ +spin_lock (&local->irq_init_lock); +if (!dev->base_addr) { +if (net_ratelimit ()) { +printk (KERN_DEBUG "%s: Interrupt, but dev not configured\n" , + dev->name); + } +spin_unlock (&local->irq_init_lock); +return IRQ_HANDLED ; + } +spin_unlock (&local->irq_init_lock); +prism2_io_debug_add (dev,PRISM2_IO_DEBUG_CMD_INTERRUPT ,0 ,0 );if (local->func->card_present && !local->func->card_present (local)) {
@@ -3187,6 +3199,7 @@ prism2_init_local_data(struct prism2_helspin_lock_init (&local->cmdlock);spin_lock_init (&local->baplock);spin_lock_init (&local->lock); +spin_lock_init (&local->irq_init_lock);mutex_init (&local->rid_bap_mtx);if (card_idx <0 || card_idx >=MAX_PARM_DEVICES )
drivers/net/wireless/hostap/hostap_wlan.h +1 -1
@@ -653,7 +653,7 @@ struct local_info {rwlock_t iface_lock;/* hostap_interfaces read lock; use write lock * when removing entries from the list. * TX and RX paths can use read lock. */ -spinlock_t cmdlock, baplock, lock; +spinlock_t cmdlock, baplock, lock, irq_init_lock;struct mutex rid_bap_mtx;u16 infofid;/* MAC buffer id for info frame */ /* txfid, intransmitfid, next_txtid, and next_alloc are protected by
PATCH 9/17 netfilter: ip6t_REJECT: fix a dst leak in ipv6 REJECT
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit 499031ac8a3df6738f6186ded9da853e8ea18253 upstream.
We should release dst if dst->error is set.
Bug introduced in 2.6.14 by commit e104411b82f5c ([XFRM]: Always release dst_entry on error in xfrm_lookup)
--- net/ipv6/netfilter/ip6t_REJECT.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_REJECT.c +4 -2
@@ -95,9 +95,11 @@ static void send_reset(struct sk_buff *o fl.fl_ip_dport = otcph.source;security_skb_classify_flow (oldskb, &fl); dst =ip6_route_output (&init_net,NULL , &fl); -if (dst ==NULL ) +if (dst ==NULL || dst->error) { +dst_release (dst);return ; -if (dst->error ||xfrm_lookup (&dst, &fl,NULL ,0 )) + } +if (xfrm_lookup (&dst, &fl,NULL ,0 ))return ; hh_len = (dst->dev->hard_header_len +15 )&~15 ;
PATCH 10/17 SCSI: aacraid: Eliminate use after free
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <[email protected]>
commit 8a52da632ceb9d8b776494563df579e87b7b586b upstream.
The debugging code using the freed structure is moved before the kfree.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@free@
expression E;
position p;
@@
kfree@p(E)
@@
expression free.E, subE<=free.E, E1;
position free.p;
@@
kfree@p(E)
...
(
subE = E1
|
* E
)
// </smpl>
--- drivers/scsi/aacraid/commctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/commctrl.c +2 -2
@@ -645,9 +645,9 @@ static int aac_send_raw_srb(struct aac_d/* Does this really need to be GFP_DMA? */ p =kmalloc (usg->sg[i].count,GFP_KERNEL |__GFP_DMA);if (!p) { -kfree (usg); -dprintk ((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n" , +dprintk ((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n" , usg->sg[i].count,i,usg->count)); +kfree (usg); rcode = -ENOMEM ; goto cleanup; }
PATCH 11/17 amd64-agp: Probe unknown AGP devices the right way
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit 6fd024893911dcb51b4a0aa71971db5ba38f7071 upstream.
The current initialisation code probes 'unsupported' AGP devices simply by calling its own probe function. It does not lock these devices or even check whether another driver is already bound to them.
We must use the device core to manage this. So if the specific device id table didn't match anything and agp_try_unsupported=1, switch the device id table and call driver_attach() again.
--- drivers/char/agp/amd64-agp.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/char/agp/amd64-agp.c +15 -12
@@ -491,6 +491,10 @@ static int __devinit agp_amd64_probe(stru8 cap_ptr;int err; +/* The Highlander principle */ +if (agp_bridges_found) +return -ENODEV ; + cap_ptr =pci_find_capability (pdev,PCI_CAP_ID_AGP );if (!cap_ptr)return -ENODEV ;
@@ -554,6 +558,8 @@ static void __devexit agp_amd64_remove(s amd64_aperture_sizes[bridge->aperture_size_idx].size);agp_remove_bridge (bridge);agp_put_bridge (bridge); + + agp_bridges_found--; }#ifdef CONFIG_PM
@@ -701,6 +707,11 @@ static struct pci_device_id agp_amd64_pcMODULE_DEVICE_TABLE (pci, agp_amd64_pci_table); +static DEFINE_PCI_DEVICE_TABLE (agp_amd64_pci_promisc_table) = { + {PCI_DEVICE_CLASS (0 ,0 ) }, + { } +}; +static struct pci_driver agp_amd64_pci_driver = { .name ="agpgart-amd64" , .id_table = agp_amd64_pci_table,
@@ -725,7 +736,6 @@ int __init agp_amd64_init(void)return err;if (agp_bridges_found ==0 ) { -struct pci_dev *dev;if (!agp_try_unsupported && !agp_try_unsupported_boot) { printk(KERN_INFO PFX "No supported AGP bridge found.\n");#ifdef MODULE
@@ -741,17 +751,10 @@ int __init agp_amd64_init(void)return -ENODEV ;/* Look for any AGP bridge */ - dev =NULL ; - err = -ENODEV ; -for_each_pci_dev (dev) { -if (!pci_find_capability (dev,PCI_CAP_ID_AGP )) -continue ; -/* Only one bridge supported right now */ -if (agp_amd64_probe (dev,NULL ) ==0 ) { - err =0 ; -break ; - } - } + agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table; + err =driver_attach (&agp_amd64_pci_driver.driver); +if (err ==0 && agp_bridges_found ==0 ) + err = -ENODEV ; }return err; }
PATCH 12/17 x86, Calgary: Increase max PHB number
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darrick J. Wong <[email protected]>
commit 499a00e92dd9a75395081f595e681629eb1eebad upstream.
Newer systems (x3950M2) can have 48 PHBs per chassis and 8 chassis, so bump the limits up and provide an explanation of the requirements for each class.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/pci-calgary_64.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
arch/x86/kernel/pci-calgary_64.c +10 -5
@@ -102,11 +102,16 @@ int use_calgary __read_mostly = 0;#define PMR_SOFTSTOPFAULT 0x40000000#define PMR_HARDSTOP 0x20000000 -#define MAX_NUM_OF_PHBS 8/* how many PHBs in total? */ -#define MAX_NUM_CHASSIS 8/* max number of chassis */ -/* MAX_PHB_BUS_NUM is the maximal possible dev->bus->number */ -#define MAX_PHB_BUS_NUM (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) -#define PHBS_PER_CALGARY 4 +/* +* The maximum PHB bus number. +* x3950M2 (rare): 8 chassis, 48 PHBs per chassis = 384 +* x3950M2: 4 chassis, 48 PHBs per chassis = 192 +* x3950 (PCIE): 8 chassis, 32 PHBs per chassis = 256 +* x3950 (PCIX): 8 chassis, 16 PHBs per chassis = 128 +*/ +#define MAX_PHB_BUS_NUM 384 + +#define PHBS_PER_CALGARY 4/* register offsets in Calgary's internal register space */ static const unsigned long tar_offsets[] = {
PATCH 13/17 x86, Calgary: Limit the max PHB number to 256
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darrick J. Wong <[email protected]>
commit d596043d71ff0d7b3d0bead19b1d68c55f003093 upstream.
The x3950 family can have as many as 256 PCI buses in a single system, so change the limits to the maximum. Since there can only be 256 PCI buses in one domain, we no longer need the BUG_ON check.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/pci-calgary_64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/pci-calgary_64.c +1 -3
@@ -109,7 +109,7 @@ int use_calgary __read_mostly = 0;* x3950 (PCIE): 8 chassis, 32 PHBs per chassis = 256 * x3950 (PCIX): 8 chassis, 16 PHBs per chassis = 128 */ -#define MAX_PHB_BUS_NUM 384 +#define MAX_PHB_BUS_NUM 256#define PHBS_PER_CALGARY 4
@@ -1097,8 +1097,6 @@ static int __init calgary_init_one(strucstruct iommu_table *tbl;int ret; -BUG_ON (dev->bus->number >=MAX_PHB_BUS_NUM ); - bbar =busno_to_bbar (dev->bus->number); ret =calgary_setup_tar (dev, bbar);if (ret)
PATCH 14/17 IPoIB: Fix world-writable child interface control sysfs attributes
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Or Gerlitz <[email protected]>
commit 7a52b34b07122ff5f45258d47f260f8a525518f0 upstream.
Sumeet Lahorani <[email protected]> reported that the IPoIB child entries are world-writable; however we don't want ordinary users to be able to create and destroy child interfaces, so fix them to be writable only by root.
--- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -2
@@ -1158,7 +1158,7 @@ static ssize_t create_child(struct devicreturn ret ? ret : count; } -static DEVICE_ATTR(create_child, S_IWUGO, NULL, create_child); +static DEVICE_ATTR(create_child, S_IWUSR, NULL, create_child); static ssize_t delete_child(struct device *dev, struct device_attribute *attr,
@@ -1178,7 +1178,7 @@ static ssize_t delete_child(struct devicreturn ret ? ret : count; } -static DEVICE_ATTR(delete_child, S_IWUGO, NULL, delete_child); +static DEVICE_ATTR(delete_child, S_IWUSR, NULL, delete_child);int ipoib_add_pkey_attr (struct net_device *dev) {
PATCH 15/17 bonding: select current active slave when enslaving device for mode tlb and alb
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Pirko <[email protected]>
commit 5a29f7893fbe681f1334285be7e41e56f0de666c upstream.
I've hit an issue on my system when I've been using RealTek RTL8139D cards in bonding interface in mode balancing-alb. When I enslave a card, the current active slave (bond->curr_active_slave) is not set and the link is therefore not functional.
----
# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: None
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:1f:1f:01:2f:22
----
The thing that gets it right is when I unplug the cable and then I put it back into the NIC. Then the current active slave is set to eth1 and link is working just fine. Here is dmesg log with bonding DEBUG messages turned on:
----ADDRCONF(NETDEV_UP): bond0: link is not readyevent_dev: bond0, event: 1IFF_MASTERevent_dev: bond0, event: 8IFF_MASTERbond_ioctl: master=bond0, cmd=35216
slave_dev=cac5d800:
slave_dev->name=eth1:
eth1: ! NETIF_F_VLAN_CHALLENGEDevent_dev: eth1, event: 8
eth1: link up, 100Mbps, full-duplex, lpa 0xC5E1event_dev: eth1, event: 1event_dev: eth1, event: 8IFF_SLAVE
Initial state of slave_dev is BOND_LINK_UP
bonding: bond0: enslaving eth1 as an active interface with an up link. ADDRCONF(NETDEV_CHANGE): bond0: link becomes readyevent_dev: bond0, event: 4IFF_MASTER
bond0: no IPv6 routers present
<<<<cable unplug>>>>
eth1: link downevent_dev: eth1, event: 4IFF_SLAVE
bonding: bond0: link status definitely down for interface eth1, disabling itevent_dev: bond0, event: 4IFF_MASTER
<<<<cable plug>>>>
eth1: link up, 100Mbps, full-duplex, lpa 0xC5E1event_dev: eth1, event: 4IFF_SLAVE
bonding: bond0: link status definitely up for interface eth1.
bonding: bond0: making interface eth1 the new active one.event_dev: eth1, event: 8IFF_SLAVEevent_dev: eth1, event: 8IFF_SLAVE
bonding: bond0: first active interface up!event_dev: bond0, event: 4IFF_MASTER
----
The current active slave is set by calling bond_select_active_slave() function from bond_miimon_commit() function when the slave (eth1) link goes to state up.
I also tested this on other machine with Broadcom NetXtreme II BCM5708 1000Base-T NIC and there all works fine. The thing is that this adapter is down and goes up after few seconds after it is enslaved.
This patch calls bond_select_active_slave() in bond_enslave() function for modes alb and tlb and makes sure that the current active slave is set up properly even when the slave state is already up. Tested on both systems, works fine.
Notice: The same problem can maybe also occrur in mode 8023AD but I'm unable to test that.
--- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_main.c +1 -0
@@ -1705,6 +1705,7 @@ int bond_enslave(struct net_device *bondcase BOND_MODE_ALB : new_slave->state =BOND_STATE_ACTIVE ;bond_set_slave_inactive_flags (new_slave); +bond_select_active_slave (bond);break ;default :dprintk ("This slave is always active in trunk mode\n" );
PATCH 16/17 kbuild: Fix modpost segfault
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Krzysztof Halasa <[email protected]>
commit 1c938663d58b5b2965976a6f54cc51b5d6f691aa upstream.
Quoted 4 lines · Alan
program:
/home/alan/GitTrees/linux-2.6-mid-ref/scripts/mod/modpost-o Module.symvers -S vmlinux.oProgram received signal SIGSEGV, Segmentation fault.
It just hit me.
It's the offset calculation in reloc_location() which overflows:
return (void *)elf->hdr + sechdrs[section].sh_offset +
(r->r_offset - sechdrs[section].sh_addr);E.g. for the first rodata r entry:r->r_offset < sechdrs[section].sh_addr
and the expression in the parenthesis produces 0xFFFFFFE0 or something equally wise.
--- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mod/modpost.c +1 -1
@@ -1292,7 +1292,7 @@ static unsigned int *reloc_location(struint section = sechdr->sh_info;return (void *)elf->hdr + sechdrs[section].sh_offset + - (r->r_offset - sechdrs[section].sh_addr); + r->r_offset - sechdrs[section].sh_addr; }static int addend_386_rel (struct elf_info *elf,Elf_Shdr *sechdr,Elf_Rela *r)
PATCH 17/17 ecryptfs: Bugfix for error related to ecryptfs_hash_buckets
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andre Osterhues <[email protected]>
commit a6f80fb7b5986fda663d94079d3bba0937a6b6ff upstream.
The function ecryptfs_uid_hash wrongly assumes that the second parameter to hash_long() is the number of hash buckets instead of the number of hash bits. This patch fixes that and renames the variable ecryptfs_hash_buckets to ecryptfs_hash_bits to make it clearer.
--- fs/ecryptfs/messaging.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
fs/ecryptfs/messaging.c +9 -8
@@ -30,9 +30,9 @@ static struct mutex ecryptfs_msg_ctx_lisstatic struct hlist_head *ecryptfs_daemon_hash;struct mutex ecryptfs_daemon_hash_mux; -static int ecryptfs_hash_buckets; +static int ecryptfs_hash_bits;#define ecryptfs_uid_hash (uid) \ - hash_long((unsigned long)uid, ecryptfs_hash_buckets) + hash_long((unsigned long)uid, ecryptfs_hash_bits)static u32 ecryptfs_msg_counter;static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -599,18 +599,19 @@ int ecryptfs_init_messaging(unsigned int }mutex_init (&ecryptfs_daemon_hash_mux);mutex_lock (&ecryptfs_daemon_hash_mux); - ecryptfs_hash_buckets =1 ; -while (ecryptfs_number_of_users >> ecryptfs_hash_buckets) - ecryptfs_hash_buckets++; + ecryptfs_hash_bits =1 ; +while (ecryptfs_number_of_users >> ecryptfs_hash_bits) + ecryptfs_hash_bits++; ecryptfs_daemon_hash =kmalloc ((sizeof (struct hlist_head ) - * ecryptfs_hash_buckets),GFP_KERNEL ); + * (1 << ecryptfs_hash_bits)), +GFP_KERNEL );if (!ecryptfs_daemon_hash) { rc = -ENOMEM ;printk (KERN_ERR "%s: Failed to allocate memory\n" , __func__);mutex_unlock (&ecryptfs_daemon_hash_mux); goto out; } -for (i =0 ; i < ecryptfs_hash_buckets; i++) +for (i =0 ; i < (1 << ecryptfs_hash_bits); i++)INIT_HLIST_HEAD (&ecryptfs_daemon_hash[i]);mutex_unlock (&ecryptfs_daemon_hash_mux); ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
@@ -680,7 +681,7 @@ void ecryptfs_release_messaging(unsignedint i;mutex_lock (&ecryptfs_daemon_hash_mux); -for (i =0 ; i < ecryptfs_hash_buckets; i++) { +for (i =0 ; i < (1 << ecryptfs_hash_bits); i++) {int rc; hlist_for_each_entry(daemon, elem,