aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-13 21:22:27 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-13 21:22:27 -0400
commit59aee3c2a1e69fe5062bd1facb72d6fcea3f3f8f (patch)
treeb337d73229a69e399d4e4f7128b33ce734660e35 /drivers
parent0d69ae5fb7eb9ba3b54cf0ba4ef5ae591f31eef7 (diff)
parent046d20b73960b7a2474b6d5e920d54c3fd7c23fe (diff)
Merge branch 'master'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atm/ambassador.c2
-rw-r--r--drivers/atm/firestream.c5
-rw-r--r--drivers/atm/fore200e.c10
-rw-r--r--drivers/base/dmapool.c5
-rw-r--r--drivers/block/pktcdvd.c4
-rw-r--r--drivers/block/scsi_ioctl.c8
-rw-r--r--drivers/bluetooth/bpa10x.c2
-rw-r--r--drivers/bluetooth/hci_usb.c2
-rw-r--r--drivers/char/drm/drm_stub.c2
-rw-r--r--drivers/char/s3c2410-rtc.c1
-rw-r--r--drivers/char/watchdog/pcwd_pci.c239
-rw-r--r--drivers/connector/connector.c2
-rw-r--r--drivers/firmware/dell_rbu.c174
-rw-r--r--drivers/ide/ide-io.c8
-rw-r--r--drivers/ieee1394/raw1394.c2
-rw-r--r--drivers/infiniband/core/mad.c2
-rw-r--r--drivers/infiniband/core/sa_query.c6
-rw-r--r--drivers/md/dm-crypt.c2
-rw-r--r--drivers/md/dm-io.c2
-rw-r--r--drivers/md/dm-raid1.c2
-rw-r--r--drivers/md/multipath.c2
-rw-r--r--drivers/md/raid1.c4
-rw-r--r--drivers/md/raid10.c4
-rw-r--r--drivers/media/video/bttv-cards.c4
-rw-r--r--drivers/mfd/ucb1x00-core.c24
-rw-r--r--drivers/mfd/ucb1x00.h2
-rw-r--r--drivers/net/bonding/bond_main.c5
-rw-r--r--drivers/net/e100.c224
-rw-r--r--drivers/net/ns83820.c2
-rw-r--r--drivers/net/sungem.h2
-rw-r--r--drivers/pcmcia/cs.c3
-rw-r--r--drivers/pcmcia/ti113x.h5
-rw-r--r--drivers/s390/cio/device.c2
-rw-r--r--drivers/s390/scsi/zfcp_aux.c2
-rw-r--r--drivers/scsi/sata_nv.c14
-rw-r--r--drivers/serial/imx.c48
-rw-r--r--drivers/serial/pxa.c2
-rw-r--r--drivers/serial/s3c2410.c18
-rw-r--r--drivers/serial/sunsab.c1
-rw-r--r--drivers/serial/sunzilog.c5
-rw-r--r--drivers/usb/core/devio.c16
-rw-r--r--drivers/usb/core/inode.c2
-rw-r--r--drivers/usb/core/usb.h3
-rw-r--r--drivers/video/p9100.c4
44 files changed, 428 insertions, 450 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index d74a7c5e75dd..4b6bf19c39c0 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -795,7 +795,7 @@ static void drain_rx_pools (amb_dev * dev) {
795} 795}
796 796
797static inline void fill_rx_pool (amb_dev * dev, unsigned char pool, 797static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
798 unsigned int __nocast priority) 798 gfp_t priority)
799{ 799{
800 rx_in rx; 800 rx_in rx;
801 amb_rxq * rxq; 801 amb_rxq * rxq;
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 58219744f5db..7f7ec288824d 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1374,8 +1374,7 @@ static void reset_chip (struct fs_dev *dev)
1374 } 1374 }
1375} 1375}
1376 1376
1377static void __devinit *aligned_kmalloc (int size, unsigned int __nocast flags, 1377static void __devinit *aligned_kmalloc (int size, gfp_t flags, int alignment)
1378 int alignment)
1379{ 1378{
1380 void *t; 1379 void *t;
1381 1380
@@ -1466,7 +1465,7 @@ static inline int nr_buffers_in_freepool (struct fs_dev *dev, struct freepool *f
1466 working again after that... -- REW */ 1465 working again after that... -- REW */
1467 1466
1468static void top_off_fp (struct fs_dev *dev, struct freepool *fp, 1467static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1469 unsigned int __nocast gfp_flags) 1468 gfp_t gfp_flags)
1470{ 1469{
1471 struct FS_BPENTRY *qe, *ne; 1470 struct FS_BPENTRY *qe, *ne;
1472 struct sk_buff *skb; 1471 struct sk_buff *skb;
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 2bf723a7b6e6..14f6a6201da3 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -178,14 +178,12 @@ fore200e_irq_itoa(int irq)
178 178
179 179
180static void* 180static void*
181fore200e_kmalloc(int size, int flags) 181fore200e_kmalloc(int size, gfp_t flags)
182{ 182{
183 void* chunk = kmalloc(size, flags); 183 void *chunk = kzalloc(size, flags);
184 184
185 if (chunk) 185 if (!chunk)
186 memset(chunk, 0x00, size); 186 printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags);
187 else
188 printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags);
189 187
190 return chunk; 188 return chunk;
191} 189}
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c
index 60a7ef6a201b..e2f64f91ed05 100644
--- a/drivers/base/dmapool.c
+++ b/drivers/base/dmapool.c
@@ -156,7 +156,7 @@ dma_pool_create (const char *name, struct device *dev,
156 156
157 157
158static struct dma_page * 158static struct dma_page *
159pool_alloc_page (struct dma_pool *pool, unsigned int __nocast mem_flags) 159pool_alloc_page (struct dma_pool *pool, gfp_t mem_flags)
160{ 160{
161 struct dma_page *page; 161 struct dma_page *page;
162 int mapsize; 162 int mapsize;
@@ -262,8 +262,7 @@ dma_pool_destroy (struct dma_pool *pool)
262 * If such a memory block can't be allocated, null is returned. 262 * If such a memory block can't be allocated, null is returned.
263 */ 263 */
264void * 264void *
265dma_pool_alloc (struct dma_pool *pool, unsigned int __nocast mem_flags, 265dma_pool_alloc (struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle)
266 dma_addr_t *handle)
267{ 266{
268 unsigned long flags; 267 unsigned long flags;
269 struct dma_page *page; 268 struct dma_page *page;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 7e22a58926b8..a280e679b1ca 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -229,7 +229,7 @@ static int pkt_grow_pktlist(struct pktcdvd_device *pd, int nr_packets)
229 return 1; 229 return 1;
230} 230}
231 231
232static void *pkt_rb_alloc(unsigned int __nocast gfp_mask, void *data) 232static void *pkt_rb_alloc(gfp_t gfp_mask, void *data)
233{ 233{
234 return kmalloc(sizeof(struct pkt_rb_node), gfp_mask); 234 return kmalloc(sizeof(struct pkt_rb_node), gfp_mask);
235} 235}
@@ -2082,7 +2082,7 @@ static int pkt_close(struct inode *inode, struct file *file)
2082} 2082}
2083 2083
2084 2084
2085static void *psd_pool_alloc(unsigned int __nocast gfp_mask, void *data) 2085static void *psd_pool_alloc(gfp_t gfp_mask, void *data)
2086{ 2086{
2087 return kmalloc(sizeof(struct packet_stacked_data), gfp_mask); 2087 return kmalloc(sizeof(struct packet_stacked_data), gfp_mask);
2088} 2088}
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index 079ec344eb47..382dea7b224c 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -201,15 +201,15 @@ static int verify_command(struct file *file, unsigned char *cmd)
201 return 0; 201 return 0;
202 } 202 }
203 203
204 /* And root can do any command.. */
205 if (capable(CAP_SYS_RAWIO))
206 return 0;
207
204 if (!type) { 208 if (!type) {
205 cmd_type[cmd[0]] = CMD_WARNED; 209 cmd_type[cmd[0]] = CMD_WARNED;
206 printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]); 210 printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
207 } 211 }
208 212
209 /* And root can do any command.. */
210 if (capable(CAP_SYS_RAWIO))
211 return 0;
212
213 /* Otherwise fail it with an "Operation not permitted" */ 213 /* Otherwise fail it with an "Operation not permitted" */
214 return -EPERM; 214 return -EPERM;
215} 215}
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index a1bf8f066c88..4fa85234d8b5 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -308,7 +308,7 @@ unlock:
308} 308}
309 309
310static inline struct urb *bpa10x_alloc_urb(struct usb_device *udev, unsigned int pipe, 310static inline struct urb *bpa10x_alloc_urb(struct usb_device *udev, unsigned int pipe,
311 size_t size, unsigned int __nocast flags, void *data) 311 size_t size, gfp_t flags, void *data)
312{ 312{
313 struct urb *urb; 313 struct urb *urb;
314 struct usb_ctrlrequest *cr; 314 struct usb_ctrlrequest *cr;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 57c48bbf6fe6..6756cb20b753 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -132,7 +132,7 @@ static struct usb_device_id blacklist_ids[] = {
132 { } /* Terminating entry */ 132 { } /* Terminating entry */
133}; 133};
134 134
135static struct _urb *_urb_alloc(int isoc, unsigned int __nocast gfp) 135static struct _urb *_urb_alloc(int isoc, gfp_t gfp)
136{ 136{
137 struct _urb *_urb = kmalloc(sizeof(struct _urb) + 137 struct _urb *_urb = kmalloc(sizeof(struct _urb) +
138 sizeof(struct usb_iso_packet_descriptor) * isoc, gfp); 138 sizeof(struct usb_iso_packet_descriptor) * isoc, gfp);
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index 95a976c96eb8..70458cb061c6 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -47,7 +47,7 @@ MODULE_PARM_DESC(cards_limit, "Maximum number of graphics cards");
47MODULE_PARM_DESC(debug, "Enable debug output"); 47MODULE_PARM_DESC(debug, "Enable debug output");
48 48
49module_param_named(cards_limit, drm_cards_limit, int, 0444); 49module_param_named(cards_limit, drm_cards_limit, int, 0444);
50module_param_named(debug, drm_debug, int, 0666); 50module_param_named(debug, drm_debug, int, 0600);
51 51
52drm_head_t **drm_heads; 52drm_head_t **drm_heads;
53struct drm_sysfs_class *drm_class; 53struct drm_sysfs_class *drm_class;
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c
index ed867db550a9..e1a90d9a8756 100644
--- a/drivers/char/s3c2410-rtc.c
+++ b/drivers/char/s3c2410-rtc.c
@@ -564,6 +564,7 @@ static int s3c2410_rtc_resume(struct device *dev, u32 level)
564 564
565static struct device_driver s3c2410_rtcdrv = { 565static struct device_driver s3c2410_rtcdrv = {
566 .name = "s3c2410-rtc", 566 .name = "s3c2410-rtc",
567 .owner = THIS_MODULE,
567 .bus = &platform_bus_type, 568 .bus = &platform_bus_type,
568 .probe = s3c2410_rtc_probe, 569 .probe = s3c2410_rtc_probe,
569 .remove = s3c2410_rtc_remove, 570 .remove = s3c2410_rtc_remove,
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
index 5a80adbf8032..0b8e493be045 100644
--- a/drivers/char/watchdog/pcwd_pci.c
+++ b/drivers/char/watchdog/pcwd_pci.c
@@ -50,8 +50,8 @@
50#include <asm/io.h> /* For inb/outb/... */ 50#include <asm/io.h> /* For inb/outb/... */
51 51
52/* Module and version information */ 52/* Module and version information */
53#define WATCHDOG_VERSION "1.01" 53#define WATCHDOG_VERSION "1.02"
54#define WATCHDOG_DATE "02 Sep 2005" 54#define WATCHDOG_DATE "03 Sep 2005"
55#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" 55#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
56#define WATCHDOG_NAME "pcwd_pci" 56#define WATCHDOG_NAME "pcwd_pci"
57#define PFX WATCHDOG_NAME ": " 57#define PFX WATCHDOG_NAME ": "
@@ -70,19 +70,30 @@
70 * These are the defines that describe the control status bits for the 70 * These are the defines that describe the control status bits for the
71 * PCI-PC Watchdog card. 71 * PCI-PC Watchdog card.
72 */ 72 */
73#define WD_PCI_WTRP 0x01 /* Watchdog Trip status */ 73/* Port 1 : Control Status #1 */
74#define WD_PCI_HRBT 0x02 /* Watchdog Heartbeat */ 74#define WD_PCI_WTRP 0x01 /* Watchdog Trip status */
75#define WD_PCI_TTRP 0x04 /* Temperature Trip status */ 75#define WD_PCI_HRBT 0x02 /* Watchdog Heartbeat */
76#define WD_PCI_TTRP 0x04 /* Temperature Trip status */
77#define WD_PCI_RL2A 0x08 /* Relay 2 Active */
78#define WD_PCI_RL1A 0x10 /* Relay 1 Active */
79#define WD_PCI_R2DS 0x40 /* Relay 2 Disable Temperature-trip/reset */
80#define WD_PCI_RLY2 0x80 /* Activate Relay 2 on the board */
81/* Port 2 : Control Status #2 */
82#define WD_PCI_WDIS 0x10 /* Watchdog Disable */
83#define WD_PCI_ENTP 0x20 /* Enable Temperature Trip Reset */
84#define WD_PCI_WRSP 0x40 /* Watchdog wrote response */
85#define WD_PCI_PCMD 0x80 /* PC has sent command */
76 86
77/* according to documentation max. time to process a command for the pci 87/* according to documentation max. time to process a command for the pci
78 * watchdog card is 100 ms, so we give it 150 ms to do it's job */ 88 * watchdog card is 100 ms, so we give it 150 ms to do it's job */
79#define PCI_COMMAND_TIMEOUT 150 89#define PCI_COMMAND_TIMEOUT 150
80 90
81/* Watchdog's internal commands */ 91/* Watchdog's internal commands */
82#define CMD_GET_STATUS 0x04 92#define CMD_GET_STATUS 0x04
83#define CMD_GET_FIRMWARE_VERSION 0x08 93#define CMD_GET_FIRMWARE_VERSION 0x08
84#define CMD_READ_WATCHDOG_TIMEOUT 0x18 94#define CMD_READ_WATCHDOG_TIMEOUT 0x18
85#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 95#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19
96#define CMD_GET_CLEAR_RESET_COUNT 0x84
86 97
87/* We can only use 1 card due to the /dev/watchdog restriction */ 98/* We can only use 1 card due to the /dev/watchdog restriction */
88static int cards_found; 99static int cards_found;
@@ -91,15 +102,22 @@ static int cards_found;
91static int temp_panic; 102static int temp_panic;
92static unsigned long is_active; 103static unsigned long is_active;
93static char expect_release; 104static char expect_release;
94static struct { 105static struct { /* this is private data for each PCI-PC watchdog card */
95 int supports_temp; /* Wether or not the card has a temperature device */ 106 int supports_temp; /* Wether or not the card has a temperature device */
96 int boot_status; /* The card's boot status */ 107 int boot_status; /* The card's boot status */
97 unsigned long io_addr; /* The cards I/O address */ 108 unsigned long io_addr; /* The cards I/O address */
98 spinlock_t io_lock; 109 spinlock_t io_lock; /* the lock for io operations */
99 struct pci_dev *pdev; 110 struct pci_dev *pdev; /* the PCI-device */
100} pcipcwd_private; 111} pcipcwd_private;
101 112
102/* module parameters */ 113/* module parameters */
114#define QUIET 0 /* Default */
115#define VERBOSE 1 /* Verbose */
116#define DEBUG 2 /* print fancy stuff too */
117static int debug = QUIET;
118module_param(debug, int, 0);
119MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
120
103#define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */ 121#define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */
104static int heartbeat = WATCHDOG_HEARTBEAT; 122static int heartbeat = WATCHDOG_HEARTBEAT;
105module_param(heartbeat, int, 0); 123module_param(heartbeat, int, 0);
@@ -117,6 +135,10 @@ static int send_command(int cmd, int *msb, int *lsb)
117{ 135{
118 int got_response, count; 136 int got_response, count;
119 137
138 if (debug >= DEBUG)
139 printk(KERN_DEBUG PFX "sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n",
140 cmd, *msb, *lsb);
141
120 spin_lock(&pcipcwd_private.io_lock); 142 spin_lock(&pcipcwd_private.io_lock);
121 /* If a command requires data it should be written first. 143 /* If a command requires data it should be written first.
122 * Data for commands with 8 bits of data should be written to port 4. 144 * Data for commands with 8 bits of data should be written to port 4.
@@ -131,10 +153,19 @@ static int send_command(int cmd, int *msb, int *lsb)
131 /* wait till the pci card processed the command, signaled by 153 /* wait till the pci card processed the command, signaled by
132 * the WRSP bit in port 2 and give it a max. timeout of 154 * the WRSP bit in port 2 and give it a max. timeout of
133 * PCI_COMMAND_TIMEOUT to process */ 155 * PCI_COMMAND_TIMEOUT to process */
134 got_response = inb_p(pcipcwd_private.io_addr + 2) & 0x40; 156 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
135 for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) { 157 for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) {
136 mdelay(1); 158 mdelay(1);
137 got_response = inb_p(pcipcwd_private.io_addr + 2) & 0x40; 159 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
160 }
161
162 if (debug >= DEBUG) {
163 if (got_response) {
164 printk(KERN_DEBUG PFX "time to process command was: %d ms\n",
165 count);
166 } else {
167 printk(KERN_DEBUG PFX "card did not respond on command!\n");
168 }
138 } 169 }
139 170
140 if (got_response) { 171 if (got_response) {
@@ -144,12 +175,66 @@ static int send_command(int cmd, int *msb, int *lsb)
144 175
145 /* clear WRSP bit */ 176 /* clear WRSP bit */
146 inb_p(pcipcwd_private.io_addr + 6); 177 inb_p(pcipcwd_private.io_addr + 6);
178
179 if (debug >= DEBUG)
180 printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n",
181 cmd, *msb, *lsb);
147 } 182 }
183
148 spin_unlock(&pcipcwd_private.io_lock); 184 spin_unlock(&pcipcwd_private.io_lock);
149 185
150 return got_response; 186 return got_response;
151} 187}
152 188
189static inline void pcipcwd_check_temperature_support(void)
190{
191 if (inb_p(pcipcwd_private.io_addr) != 0xF0)
192 pcipcwd_private.supports_temp = 1;
193}
194
195static int pcipcwd_get_option_switches(void)
196{
197 int option_switches;
198
199 option_switches = inb_p(pcipcwd_private.io_addr + 3);
200 return option_switches;
201}
202
203static void pcipcwd_show_card_info(void)
204{
205 int got_fw_rev, fw_rev_major, fw_rev_minor;
206 char fw_ver_str[20]; /* The cards firmware version */
207 int option_switches;
208
209 got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
210 if (got_fw_rev) {
211 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
212 } else {
213 sprintf(fw_ver_str, "<card no answer>");
214 }
215
216 /* Get switch settings */
217 option_switches = pcipcwd_get_option_switches();
218
219 printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n",
220 (int) pcipcwd_private.io_addr, fw_ver_str,
221 (pcipcwd_private.supports_temp ? "with" : "without"));
222
223 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
224 option_switches,
225 ((option_switches & 0x10) ? "ON" : "OFF"),
226 ((option_switches & 0x08) ? "ON" : "OFF"));
227
228 if (pcipcwd_private.boot_status & WDIOF_CARDRESET)
229 printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n");
230
231 if (pcipcwd_private.boot_status & WDIOF_OVERHEAT)
232 printk(KERN_INFO PFX "Card sensed a CPU Overheat\n");
233
234 if (pcipcwd_private.boot_status == 0)
235 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
236}
237
153static int pcipcwd_start(void) 238static int pcipcwd_start(void)
154{ 239{
155 int stat_reg; 240 int stat_reg;
@@ -161,11 +246,14 @@ static int pcipcwd_start(void)
161 stat_reg = inb_p(pcipcwd_private.io_addr + 2); 246 stat_reg = inb_p(pcipcwd_private.io_addr + 2);
162 spin_unlock(&pcipcwd_private.io_lock); 247 spin_unlock(&pcipcwd_private.io_lock);
163 248
164 if (stat_reg & 0x10) { 249 if (stat_reg & WD_PCI_WDIS) {
165 printk(KERN_ERR PFX "Card timer not enabled\n"); 250 printk(KERN_ERR PFX "Card timer not enabled\n");
166 return -1; 251 return -1;
167 } 252 }
168 253
254 if (debug >= VERBOSE)
255 printk(KERN_DEBUG PFX "Watchdog started\n");
256
169 return 0; 257 return 0;
170} 258}
171 259
@@ -183,18 +271,25 @@ static int pcipcwd_stop(void)
183 stat_reg = inb_p(pcipcwd_private.io_addr + 2); 271 stat_reg = inb_p(pcipcwd_private.io_addr + 2);
184 spin_unlock(&pcipcwd_private.io_lock); 272 spin_unlock(&pcipcwd_private.io_lock);
185 273
186 if (!(stat_reg & 0x10)) { 274 if (!(stat_reg & WD_PCI_WDIS)) {
187 printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n"); 275 printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n");
188 return -1; 276 return -1;
189 } 277 }
190 278
279 if (debug >= VERBOSE)
280 printk(KERN_DEBUG PFX "Watchdog stopped\n");
281
191 return 0; 282 return 0;
192} 283}
193 284
194static int pcipcwd_keepalive(void) 285static int pcipcwd_keepalive(void)
195{ 286{
196 /* Re-trigger watchdog by writing to port 0 */ 287 /* Re-trigger watchdog by writing to port 0 */
197 outb_p(0x42, pcipcwd_private.io_addr); 288 outb_p(0x42, pcipcwd_private.io_addr); /* send out any data */
289
290 if (debug >= DEBUG)
291 printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
292
198 return 0; 293 return 0;
199} 294}
200 295
@@ -210,29 +305,64 @@ static int pcipcwd_set_heartbeat(int t)
210 send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb); 305 send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb);
211 306
212 heartbeat = t; 307 heartbeat = t;
308 if (debug >= VERBOSE)
309 printk(KERN_DEBUG PFX "New heartbeat: %d\n",
310 heartbeat);
311
213 return 0; 312 return 0;
214} 313}
215 314
216static int pcipcwd_get_status(int *status) 315static int pcipcwd_get_status(int *status)
217{ 316{
218 int new_status; 317 int control_status;
219 318
220 *status=0; 319 *status=0;
221 new_status = inb_p(pcipcwd_private.io_addr + 1); 320 control_status = inb_p(pcipcwd_private.io_addr + 1);
222 if (new_status & WD_PCI_WTRP) 321 if (control_status & WD_PCI_WTRP)
223 *status |= WDIOF_CARDRESET; 322 *status |= WDIOF_CARDRESET;
224 if (new_status & WD_PCI_TTRP) { 323 if (control_status & WD_PCI_TTRP) {
225 *status |= WDIOF_OVERHEAT; 324 *status |= WDIOF_OVERHEAT;
226 if (temp_panic) 325 if (temp_panic)
227 panic(PFX "Temperature overheat trip!\n"); 326 panic(PFX "Temperature overheat trip!\n");
228 } 327 }
229 328
329 if (debug >= DEBUG)
330 printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n",
331 control_status);
332
230 return 0; 333 return 0;
231} 334}
232 335
233static int pcipcwd_clear_status(void) 336static int pcipcwd_clear_status(void)
234{ 337{
235 outb_p(0x01, pcipcwd_private.io_addr + 1); 338 int control_status;
339 int msb;
340 int reset_counter;
341
342 if (debug >= VERBOSE)
343 printk(KERN_INFO PFX "clearing watchdog trip status & LED\n");
344
345 control_status = inb_p(pcipcwd_private.io_addr + 1);
346
347 if (debug >= DEBUG) {
348 printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status);
349 printk(KERN_DEBUG PFX "sending: 0x%02x\n",
350 (control_status & WD_PCI_R2DS) | WD_PCI_WTRP);
351 }
352
353 /* clear trip status & LED and keep mode of relay 2 */
354 outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1);
355
356 /* clear reset counter */
357 msb=0;
358 reset_counter=0xff;
359 send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter);
360
361 if (debug >= DEBUG) {
362 printk(KERN_DEBUG PFX "reset count was: 0x%02x\n",
363 reset_counter);
364 }
365
236 return 0; 366 return 0;
237} 367}
238 368
@@ -242,11 +372,18 @@ static int pcipcwd_get_temperature(int *temperature)
242 if (!pcipcwd_private.supports_temp) 372 if (!pcipcwd_private.supports_temp)
243 return -ENODEV; 373 return -ENODEV;
244 374
375 *temperature = inb_p(pcipcwd_private.io_addr);
376
245 /* 377 /*
246 * Convert celsius to fahrenheit, since this was 378 * Convert celsius to fahrenheit, since this was
247 * the decided 'standard' for this return value. 379 * the decided 'standard' for this return value.
248 */ 380 */
249 *temperature = ((inb_p(pcipcwd_private.io_addr)) * 9 / 5) + 32; 381 *temperature = (*temperature * 9 / 5) + 32;
382
383 if (debug >= DEBUG) {
384 printk(KERN_DEBUG PFX "temperature is: %d F\n",
385 *temperature);
386 }
250 387
251 return 0; 388 return 0;
252} 389}
@@ -256,7 +393,7 @@ static int pcipcwd_get_temperature(int *temperature)
256 */ 393 */
257 394
258static ssize_t pcipcwd_write(struct file *file, const char __user *data, 395static ssize_t pcipcwd_write(struct file *file, const char __user *data,
259 size_t len, loff_t *ppos) 396 size_t len, loff_t *ppos)
260{ 397{
261 /* See if we got the magic character 'V' and reload the timer */ 398 /* See if we got the magic character 'V' and reload the timer */
262 if (len) { 399 if (len) {
@@ -381,8 +518,11 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
381static int pcipcwd_open(struct inode *inode, struct file *file) 518static int pcipcwd_open(struct inode *inode, struct file *file)
382{ 519{
383 /* /dev/watchdog can only be opened once */ 520 /* /dev/watchdog can only be opened once */
384 if (test_and_set_bit(0, &is_active)) 521 if (test_and_set_bit(0, &is_active)) {
522 if (debug >= VERBOSE)
523 printk(KERN_ERR PFX "Attempt to open already opened device.\n");
385 return -EBUSY; 524 return -EBUSY;
525 }
386 526
387 /* Activate */ 527 /* Activate */
388 pcipcwd_start(); 528 pcipcwd_start();
@@ -492,19 +632,10 @@ static struct notifier_block pcipcwd_notifier = {
492 * Init & exit routines 632 * Init & exit routines
493 */ 633 */
494 634
495static inline void check_temperature_support(void)
496{
497 if (inb_p(pcipcwd_private.io_addr) != 0xF0)
498 pcipcwd_private.supports_temp = 1;
499}
500
501static int __devinit pcipcwd_card_init(struct pci_dev *pdev, 635static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
502 const struct pci_device_id *ent) 636 const struct pci_device_id *ent)
503{ 637{
504 int ret = -EIO; 638 int ret = -EIO;
505 int got_fw_rev, fw_rev_major, fw_rev_minor;
506 char fw_ver_str[20];
507 char option_switches;
508 639
509 cards_found++; 640 cards_found++;
510 if (cards_found == 1) 641 if (cards_found == 1)
@@ -546,36 +677,10 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
546 pcipcwd_stop(); 677 pcipcwd_stop();
547 678
548 /* Check whether or not the card supports the temperature device */ 679 /* Check whether or not the card supports the temperature device */
549 check_temperature_support(); 680 pcipcwd_check_temperature_support();
550
551 /* Get the Firmware Version */
552 got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
553 if (got_fw_rev) {
554 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
555 } else {
556 sprintf(fw_ver_str, "<card no answer>");
557 }
558 681
559 /* Get switch settings */ 682 /* Show info about the card itself */
560 option_switches = inb_p(pcipcwd_private.io_addr + 3); 683 pcipcwd_show_card_info();
561
562 printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n",
563 (int) pcipcwd_private.io_addr, fw_ver_str,
564 (pcipcwd_private.supports_temp ? "with" : "without"));
565
566 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
567 option_switches,
568 ((option_switches & 0x10) ? "ON" : "OFF"),
569 ((option_switches & 0x08) ? "ON" : "OFF"));
570
571 if (pcipcwd_private.boot_status & WDIOF_CARDRESET)
572 printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n");
573
574 if (pcipcwd_private.boot_status & WDIOF_OVERHEAT)
575 printk(KERN_INFO PFX "Card sensed a CPU Overheat\n");
576
577 if (pcipcwd_private.boot_status == 0)
578 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
579 684
580 /* Check that the heartbeat value is within it's range ; if not reset to the default */ 685 /* Check that the heartbeat value is within it's range ; if not reset to the default */
581 if (pcipcwd_set_heartbeat(heartbeat)) { 686 if (pcipcwd_set_heartbeat(heartbeat)) {
@@ -656,7 +761,7 @@ static struct pci_driver pcipcwd_driver = {
656 761
657static int __init pcipcwd_init_module(void) 762static int __init pcipcwd_init_module(void)
658{ 763{
659 spin_lock_init (&pcipcwd_private.io_lock); 764 spin_lock_init(&pcipcwd_private.io_lock);
660 765
661 return pci_register_driver(&pcipcwd_driver); 766 return pci_register_driver(&pcipcwd_driver);
662} 767}
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index bb0b3a8de14b..505677fb3157 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -69,7 +69,7 @@ int cn_already_initialized = 0;
69 * a new message. 69 * a new message.
70 * 70 *
71 */ 71 */
72int cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask) 72int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask)
73{ 73{
74 struct cn_callback_entry *__cbq; 74 struct cn_callback_entry *__cbq;
75 unsigned int size; 75 unsigned int size;
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index b66782398258..4f4ba9b6d182 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -50,7 +50,7 @@
50MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>"); 50MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
51MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); 51MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
52MODULE_LICENSE("GPL"); 52MODULE_LICENSE("GPL");
53MODULE_VERSION("2.0"); 53MODULE_VERSION("3.0");
54 54
55#define BIOS_SCAN_LIMIT 0xffffffff 55#define BIOS_SCAN_LIMIT 0xffffffff
56#define MAX_IMAGE_LENGTH 16 56#define MAX_IMAGE_LENGTH 16
@@ -62,15 +62,16 @@ static struct _rbu_data {
62 int dma_alloc; 62 int dma_alloc;
63 spinlock_t lock; 63 spinlock_t lock;
64 unsigned long packet_read_count; 64 unsigned long packet_read_count;
65 unsigned long packet_write_count;
66 unsigned long num_packets; 65 unsigned long num_packets;
67 unsigned long packetsize; 66 unsigned long packetsize;
67 unsigned long imagesize;
68 int entry_created; 68 int entry_created;
69} rbu_data; 69} rbu_data;
70 70
71static char image_type[MAX_IMAGE_LENGTH + 1] = "mono"; 71static char image_type[MAX_IMAGE_LENGTH + 1] = "mono";
72module_param_string(image_type, image_type, sizeof (image_type), 0); 72module_param_string(image_type, image_type, sizeof (image_type), 0);
73MODULE_PARM_DESC(image_type, "BIOS image type. choose- mono or packet"); 73MODULE_PARM_DESC(image_type,
74 "BIOS image type. choose- mono or packet or init");
74 75
75struct packet_data { 76struct packet_data {
76 struct list_head list; 77 struct list_head list;
@@ -88,55 +89,13 @@ static dma_addr_t dell_rbu_dmaaddr;
88static void init_packet_head(void) 89static void init_packet_head(void)
89{ 90{
90 INIT_LIST_HEAD(&packet_data_head.list); 91 INIT_LIST_HEAD(&packet_data_head.list);
91 rbu_data.packet_write_count = 0;
92 rbu_data.packet_read_count = 0; 92 rbu_data.packet_read_count = 0;
93 rbu_data.num_packets = 0; 93 rbu_data.num_packets = 0;
94 rbu_data.packetsize = 0; 94 rbu_data.packetsize = 0;
95 rbu_data.imagesize = 0;
95} 96}
96 97
97static int fill_last_packet(void *data, size_t length) 98static int create_packet(void *data, size_t length)
98{
99 struct list_head *ptemp_list;
100 struct packet_data *packet = NULL;
101 int packet_count = 0;
102
103 pr_debug("fill_last_packet: entry \n");
104
105 if (!rbu_data.num_packets) {
106 pr_debug("fill_last_packet: num_packets=0\n");
107 return -ENOMEM;
108 }
109
110 packet_count = rbu_data.num_packets;
111
112 ptemp_list = (&packet_data_head.list)->prev;
113
114 packet = list_entry(ptemp_list, struct packet_data, list);
115
116 if ((rbu_data.packet_write_count + length) > rbu_data.packetsize) {
117 pr_debug("dell_rbu:%s: packet size data "
118 "overrun\n", __FUNCTION__);
119 return -EINVAL;
120 }
121
122 pr_debug("fill_last_packet : buffer = %p\n", packet->data);
123
124 memcpy((packet->data + rbu_data.packet_write_count), data, length);
125
126 if ((rbu_data.packet_write_count + length) == rbu_data.packetsize) {
127 /*
128 * this was the last data chunk in the packet
129 * so reinitialize the packet data counter to zero
130 */
131 rbu_data.packet_write_count = 0;
132 } else
133 rbu_data.packet_write_count += length;
134
135 pr_debug("fill_last_packet: exit \n");
136 return 0;
137}
138
139static int create_packet(size_t length)
140{ 99{
141 struct packet_data *newpacket; 100 struct packet_data *newpacket;
142 int ordernum = 0; 101 int ordernum = 0;
@@ -186,9 +145,11 @@ static int create_packet(size_t length)
186 INIT_LIST_HEAD(&newpacket->list); 145 INIT_LIST_HEAD(&newpacket->list);
187 list_add_tail(&newpacket->list, &packet_data_head.list); 146 list_add_tail(&newpacket->list, &packet_data_head.list);
188 /* 147 /*
189 * packets have fixed size 148 * packets may not have fixed size
190 */ 149 */
191 newpacket->length = rbu_data.packetsize; 150 newpacket->length = length;
151
152 memcpy(newpacket->data, data, length);
192 153
193 pr_debug("create_packet: exit \n"); 154 pr_debug("create_packet: exit \n");
194 155
@@ -198,13 +159,37 @@ static int create_packet(size_t length)
198static int packetize_data(void *data, size_t length) 159static int packetize_data(void *data, size_t length)
199{ 160{
200 int rc = 0; 161 int rc = 0;
162 int done = 0;
163 int packet_length;
164 u8 *temp;
165 u8 *end = (u8 *) data + length;
166 pr_debug("packetize_data: data length %d\n", length);
167 if (!rbu_data.packetsize) {
168 printk(KERN_WARNING
169 "dell_rbu: packetsize not specified\n");
170 return -EIO;
171 }
201 172
202 if (!rbu_data.packet_write_count) { 173 temp = (u8 *) data;
203 if ((rc = create_packet(length))) 174
175 /* packetize the hunk */
176 while (!done) {
177 if ((temp + rbu_data.packetsize) < end)
178 packet_length = rbu_data.packetsize;
179 else {
180 /* this is the last packet */
181 packet_length = end - temp;
182 done = 1;
183 }
184
185 if ((rc = create_packet(temp, packet_length)))
204 return rc; 186 return rc;
187
188 pr_debug("%lu:%lu\n", temp, (end - temp));
189 temp += packet_length;
205 } 190 }
206 if ((rc = fill_last_packet(data, length))) 191
207 return rc; 192 rbu_data.imagesize = length;
208 193
209 return rc; 194 return rc;
210} 195}
@@ -243,7 +228,7 @@ static int do_packet_read(char *data, struct list_head *ptemp_list,
243 return bytes_copied; 228 return bytes_copied;
244} 229}
245 230
246static int packet_read_list(char *data, size_t *pread_length) 231static int packet_read_list(char *data, size_t * pread_length)
247{ 232{
248 struct list_head *ptemp_list; 233 struct list_head *ptemp_list;
249 int temp_count = 0; 234 int temp_count = 0;
@@ -303,10 +288,9 @@ static void packet_empty_list(void)
303 newpacket->ordernum); 288 newpacket->ordernum);
304 kfree(newpacket); 289 kfree(newpacket);
305 } 290 }
306 rbu_data.packet_write_count = 0;
307 rbu_data.packet_read_count = 0; 291 rbu_data.packet_read_count = 0;
308 rbu_data.num_packets = 0; 292 rbu_data.num_packets = 0;
309 rbu_data.packetsize = 0; 293 rbu_data.imagesize = 0;
310} 294}
311 295
312/* 296/*
@@ -425,7 +409,6 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
425 size_t bytes_left; 409 size_t bytes_left;
426 size_t data_length; 410 size_t data_length;
427 char *ptempBuf = buffer; 411 char *ptempBuf = buffer;
428 unsigned long imagesize;
429 412
430 /* check to see if we have something to return */ 413 /* check to see if we have something to return */
431 if (rbu_data.num_packets == 0) { 414 if (rbu_data.num_packets == 0) {
@@ -434,22 +417,20 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
434 goto read_rbu_data_exit; 417 goto read_rbu_data_exit;
435 } 418 }
436 419
437 imagesize = rbu_data.num_packets * rbu_data.packetsize; 420 if (pos > rbu_data.imagesize) {
438
439 if (pos > imagesize) {
440 retval = 0; 421 retval = 0;
441 printk(KERN_WARNING "dell_rbu:read_packet_data: " 422 printk(KERN_WARNING "dell_rbu:read_packet_data: "
442 "data underrun\n"); 423 "data underrun\n");
443 goto read_rbu_data_exit; 424 goto read_rbu_data_exit;
444 } 425 }
445 426
446 bytes_left = imagesize - pos; 427 bytes_left = rbu_data.imagesize - pos;
447 data_length = min(bytes_left, count); 428 data_length = min(bytes_left, count);
448 429
449 if ((retval = packet_read_list(ptempBuf, &data_length)) < 0) 430 if ((retval = packet_read_list(ptempBuf, &data_length)) < 0)
450 goto read_rbu_data_exit; 431 goto read_rbu_data_exit;
451 432
452 if ((pos + count) > imagesize) { 433 if ((pos + count) > rbu_data.imagesize) {
453 rbu_data.packet_read_count = 0; 434 rbu_data.packet_read_count = 0;
454 /* this was the last copy */ 435 /* this was the last copy */
455 retval = bytes_left; 436 retval = bytes_left;
@@ -499,7 +480,7 @@ static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count)
499} 480}
500 481
501static ssize_t read_rbu_data(struct kobject *kobj, char *buffer, 482static ssize_t read_rbu_data(struct kobject *kobj, char *buffer,
502 loff_t pos, size_t count) 483 loff_t pos, size_t count)
503{ 484{
504 ssize_t ret_count = 0; 485 ssize_t ret_count = 0;
505 486
@@ -531,13 +512,18 @@ static void callbackfn_rbu(const struct firmware *fw, void *context)
531 memcpy(rbu_data.image_update_buffer, 512 memcpy(rbu_data.image_update_buffer,
532 fw->data, fw->size); 513 fw->data, fw->size);
533 } else if (!strcmp(image_type, "packet")) { 514 } else if (!strcmp(image_type, "packet")) {
534 if (!rbu_data.packetsize) 515 /*
535 rbu_data.packetsize = fw->size; 516 * we need to free previous packets if a
536 else if (rbu_data.packetsize != fw->size) { 517 * new hunk of packets needs to be downloaded
518 */
519 packet_empty_list();
520 if (packetize_data(fw->data, fw->size))
521 /* Incase something goes wrong when we are
522 * in middle of packetizing the data, we
523 * need to free up whatever packets might
524 * have been created before we quit.
525 */
537 packet_empty_list(); 526 packet_empty_list();
538 rbu_data.packetsize = fw->size;
539 }
540 packetize_data(fw->data, fw->size);
541 } else 527 } else
542 pr_debug("invalid image type specified.\n"); 528 pr_debug("invalid image type specified.\n");
543 spin_unlock(&rbu_data.lock); 529 spin_unlock(&rbu_data.lock);
@@ -553,7 +539,7 @@ static void callbackfn_rbu(const struct firmware *fw, void *context)
553} 539}
554 540
555static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer, 541static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer,
556 loff_t pos, size_t count) 542 loff_t pos, size_t count)
557{ 543{
558 int size = 0; 544 int size = 0;
559 if (!pos) 545 if (!pos)
@@ -562,7 +548,7 @@ static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer,
562} 548}
563 549
564static ssize_t write_rbu_image_type(struct kobject *kobj, char *buffer, 550static ssize_t write_rbu_image_type(struct kobject *kobj, char *buffer,
565 loff_t pos, size_t count) 551 loff_t pos, size_t count)
566{ 552{
567 int rc = count; 553 int rc = count;
568 int req_firm_rc = 0; 554 int req_firm_rc = 0;
@@ -621,25 +607,49 @@ static ssize_t write_rbu_image_type(struct kobject *kobj, char *buffer,
621 return rc; 607 return rc;
622} 608}
623 609
610static ssize_t read_rbu_packet_size(struct kobject *kobj, char *buffer,
611 loff_t pos, size_t count)
612{
613 int size = 0;
614 if (!pos) {
615 spin_lock(&rbu_data.lock);
616 size = sprintf(buffer, "%lu\n", rbu_data.packetsize);
617 spin_unlock(&rbu_data.lock);
618 }
619 return size;
620}
621
622static ssize_t write_rbu_packet_size(struct kobject *kobj, char *buffer,
623 loff_t pos, size_t count)
624{
625 unsigned long temp;
626 spin_lock(&rbu_data.lock);
627 packet_empty_list();
628 sscanf(buffer, "%lu", &temp);
629 if (temp < 0xffffffff)
630 rbu_data.packetsize = temp;
631
632 spin_unlock(&rbu_data.lock);
633 return count;
634}
635
624static struct bin_attribute rbu_data_attr = { 636static struct bin_attribute rbu_data_attr = {
625 .attr = { 637 .attr = {.name = "data",.owner = THIS_MODULE,.mode = 0444},
626 .name = "data",
627 .owner = THIS_MODULE,
628 .mode = 0444,
629 },
630 .read = read_rbu_data, 638 .read = read_rbu_data,
631}; 639};
632 640
633static struct bin_attribute rbu_image_type_attr = { 641static struct bin_attribute rbu_image_type_attr = {
634 .attr = { 642 .attr = {.name = "image_type",.owner = THIS_MODULE,.mode = 0644},
635 .name = "image_type",
636 .owner = THIS_MODULE,
637 .mode = 0644,
638 },
639 .read = read_rbu_image_type, 643 .read = read_rbu_image_type,
640 .write = write_rbu_image_type, 644 .write = write_rbu_image_type,
641}; 645};
642 646
647static struct bin_attribute rbu_packet_size_attr = {
648 .attr = {.name = "packet_size",.owner = THIS_MODULE,.mode = 0644},
649 .read = read_rbu_packet_size,
650 .write = write_rbu_packet_size,
651};
652
643static int __init dcdrbu_init(void) 653static int __init dcdrbu_init(void)
644{ 654{
645 int rc = 0; 655 int rc = 0;
@@ -657,6 +667,8 @@ static int __init dcdrbu_init(void)
657 667
658 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); 668 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
659 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); 669 sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr);
670 sysfs_create_bin_file(&rbu_device->dev.kobj,
671 &rbu_packet_size_attr);
660 672
661 rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, 673 rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
662 "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu); 674 "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 9e9cf1407311..5275cbb1afe9 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1101,6 +1101,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
1101 ide_hwif_t *hwif; 1101 ide_hwif_t *hwif;
1102 struct request *rq; 1102 struct request *rq;
1103 ide_startstop_t startstop; 1103 ide_startstop_t startstop;
1104 int loops = 0;
1104 1105
1105 /* for atari only: POSSIBLY BROKEN HERE(?) */ 1106 /* for atari only: POSSIBLY BROKEN HERE(?) */
1106 ide_get_lock(ide_intr, hwgroup); 1107 ide_get_lock(ide_intr, hwgroup);
@@ -1153,6 +1154,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
1153 /* no more work for this hwgroup (for now) */ 1154 /* no more work for this hwgroup (for now) */
1154 return; 1155 return;
1155 } 1156 }
1157 again:
1156 hwif = HWIF(drive); 1158 hwif = HWIF(drive);
1157 if (hwgroup->hwif->sharing_irq && 1159 if (hwgroup->hwif->sharing_irq &&
1158 hwif != hwgroup->hwif && 1160 hwif != hwgroup->hwif &&
@@ -1192,8 +1194,14 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
1192 * though. I hope that doesn't happen too much, hopefully not 1194 * though. I hope that doesn't happen too much, hopefully not
1193 * unless the subdriver triggers such a thing in its own PM 1195 * unless the subdriver triggers such a thing in its own PM
1194 * state machine. 1196 * state machine.
1197 *
1198 * We count how many times we loop here to make sure we service
1199 * all drives in the hwgroup without looping for ever
1195 */ 1200 */
1196 if (drive->blocked && !blk_pm_request(rq) && !(rq->flags & REQ_PREEMPT)) { 1201 if (drive->blocked && !blk_pm_request(rq) && !(rq->flags & REQ_PREEMPT)) {
1202 drive = drive->next ? drive->next : hwgroup->drive;
1203 if (loops++ < 4 && !blk_queue_plugged(drive->queue))
1204 goto again;
1197 /* We clear busy, there should be no pending ATA command at this point. */ 1205 /* We clear busy, there should be no pending ATA command at this point. */
1198 hwgroup->busy = 0; 1206 hwgroup->busy = 0;
1199 break; 1207 break;
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 5fe4f2ba0979..315f5ca8bedb 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -98,7 +98,7 @@ static struct hpsb_address_ops arm_ops = {
98 98
99static void queue_complete_cb(struct pending_request *req); 99static void queue_complete_cb(struct pending_request *req);
100 100
101static struct pending_request *__alloc_pending_request(unsigned int __nocast flags) 101static struct pending_request *__alloc_pending_request(gfp_t flags)
102{ 102{
103 struct pending_request *req; 103 struct pending_request *req;
104 104
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index a4a4d9c1eef3..a14ca87fda18 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -783,7 +783,7 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent,
783 u32 remote_qpn, u16 pkey_index, 783 u32 remote_qpn, u16 pkey_index,
784 struct ib_ah *ah, int rmpp_active, 784 struct ib_ah *ah, int rmpp_active,
785 int hdr_len, int data_len, 785 int hdr_len, int data_len,
786 unsigned int __nocast gfp_mask) 786 gfp_t gfp_mask)
787{ 787{
788 struct ib_mad_agent_private *mad_agent_priv; 788 struct ib_mad_agent_private *mad_agent_priv;
789 struct ib_mad_send_buf *send_buf; 789 struct ib_mad_send_buf *send_buf;
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 78de2dd1a4f2..262618210c1c 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -574,7 +574,7 @@ static void ib_sa_path_rec_release(struct ib_sa_query *sa_query)
574int ib_sa_path_rec_get(struct ib_device *device, u8 port_num, 574int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
575 struct ib_sa_path_rec *rec, 575 struct ib_sa_path_rec *rec,
576 ib_sa_comp_mask comp_mask, 576 ib_sa_comp_mask comp_mask,
577 int timeout_ms, unsigned int __nocast gfp_mask, 577 int timeout_ms, gfp_t gfp_mask,
578 void (*callback)(int status, 578 void (*callback)(int status,
579 struct ib_sa_path_rec *resp, 579 struct ib_sa_path_rec *resp,
580 void *context), 580 void *context),
@@ -676,7 +676,7 @@ static void ib_sa_service_rec_release(struct ib_sa_query *sa_query)
676int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, u8 method, 676int ib_sa_service_rec_query(struct ib_device *device, u8 port_num, u8 method,
677 struct ib_sa_service_rec *rec, 677 struct ib_sa_service_rec *rec,
678 ib_sa_comp_mask comp_mask, 678 ib_sa_comp_mask comp_mask,
679 int timeout_ms, unsigned int __nocast gfp_mask, 679 int timeout_ms, gfp_t gfp_mask,
680 void (*callback)(int status, 680 void (*callback)(int status,
681 struct ib_sa_service_rec *resp, 681 struct ib_sa_service_rec *resp,
682 void *context), 682 void *context),
@@ -759,7 +759,7 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
759 u8 method, 759 u8 method,
760 struct ib_sa_mcmember_rec *rec, 760 struct ib_sa_mcmember_rec *rec,
761 ib_sa_comp_mask comp_mask, 761 ib_sa_comp_mask comp_mask,
762 int timeout_ms, unsigned int __nocast gfp_mask, 762 int timeout_ms, gfp_t gfp_mask,
763 void (*callback)(int status, 763 void (*callback)(int status,
764 struct ib_sa_mcmember_rec *resp, 764 struct ib_sa_mcmember_rec *resp,
765 void *context), 765 void *context),
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index b82bc3150476..b6148f6f7836 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -96,7 +96,7 @@ static kmem_cache_t *_crypt_io_pool;
96/* 96/*
97 * Mempool alloc and free functions for the page 97 * Mempool alloc and free functions for the page
98 */ 98 */
99static void *mempool_alloc_page(unsigned int __nocast gfp_mask, void *data) 99static void *mempool_alloc_page(gfp_t gfp_mask, void *data)
100{ 100{
101 return alloc_page(gfp_mask); 101 return alloc_page(gfp_mask);
102} 102}
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 9de000131a8a..4809b209fbb1 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -32,7 +32,7 @@ struct io {
32static unsigned _num_ios; 32static unsigned _num_ios;
33static mempool_t *_io_pool; 33static mempool_t *_io_pool;
34 34
35static void *alloc_io(unsigned int __nocast gfp_mask, void *pool_data) 35static void *alloc_io(gfp_t gfp_mask, void *pool_data)
36{ 36{
37 return kmalloc(sizeof(struct io), gfp_mask); 37 return kmalloc(sizeof(struct io), gfp_mask);
38} 38}
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 863282513753..2375709a392c 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -122,7 +122,7 @@ static inline sector_t region_to_sector(struct region_hash *rh, region_t region)
122/* FIXME move this */ 122/* FIXME move this */
123static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw); 123static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw);
124 124
125static void *region_alloc(unsigned int __nocast gfp_mask, void *pool_data) 125static void *region_alloc(gfp_t gfp_mask, void *pool_data)
126{ 126{
127 return kmalloc(sizeof(struct region), gfp_mask); 127 return kmalloc(sizeof(struct region), gfp_mask);
128} 128}
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 286342375fb7..1151c3ed3006 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -38,7 +38,7 @@
38static mdk_personality_t multipath_personality; 38static mdk_personality_t multipath_personality;
39 39
40 40
41static void *mp_pool_alloc(unsigned int __nocast gfp_flags, void *data) 41static void *mp_pool_alloc(gfp_t gfp_flags, void *data)
42{ 42{
43 struct multipath_bh *mpb; 43 struct multipath_bh *mpb;
44 mpb = kmalloc(sizeof(*mpb), gfp_flags); 44 mpb = kmalloc(sizeof(*mpb), gfp_flags);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a93ca478142a..0e1f148dd41d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -52,7 +52,7 @@ static mdk_personality_t raid1_personality;
52static void unplug_slaves(mddev_t *mddev); 52static void unplug_slaves(mddev_t *mddev);
53 53
54 54
55static void * r1bio_pool_alloc(unsigned int __nocast gfp_flags, void *data) 55static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data)
56{ 56{
57 struct pool_info *pi = data; 57 struct pool_info *pi = data;
58 r1bio_t *r1_bio; 58 r1bio_t *r1_bio;
@@ -79,7 +79,7 @@ static void r1bio_pool_free(void *r1_bio, void *data)
79#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) 79#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
80#define RESYNC_WINDOW (2048*1024) 80#define RESYNC_WINDOW (2048*1024)
81 81
82static void * r1buf_pool_alloc(unsigned int __nocast gfp_flags, void *data) 82static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
83{ 83{
84 struct pool_info *pi = data; 84 struct pool_info *pi = data;
85 struct page *page; 85 struct page *page;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 5bd1e9ec899d..28dd028415e4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -47,7 +47,7 @@
47 47
48static void unplug_slaves(mddev_t *mddev); 48static void unplug_slaves(mddev_t *mddev);
49 49
50static void * r10bio_pool_alloc(unsigned int __nocast gfp_flags, void *data) 50static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data)
51{ 51{
52 conf_t *conf = data; 52 conf_t *conf = data;
53 r10bio_t *r10_bio; 53 r10bio_t *r10_bio;
@@ -81,7 +81,7 @@ static void r10bio_pool_free(void *r10_bio, void *data)
81 * one for write (we recover only one drive per r10buf) 81 * one for write (we recover only one drive per r10buf)
82 * 82 *
83 */ 83 */
84static void * r10buf_pool_alloc(unsigned int __nocast gfp_flags, void *data) 84static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
85{ 85{
86 conf_t *conf = data; 86 conf_t *conf = data;
87 struct page *page; 87 struct page *page;
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 6c332800d6ab..0881a17d5226 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -2393,10 +2393,10 @@ struct tvcard bttv_tvcards[] = {
2393 .tuner = 0, 2393 .tuner = 0,
2394 .tuner_type = TUNER_LG_TDVS_H062F, 2394 .tuner_type = TUNER_LG_TDVS_H062F,
2395 .tuner_addr = ADDR_UNSET, 2395 .tuner_addr = ADDR_UNSET,
2396 .video_inputs = 2, 2396 .video_inputs = 3,
2397 .audio_inputs = 1, 2397 .audio_inputs = 1,
2398 .svhs = 2, 2398 .svhs = 2,
2399 .muxsel = { 2, 3 }, 2399 .muxsel = { 2, 3, 1 },
2400 .gpiomask = 0x00e00007, 2400 .gpiomask = 0x00e00007,
2401 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 }, 2401 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2402 .no_msp34xx = 1, 2402 .no_msp34xx = 1,
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 10f6ce1bc0ab..e335d54c4659 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -457,6 +457,17 @@ static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
457 return probe_irq_off(mask); 457 return probe_irq_off(mask);
458} 458}
459 459
460static void ucb1x00_release(struct class_device *dev)
461{
462 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev);
463 kfree(ucb);
464}
465
466static struct class ucb1x00_class = {
467 .name = "ucb1x00",
468 .release = ucb1x00_release,
469};
470
460static int ucb1x00_probe(struct mcp *mcp) 471static int ucb1x00_probe(struct mcp *mcp)
461{ 472{
462 struct ucb1x00 *ucb; 473 struct ucb1x00 *ucb;
@@ -546,17 +557,6 @@ static void ucb1x00_remove(struct mcp *mcp)
546 class_device_unregister(&ucb->cdev); 557 class_device_unregister(&ucb->cdev);
547} 558}
548 559
549static void ucb1x00_release(struct class_device *dev)
550{
551 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev);
552 kfree(ucb);
553}
554
555static struct class ucb1x00_class = {
556 .name = "ucb1x00",
557 .release = ucb1x00_release,
558};
559
560int ucb1x00_register_driver(struct ucb1x00_driver *drv) 560int ucb1x00_register_driver(struct ucb1x00_driver *drv)
561{ 561{
562 struct ucb1x00 *ucb; 562 struct ucb1x00 *ucb;
@@ -642,8 +642,6 @@ static void __exit ucb1x00_exit(void)
642module_init(ucb1x00_init); 642module_init(ucb1x00_init);
643module_exit(ucb1x00_exit); 643module_exit(ucb1x00_exit);
644 644
645EXPORT_SYMBOL(ucb1x00_class);
646
647EXPORT_SYMBOL(ucb1x00_io_set_dir); 645EXPORT_SYMBOL(ucb1x00_io_set_dir);
648EXPORT_SYMBOL(ucb1x00_io_write); 646EXPORT_SYMBOL(ucb1x00_io_write);
649EXPORT_SYMBOL(ucb1x00_io_read); 647EXPORT_SYMBOL(ucb1x00_io_read);
diff --git a/drivers/mfd/ucb1x00.h b/drivers/mfd/ucb1x00.h
index 6b632644f59a..9c9a647d8b7b 100644
--- a/drivers/mfd/ucb1x00.h
+++ b/drivers/mfd/ucb1x00.h
@@ -106,8 +106,6 @@ struct ucb1x00_irq {
106 void (*fn)(int, void *); 106 void (*fn)(int, void *);
107}; 107};
108 108
109extern struct class ucb1x00_class;
110
111struct ucb1x00 { 109struct ucb1x00 {
112 spinlock_t lock; 110 spinlock_t lock;
113 struct mcp *mcp; 111 struct mcp *mcp;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2c9e63a14596..58c4e36f87d7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1289,12 +1289,13 @@ static void bond_mc_list_destroy(struct bonding *bond)
1289/* 1289/*
1290 * Copy all the Multicast addresses from src to the bonding device dst 1290 * Copy all the Multicast addresses from src to the bonding device dst
1291 */ 1291 */
1292static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, int gpf_flag) 1292static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond,
1293 gfp_t gfp_flag)
1293{ 1294{
1294 struct dev_mc_list *dmi, *new_dmi; 1295 struct dev_mc_list *dmi, *new_dmi;
1295 1296
1296 for (dmi = mc_list; dmi; dmi = dmi->next) { 1297 for (dmi = mc_list; dmi; dmi = dmi->next) {
1297 new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag); 1298 new_dmi = kmalloc(sizeof(struct dev_mc_list), gfp_flag);
1298 1299
1299 if (!new_dmi) { 1300 if (!new_dmi) {
1300 /* FIXME: Potential memory leak !!! */ 1301 /* FIXME: Potential memory leak !!! */
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index c15406d46418..eb169a8e8773 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -903,8 +903,8 @@ static void mdio_write(struct net_device *netdev, int addr, int reg, int data)
903 903
904static void e100_get_defaults(struct nic *nic) 904static void e100_get_defaults(struct nic *nic)
905{ 905{
906 struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; 906 struct param_range rfds = { .min = 16, .max = 256, .count = 64 };
907 struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; 907 struct param_range cbs = { .min = 64, .max = 256, .count = 64 };
908 908
909 pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); 909 pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id);
910 /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ 910 /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */
@@ -1007,213 +1007,25 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1007 c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); 1007 c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
1008} 1008}
1009 1009
1010/********************************************************/
1011/* Micro code for 8086:1229 Rev 8 */
1012/********************************************************/
1013
1014/* Parameter values for the D101M B-step */
1015#define D101M_CPUSAVER_TIMER_DWORD 78
1016#define D101M_CPUSAVER_BUNDLE_DWORD 65
1017#define D101M_CPUSAVER_MIN_SIZE_DWORD 126
1018
1019#define D101M_B_RCVBUNDLE_UCODE \
1020{\
10210x00550215, 0xFFFF0437, 0xFFFFFFFF, 0x06A70789, 0xFFFFFFFF, 0x0558FFFF, \
10220x000C0001, 0x00101312, 0x000C0008, 0x00380216, \
10230x0010009C, 0x00204056, 0x002380CC, 0x00380056, \
10240x0010009C, 0x00244C0B, 0x00000800, 0x00124818, \
10250x00380438, 0x00000000, 0x00140000, 0x00380555, \
10260x00308000, 0x00100662, 0x00100561, 0x000E0408, \
10270x00134861, 0x000C0002, 0x00103093, 0x00308000, \
10280x00100624, 0x00100561, 0x000E0408, 0x00100861, \
10290x000C007E, 0x00222C21, 0x000C0002, 0x00103093, \
10300x00380C7A, 0x00080000, 0x00103090, 0x00380C7A, \
10310x00000000, 0x00000000, 0x00000000, 0x00000000, \
10320x0010009C, 0x00244C2D, 0x00010004, 0x00041000, \
10330x003A0437, 0x00044010, 0x0038078A, 0x00000000, \
10340x00100099, 0x00206C7A, 0x0010009C, 0x00244C48, \
10350x00130824, 0x000C0001, 0x00101213, 0x00260C75, \
10360x00041000, 0x00010004, 0x00130826, 0x000C0006, \
10370x002206A8, 0x0013C926, 0x00101313, 0x003806A8, \
10380x00000000, 0x00000000, 0x00000000, 0x00000000, \
10390x00000000, 0x00000000, 0x00000000, 0x00000000, \
10400x00080600, 0x00101B10, 0x00050004, 0x00100826, \
10410x00101210, 0x00380C34, 0x00000000, 0x00000000, \
10420x0021155B, 0x00100099, 0x00206559, 0x0010009C, \
10430x00244559, 0x00130836, 0x000C0000, 0x00220C62, \
10440x000C0001, 0x00101B13, 0x00229C0E, 0x00210C0E, \
10450x00226C0E, 0x00216C0E, 0x0022FC0E, 0x00215C0E, \
10460x00214C0E, 0x00380555, 0x00010004, 0x00041000, \
10470x00278C67, 0x00040800, 0x00018100, 0x003A0437, \
10480x00130826, 0x000C0001, 0x00220559, 0x00101313, \
10490x00380559, 0x00000000, 0x00000000, 0x00000000, \
10500x00000000, 0x00000000, 0x00000000, 0x00000000, \
10510x00000000, 0x00130831, 0x0010090B, 0x00124813, \
10520x000CFF80, 0x002606AB, 0x00041000, 0x00010004, \
10530x003806A8, 0x00000000, 0x00000000, 0x00000000, \
1054}
1055
1056/********************************************************/
1057/* Micro code for 8086:1229 Rev 9 */
1058/********************************************************/
1059
1060/* Parameter values for the D101S */
1061#define D101S_CPUSAVER_TIMER_DWORD 78
1062#define D101S_CPUSAVER_BUNDLE_DWORD 67
1063#define D101S_CPUSAVER_MIN_SIZE_DWORD 128
1064
1065#define D101S_RCVBUNDLE_UCODE \
1066{\
10670x00550242, 0xFFFF047E, 0xFFFFFFFF, 0x06FF0818, 0xFFFFFFFF, 0x05A6FFFF, \
10680x000C0001, 0x00101312, 0x000C0008, 0x00380243, \
10690x0010009C, 0x00204056, 0x002380D0, 0x00380056, \
10700x0010009C, 0x00244F8B, 0x00000800, 0x00124818, \
10710x0038047F, 0x00000000, 0x00140000, 0x003805A3, \
10720x00308000, 0x00100610, 0x00100561, 0x000E0408, \
10730x00134861, 0x000C0002, 0x00103093, 0x00308000, \
10740x00100624, 0x00100561, 0x000E0408, 0x00100861, \
10750x000C007E, 0x00222FA1, 0x000C0002, 0x00103093, \
10760x00380F90, 0x00080000, 0x00103090, 0x00380F90, \
10770x00000000, 0x00000000, 0x00000000, 0x00000000, \
10780x0010009C, 0x00244FAD, 0x00010004, 0x00041000, \
10790x003A047E, 0x00044010, 0x00380819, 0x00000000, \
10800x00100099, 0x00206FFD, 0x0010009A, 0x0020AFFD, \
10810x0010009C, 0x00244FC8, 0x00130824, 0x000C0001, \
10820x00101213, 0x00260FF7, 0x00041000, 0x00010004, \
10830x00130826, 0x000C0006, 0x00220700, 0x0013C926, \
10840x00101313, 0x00380700, 0x00000000, 0x00000000, \
10850x00000000, 0x00000000, 0x00000000, 0x00000000, \
10860x00080600, 0x00101B10, 0x00050004, 0x00100826, \
10870x00101210, 0x00380FB6, 0x00000000, 0x00000000, \
10880x002115A9, 0x00100099, 0x002065A7, 0x0010009A, \
10890x0020A5A7, 0x0010009C, 0x002445A7, 0x00130836, \
10900x000C0000, 0x00220FE4, 0x000C0001, 0x00101B13, \
10910x00229F8E, 0x00210F8E, 0x00226F8E, 0x00216F8E, \
10920x0022FF8E, 0x00215F8E, 0x00214F8E, 0x003805A3, \
10930x00010004, 0x00041000, 0x00278FE9, 0x00040800, \
10940x00018100, 0x003A047E, 0x00130826, 0x000C0001, \
10950x002205A7, 0x00101313, 0x003805A7, 0x00000000, \
10960x00000000, 0x00000000, 0x00000000, 0x00000000, \
10970x00000000, 0x00000000, 0x00000000, 0x00130831, \
10980x0010090B, 0x00124813, 0x000CFF80, 0x00260703, \
10990x00041000, 0x00010004, 0x00380700 \
1100}
1101
1102/********************************************************/
1103/* Micro code for the 8086:1229 Rev F/10 */
1104/********************************************************/
1105
1106/* Parameter values for the D102 E-step */
1107#define D102_E_CPUSAVER_TIMER_DWORD 42
1108#define D102_E_CPUSAVER_BUNDLE_DWORD 54
1109#define D102_E_CPUSAVER_MIN_SIZE_DWORD 46
1110
1111#define D102_E_RCVBUNDLE_UCODE \
1112{\
11130x007D028F, 0x0E4204F9, 0x14ED0C85, 0x14FA14E9, 0x0EF70E36, 0x1FFF1FFF, \
11140x00E014B9, 0x00000000, 0x00000000, 0x00000000, \
11150x00E014BD, 0x00000000, 0x00000000, 0x00000000, \
11160x00E014D5, 0x00000000, 0x00000000, 0x00000000, \
11170x00000000, 0x00000000, 0x00000000, 0x00000000, \
11180x00E014C1, 0x00000000, 0x00000000, 0x00000000, \
11190x00000000, 0x00000000, 0x00000000, 0x00000000, \
11200x00000000, 0x00000000, 0x00000000, 0x00000000, \
11210x00000000, 0x00000000, 0x00000000, 0x00000000, \
11220x00E014C8, 0x00000000, 0x00000000, 0x00000000, \
11230x00200600, 0x00E014EE, 0x00000000, 0x00000000, \
11240x0030FF80, 0x00940E46, 0x00038200, 0x00102000, \
11250x00E00E43, 0x00000000, 0x00000000, 0x00000000, \
11260x00300006, 0x00E014FB, 0x00000000, 0x00000000, \
11270x00000000, 0x00000000, 0x00000000, 0x00000000, \
11280x00000000, 0x00000000, 0x00000000, 0x00000000, \
11290x00000000, 0x00000000, 0x00000000, 0x00000000, \
11300x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, \
11310x00906EFD, 0x00900EFD, 0x00E00EF8, 0x00000000, \
11320x00000000, 0x00000000, 0x00000000, 0x00000000, \
11330x00000000, 0x00000000, 0x00000000, 0x00000000, \
11340x00000000, 0x00000000, 0x00000000, 0x00000000, \
11350x00000000, 0x00000000, 0x00000000, 0x00000000, \
11360x00000000, 0x00000000, 0x00000000, 0x00000000, \
11370x00000000, 0x00000000, 0x00000000, 0x00000000, \
11380x00000000, 0x00000000, 0x00000000, 0x00000000, \
11390x00000000, 0x00000000, 0x00000000, 0x00000000, \
11400x00000000, 0x00000000, 0x00000000, 0x00000000, \
11410x00000000, 0x00000000, 0x00000000, 0x00000000, \
11420x00000000, 0x00000000, 0x00000000, 0x00000000, \
11430x00000000, 0x00000000, 0x00000000, 0x00000000, \
11440x00000000, 0x00000000, 0x00000000, 0x00000000, \
11450x00000000, 0x00000000, 0x00000000, 0x00000000, \
1146}
1147
1148static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb) 1010static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1149{ 1011{
1150/* *INDENT-OFF* */ 1012 int i;
1151 static struct { 1013 static const u32 ucode[UCODE_SIZE] = {
1152 u32 ucode[UCODE_SIZE + 1]; 1014 /* NFS packets are misinterpreted as TCO packets and
1153 u8 mac; 1015 * incorrectly routed to the BMC over SMBus. This
1154 u8 timer_dword; 1016 * microcode patch checks the fragmented IP bit in the
1155 u8 bundle_dword; 1017 * NFS/UDP header to distinguish between NFS and TCO. */
1156 u8 min_size_dword; 1018 0x0EF70E36, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF,
1157 } ucode_opts[] = { 1019 0x1FFF1FFF, 0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000,
1158 { D101M_B_RCVBUNDLE_UCODE, 1020 0x00906EFD, 0x00900EFD, 0x00E00EF8,
1159 mac_82559_D101M, 1021 };
1160 D101M_CPUSAVER_TIMER_DWORD,
1161 D101M_CPUSAVER_BUNDLE_DWORD,
1162 D101M_CPUSAVER_MIN_SIZE_DWORD },
1163 { D101S_RCVBUNDLE_UCODE,
1164 mac_82559_D101S,
1165 D101S_CPUSAVER_TIMER_DWORD,
1166 D101S_CPUSAVER_BUNDLE_DWORD,
1167 D101S_CPUSAVER_MIN_SIZE_DWORD },
1168 { D102_E_RCVBUNDLE_UCODE,
1169 mac_82551_F,
1170 D102_E_CPUSAVER_TIMER_DWORD,
1171 D102_E_CPUSAVER_BUNDLE_DWORD,
1172 D102_E_CPUSAVER_MIN_SIZE_DWORD },
1173 { D102_E_RCVBUNDLE_UCODE,
1174 mac_82551_10,
1175 D102_E_CPUSAVER_TIMER_DWORD,
1176 D102_E_CPUSAVER_BUNDLE_DWORD,
1177 D102_E_CPUSAVER_MIN_SIZE_DWORD },
1178 { {0}, 0, 0, 0, 0}
1179 }, *opts;
1180/* *INDENT-ON* */
1181
1182#define BUNDLESMALL 1
1183#define BUNDLEMAX 50
1184#define INTDELAY 15000
1185
1186 opts = ucode_opts;
1187
1188 /* do not load u-code for ICH devices */
1189 if (nic->flags & ich)
1190 return;
1191
1192 /* Search for ucode match against h/w rev_id */
1193 while (opts->mac) {
1194 if (nic->mac == opts->mac) {
1195 int i;
1196 u32 *ucode = opts->ucode;
1197
1198 /* Insert user-tunable settings */
1199 ucode[opts->timer_dword] &= 0xFFFF0000;
1200 ucode[opts->timer_dword] |=
1201 (u16) INTDELAY;
1202 ucode[opts->bundle_dword] &= 0xFFFF0000;
1203 ucode[opts->bundle_dword] |= (u16) BUNDLEMAX;
1204 ucode[opts->min_size_dword] &= 0xFFFF0000;
1205 ucode[opts->min_size_dword] |=
1206 (BUNDLESMALL) ? 0xFFFF : 0xFF80;
1207
1208 for(i = 0; i < UCODE_SIZE; i++)
1209 cb->u.ucode[i] = cpu_to_le32(ucode[i]);
1210 cb->command = cpu_to_le16(cb_ucode);
1211 return;
1212 }
1213 opts++;
1214 }
1215 1022
1216 cb->command = cpu_to_le16(cb_nop); 1023 if(nic->mac == mac_82551_F || nic->mac == mac_82551_10) {
1024 for(i = 0; i < UCODE_SIZE; i++)
1025 cb->u.ucode[i] = cpu_to_le32(ucode[i]);
1026 cb->command = cpu_to_le16(cb_ucode);
1027 } else
1028 cb->command = cpu_to_le16(cb_nop);
1217} 1029}
1218 1030
1219static void e100_setup_iaaddr(struct nic *nic, struct cb *cb, 1031static void e100_setup_iaaddr(struct nic *nic, struct cb *cb,
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index a3ea69bca474..a3c3fc9c0d8a 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -584,7 +584,7 @@ static inline int ns83820_add_rx_skb(struct ns83820 *dev, struct sk_buff *skb)
584 return 0; 584 return 0;
585} 585}
586 586
587static inline int rx_refill(struct net_device *ndev, unsigned int __nocast gfp) 587static inline int rx_refill(struct net_device *ndev, gfp_t gfp)
588{ 588{
589 struct ns83820 *dev = PRIV(ndev); 589 struct ns83820 *dev = PRIV(ndev);
590 unsigned i; 590 unsigned i;
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h
index 16edbb1a4a7a..13006d759ad8 100644
--- a/drivers/net/sungem.h
+++ b/drivers/net/sungem.h
@@ -1036,7 +1036,7 @@ struct gem {
1036#define ALIGNED_RX_SKB_ADDR(addr) \ 1036#define ALIGNED_RX_SKB_ADDR(addr) \
1037 ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) 1037 ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr))
1038static __inline__ struct sk_buff *gem_alloc_skb(int size, 1038static __inline__ struct sk_buff *gem_alloc_skb(int size,
1039 unsigned int __nocast gfp_flags) 1039 gfp_t gfp_flags)
1040{ 1040{
1041 struct sk_buff *skb = alloc_skb(size + 64, gfp_flags); 1041 struct sk_buff *skb = alloc_skb(size + 64, gfp_flags);
1042 1042
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index fabd3529cebc..d5e76423a0ee 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -689,6 +689,9 @@ static int pccardd(void *__skt)
689 schedule(); 689 schedule();
690 try_to_freeze(); 690 try_to_freeze();
691 } 691 }
692 /* make sure we are running before we exit */
693 set_current_state(TASK_RUNNING);
694
692 remove_wait_queue(&skt->thread_wait, &wait); 695 remove_wait_queue(&skt->thread_wait, &wait);
693 696
694 /* remove from the device core */ 697 /* remove from the device core */
diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
index da0b404561c9..539b5cd1a598 100644
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -873,6 +873,7 @@ static int ti1250_override(struct yenta_socket *socket)
873 * Some fixup code to make everybody happy (TM). 873 * Some fixup code to make everybody happy (TM).
874 */ 874 */
875 875
876#ifdef CONFIG_CARDBUS
876/** 877/**
877 * set/clear various test bits: 878 * set/clear various test bits:
878 * Defaults to clear the bit. 879 * Defaults to clear the bit.
@@ -927,7 +928,6 @@ static void ene_tune_bridge(struct pcmcia_socket *sock, struct pci_bus *bus)
927 config_writeb(socket, ENE_TEST_C9, test_c9); 928 config_writeb(socket, ENE_TEST_C9, test_c9);
928} 929}
929 930
930
931static int ene_override(struct yenta_socket *socket) 931static int ene_override(struct yenta_socket *socket)
932{ 932{
933 /* install tune_bridge() function */ 933 /* install tune_bridge() function */
@@ -935,6 +935,9 @@ static int ene_override(struct yenta_socket *socket)
935 935
936 return ti1250_override(socket); 936 return ti1250_override(socket);
937} 937}
938#else
939# define ene_override ti1250_override
940#endif
938 941
939#endif /* _LINUX_TI113X_H */ 942#endif /* _LINUX_TI113X_H */
940 943
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 14c76f5e4177..9adc11e8b8bc 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -544,7 +544,7 @@ get_disc_ccwdev_by_devno(unsigned int devno, struct ccw_device *sibling)
544 .sibling = sibling, 544 .sibling = sibling,
545 }; 545 };
546 546
547 dev = bus_find_device(&css_bus_type, NULL, &data, match_devno); 547 dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno);
548 548
549 return dev ? to_ccwdev(dev) : NULL; 549 return dev ? to_ccwdev(dev) : NULL;
550} 550}
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 0b5087f7cabc..cab098556b44 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -833,7 +833,7 @@ zfcp_unit_dequeue(struct zfcp_unit *unit)
833} 833}
834 834
835static void * 835static void *
836zfcp_mempool_alloc(unsigned int __nocast gfp_mask, void *size) 836zfcp_mempool_alloc(gfp_t gfp_mask, void *size)
837{ 837{
838 return kmalloc((size_t) size, gfp_mask); 838 return kmalloc((size_t) size, gfp_mask);
839} 839}
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index c05653c7779d..cb832b03ec5e 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -29,6 +29,8 @@
29 * NV-specific details such as register offsets, SATA phy location, 29 * NV-specific details such as register offsets, SATA phy location,
30 * hotplug info, etc. 30 * hotplug info, etc.
31 * 31 *
32 * 0.09
33 * - Fixed bug introduced by 0.08's MCP51 and MCP55 support.
32 * 34 *
33 * 0.08 35 * 0.08
34 * - Added support for MCP51 and MCP55. 36 * - Added support for MCP51 and MCP55.
@@ -132,9 +134,7 @@ enum nv_host_type
132 GENERIC, 134 GENERIC,
133 NFORCE2, 135 NFORCE2,
134 NFORCE3, 136 NFORCE3,
135 CK804, 137 CK804
136 MCP51,
137 MCP55
138}; 138};
139 139
140static struct pci_device_id nv_pci_tbl[] = { 140static struct pci_device_id nv_pci_tbl[] = {
@@ -153,13 +153,13 @@ static struct pci_device_id nv_pci_tbl[] = {
153 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, 153 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,
154 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 }, 154 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
155 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA, 155 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA,
156 PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, 156 PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
157 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2, 157 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2,
158 PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP51 }, 158 PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
159 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA, 159 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA,
160 PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, 160 PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
161 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2, 161 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2,
162 PCI_ANY_ID, PCI_ANY_ID, 0, 0, MCP55 }, 162 PCI_ANY_ID, PCI_ANY_ID, 0, 0, GENERIC },
163 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, 163 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
164 PCI_ANY_ID, PCI_ANY_ID, 164 PCI_ANY_ID, PCI_ANY_ID,
165 PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, 165 PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 4e1e80adaf11..bdb4e454b8b0 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -73,7 +73,7 @@ struct imx_port {
73 struct uart_port port; 73 struct uart_port port;
74 struct timer_list timer; 74 struct timer_list timer;
75 unsigned int old_status; 75 unsigned int old_status;
76 int txirq,rxirq; 76 int txirq,rxirq,rtsirq;
77}; 77};
78 78
79/* 79/*
@@ -181,6 +181,22 @@ static void imx_start_tx(struct uart_port *port)
181 imx_transmit_buffer(sport); 181 imx_transmit_buffer(sport);
182} 182}
183 183
184static irqreturn_t imx_rtsint(int irq, void *dev_id, struct pt_regs *regs)
185{
186 struct imx_port *sport = (struct imx_port *)dev_id;
187 unsigned int val = USR1((u32)sport->port.membase)&USR1_RTSS;
188 unsigned long flags;
189
190 spin_lock_irqsave(&sport->port.lock, flags);
191
192 USR1((u32)sport->port.membase) = USR1_RTSD;
193 uart_handle_cts_change(&sport->port, !!val);
194 wake_up_interruptible(&sport->port.info->delta_msr_wait);
195
196 spin_unlock_irqrestore(&sport->port.lock, flags);
197 return IRQ_HANDLED;
198}
199
184static irqreturn_t imx_txint(int irq, void *dev_id, struct pt_regs *regs) 200static irqreturn_t imx_txint(int irq, void *dev_id, struct pt_regs *regs)
185{ 201{
186 struct imx_port *sport = (struct imx_port *)dev_id; 202 struct imx_port *sport = (struct imx_port *)dev_id;
@@ -383,18 +399,24 @@ static int imx_startup(struct uart_port *port)
383 */ 399 */
384 retval = request_irq(sport->rxirq, imx_rxint, 0, 400 retval = request_irq(sport->rxirq, imx_rxint, 0,
385 DRIVER_NAME, sport); 401 DRIVER_NAME, sport);
386 if (retval) goto error_out2; 402 if (retval) goto error_out1;
387 403
388 retval = request_irq(sport->txirq, imx_txint, 0, 404 retval = request_irq(sport->txirq, imx_txint, 0,
389 "imx-uart", sport); 405 DRIVER_NAME, sport);
390 if (retval) goto error_out1; 406 if (retval) goto error_out2;
407
408 retval = request_irq(sport->rtsirq, imx_rtsint, 0,
409 DRIVER_NAME, sport);
410 if (retval) goto error_out3;
411 set_irq_type(sport->rtsirq, IRQT_BOTHEDGE);
391 412
392 /* 413 /*
393 * Finally, clear and enable interrupts 414 * Finally, clear and enable interrupts
394 */ 415 */
395 416
417 USR1((u32)sport->port.membase) = USR1_RTSD;
396 UCR1((u32)sport->port.membase) |= 418 UCR1((u32)sport->port.membase) |=
397 (UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_UARTEN); 419 (UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN);
398 420
399 UCR2((u32)sport->port.membase) |= (UCR2_RXEN | UCR2_TXEN); 421 UCR2((u32)sport->port.membase) |= (UCR2_RXEN | UCR2_TXEN);
400 /* 422 /*
@@ -406,10 +428,11 @@ static int imx_startup(struct uart_port *port)
406 428
407 return 0; 429 return 0;
408 430
409error_out1: 431error_out3:
410 free_irq(sport->rxirq, sport);
411error_out2:
412 free_irq(sport->txirq, sport); 432 free_irq(sport->txirq, sport);
433error_out2:
434 free_irq(sport->rxirq, sport);
435error_out1:
413 return retval; 436 return retval;
414} 437}
415 438
@@ -425,6 +448,7 @@ static void imx_shutdown(struct uart_port *port)
425 /* 448 /*
426 * Free the interrupts 449 * Free the interrupts
427 */ 450 */
451 free_irq(sport->rtsirq, sport);
428 free_irq(sport->txirq, sport); 452 free_irq(sport->txirq, sport);
429 free_irq(sport->rxirq, sport); 453 free_irq(sport->rxirq, sport);
430 454
@@ -433,7 +457,7 @@ static void imx_shutdown(struct uart_port *port)
433 */ 457 */
434 458
435 UCR1((u32)sport->port.membase) &= 459 UCR1((u32)sport->port.membase) &=
436 ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_UARTEN); 460 ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN);
437} 461}
438 462
439static void 463static void
@@ -523,7 +547,7 @@ imx_set_termios(struct uart_port *port, struct termios *termios,
523 * disable interrupts and drain transmitter 547 * disable interrupts and drain transmitter
524 */ 548 */
525 old_ucr1 = UCR1((u32)sport->port.membase); 549 old_ucr1 = UCR1((u32)sport->port.membase);
526 UCR1((u32)sport->port.membase) &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN); 550 UCR1((u32)sport->port.membase) &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN);
527 551
528 while ( !(USR2((u32)sport->port.membase) & USR2_TXDC)) 552 while ( !(USR2((u32)sport->port.membase) & USR2_TXDC))
529 barrier(); 553 barrier();
@@ -644,6 +668,7 @@ static struct imx_port imx_ports[] = {
644 { 668 {
645 .txirq = UART1_MINT_TX, 669 .txirq = UART1_MINT_TX,
646 .rxirq = UART1_MINT_RX, 670 .rxirq = UART1_MINT_RX,
671 .rtsirq = UART1_MINT_RTS,
647 .port = { 672 .port = {
648 .type = PORT_IMX, 673 .type = PORT_IMX,
649 .iotype = SERIAL_IO_MEM, 674 .iotype = SERIAL_IO_MEM,
@@ -659,6 +684,7 @@ static struct imx_port imx_ports[] = {
659 }, { 684 }, {
660 .txirq = UART2_MINT_TX, 685 .txirq = UART2_MINT_TX,
661 .rxirq = UART2_MINT_RX, 686 .rxirq = UART2_MINT_RX,
687 .rtsirq = UART2_MINT_RTS,
662 .port = { 688 .port = {
663 .type = PORT_IMX, 689 .type = PORT_IMX,
664 .iotype = SERIAL_IO_MEM, 690 .iotype = SERIAL_IO_MEM,
@@ -738,7 +764,7 @@ imx_console_write(struct console *co, const char *s, unsigned int count)
738 764
739 UCR1((u32)sport->port.membase) = 765 UCR1((u32)sport->port.membase) =
740 (old_ucr1 | UCR1_UARTCLKEN | UCR1_UARTEN) 766 (old_ucr1 | UCR1_UARTCLKEN | UCR1_UARTEN)
741 & ~(UCR1_TXMPTYEN | UCR1_RRDYEN); 767 & ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN);
742 UCR2((u32)sport->port.membase) = old_ucr2 | UCR2_TXEN; 768 UCR2((u32)sport->port.membase) = old_ucr2 | UCR2_TXEN;
743 769
744 /* 770 /*
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 672b359b07ce..90c2a86c421b 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -499,7 +499,7 @@ serial_pxa_set_termios(struct uart_port *port, struct termios *termios,
499 /* 499 /*
500 * Update the per-port timeout. 500 * Update the per-port timeout.
501 */ 501 */
502 uart_update_timeout(port, termios->c_cflag, quot); 502 uart_update_timeout(port, termios->c_cflag, baud);
503 503
504 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; 504 up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
505 if (termios->c_iflag & INPCK) 505 if (termios->c_iflag & INPCK)
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 50d7870d92bb..52692aa345ec 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1092,8 +1092,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1092 1092
1093static int probe_index = 0; 1093static int probe_index = 0;
1094 1094
1095int s3c24xx_serial_probe(struct device *_dev, 1095static int s3c24xx_serial_probe(struct device *_dev,
1096 struct s3c24xx_uart_info *info) 1096 struct s3c24xx_uart_info *info)
1097{ 1097{
1098 struct s3c24xx_uart_port *ourport; 1098 struct s3c24xx_uart_port *ourport;
1099 struct platform_device *dev = to_platform_device(_dev); 1099 struct platform_device *dev = to_platform_device(_dev);
@@ -1120,7 +1120,7 @@ int s3c24xx_serial_probe(struct device *_dev,
1120 return ret; 1120 return ret;
1121} 1121}
1122 1122
1123int s3c24xx_serial_remove(struct device *_dev) 1123static int s3c24xx_serial_remove(struct device *_dev)
1124{ 1124{
1125 struct uart_port *port = s3c24xx_dev_to_port(_dev); 1125 struct uart_port *port = s3c24xx_dev_to_port(_dev);
1126 1126
@@ -1134,7 +1134,8 @@ int s3c24xx_serial_remove(struct device *_dev)
1134 1134
1135#ifdef CONFIG_PM 1135#ifdef CONFIG_PM
1136 1136
1137int s3c24xx_serial_suspend(struct device *dev, pm_message_t state, u32 level) 1137static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state,
1138 u32 level)
1138{ 1139{
1139 struct uart_port *port = s3c24xx_dev_to_port(dev); 1140 struct uart_port *port = s3c24xx_dev_to_port(dev);
1140 1141
@@ -1144,7 +1145,7 @@ int s3c24xx_serial_suspend(struct device *dev, pm_message_t state, u32 level)
1144 return 0; 1145 return 0;
1145} 1146}
1146 1147
1147int s3c24xx_serial_resume(struct device *dev, u32 level) 1148static int s3c24xx_serial_resume(struct device *dev, u32 level)
1148{ 1149{
1149 struct uart_port *port = s3c24xx_dev_to_port(dev); 1150 struct uart_port *port = s3c24xx_dev_to_port(dev);
1150 struct s3c24xx_uart_port *ourport = to_ourport(port); 1151 struct s3c24xx_uart_port *ourport = to_ourport(port);
@@ -1165,8 +1166,8 @@ int s3c24xx_serial_resume(struct device *dev, u32 level)
1165#define s3c24xx_serial_resume NULL 1166#define s3c24xx_serial_resume NULL
1166#endif 1167#endif
1167 1168
1168int s3c24xx_serial_init(struct device_driver *drv, 1169static int s3c24xx_serial_init(struct device_driver *drv,
1169 struct s3c24xx_uart_info *info) 1170 struct s3c24xx_uart_info *info)
1170{ 1171{
1171 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1172 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
1172 return driver_register(drv); 1173 return driver_register(drv);
@@ -1235,6 +1236,7 @@ static int s3c2400_serial_probe(struct device *dev)
1235 1236
1236static struct device_driver s3c2400_serial_drv = { 1237static struct device_driver s3c2400_serial_drv = {
1237 .name = "s3c2400-uart", 1238 .name = "s3c2400-uart",
1239 .owner = THIS_MODULE,
1238 .bus = &platform_bus_type, 1240 .bus = &platform_bus_type,
1239 .probe = s3c2400_serial_probe, 1241 .probe = s3c2400_serial_probe,
1240 .remove = s3c24xx_serial_remove, 1242 .remove = s3c24xx_serial_remove,
@@ -1338,6 +1340,7 @@ static int s3c2410_serial_probe(struct device *dev)
1338 1340
1339static struct device_driver s3c2410_serial_drv = { 1341static struct device_driver s3c2410_serial_drv = {
1340 .name = "s3c2410-uart", 1342 .name = "s3c2410-uart",
1343 .owner = THIS_MODULE,
1341 .bus = &platform_bus_type, 1344 .bus = &platform_bus_type,
1342 .probe = s3c2410_serial_probe, 1345 .probe = s3c2410_serial_probe,
1343 .remove = s3c24xx_serial_remove, 1346 .remove = s3c24xx_serial_remove,
@@ -1499,6 +1502,7 @@ static int s3c2440_serial_probe(struct device *dev)
1499 1502
1500static struct device_driver s3c2440_serial_drv = { 1503static struct device_driver s3c2440_serial_drv = {
1501 .name = "s3c2440-uart", 1504 .name = "s3c2440-uart",
1505 .owner = THIS_MODULE,
1502 .bus = &platform_bus_type, 1506 .bus = &platform_bus_type,
1503 .probe = s3c2440_serial_probe, 1507 .probe = s3c2440_serial_probe,
1504 .remove = s3c24xx_serial_remove, 1508 .remove = s3c24xx_serial_remove,
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index e971156daa60..ba9381fd3f2d 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -274,7 +274,6 @@ static void transmit_chars(struct uart_sunsab_port *up,
274 if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { 274 if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
275 up->interrupt_mask1 |= SAB82532_IMR1_XPR; 275 up->interrupt_mask1 |= SAB82532_IMR1_XPR;
276 writeb(up->interrupt_mask1, &up->regs->w.imr1); 276 writeb(up->interrupt_mask1, &up->regs->w.imr1);
277 uart_write_wakeup(&up->port);
278 return; 277 return;
279 } 278 }
280 279
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index d75445738c88..7653d6cf05af 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -517,10 +517,9 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
517 if (up->port.info == NULL) 517 if (up->port.info == NULL)
518 goto ack_tx_int; 518 goto ack_tx_int;
519 xmit = &up->port.info->xmit; 519 xmit = &up->port.info->xmit;
520 if (uart_circ_empty(xmit)) { 520 if (uart_circ_empty(xmit))
521 uart_write_wakeup(&up->port);
522 goto ack_tx_int; 521 goto ack_tx_int;
523 } 522
524 if (uart_tx_stopped(&up->port)) 523 if (uart_tx_stopped(&up->port))
525 goto ack_tx_int; 524 goto ack_tx_int;
526 525
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index b4265aa7d45e..487ff672b104 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -30,6 +30,8 @@
30 * Revision history 30 * Revision history
31 * 22.12.1999 0.1 Initial release (split from proc_usb.c) 31 * 22.12.1999 0.1 Initial release (split from proc_usb.c)
32 * 04.01.2000 0.2 Turned into its own filesystem 32 * 04.01.2000 0.2 Turned into its own filesystem
33 * 30.09.2005 0.3 Fix user-triggerable oops in async URB delivery
34 * (CAN-2005-3055)
33 */ 35 */
34 36
35/*****************************************************************************/ 37/*****************************************************************************/
@@ -58,7 +60,8 @@ static struct class *usb_device_class;
58struct async { 60struct async {
59 struct list_head asynclist; 61 struct list_head asynclist;
60 struct dev_state *ps; 62 struct dev_state *ps;
61 struct task_struct *task; 63 pid_t pid;
64 uid_t uid, euid;
62 unsigned int signr; 65 unsigned int signr;
63 unsigned int ifnum; 66 unsigned int ifnum;
64 void __user *userbuffer; 67 void __user *userbuffer;
@@ -290,7 +293,8 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
290 sinfo.si_errno = as->urb->status; 293 sinfo.si_errno = as->urb->status;
291 sinfo.si_code = SI_ASYNCIO; 294 sinfo.si_code = SI_ASYNCIO;
292 sinfo.si_addr = as->userurb; 295 sinfo.si_addr = as->userurb;
293 send_sig_info(as->signr, &sinfo, as->task); 296 kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid,
297 as->euid);
294 } 298 }
295 wake_up(&ps->wait); 299 wake_up(&ps->wait);
296} 300}
@@ -526,7 +530,9 @@ static int usbdev_open(struct inode *inode, struct file *file)
526 INIT_LIST_HEAD(&ps->async_completed); 530 INIT_LIST_HEAD(&ps->async_completed);
527 init_waitqueue_head(&ps->wait); 531 init_waitqueue_head(&ps->wait);
528 ps->discsignr = 0; 532 ps->discsignr = 0;
529 ps->disctask = current; 533 ps->disc_pid = current->pid;
534 ps->disc_uid = current->uid;
535 ps->disc_euid = current->euid;
530 ps->disccontext = NULL; 536 ps->disccontext = NULL;
531 ps->ifclaimed = 0; 537 ps->ifclaimed = 0;
532 wmb(); 538 wmb();
@@ -988,7 +994,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
988 as->userbuffer = NULL; 994 as->userbuffer = NULL;
989 as->signr = uurb->signr; 995 as->signr = uurb->signr;
990 as->ifnum = ifnum; 996 as->ifnum = ifnum;
991 as->task = current; 997 as->pid = current->pid;
998 as->uid = current->uid;
999 as->euid = current->euid;
992 if (!(uurb->endpoint & USB_DIR_IN)) { 1000 if (!(uurb->endpoint & USB_DIR_IN)) {
993 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { 1001 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) {
994 free_async(as); 1002 free_async(as);
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 640f41e47029..d07bba01995b 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -713,7 +713,7 @@ void usbfs_remove_device(struct usb_device *dev)
713 sinfo.si_errno = EPIPE; 713 sinfo.si_errno = EPIPE;
714 sinfo.si_code = SI_ASYNCIO; 714 sinfo.si_code = SI_ASYNCIO;
715 sinfo.si_addr = ds->disccontext; 715 sinfo.si_addr = ds->disccontext;
716 send_sig_info(ds->discsignr, &sinfo, ds->disctask); 716 kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid);
717 } 717 }
718 } 718 }
719 usbfs_update_special(); 719 usbfs_update_special();
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 83d48c8133af..e6504f3370ad 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -52,7 +52,8 @@ struct dev_state {
52 struct list_head async_completed; 52 struct list_head async_completed;
53 wait_queue_head_t wait; /* wake up if a request completed */ 53 wait_queue_head_t wait; /* wake up if a request completed */
54 unsigned int discsignr; 54 unsigned int discsignr;
55 struct task_struct *disctask; 55 pid_t disc_pid;
56 uid_t disc_uid, disc_euid;
56 void __user *disccontext; 57 void __user *disccontext;
57 unsigned long ifclaimed; 58 unsigned long ifclaimed;
58}; 59};
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 7808a01493ad..b76a5a9a125b 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -288,6 +288,9 @@ static void p9100_init_one(struct sbus_dev *sdev)
288 all->par.physbase = sdev->reg_addrs[2].phys_addr; 288 all->par.physbase = sdev->reg_addrs[2].phys_addr;
289 289
290 sbusfb_fill_var(&all->info.var, sdev->prom_node, 8); 290 sbusfb_fill_var(&all->info.var, sdev->prom_node, 8);
291 all->info.var.red.length = 8;
292 all->info.var.green.length = 8;
293 all->info.var.blue.length = 8;
291 294
292 linebytes = prom_getintdefault(sdev->prom_node, "linebytes", 295 linebytes = prom_getintdefault(sdev->prom_node, "linebytes",
293 all->info.var.xres); 296 all->info.var.xres);
@@ -323,6 +326,7 @@ static void p9100_init_one(struct sbus_dev *sdev)
323 kfree(all); 326 kfree(all);
324 return; 327 return;
325 } 328 }
329 fb_set_cmap(&all->info.cmap, &all->info);
326 330
327 list_add(&all->list, &p9100_list); 331 list_add(&all->list, &p9100_list);
328 332