aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-11 01:48:37 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-11 01:48:37 -0400
commit1a04392bd6439876b1552793389cbb5be356ea54 (patch)
tree12af7b77e3b0848127f2d2871778c9c1f315578a /drivers
parent68399bb5080c1d96f2110b0a040b39d3ccd7a18a (diff)
parent3c92c2ba33cd7d666c5f83cc32aa590e794e91b0 (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.c2
-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/s3c2410-rtc.c1
-rw-r--r--drivers/char/watchdog/pcwd_pci.c239
-rw-r--r--drivers/connector/connector.c3
-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/mfd/ucb1x00-core.c22
-rw-r--r--drivers/net/bonding/bond_main.c2
-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/scsi/zfcp_aux.c2
-rw-r--r--drivers/serial/imx.c9
-rw-r--r--drivers/serial/s3c2410.c3
-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
34 files changed, 257 insertions, 125 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 6f1a83c9d9e0..14f6a6201da3 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -178,7 +178,7 @@ fore200e_irq_itoa(int irq)
178 178
179 179
180static void* 180static void*
181fore200e_kmalloc(int size, unsigned int __nocast flags) 181fore200e_kmalloc(int size, gfp_t flags)
182{ 182{
183 void *chunk = kzalloc(size, flags); 183 void *chunk = kzalloc(size, flags);
184 184
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/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 1422285d537c..505677fb3157 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -69,8 +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, 72int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask)
73 unsigned int __nocast gfp_mask)
74{ 73{
75 struct cn_callback_entry *__cbq; 74 struct cn_callback_entry *__cbq;
76 unsigned int size; 75 unsigned int size;
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/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 612564ac6f7b..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;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f0a5b772a386..f264ff162979 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1290,7 +1290,7 @@ static void bond_mc_list_destroy(struct bonding *bond)
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, 1292static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond,
1293 unsigned int __nocast gfp_flag) 1293 gfp_t gfp_flag)
1294{ 1294{
1295 struct dev_mc_list *dmi, *new_dmi; 1295 struct dev_mc_list *dmi, *new_dmi;
1296 1296
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 83334db2921c..e4811b42a6b7 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/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/serial/imx.c b/drivers/serial/imx.c
index 4e1e80adaf11..53e0323d4b83 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -383,11 +383,11 @@ static int imx_startup(struct uart_port *port)
383 */ 383 */
384 retval = request_irq(sport->rxirq, imx_rxint, 0, 384 retval = request_irq(sport->rxirq, imx_rxint, 0,
385 DRIVER_NAME, sport); 385 DRIVER_NAME, sport);
386 if (retval) goto error_out2; 386 if (retval) goto error_out1;
387 387
388 retval = request_irq(sport->txirq, imx_txint, 0, 388 retval = request_irq(sport->txirq, imx_txint, 0,
389 "imx-uart", sport); 389 "imx-uart", sport);
390 if (retval) goto error_out1; 390 if (retval) goto error_out2;
391 391
392 /* 392 /*
393 * Finally, clear and enable interrupts 393 * Finally, clear and enable interrupts
@@ -406,10 +406,9 @@ static int imx_startup(struct uart_port *port)
406 406
407 return 0; 407 return 0;
408 408
409error_out1:
410 free_irq(sport->rxirq, sport);
411error_out2: 409error_out2:
412 free_irq(sport->txirq, sport); 410 free_irq(sport->rxirq, sport);
411error_out1:
413 return retval; 412 return retval;
414} 413}
415 414
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 50d7870d92bb..eff2158024c8 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1235,6 +1235,7 @@ static int s3c2400_serial_probe(struct device *dev)
1235 1235
1236static struct device_driver s3c2400_serial_drv = { 1236static struct device_driver s3c2400_serial_drv = {
1237 .name = "s3c2400-uart", 1237 .name = "s3c2400-uart",
1238 .owner = THIS_MODULE,
1238 .bus = &platform_bus_type, 1239 .bus = &platform_bus_type,
1239 .probe = s3c2400_serial_probe, 1240 .probe = s3c2400_serial_probe,
1240 .remove = s3c24xx_serial_remove, 1241 .remove = s3c24xx_serial_remove,
@@ -1338,6 +1339,7 @@ static int s3c2410_serial_probe(struct device *dev)
1338 1339
1339static struct device_driver s3c2410_serial_drv = { 1340static struct device_driver s3c2410_serial_drv = {
1340 .name = "s3c2410-uart", 1341 .name = "s3c2410-uart",
1342 .owner = THIS_MODULE,
1341 .bus = &platform_bus_type, 1343 .bus = &platform_bus_type,
1342 .probe = s3c2410_serial_probe, 1344 .probe = s3c2410_serial_probe,
1343 .remove = s3c24xx_serial_remove, 1345 .remove = s3c24xx_serial_remove,
@@ -1499,6 +1501,7 @@ static int s3c2440_serial_probe(struct device *dev)
1499 1501
1500static struct device_driver s3c2440_serial_drv = { 1502static struct device_driver s3c2440_serial_drv = {
1501 .name = "s3c2440-uart", 1503 .name = "s3c2440-uart",
1504 .owner = THIS_MODULE,
1502 .bus = &platform_bus_type, 1505 .bus = &platform_bus_type,
1503 .probe = s3c2440_serial_probe, 1506 .probe = s3c2440_serial_probe,
1504 .remove = s3c24xx_serial_remove, 1507 .remove = s3c24xx_serial_remove,
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