aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/avr32/Kconfig3
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c4
-rw-r--r--arch/avr32/mach-at32ap/hsmc.c1
-rw-r--r--arch/avr32/mach-at32ap/intc.c4
-rw-r--r--drivers/i2c/busses/i2c-pasemi.c7
-rw-r--r--drivers/i2c/chips/eeprom.c37
-rw-r--r--drivers/i2c/i2c-core.c3
-rw-r--r--drivers/i2c/i2c-dev.c86
-rw-r--r--drivers/net/skge.c51
-rw-r--r--include/asm-avr32/sysreg.h2
-rw-r--r--include/linux/i2c.h5
-rw-r--r--include/pcmcia/cs_types.h2
-rw-r--r--kernel/exit.c3
-rw-r--r--kernel/sched.c62
-rw-r--r--kernel/sched_fair.c2
-rw-r--r--mm/slob.c3
16 files changed, 181 insertions, 94 deletions
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index bbecbd8469b5..4f402c924504 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -19,9 +19,6 @@ config AVR32
19 There is an AVR32 Linux project with a web page at 19 There is an AVR32 Linux project with a web page at
20 http://avr32linux.org/. 20 http://avr32linux.org/.
21 21
22config UID16
23 bool
24
25config GENERIC_GPIO 22config GENERIC_GPIO
26 bool 23 bool
27 default y 24 default y
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index a9d9ec081e3d..7c4388f4f17f 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -474,7 +474,7 @@ static struct resource at32ap700x_rtc0_resource[] = {
474static struct resource at32_wdt0_resource[] = { 474static struct resource at32_wdt0_resource[] = {
475 { 475 {
476 .start = 0xfff000b0, 476 .start = 0xfff000b0,
477 .end = 0xfff000bf, 477 .end = 0xfff000cf,
478 .flags = IORESOURCE_MEM, 478 .flags = IORESOURCE_MEM,
479 }, 479 },
480}; 480};
@@ -690,7 +690,7 @@ static struct resource atmel_usart0_resource[] = {
690 IRQ(6), 690 IRQ(6),
691}; 691};
692DEFINE_DEV_DATA(atmel_usart, 0); 692DEFINE_DEV_DATA(atmel_usart, 0);
693DEV_CLK(usart, atmel_usart0, pba, 4); 693DEV_CLK(usart, atmel_usart0, pba, 3);
694 694
695static struct atmel_uart_data atmel_usart1_data = { 695static struct atmel_uart_data atmel_usart1_data = {
696 .use_dma_tx = 1, 696 .use_dma_tx = 1,
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c
index 704607fbcc69..fa427ed42787 100644
--- a/arch/avr32/mach-at32ap/hsmc.c
+++ b/arch/avr32/mach-at32ap/hsmc.c
@@ -7,7 +7,6 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#define DEBUG
11#include <linux/clk.h> 10#include <linux/clk.h>
12#include <linux/err.h> 11#include <linux/err.h>
13#include <linux/init.h> 12#include <linux/init.h>
diff --git a/arch/avr32/mach-at32ap/intc.c b/arch/avr32/mach-at32ap/intc.c
index dd5c009cf224..0b286cd53028 100644
--- a/arch/avr32/mach-at32ap/intc.c
+++ b/arch/avr32/mach-at32ap/intc.c
@@ -13,6 +13,7 @@
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15 15
16#include <asm/intc.h>
16#include <asm/io.h> 17#include <asm/io.h>
17 18
18#include "intc.h" 19#include "intc.h"
@@ -136,7 +137,8 @@ fail:
136 panic("Interrupt controller initialization failed!\n"); 137 panic("Interrupt controller initialization failed!\n");
137} 138}
138 139
139unsigned long intc_get_pending(int group) 140unsigned long intc_get_pending(unsigned int group)
140{ 141{
141 return intc_readl(&intc0, INTREQ0 + 4 * group); 142 return intc_readl(&intc0, INTREQ0 + 4 * group);
142} 143}
144EXPORT_SYMBOL_GPL(intc_get_pending);
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c
index 58e32714afb5..ca18e0be4901 100644
--- a/drivers/i2c/busses/i2c-pasemi.c
+++ b/drivers/i2c/busses/i2c-pasemi.c
@@ -51,6 +51,7 @@ struct pasemi_smbus {
51#define MRXFIFO_DATA_M 0x000000ff 51#define MRXFIFO_DATA_M 0x000000ff
52 52
53#define SMSTA_XEN 0x08000000 53#define SMSTA_XEN 0x08000000
54#define SMSTA_MTN 0x00200000
54 55
55#define CTL_MRR 0x00000400 56#define CTL_MRR 0x00000400
56#define CTL_MTR 0x00000200 57#define CTL_MTR 0x00000200
@@ -98,6 +99,10 @@ static unsigned int pasemi_smb_waitready(struct pasemi_smbus *smbus)
98 status = reg_read(smbus, REG_SMSTA); 99 status = reg_read(smbus, REG_SMSTA);
99 } 100 }
100 101
102 /* Got NACK? */
103 if (status & SMSTA_MTN)
104 return -ENXIO;
105
101 if (timeout < 0) { 106 if (timeout < 0) {
102 dev_warn(&smbus->dev->dev, "Timeout, status 0x%08x\n", status); 107 dev_warn(&smbus->dev->dev, "Timeout, status 0x%08x\n", status);
103 reg_write(smbus, REG_SMSTA, status); 108 reg_write(smbus, REG_SMSTA, status);
@@ -364,7 +369,7 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
364 smbus->adapter.algo = &smbus_algorithm; 369 smbus->adapter.algo = &smbus_algorithm;
365 smbus->adapter.algo_data = smbus; 370 smbus->adapter.algo_data = smbus;
366 371
367 /* set up the driverfs linkage to our parent device */ 372 /* set up the sysfs linkage to our parent device */
368 smbus->adapter.dev.parent = &dev->dev; 373 smbus->adapter.dev.parent = &dev->dev;
369 374
370 reg_write(smbus, REG_CTL, (CTL_MTR | CTL_MRR | 375 reg_write(smbus, REG_CTL, (CTL_MTR | CTL_MRR |
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
index d3da1fb05b9b..1a7eeebac506 100644
--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -128,13 +128,20 @@ static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr,
128 for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++) 128 for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
129 eeprom_update_client(client, slice); 129 eeprom_update_client(client, slice);
130 130
131 /* Hide Vaio security settings to regular users (16 first bytes) */ 131 /* Hide Vaio private settings to regular users:
132 if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) { 132 - BIOS passwords: bytes 0x00 to 0x0f
133 size_t in_row1 = 16 - off; 133 - UUID: bytes 0x10 to 0x1f
134 in_row1 = min(in_row1, count); 134 - Serial number: 0xc0 to 0xdf */
135 memset(buf, 0, in_row1); 135 if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
136 if (count - in_row1 > 0) 136 int i;
137 memcpy(buf + in_row1, &data->data[16], count - in_row1); 137
138 for (i = 0; i < count; i++) {
139 if ((off + i <= 0x1f) ||
140 (off + i >= 0xc0 && off + i <= 0xdf))
141 buf[i] = 0;
142 else
143 buf[i] = data->data[off + i];
144 }
138 } else { 145 } else {
139 memcpy(buf, &data->data[off], count); 146 memcpy(buf, &data->data[off], count);
140 } 147 }
@@ -197,14 +204,18 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
197 goto exit_kfree; 204 goto exit_kfree;
198 205
199 /* Detect the Vaio nature of EEPROMs. 206 /* Detect the Vaio nature of EEPROMs.
200 We use the "PCG-" prefix as the signature. */ 207 We use the "PCG-" or "VGN-" prefix as the signature. */
201 if (address == 0x57) { 208 if (address == 0x57) {
202 if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' 209 char name[4];
203 && i2c_smbus_read_byte(new_client) == 'C' 210
204 && i2c_smbus_read_byte(new_client) == 'G' 211 name[0] = i2c_smbus_read_byte_data(new_client, 0x80);
205 && i2c_smbus_read_byte(new_client) == '-') { 212 name[1] = i2c_smbus_read_byte(new_client);
213 name[2] = i2c_smbus_read_byte(new_client);
214 name[3] = i2c_smbus_read_byte(new_client);
215
216 if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) {
206 dev_info(&new_client->dev, "Vaio EEPROM detected, " 217 dev_info(&new_client->dev, "Vaio EEPROM detected, "
207 "enabling password protection\n"); 218 "enabling privacy protection\n");
208 data->nature = VAIO; 219 data->nature = VAIO;
209 } 220 }
210 } 221 }
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 1a4e8dc03b36..b5e13e405e72 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -673,7 +673,7 @@ static int __i2c_check_addr(struct i2c_adapter *adapter, unsigned int addr)
673 return 0; 673 return 0;
674} 674}
675 675
676int i2c_check_addr(struct i2c_adapter *adapter, int addr) 676static int i2c_check_addr(struct i2c_adapter *adapter, int addr)
677{ 677{
678 int rval; 678 int rval;
679 679
@@ -683,7 +683,6 @@ int i2c_check_addr(struct i2c_adapter *adapter, int addr)
683 683
684 return rval; 684 return rval;
685} 685}
686EXPORT_SYMBOL(i2c_check_addr);
687 686
688int i2c_attach_client(struct i2c_client *client) 687int i2c_attach_client(struct i2c_client *client)
689{ 688{
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 5a15e50748de..c21ae20ae362 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -38,6 +38,15 @@
38 38
39static struct i2c_driver i2cdev_driver; 39static struct i2c_driver i2cdev_driver;
40 40
41/*
42 * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a
43 * slave (i2c_client) with which messages will be exchanged. It's coupled
44 * with a character special file which is accessed by user mode drivers.
45 *
46 * The list of i2c_dev structures is parallel to the i2c_adapter lists
47 * maintained by the driver model, and is updated using notifications
48 * delivered to the i2cdev_driver.
49 */
41struct i2c_dev { 50struct i2c_dev {
42 struct list_head list; 51 struct list_head list;
43 struct i2c_adapter *adap; 52 struct i2c_adapter *adap;
@@ -103,6 +112,25 @@ static ssize_t show_adapter_name(struct device *dev,
103} 112}
104static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL); 113static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
105 114
115/* ------------------------------------------------------------------------- */
116
117/*
118 * After opening an instance of this character special file, a file
119 * descriptor starts out associated only with an i2c_adapter (and bus).
120 *
121 * Using the I2C_RDWR ioctl(), you can then *immediately* issue i2c_msg
122 * traffic to any devices on the bus used by that adapter. That's because
123 * the i2c_msg vectors embed all the addressing information they need, and
124 * are submitted directly to an i2c_adapter. However, SMBus-only adapters
125 * don't support that interface.
126 *
127 * To use read()/write() system calls on that file descriptor, or to use
128 * SMBus interfaces (and work with SMBus-only hosts!), you must first issue
129 * an I2C_SLAVE (or I2C_SLAVE_FORCE) ioctl. That configures an anonymous
130 * (never registered) i2c_client so it holds the addressing information
131 * needed by those system calls and by this SMBus interface.
132 */
133
106static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count, 134static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
107 loff_t *offset) 135 loff_t *offset)
108{ 136{
@@ -154,6 +182,29 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
154 return ret; 182 return ret;
155} 183}
156 184
185/* This address checking function differs from the one in i2c-core
186 in that it considers an address with a registered device, but no
187 bounded driver, as NOT busy. */
188static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr)
189{
190 struct list_head *item;
191 struct i2c_client *client;
192 int res = 0;
193
194 mutex_lock(&adapter->clist_lock);
195 list_for_each(item, &adapter->clients) {
196 client = list_entry(item, struct i2c_client, list);
197 if (client->addr == addr) {
198 if (client->driver)
199 res = -EBUSY;
200 break;
201 }
202 }
203 mutex_unlock(&adapter->clist_lock);
204
205 return res;
206}
207
157static int i2cdev_ioctl(struct inode *inode, struct file *file, 208static int i2cdev_ioctl(struct inode *inode, struct file *file,
158 unsigned int cmd, unsigned long arg) 209 unsigned int cmd, unsigned long arg)
159{ 210{
@@ -172,11 +223,22 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
172 switch ( cmd ) { 223 switch ( cmd ) {
173 case I2C_SLAVE: 224 case I2C_SLAVE:
174 case I2C_SLAVE_FORCE: 225 case I2C_SLAVE_FORCE:
226 /* NOTE: devices set up to work with "new style" drivers
227 * can't use I2C_SLAVE, even when the device node is not
228 * bound to a driver. Only I2C_SLAVE_FORCE will work.
229 *
230 * Setting the PEC flag here won't affect kernel drivers,
231 * which will be using the i2c_client node registered with
232 * the driver model core. Likewise, when that client has
233 * the PEC flag already set, the i2c-dev driver won't see
234 * (or use) this setting.
235 */
175 if ((arg > 0x3ff) || 236 if ((arg > 0x3ff) ||
176 (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f)) 237 (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
177 return -EINVAL; 238 return -EINVAL;
178 if ((cmd == I2C_SLAVE) && i2c_check_addr(client->adapter,arg)) 239 if (cmd == I2C_SLAVE && i2cdev_check_addr(client->adapter, arg))
179 return -EBUSY; 240 return -EBUSY;
241 /* REVISIT: address could become busy later */
180 client->addr = arg; 242 client->addr = arg;
181 return 0; 243 return 0;
182 case I2C_TENBIT: 244 case I2C_TENBIT:
@@ -386,6 +448,13 @@ static int i2cdev_open(struct inode *inode, struct file *file)
386 if (!adap) 448 if (!adap)
387 return -ENODEV; 449 return -ENODEV;
388 450
451 /* This creates an anonymous i2c_client, which may later be
452 * pointed to some address using I2C_SLAVE or I2C_SLAVE_FORCE.
453 *
454 * This client is ** NEVER REGISTERED ** with the driver model
455 * or I2C core code!! It just holds private copies of addressing
456 * information and maybe a PEC flag.
457 */
389 client = kzalloc(sizeof(*client), GFP_KERNEL); 458 client = kzalloc(sizeof(*client), GFP_KERNEL);
390 if (!client) { 459 if (!client) {
391 i2c_put_adapter(adap); 460 i2c_put_adapter(adap);
@@ -394,7 +463,6 @@ static int i2cdev_open(struct inode *inode, struct file *file)
394 snprintf(client->name, I2C_NAME_SIZE, "i2c-dev %d", adap->nr); 463 snprintf(client->name, I2C_NAME_SIZE, "i2c-dev %d", adap->nr);
395 client->driver = &i2cdev_driver; 464 client->driver = &i2cdev_driver;
396 465
397 /* registered with adapter, passed as client to user */
398 client->adapter = adap; 466 client->adapter = adap;
399 file->private_data = client; 467 file->private_data = client;
400 468
@@ -422,6 +490,14 @@ static const struct file_operations i2cdev_fops = {
422 .release = i2cdev_release, 490 .release = i2cdev_release,
423}; 491};
424 492
493/* ------------------------------------------------------------------------- */
494
495/*
496 * The legacy "i2cdev_driver" is used primarily to get notifications when
497 * I2C adapters are added or removed, so that each one gets an i2c_dev
498 * and is thus made available to userspace driver code.
499 */
500
425static struct class *i2c_dev_class; 501static struct class *i2c_dev_class;
426 502
427static int i2cdev_attach_adapter(struct i2c_adapter *adap) 503static int i2cdev_attach_adapter(struct i2c_adapter *adap)
@@ -486,6 +562,12 @@ static struct i2c_driver i2cdev_driver = {
486 .detach_client = i2cdev_detach_client, 562 .detach_client = i2cdev_detach_client,
487}; 563};
488 564
565/* ------------------------------------------------------------------------- */
566
567/*
568 * module load/unload record keeping
569 */
570
489static int __init i2c_dev_init(void) 571static int __init i2c_dev_init(void)
490{ 572{
491 int res; 573 int res;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index b9961dc47606..6d62250fba07 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2512,31 +2512,32 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2512 return err; 2512 return err;
2513} 2513}
2514 2514
2515/* Assign Ram Buffer allocation to queue */ 2515static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len)
2516static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, u32 space)
2517{ 2516{
2518 u32 end; 2517 u32 end;
2519 2518
2520 /* convert from K bytes to qwords used for hw register */ 2519 start /= 8;
2521 start *= 1024/8; 2520 len /= 8;
2522 space *= 1024/8; 2521 end = start + len - 1;
2523 end = start + space - 1;
2524 2522
2525 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); 2523 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR);
2526 skge_write32(hw, RB_ADDR(q, RB_START), start); 2524 skge_write32(hw, RB_ADDR(q, RB_START), start);
2527 skge_write32(hw, RB_ADDR(q, RB_END), end);
2528 skge_write32(hw, RB_ADDR(q, RB_WP), start); 2525 skge_write32(hw, RB_ADDR(q, RB_WP), start);
2529 skge_write32(hw, RB_ADDR(q, RB_RP), start); 2526 skge_write32(hw, RB_ADDR(q, RB_RP), start);
2527 skge_write32(hw, RB_ADDR(q, RB_END), end);
2530 2528
2531 if (q == Q_R1 || q == Q_R2) { 2529 if (q == Q_R1 || q == Q_R2) {
2532 u32 tp = space - space/4;
2533
2534 /* Set thresholds on receive queue's */ 2530 /* Set thresholds on receive queue's */
2535 skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), tp); 2531 skge_write32(hw, RB_ADDR(q, RB_RX_UTPP),
2536 skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), space/4); 2532 start + (2*len)/3);
2537 } else if (hw->chip_id != CHIP_ID_GENESIS) 2533 skge_write32(hw, RB_ADDR(q, RB_RX_LTPP),
2538 /* Genesis Tx Fifo is too small for normal store/forward */ 2534 start + (len/3));
2535 } else {
2536 /* Enable store & forward on Tx queue's because
2537 * Tx FIFO is only 4K on Genesis and 1K on Yukon
2538 */
2539 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); 2539 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD);
2540 }
2540 2541
2541 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); 2542 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD);
2542} 2543}
@@ -2564,7 +2565,7 @@ static int skge_up(struct net_device *dev)
2564 struct skge_port *skge = netdev_priv(dev); 2565 struct skge_port *skge = netdev_priv(dev);
2565 struct skge_hw *hw = skge->hw; 2566 struct skge_hw *hw = skge->hw;
2566 int port = skge->port; 2567 int port = skge->port;
2567 u32 ramaddr, ramsize, rxspace; 2568 u32 chunk, ram_addr;
2568 size_t rx_size, tx_size; 2569 size_t rx_size, tx_size;
2569 int err; 2570 int err;
2570 2571
@@ -2619,15 +2620,14 @@ static int skge_up(struct net_device *dev)
2619 spin_unlock_bh(&hw->phy_lock); 2620 spin_unlock_bh(&hw->phy_lock);
2620 2621
2621 /* Configure RAMbuffers */ 2622 /* Configure RAMbuffers */
2622 ramsize = (hw->ram_size - hw->ram_offset) / hw->ports; 2623 chunk = hw->ram_size / ((hw->ports + 1)*2);
2623 ramaddr = hw->ram_offset + port * ramsize; 2624 ram_addr = hw->ram_offset + 2 * chunk * port;
2624 rxspace = 8 + (2*(ramsize - 16))/3;
2625
2626 skge_ramset(hw, rxqaddr[port], ramaddr, rxspace);
2627 skge_ramset(hw, txqaddr[port], ramaddr + rxspace, ramsize - rxspace);
2628 2625
2626 skge_ramset(hw, rxqaddr[port], ram_addr, chunk);
2629 skge_qset(skge, rxqaddr[port], skge->rx_ring.to_clean); 2627 skge_qset(skge, rxqaddr[port], skge->rx_ring.to_clean);
2628
2630 BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); 2629 BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean);
2630 skge_ramset(hw, txqaddr[port], ram_addr+chunk, chunk);
2631 skge_qset(skge, txqaddr[port], skge->tx_ring.to_use); 2631 skge_qset(skge, txqaddr[port], skge->tx_ring.to_use);
2632 2632
2633 /* Start receiver BMU */ 2633 /* Start receiver BMU */
@@ -3591,12 +3591,15 @@ static int skge_reset(struct skge_hw *hw)
3591 if (hw->chip_id == CHIP_ID_GENESIS) { 3591 if (hw->chip_id == CHIP_ID_GENESIS) {
3592 if (t8 == 3) { 3592 if (t8 == 3) {
3593 /* special case: 4 x 64k x 36, offset = 0x80000 */ 3593 /* special case: 4 x 64k x 36, offset = 0x80000 */
3594 hw->ram_size = 1024; 3594 hw->ram_size = 0x100000;
3595 hw->ram_offset = 512; 3595 hw->ram_offset = 0x80000;
3596 } else 3596 } else
3597 hw->ram_size = t8 * 512; 3597 hw->ram_size = t8 * 512;
3598 } else /* Yukon */ 3598 }
3599 hw->ram_size = t8 ? t8 * 4 : 128; 3599 else if (t8 == 0)
3600 hw->ram_size = 0x20000;
3601 else
3602 hw->ram_size = t8 * 4096;
3600 3603
3601 hw->intr_mask = IS_HW_ERR; 3604 hw->intr_mask = IS_HW_ERR;
3602 3605
diff --git a/include/asm-avr32/sysreg.h b/include/asm-avr32/sysreg.h
index c02bc8304b13..dd21182b60e0 100644
--- a/include/asm-avr32/sysreg.h
+++ b/include/asm-avr32/sysreg.h
@@ -215,6 +215,8 @@
215#define SYSREG_IRP_SIZE 6 215#define SYSREG_IRP_SIZE 6
216 216
217/* Bitfields in PCCR */ 217/* Bitfields in PCCR */
218#define SYSREG_PCCR_E_OFFSET 0
219#define SYSREG_PCCR_E_SIZE 1
218#define SYSREG_PCCR_R_OFFSET 1 220#define SYSREG_PCCR_R_OFFSET 1
219#define SYSREG_PCCR_R_SIZE 1 221#define SYSREG_PCCR_R_SIZE 1
220#define SYSREG_PCCR_C_OFFSET 2 222#define SYSREG_PCCR_C_OFFSET 2
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 8033e6b33271..a100c9f8eb7c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -400,11 +400,6 @@ extern int i2c_release_client(struct i2c_client *);
400extern void i2c_clients_command(struct i2c_adapter *adap, 400extern void i2c_clients_command(struct i2c_adapter *adap,
401 unsigned int cmd, void *arg); 401 unsigned int cmd, void *arg);
402 402
403/* returns -EBUSY if address has been taken, 0 if not. Note that the only
404 other place at which this is called is within i2c_attach_client; so
405 you can cheat by simply not registering. Not recommended, of course! */
406extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
407
408/* Detect function. It iterates over all possible addresses itself. 403/* Detect function. It iterates over all possible addresses itself.
409 * It will only call found_proc if some client is connected at the 404 * It will only call found_proc if some client is connected at the
410 * specific address (unless a 'force' matched); 405 * specific address (unless a 'force' matched);
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index c1d1629fcd27..5f388035687d 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -21,7 +21,7 @@
21#include <sys/types.h> 21#include <sys/types.h>
22#endif 22#endif
23 23
24#if defined(__arm__) || defined(__mips__) 24#if defined(__arm__) || defined(__mips__) || defined(__avr32__)
25/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */ 25/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
26typedef u_int ioaddr_t; 26typedef u_int ioaddr_t;
27#else 27#else
diff --git a/kernel/exit.c b/kernel/exit.c
index f1aec27f1df0..cd0f1d4137a7 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1386,8 +1386,7 @@ static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
1386 int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED; 1386 int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED;
1387 1387
1388 exit_code = p->exit_code; 1388 exit_code = p->exit_code;
1389 if (unlikely(!exit_code) || 1389 if (unlikely(!exit_code) || unlikely(p->exit_state))
1390 unlikely(p->state & TASK_TRACED))
1391 goto bail_ref; 1390 goto bail_ref;
1392 return wait_noreap_copyout(p, pid, uid, 1391 return wait_noreap_copyout(p, pid, uid,
1393 why, (exit_code << 8) | 0x7f, 1392 why, (exit_code << 8) | 0x7f,
diff --git a/kernel/sched.c b/kernel/sched.c
index 4fb3532dd7e8..38933cafea8a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -216,15 +216,15 @@ static inline struct task_group *task_group(struct task_struct *p)
216} 216}
217 217
218/* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ 218/* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
219static inline void set_task_cfs_rq(struct task_struct *p) 219static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu)
220{ 220{
221 p->se.cfs_rq = task_group(p)->cfs_rq[task_cpu(p)]; 221 p->se.cfs_rq = task_group(p)->cfs_rq[cpu];
222 p->se.parent = task_group(p)->se[task_cpu(p)]; 222 p->se.parent = task_group(p)->se[cpu];
223} 223}
224 224
225#else 225#else
226 226
227static inline void set_task_cfs_rq(struct task_struct *p) { } 227static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu) { }
228 228
229#endif /* CONFIG_FAIR_GROUP_SCHED */ 229#endif /* CONFIG_FAIR_GROUP_SCHED */
230 230
@@ -455,18 +455,18 @@ static void update_rq_clock(struct rq *rq)
455 */ 455 */
456enum { 456enum {
457 SCHED_FEAT_NEW_FAIR_SLEEPERS = 1, 457 SCHED_FEAT_NEW_FAIR_SLEEPERS = 1,
458 SCHED_FEAT_START_DEBIT = 2, 458 SCHED_FEAT_WAKEUP_PREEMPT = 2,
459 SCHED_FEAT_TREE_AVG = 4, 459 SCHED_FEAT_START_DEBIT = 4,
460 SCHED_FEAT_APPROX_AVG = 8, 460 SCHED_FEAT_TREE_AVG = 8,
461 SCHED_FEAT_WAKEUP_PREEMPT = 16, 461 SCHED_FEAT_APPROX_AVG = 16,
462}; 462};
463 463
464const_debug unsigned int sysctl_sched_features = 464const_debug unsigned int sysctl_sched_features =
465 SCHED_FEAT_NEW_FAIR_SLEEPERS * 1 | 465 SCHED_FEAT_NEW_FAIR_SLEEPERS * 1 |
466 SCHED_FEAT_WAKEUP_PREEMPT * 1 |
466 SCHED_FEAT_START_DEBIT * 1 | 467 SCHED_FEAT_START_DEBIT * 1 |
467 SCHED_FEAT_TREE_AVG * 0 | 468 SCHED_FEAT_TREE_AVG * 0 |
468 SCHED_FEAT_APPROX_AVG * 0 | 469 SCHED_FEAT_APPROX_AVG * 0;
469 SCHED_FEAT_WAKEUP_PREEMPT * 1;
470 470
471#define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x) 471#define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x)
472 472
@@ -1022,10 +1022,16 @@ unsigned long weighted_cpuload(const int cpu)
1022 1022
1023static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu) 1023static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
1024{ 1024{
1025 set_task_cfs_rq(p, cpu);
1025#ifdef CONFIG_SMP 1026#ifdef CONFIG_SMP
1027 /*
1028 * After ->cpu is set up to a new value, task_rq_lock(p, ...) can be
1029 * successfuly executed on another CPU. We must ensure that updates of
1030 * per-task data have been completed by this moment.
1031 */
1032 smp_wmb();
1026 task_thread_info(p)->cpu = cpu; 1033 task_thread_info(p)->cpu = cpu;
1027#endif 1034#endif
1028 set_task_cfs_rq(p);
1029} 1035}
1030 1036
1031#ifdef CONFIG_SMP 1037#ifdef CONFIG_SMP
@@ -3390,10 +3396,8 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
3390 struct rq *rq = this_rq(); 3396 struct rq *rq = this_rq();
3391 cputime64_t tmp; 3397 cputime64_t tmp;
3392 3398
3393 if (p->flags & PF_VCPU) { 3399 if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0))
3394 account_guest_time(p, cputime); 3400 return account_guest_time(p, cputime);
3395 return;
3396 }
3397 3401
3398 p->stime = cputime_add(p->stime, cputime); 3402 p->stime = cputime_add(p->stime, cputime);
3399 3403
@@ -5278,23 +5282,9 @@ static void migrate_live_tasks(int src_cpu)
5278} 5282}
5279 5283
5280/* 5284/*
5281 * activate_idle_task - move idle task to the _front_ of runqueue.
5282 */
5283static void activate_idle_task(struct task_struct *p, struct rq *rq)
5284{
5285 update_rq_clock(rq);
5286
5287 if (p->state == TASK_UNINTERRUPTIBLE)
5288 rq->nr_uninterruptible--;
5289
5290 enqueue_task(rq, p, 0);
5291 inc_nr_running(p, rq);
5292}
5293
5294/*
5295 * Schedules idle task to be the next runnable task on current CPU. 5285 * Schedules idle task to be the next runnable task on current CPU.
5296 * It does so by boosting its priority to highest possible and adding it to 5286 * It does so by boosting its priority to highest possible.
5297 * the _front_ of the runqueue. Used by CPU offline code. 5287 * Used by CPU offline code.
5298 */ 5288 */
5299void sched_idle_next(void) 5289void sched_idle_next(void)
5300{ 5290{
@@ -5314,8 +5304,8 @@ void sched_idle_next(void)
5314 5304
5315 __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1); 5305 __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1);
5316 5306
5317 /* Add idle task to the _front_ of its priority queue: */ 5307 update_rq_clock(rq);
5318 activate_idle_task(p, rq); 5308 activate_task(rq, p, 0);
5319 5309
5320 spin_unlock_irqrestore(&rq->lock, flags); 5310 spin_unlock_irqrestore(&rq->lock, flags);
5321} 5311}
@@ -7089,8 +7079,10 @@ void sched_move_task(struct task_struct *tsk)
7089 7079
7090 rq = task_rq_lock(tsk, &flags); 7080 rq = task_rq_lock(tsk, &flags);
7091 7081
7092 if (tsk->sched_class != &fair_sched_class) 7082 if (tsk->sched_class != &fair_sched_class) {
7083 set_task_cfs_rq(tsk, task_cpu(tsk));
7093 goto done; 7084 goto done;
7085 }
7094 7086
7095 update_rq_clock(rq); 7087 update_rq_clock(rq);
7096 7088
@@ -7103,7 +7095,7 @@ void sched_move_task(struct task_struct *tsk)
7103 tsk->sched_class->put_prev_task(rq, tsk); 7095 tsk->sched_class->put_prev_task(rq, tsk);
7104 } 7096 }
7105 7097
7106 set_task_cfs_rq(tsk); 7098 set_task_cfs_rq(tsk, task_cpu(tsk));
7107 7099
7108 if (on_rq) { 7100 if (on_rq) {
7109 if (unlikely(running)) 7101 if (unlikely(running))
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index d3c03070872d..ee00da284b12 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -43,7 +43,7 @@ unsigned int sysctl_sched_min_granularity = 1000000ULL;
43/* 43/*
44 * is kept at sysctl_sched_latency / sysctl_sched_min_granularity 44 * is kept at sysctl_sched_latency / sysctl_sched_min_granularity
45 */ 45 */
46unsigned int sched_nr_latency = 20; 46static unsigned int sched_nr_latency = 20;
47 47
48/* 48/*
49 * After fork, child runs first. (default) If set to 0 then 49 * After fork, child runs first. (default) If set to 0 then
diff --git a/mm/slob.c b/mm/slob.c
index 5bc2ceb692ec..08a9bd91a1aa 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -321,7 +321,8 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
321 /* Improve fragment distribution and reduce our average 321 /* Improve fragment distribution and reduce our average
322 * search time by starting our next search here. (see 322 * search time by starting our next search here. (see
323 * Knuth vol 1, sec 2.5, pg 449) */ 323 * Knuth vol 1, sec 2.5, pg 449) */
324 if (free_slob_pages.next != prev->next) 324 if (prev != free_slob_pages.prev &&
325 free_slob_pages.next != prev->next)
325 list_move_tail(&free_slob_pages, prev->next); 326 list_move_tail(&free_slob_pages, prev->next);
326 break; 327 break;
327 } 328 }