diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-02-13 00:13:48 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-13 00:13:48 -0500 |
commit | 3875e1945b55f0eb83fe7359614a801eeb716761 (patch) | |
tree | 4567aef3fb7d081cb7d7b7c9bcd94e0e44d39557 /drivers | |
parent | 587005de144acd3007b8e7f2a2a7c6add157c155 (diff) | |
parent | f1b318793dcd2d9ff6b5ac06e7762098fa079cee (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tipar.c | 15 | ||||
-rw-r--r-- | drivers/char/watchdog/pcwd.c | 450 | ||||
-rw-r--r-- | drivers/char/watchdog/sa1100_wdt.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_cs.c | 1 | ||||
-rw-r--r-- | drivers/s390/char/sclp.c | 13 | ||||
-rw-r--r-- | drivers/s390/cio/chsc.c | 10 | ||||
-rw-r--r-- | drivers/scsi/ahci.c | 4 | ||||
-rw-r--r-- | drivers/scsi/ata_piix.c | 4 | ||||
-rw-r--r-- | drivers/scsi/libata-core.c | 148 | ||||
-rw-r--r-- | drivers/scsi/libata-scsi.c | 33 | ||||
-rw-r--r-- | drivers/scsi/pdc_adma.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_mv.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_nv.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_promise.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_qstor.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_sil.c | 24 | ||||
-rw-r--r-- | drivers/scsi/sata_sil24.c | 5 | ||||
-rw-r--r-- | drivers/scsi/sata_sis.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_svw.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_sx4.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_uli.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_via.c | 1 | ||||
-rw-r--r-- | drivers/scsi/sata_vsc.c | 1 | ||||
-rw-r--r-- | drivers/video/Kconfig | 5 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 2 | ||||
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 2 |
26 files changed, 381 insertions, 358 deletions
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c index 41a94bc79f67..eb2eb3e12d6a 100644 --- a/drivers/char/tipar.c +++ b/drivers/char/tipar.c | |||
@@ -250,12 +250,17 @@ tipar_open(struct inode *inode, struct file *file) | |||
250 | { | 250 | { |
251 | unsigned int minor = iminor(inode) - TIPAR_MINOR; | 251 | unsigned int minor = iminor(inode) - TIPAR_MINOR; |
252 | 252 | ||
253 | if (minor > tp_count - 1) | 253 | if (tp_count == 0 || minor > tp_count - 1) |
254 | return -ENXIO; | 254 | return -ENXIO; |
255 | 255 | ||
256 | if (test_and_set_bit(minor, &opened)) | 256 | if (test_and_set_bit(minor, &opened)) |
257 | return -EBUSY; | 257 | return -EBUSY; |
258 | 258 | ||
259 | if (!table[minor].dev) { | ||
260 | printk(KERN_ERR "%s: NULL device for minor %u\n", | ||
261 | __FUNCTION__, minor); | ||
262 | return -ENXIO; | ||
263 | } | ||
259 | parport_claim_or_block(table[minor].dev); | 264 | parport_claim_or_block(table[minor].dev); |
260 | init_ti_parallel(minor); | 265 | init_ti_parallel(minor); |
261 | parport_release(table[minor].dev); | 266 | parport_release(table[minor].dev); |
@@ -510,16 +515,20 @@ tipar_init_module(void) | |||
510 | err = PTR_ERR(tipar_class); | 515 | err = PTR_ERR(tipar_class); |
511 | goto out_chrdev; | 516 | goto out_chrdev; |
512 | } | 517 | } |
513 | if (parport_register_driver(&tipar_driver)) { | 518 | if (parport_register_driver(&tipar_driver) || tp_count == 0) { |
514 | printk(KERN_ERR "tipar: unable to register with parport\n"); | 519 | printk(KERN_ERR "tipar: unable to register with parport\n"); |
515 | err = -EIO; | 520 | err = -EIO; |
516 | goto out; | 521 | goto out_class; |
517 | } | 522 | } |
518 | 523 | ||
519 | err = 0; | 524 | err = 0; |
520 | goto out; | 525 | goto out; |
521 | 526 | ||
527 | out_class: | ||
528 | class_destroy(tipar_class); | ||
529 | |||
522 | out_chrdev: | 530 | out_chrdev: |
531 | devfs_remove("ticables/par"); | ||
523 | unregister_chrdev(TIPAR_MAJOR, "tipar"); | 532 | unregister_chrdev(TIPAR_MAJOR, "tipar"); |
524 | out: | 533 | out: |
525 | return err; | 534 | return err; |
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c index 37c9e13ad3ac..8d6b249ad66b 100644 --- a/drivers/char/watchdog/pcwd.c +++ b/drivers/char/watchdog/pcwd.c | |||
@@ -49,29 +49,37 @@ | |||
49 | * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/ | 49 | * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/ |
50 | */ | 50 | */ |
51 | 51 | ||
52 | #include <linux/module.h> | 52 | #include <linux/config.h> /* For CONFIG_WATCHDOG_NOWAYOUT/... */ |
53 | #include <linux/moduleparam.h> | 53 | #include <linux/module.h> /* For module specific items */ |
54 | #include <linux/types.h> | 54 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
55 | #include <linux/timer.h> | 55 | #include <linux/types.h> /* For standard types (like size_t) */ |
56 | #include <linux/jiffies.h> | 56 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
57 | #include <linux/config.h> | 57 | #include <linux/kernel.h> /* For printk/panic/... */ |
58 | #include <linux/wait.h> | 58 | #include <linux/delay.h> /* For mdelay function */ |
59 | #include <linux/slab.h> | 59 | #include <linux/timer.h> /* For timer related operations */ |
60 | #include <linux/ioport.h> | 60 | #include <linux/jiffies.h> /* For jiffies stuff */ |
61 | #include <linux/delay.h> | 61 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ |
62 | #include <linux/fs.h> | 62 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
63 | #include <linux/miscdevice.h> | 63 | #include <linux/notifier.h> /* For notifier support */ |
64 | #include <linux/watchdog.h> | 64 | #include <linux/reboot.h> /* For reboot_notifier stuff */ |
65 | #include <linux/notifier.h> | 65 | #include <linux/init.h> /* For __init/__exit/... */ |
66 | #include <linux/init.h> | 66 | #include <linux/fs.h> /* For file operations */ |
67 | #include <linux/spinlock.h> | 67 | #include <linux/ioport.h> /* For io-port access */ |
68 | #include <linux/reboot.h> | 68 | #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */ |
69 | #include <linux/sched.h> /* TASK_INTERRUPTIBLE, set_current_state() and friends */ | 69 | #include <linux/sched.h> /* TASK_INTERRUPTIBLE, set_current_state() and friends */ |
70 | #include <asm/uaccess.h> | 70 | #include <linux/slab.h> /* For kmalloc */ |
71 | #include <asm/io.h> | ||
72 | 71 | ||
73 | #define WD_VER "1.16 (06/12/2004)" | 72 | #include <asm/uaccess.h> /* For copy_to_user/put_user/... */ |
74 | #define PFX "pcwd: " | 73 | #include <asm/io.h> /* For inb/outb/... */ |
74 | |||
75 | /* Module and version information */ | ||
76 | #define WATCHDOG_VERSION "1.16" | ||
77 | #define WATCHDOG_DATE "03 Jan 2006" | ||
78 | #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" | ||
79 | #define WATCHDOG_NAME "pcwd" | ||
80 | #define PFX WATCHDOG_NAME ": " | ||
81 | #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n" | ||
82 | #define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")" | ||
75 | 83 | ||
76 | /* | 84 | /* |
77 | * It should be noted that PCWD_REVISION_B was removed because A and B | 85 | * It should be noted that PCWD_REVISION_B was removed because A and B |
@@ -85,36 +93,38 @@ | |||
85 | 93 | ||
86 | /* | 94 | /* |
87 | * These are the defines that describe the control status bits for the | 95 | * These are the defines that describe the control status bits for the |
88 | * PC Watchdog card, revision A. | 96 | * PCI-PC Watchdog card. |
89 | */ | 97 | */ |
98 | /* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */ | ||
90 | #define WD_WDRST 0x01 /* Previously reset state */ | 99 | #define WD_WDRST 0x01 /* Previously reset state */ |
91 | #define WD_T110 0x02 /* Temperature overheat sense */ | 100 | #define WD_T110 0x02 /* Temperature overheat sense */ |
92 | #define WD_HRTBT 0x04 /* Heartbeat sense */ | 101 | #define WD_HRTBT 0x04 /* Heartbeat sense */ |
93 | #define WD_RLY2 0x08 /* External relay triggered */ | 102 | #define WD_RLY2 0x08 /* External relay triggered */ |
94 | #define WD_SRLY2 0x80 /* Software external relay triggered */ | 103 | #define WD_SRLY2 0x80 /* Software external relay triggered */ |
95 | 104 | /* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */ | |
96 | /* | ||
97 | * These are the defines that describe the control status bits for the | ||
98 | * PC Watchdog card, revision C. | ||
99 | */ | ||
100 | #define WD_REVC_WTRP 0x01 /* Watchdog Trip status */ | 105 | #define WD_REVC_WTRP 0x01 /* Watchdog Trip status */ |
101 | #define WD_REVC_HRBT 0x02 /* Watchdog Heartbeat */ | 106 | #define WD_REVC_HRBT 0x02 /* Watchdog Heartbeat */ |
102 | #define WD_REVC_TTRP 0x04 /* Temperature Trip status */ | 107 | #define WD_REVC_TTRP 0x04 /* Temperature Trip status */ |
108 | /* Port 2 : Control Status #2 */ | ||
109 | #define WD_WDIS 0x10 /* Watchdog Disabled */ | ||
110 | #define WD_ENTP 0x20 /* Watchdog Enable Temperature Trip */ | ||
111 | #define WD_SSEL 0x40 /* Watchdog Switch Select (1:SW1 <-> 0:SW2) */ | ||
112 | #define WD_WCMD 0x80 /* Watchdog Command Mode */ | ||
103 | 113 | ||
104 | /* max. time we give an ISA watchdog card to process a command */ | 114 | /* max. time we give an ISA watchdog card to process a command */ |
105 | /* 500ms for each 4 bit response (according to spec.) */ | 115 | /* 500ms for each 4 bit response (according to spec.) */ |
106 | #define ISA_COMMAND_TIMEOUT 1000 | 116 | #define ISA_COMMAND_TIMEOUT 1000 |
107 | 117 | ||
108 | /* Watchdog's internal commands */ | 118 | /* Watchdog's internal commands */ |
109 | #define CMD_ISA_IDLE 0x00 | 119 | #define CMD_ISA_IDLE 0x00 |
110 | #define CMD_ISA_VERSION_INTEGER 0x01 | 120 | #define CMD_ISA_VERSION_INTEGER 0x01 |
111 | #define CMD_ISA_VERSION_TENTH 0x02 | 121 | #define CMD_ISA_VERSION_TENTH 0x02 |
112 | #define CMD_ISA_VERSION_HUNDRETH 0x03 | 122 | #define CMD_ISA_VERSION_HUNDRETH 0x03 |
113 | #define CMD_ISA_VERSION_MINOR 0x04 | 123 | #define CMD_ISA_VERSION_MINOR 0x04 |
114 | #define CMD_ISA_SWITCH_SETTINGS 0x05 | 124 | #define CMD_ISA_SWITCH_SETTINGS 0x05 |
115 | #define CMD_ISA_DELAY_TIME_2SECS 0x0A | 125 | #define CMD_ISA_DELAY_TIME_2SECS 0x0A |
116 | #define CMD_ISA_DELAY_TIME_4SECS 0x0B | 126 | #define CMD_ISA_DELAY_TIME_4SECS 0x0B |
117 | #define CMD_ISA_DELAY_TIME_8SECS 0x0C | 127 | #define CMD_ISA_DELAY_TIME_8SECS 0x0C |
118 | 128 | ||
119 | /* | 129 | /* |
120 | * We are using an kernel timer to do the pinging of the watchdog | 130 | * We are using an kernel timer to do the pinging of the watchdog |
@@ -130,15 +140,17 @@ static int cards_found; | |||
130 | /* internal variables */ | 140 | /* internal variables */ |
131 | static atomic_t open_allowed = ATOMIC_INIT(1); | 141 | static atomic_t open_allowed = ATOMIC_INIT(1); |
132 | static char expect_close; | 142 | static char expect_close; |
133 | static struct timer_list timer; | ||
134 | static unsigned long next_heartbeat; | ||
135 | static int temp_panic; | 143 | static int temp_panic; |
136 | static int revision; /* The card's revision */ | 144 | static struct { /* this is private data for each ISA-PC watchdog card */ |
137 | static int supports_temp; /* Wether or not the card has a temperature device */ | 145 | int revision; /* The card's revision */ |
138 | static int command_mode; /* Wether or not the card is in command mode */ | 146 | int supports_temp; /* Wether or not the card has a temperature device */ |
139 | static int initial_status; /* The card's boot status */ | 147 | int command_mode; /* Wether or not the card is in command mode */ |
140 | static int current_readport; /* The cards I/O address */ | 148 | int boot_status; /* The card's boot status */ |
141 | static spinlock_t io_lock; | 149 | int io_addr; /* The cards I/O address */ |
150 | spinlock_t io_lock; /* the lock for io operations */ | ||
151 | struct timer_list timer; /* The timer that pings the watchdog */ | ||
152 | unsigned long next_heartbeat; /* the next_heartbeat for the timer */ | ||
153 | } pcwd_private; | ||
142 | 154 | ||
143 | /* module parameters */ | 155 | /* module parameters */ |
144 | #define WATCHDOG_HEARTBEAT 60 /* 60 sec default heartbeat */ | 156 | #define WATCHDOG_HEARTBEAT 60 /* 60 sec default heartbeat */ |
@@ -161,14 +173,14 @@ static int send_isa_command(int cmd) | |||
161 | int port0, last_port0; /* Double read for stabilising */ | 173 | int port0, last_port0; /* Double read for stabilising */ |
162 | 174 | ||
163 | /* The WCMD bit must be 1 and the command is only 4 bits in size */ | 175 | /* The WCMD bit must be 1 and the command is only 4 bits in size */ |
164 | control_status = (cmd & 0x0F) | 0x80; | 176 | control_status = (cmd & 0x0F) | WD_WCMD; |
165 | outb_p(control_status, current_readport + 2); | 177 | outb_p(control_status, pcwd_private.io_addr + 2); |
166 | udelay(ISA_COMMAND_TIMEOUT); | 178 | udelay(ISA_COMMAND_TIMEOUT); |
167 | 179 | ||
168 | port0 = inb_p(current_readport); | 180 | port0 = inb_p(pcwd_private.io_addr); |
169 | for (i = 0; i < 25; ++i) { | 181 | for (i = 0; i < 25; ++i) { |
170 | last_port0 = port0; | 182 | last_port0 = port0; |
171 | port0 = inb_p(current_readport); | 183 | port0 = inb_p(pcwd_private.io_addr); |
172 | 184 | ||
173 | if (port0 == last_port0) | 185 | if (port0 == last_port0) |
174 | break; /* Data is stable */ | 186 | break; /* Data is stable */ |
@@ -184,7 +196,7 @@ static int set_command_mode(void) | |||
184 | int i, found=0, count=0; | 196 | int i, found=0, count=0; |
185 | 197 | ||
186 | /* Set the card into command mode */ | 198 | /* Set the card into command mode */ |
187 | spin_lock(&io_lock); | 199 | spin_lock(&pcwd_private.io_lock); |
188 | while ((!found) && (count < 3)) { | 200 | while ((!found) && (count < 3)) { |
189 | i = send_isa_command(CMD_ISA_IDLE); | 201 | i = send_isa_command(CMD_ISA_IDLE); |
190 | 202 | ||
@@ -192,15 +204,15 @@ static int set_command_mode(void) | |||
192 | found = 1; | 204 | found = 1; |
193 | else if (i == 0xF3) { | 205 | else if (i == 0xF3) { |
194 | /* Card does not like what we've done to it */ | 206 | /* Card does not like what we've done to it */ |
195 | outb_p(0x00, current_readport + 2); | 207 | outb_p(0x00, pcwd_private.io_addr + 2); |
196 | udelay(1200); /* Spec says wait 1ms */ | 208 | udelay(1200); /* Spec says wait 1ms */ |
197 | outb_p(0x00, current_readport + 2); | 209 | outb_p(0x00, pcwd_private.io_addr + 2); |
198 | udelay(ISA_COMMAND_TIMEOUT); | 210 | udelay(ISA_COMMAND_TIMEOUT); |
199 | } | 211 | } |
200 | count++; | 212 | count++; |
201 | } | 213 | } |
202 | spin_unlock(&io_lock); | 214 | spin_unlock(&pcwd_private.io_lock); |
203 | command_mode = found; | 215 | pcwd_private.command_mode = found; |
204 | 216 | ||
205 | return(found); | 217 | return(found); |
206 | } | 218 | } |
@@ -208,12 +220,95 @@ static int set_command_mode(void) | |||
208 | static void unset_command_mode(void) | 220 | static void unset_command_mode(void) |
209 | { | 221 | { |
210 | /* Set the card into normal mode */ | 222 | /* Set the card into normal mode */ |
211 | spin_lock(&io_lock); | 223 | spin_lock(&pcwd_private.io_lock); |
212 | outb_p(0x00, current_readport + 2); | 224 | outb_p(0x00, pcwd_private.io_addr + 2); |
213 | udelay(ISA_COMMAND_TIMEOUT); | 225 | udelay(ISA_COMMAND_TIMEOUT); |
214 | spin_unlock(&io_lock); | 226 | spin_unlock(&pcwd_private.io_lock); |
227 | |||
228 | pcwd_private.command_mode = 0; | ||
229 | } | ||
230 | |||
231 | static inline void pcwd_check_temperature_support(void) | ||
232 | { | ||
233 | if (inb(pcwd_private.io_addr) != 0xF0) | ||
234 | pcwd_private.supports_temp = 1; | ||
235 | } | ||
236 | |||
237 | static inline char *get_firmware(void) | ||
238 | { | ||
239 | int one, ten, hund, minor; | ||
240 | char *ret; | ||
241 | |||
242 | ret = kmalloc(6, GFP_KERNEL); | ||
243 | if(ret == NULL) | ||
244 | return NULL; | ||
245 | |||
246 | if (set_command_mode()) { | ||
247 | one = send_isa_command(CMD_ISA_VERSION_INTEGER); | ||
248 | ten = send_isa_command(CMD_ISA_VERSION_TENTH); | ||
249 | hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH); | ||
250 | minor = send_isa_command(CMD_ISA_VERSION_MINOR); | ||
251 | sprintf(ret, "%c.%c%c%c", one, ten, hund, minor); | ||
252 | } | ||
253 | else | ||
254 | sprintf(ret, "ERROR"); | ||
255 | |||
256 | unset_command_mode(); | ||
257 | return(ret); | ||
258 | } | ||
259 | |||
260 | static inline int pcwd_get_option_switches(void) | ||
261 | { | ||
262 | int option_switches=0; | ||
263 | |||
264 | if (set_command_mode()) { | ||
265 | /* Get switch settings */ | ||
266 | option_switches = send_isa_command(CMD_ISA_SWITCH_SETTINGS); | ||
267 | } | ||
268 | |||
269 | unset_command_mode(); | ||
270 | return(option_switches); | ||
271 | } | ||
272 | |||
273 | static void pcwd_show_card_info(void) | ||
274 | { | ||
275 | char *firmware; | ||
276 | int option_switches; | ||
277 | |||
278 | /* Get some extra info from the hardware (in command/debug/diag mode) */ | ||
279 | if (pcwd_private.revision == PCWD_REVISION_A) | ||
280 | printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", pcwd_private.io_addr); | ||
281 | else if (pcwd_private.revision == PCWD_REVISION_C) { | ||
282 | firmware = get_firmware(); | ||
283 | printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", | ||
284 | pcwd_private.io_addr, firmware); | ||
285 | kfree(firmware); | ||
286 | option_switches = pcwd_get_option_switches(); | ||
287 | printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
288 | option_switches, | ||
289 | ((option_switches & 0x10) ? "ON" : "OFF"), | ||
290 | ((option_switches & 0x08) ? "ON" : "OFF")); | ||
291 | |||
292 | /* Reprogram internal heartbeat to 2 seconds */ | ||
293 | if (set_command_mode()) { | ||
294 | send_isa_command(CMD_ISA_DELAY_TIME_2SECS); | ||
295 | unset_command_mode(); | ||
296 | } | ||
297 | } | ||
298 | |||
299 | if (pcwd_private.supports_temp) | ||
300 | printk(KERN_INFO PFX "Temperature Option Detected\n"); | ||
301 | |||
302 | if (pcwd_private.boot_status & WDIOF_CARDRESET) | ||
303 | printk(KERN_INFO PFX "Previous reboot was caused by the card\n"); | ||
304 | |||
305 | if (pcwd_private.boot_status & WDIOF_OVERHEAT) { | ||
306 | printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n"); | ||
307 | printk(KERN_EMERG PFX "CPU Overheat\n"); | ||
308 | } | ||
215 | 309 | ||
216 | command_mode = 0; | 310 | if (pcwd_private.boot_status == 0) |
311 | printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); | ||
217 | } | 312 | } |
218 | 313 | ||
219 | static void pcwd_timer_ping(unsigned long data) | 314 | static void pcwd_timer_ping(unsigned long data) |
@@ -222,25 +317,25 @@ static void pcwd_timer_ping(unsigned long data) | |||
222 | 317 | ||
223 | /* If we got a heartbeat pulse within the WDT_INTERVAL | 318 | /* If we got a heartbeat pulse within the WDT_INTERVAL |
224 | * we agree to ping the WDT */ | 319 | * we agree to ping the WDT */ |
225 | if(time_before(jiffies, next_heartbeat)) { | 320 | if(time_before(jiffies, pcwd_private.next_heartbeat)) { |
226 | /* Ping the watchdog */ | 321 | /* Ping the watchdog */ |
227 | spin_lock(&io_lock); | 322 | spin_lock(&pcwd_private.io_lock); |
228 | if (revision == PCWD_REVISION_A) { | 323 | if (pcwd_private.revision == PCWD_REVISION_A) { |
229 | /* Rev A cards are reset by setting the WD_WDRST bit in register 1 */ | 324 | /* Rev A cards are reset by setting the WD_WDRST bit in register 1 */ |
230 | wdrst_stat = inb_p(current_readport); | 325 | wdrst_stat = inb_p(pcwd_private.io_addr); |
231 | wdrst_stat &= 0x0F; | 326 | wdrst_stat &= 0x0F; |
232 | wdrst_stat |= WD_WDRST; | 327 | wdrst_stat |= WD_WDRST; |
233 | 328 | ||
234 | outb_p(wdrst_stat, current_readport + 1); | 329 | outb_p(wdrst_stat, pcwd_private.io_addr + 1); |
235 | } else { | 330 | } else { |
236 | /* Re-trigger watchdog by writing to port 0 */ | 331 | /* Re-trigger watchdog by writing to port 0 */ |
237 | outb_p(0x00, current_readport); | 332 | outb_p(0x00, pcwd_private.io_addr); |
238 | } | 333 | } |
239 | 334 | ||
240 | /* Re-set the timer interval */ | 335 | /* Re-set the timer interval */ |
241 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 336 | mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL); |
242 | 337 | ||
243 | spin_unlock(&io_lock); | 338 | spin_unlock(&pcwd_private.io_lock); |
244 | } else { | 339 | } else { |
245 | printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); | 340 | printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); |
246 | } | 341 | } |
@@ -250,19 +345,19 @@ static int pcwd_start(void) | |||
250 | { | 345 | { |
251 | int stat_reg; | 346 | int stat_reg; |
252 | 347 | ||
253 | next_heartbeat = jiffies + (heartbeat * HZ); | 348 | pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); |
254 | 349 | ||
255 | /* Start the timer */ | 350 | /* Start the timer */ |
256 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 351 | mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL); |
257 | 352 | ||
258 | /* Enable the port */ | 353 | /* Enable the port */ |
259 | if (revision == PCWD_REVISION_C) { | 354 | if (pcwd_private.revision == PCWD_REVISION_C) { |
260 | spin_lock(&io_lock); | 355 | spin_lock(&pcwd_private.io_lock); |
261 | outb_p(0x00, current_readport + 3); | 356 | outb_p(0x00, pcwd_private.io_addr + 3); |
262 | udelay(ISA_COMMAND_TIMEOUT); | 357 | udelay(ISA_COMMAND_TIMEOUT); |
263 | stat_reg = inb_p(current_readport + 2); | 358 | stat_reg = inb_p(pcwd_private.io_addr + 2); |
264 | spin_unlock(&io_lock); | 359 | spin_unlock(&pcwd_private.io_lock); |
265 | if (stat_reg & 0x10) { | 360 | if (stat_reg & WD_WDIS) { |
266 | printk(KERN_INFO PFX "Could not start watchdog\n"); | 361 | printk(KERN_INFO PFX "Could not start watchdog\n"); |
267 | return -EIO; | 362 | return -EIO; |
268 | } | 363 | } |
@@ -275,18 +370,18 @@ static int pcwd_stop(void) | |||
275 | int stat_reg; | 370 | int stat_reg; |
276 | 371 | ||
277 | /* Stop the timer */ | 372 | /* Stop the timer */ |
278 | del_timer(&timer); | 373 | del_timer(&pcwd_private.timer); |
279 | 374 | ||
280 | /* Disable the board */ | 375 | /* Disable the board */ |
281 | if (revision == PCWD_REVISION_C) { | 376 | if (pcwd_private.revision == PCWD_REVISION_C) { |
282 | spin_lock(&io_lock); | 377 | spin_lock(&pcwd_private.io_lock); |
283 | outb_p(0xA5, current_readport + 3); | 378 | outb_p(0xA5, pcwd_private.io_addr + 3); |
284 | udelay(ISA_COMMAND_TIMEOUT); | 379 | udelay(ISA_COMMAND_TIMEOUT); |
285 | outb_p(0xA5, current_readport + 3); | 380 | outb_p(0xA5, pcwd_private.io_addr + 3); |
286 | udelay(ISA_COMMAND_TIMEOUT); | 381 | udelay(ISA_COMMAND_TIMEOUT); |
287 | stat_reg = inb_p(current_readport + 2); | 382 | stat_reg = inb_p(pcwd_private.io_addr + 2); |
288 | spin_unlock(&io_lock); | 383 | spin_unlock(&pcwd_private.io_lock); |
289 | if ((stat_reg & 0x10) == 0) { | 384 | if ((stat_reg & WD_WDIS) == 0) { |
290 | printk(KERN_INFO PFX "Could not stop watchdog\n"); | 385 | printk(KERN_INFO PFX "Could not stop watchdog\n"); |
291 | return -EIO; | 386 | return -EIO; |
292 | } | 387 | } |
@@ -297,7 +392,7 @@ static int pcwd_stop(void) | |||
297 | static int pcwd_keepalive(void) | 392 | static int pcwd_keepalive(void) |
298 | { | 393 | { |
299 | /* user land ping */ | 394 | /* user land ping */ |
300 | next_heartbeat = jiffies + (heartbeat * HZ); | 395 | pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); |
301 | return 0; | 396 | return 0; |
302 | } | 397 | } |
303 | 398 | ||
@@ -315,23 +410,23 @@ static int pcwd_get_status(int *status) | |||
315 | int card_status; | 410 | int card_status; |
316 | 411 | ||
317 | *status=0; | 412 | *status=0; |
318 | spin_lock(&io_lock); | 413 | spin_lock(&pcwd_private.io_lock); |
319 | if (revision == PCWD_REVISION_A) | 414 | if (pcwd_private.revision == PCWD_REVISION_A) |
320 | /* Rev A cards return status information from | 415 | /* Rev A cards return status information from |
321 | * the base register, which is used for the | 416 | * the base register, which is used for the |
322 | * temperature in other cards. */ | 417 | * temperature in other cards. */ |
323 | card_status = inb(current_readport); | 418 | card_status = inb(pcwd_private.io_addr); |
324 | else { | 419 | else { |
325 | /* Rev C cards return card status in the base | 420 | /* Rev C cards return card status in the base |
326 | * address + 1 register. And use different bits | 421 | * address + 1 register. And use different bits |
327 | * to indicate a card initiated reset, and an | 422 | * to indicate a card initiated reset, and an |
328 | * over-temperature condition. And the reboot | 423 | * over-temperature condition. And the reboot |
329 | * status can be reset. */ | 424 | * status can be reset. */ |
330 | card_status = inb(current_readport + 1); | 425 | card_status = inb(pcwd_private.io_addr + 1); |
331 | } | 426 | } |
332 | spin_unlock(&io_lock); | 427 | spin_unlock(&pcwd_private.io_lock); |
333 | 428 | ||
334 | if (revision == PCWD_REVISION_A) { | 429 | if (pcwd_private.revision == PCWD_REVISION_A) { |
335 | if (card_status & WD_WDRST) | 430 | if (card_status & WD_WDRST) |
336 | *status |= WDIOF_CARDRESET; | 431 | *status |= WDIOF_CARDRESET; |
337 | 432 | ||
@@ -360,10 +455,10 @@ static int pcwd_get_status(int *status) | |||
360 | 455 | ||
361 | static int pcwd_clear_status(void) | 456 | static int pcwd_clear_status(void) |
362 | { | 457 | { |
363 | if (revision == PCWD_REVISION_C) { | 458 | if (pcwd_private.revision == PCWD_REVISION_C) { |
364 | spin_lock(&io_lock); | 459 | spin_lock(&pcwd_private.io_lock); |
365 | outb_p(0x00, current_readport + 1); /* clear reset status */ | 460 | outb_p(0x00, pcwd_private.io_addr + 1); /* clear reset status */ |
366 | spin_unlock(&io_lock); | 461 | spin_unlock(&pcwd_private.io_lock); |
367 | } | 462 | } |
368 | return 0; | 463 | return 0; |
369 | } | 464 | } |
@@ -371,20 +466,20 @@ static int pcwd_clear_status(void) | |||
371 | static int pcwd_get_temperature(int *temperature) | 466 | static int pcwd_get_temperature(int *temperature) |
372 | { | 467 | { |
373 | /* check that port 0 gives temperature info and no command results */ | 468 | /* check that port 0 gives temperature info and no command results */ |
374 | if (command_mode) | 469 | if (pcwd_private.command_mode) |
375 | return -1; | 470 | return -1; |
376 | 471 | ||
377 | *temperature = 0; | 472 | *temperature = 0; |
378 | if (!supports_temp) | 473 | if (!pcwd_private.supports_temp) |
379 | return -ENODEV; | 474 | return -ENODEV; |
380 | 475 | ||
381 | /* | 476 | /* |
382 | * Convert celsius to fahrenheit, since this was | 477 | * Convert celsius to fahrenheit, since this was |
383 | * the decided 'standard' for this return value. | 478 | * the decided 'standard' for this return value. |
384 | */ | 479 | */ |
385 | spin_lock(&io_lock); | 480 | spin_lock(&pcwd_private.io_lock); |
386 | *temperature = ((inb(current_readport)) * 9 / 5) + 32; | 481 | *temperature = ((inb(pcwd_private.io_addr)) * 9 / 5) + 32; |
387 | spin_unlock(&io_lock); | 482 | spin_unlock(&pcwd_private.io_lock); |
388 | 483 | ||
389 | return 0; | 484 | return 0; |
390 | } | 485 | } |
@@ -425,7 +520,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file, | |||
425 | return put_user(status, argp); | 520 | return put_user(status, argp); |
426 | 521 | ||
427 | case WDIOC_GETBOOTSTATUS: | 522 | case WDIOC_GETBOOTSTATUS: |
428 | return put_user(initial_status, argp); | 523 | return put_user(pcwd_private.boot_status, argp); |
429 | 524 | ||
430 | case WDIOC_GETTEMP: | 525 | case WDIOC_GETTEMP: |
431 | if (pcwd_get_temperature(&temperature)) | 526 | if (pcwd_get_temperature(&temperature)) |
@@ -434,7 +529,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file, | |||
434 | return put_user(temperature, argp); | 529 | return put_user(temperature, argp); |
435 | 530 | ||
436 | case WDIOC_SETOPTIONS: | 531 | case WDIOC_SETOPTIONS: |
437 | if (revision == PCWD_REVISION_C) | 532 | if (pcwd_private.revision == PCWD_REVISION_C) |
438 | { | 533 | { |
439 | if(copy_from_user(&rv, argp, sizeof(int))) | 534 | if(copy_from_user(&rv, argp, sizeof(int))) |
440 | return -EFAULT; | 535 | return -EFAULT; |
@@ -550,7 +645,7 @@ static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count, | |||
550 | 645 | ||
551 | static int pcwd_temp_open(struct inode *inode, struct file *file) | 646 | static int pcwd_temp_open(struct inode *inode, struct file *file) |
552 | { | 647 | { |
553 | if (!supports_temp) | 648 | if (!pcwd_private.supports_temp) |
554 | return -ENODEV; | 649 | return -ENODEV; |
555 | 650 | ||
556 | return nonseekable_open(inode, file); | 651 | return nonseekable_open(inode, file); |
@@ -616,68 +711,24 @@ static struct notifier_block pcwd_notifier = { | |||
616 | * Init & exit routines | 711 | * Init & exit routines |
617 | */ | 712 | */ |
618 | 713 | ||
619 | static inline void get_support(void) | ||
620 | { | ||
621 | if (inb(current_readport) != 0xF0) | ||
622 | supports_temp = 1; | ||
623 | } | ||
624 | |||
625 | static inline int get_revision(void) | 714 | static inline int get_revision(void) |
626 | { | 715 | { |
627 | int r = PCWD_REVISION_C; | 716 | int r = PCWD_REVISION_C; |
628 | 717 | ||
629 | spin_lock(&io_lock); | 718 | spin_lock(&pcwd_private.io_lock); |
630 | /* REV A cards use only 2 io ports; test | 719 | /* REV A cards use only 2 io ports; test |
631 | * presumes a floating bus reads as 0xff. */ | 720 | * presumes a floating bus reads as 0xff. */ |
632 | if ((inb(current_readport + 2) == 0xFF) || | 721 | if ((inb(pcwd_private.io_addr + 2) == 0xFF) || |
633 | (inb(current_readport + 3) == 0xFF)) | 722 | (inb(pcwd_private.io_addr + 3) == 0xFF)) |
634 | r=PCWD_REVISION_A; | 723 | r=PCWD_REVISION_A; |
635 | spin_unlock(&io_lock); | 724 | spin_unlock(&pcwd_private.io_lock); |
636 | 725 | ||
637 | return r; | 726 | return r; |
638 | } | 727 | } |
639 | 728 | ||
640 | static inline char *get_firmware(void) | ||
641 | { | ||
642 | int one, ten, hund, minor; | ||
643 | char *ret; | ||
644 | |||
645 | ret = kmalloc(6, GFP_KERNEL); | ||
646 | if(ret == NULL) | ||
647 | return NULL; | ||
648 | |||
649 | if (set_command_mode()) { | ||
650 | one = send_isa_command(CMD_ISA_VERSION_INTEGER); | ||
651 | ten = send_isa_command(CMD_ISA_VERSION_TENTH); | ||
652 | hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH); | ||
653 | minor = send_isa_command(CMD_ISA_VERSION_MINOR); | ||
654 | sprintf(ret, "%c.%c%c%c", one, ten, hund, minor); | ||
655 | } | ||
656 | else | ||
657 | sprintf(ret, "ERROR"); | ||
658 | |||
659 | unset_command_mode(); | ||
660 | return(ret); | ||
661 | } | ||
662 | |||
663 | static inline int get_option_switches(void) | ||
664 | { | ||
665 | int rv=0; | ||
666 | |||
667 | if (set_command_mode()) { | ||
668 | /* Get switch settings */ | ||
669 | rv = send_isa_command(CMD_ISA_SWITCH_SETTINGS); | ||
670 | } | ||
671 | |||
672 | unset_command_mode(); | ||
673 | return(rv); | ||
674 | } | ||
675 | |||
676 | static int __devinit pcwatchdog_init(int base_addr) | 729 | static int __devinit pcwatchdog_init(int base_addr) |
677 | { | 730 | { |
678 | int ret; | 731 | int ret; |
679 | char *firmware; | ||
680 | int option_switches; | ||
681 | 732 | ||
682 | cards_found++; | 733 | cards_found++; |
683 | if (cards_found == 1) | 734 | if (cards_found == 1) |
@@ -692,104 +743,66 @@ static int __devinit pcwatchdog_init(int base_addr) | |||
692 | printk(KERN_ERR PFX "No I/O-Address for card detected\n"); | 743 | printk(KERN_ERR PFX "No I/O-Address for card detected\n"); |
693 | return -ENODEV; | 744 | return -ENODEV; |
694 | } | 745 | } |
695 | current_readport = base_addr; | 746 | pcwd_private.io_addr = base_addr; |
696 | 747 | ||
697 | /* Check card's revision */ | 748 | /* Check card's revision */ |
698 | revision = get_revision(); | 749 | pcwd_private.revision = get_revision(); |
699 | 750 | ||
700 | if (!request_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { | 751 | if (!request_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { |
701 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 752 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", |
702 | current_readport); | 753 | pcwd_private.io_addr); |
703 | current_readport = 0x0000; | 754 | pcwd_private.io_addr = 0x0000; |
704 | return -EIO; | 755 | return -EIO; |
705 | } | 756 | } |
706 | 757 | ||
707 | /* Initial variables */ | 758 | /* Initial variables */ |
708 | supports_temp = 0; | 759 | pcwd_private.supports_temp = 0; |
709 | temp_panic = 0; | 760 | temp_panic = 0; |
710 | initial_status = 0x0000; | 761 | pcwd_private.boot_status = 0x0000; |
711 | 762 | ||
712 | /* get the boot_status */ | 763 | /* get the boot_status */ |
713 | pcwd_get_status(&initial_status); | 764 | pcwd_get_status(&pcwd_private.boot_status); |
714 | 765 | ||
715 | /* clear the "card caused reboot" flag */ | 766 | /* clear the "card caused reboot" flag */ |
716 | pcwd_clear_status(); | 767 | pcwd_clear_status(); |
717 | 768 | ||
718 | init_timer(&timer); | 769 | init_timer(&pcwd_private.timer); |
719 | timer.function = pcwd_timer_ping; | 770 | pcwd_private.timer.function = pcwd_timer_ping; |
720 | timer.data = 0; | 771 | pcwd_private.timer.data = 0; |
721 | 772 | ||
722 | /* Disable the board */ | 773 | /* Disable the board */ |
723 | pcwd_stop(); | 774 | pcwd_stop(); |
724 | 775 | ||
725 | /* Check whether or not the card supports the temperature device */ | 776 | /* Check whether or not the card supports the temperature device */ |
726 | get_support(); | 777 | pcwd_check_temperature_support(); |
727 | |||
728 | /* Get some extra info from the hardware (in command/debug/diag mode) */ | ||
729 | if (revision == PCWD_REVISION_A) | ||
730 | printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", current_readport); | ||
731 | else if (revision == PCWD_REVISION_C) { | ||
732 | firmware = get_firmware(); | ||
733 | printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", | ||
734 | current_readport, firmware); | ||
735 | kfree(firmware); | ||
736 | option_switches = get_option_switches(); | ||
737 | printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
738 | option_switches, | ||
739 | ((option_switches & 0x10) ? "ON" : "OFF"), | ||
740 | ((option_switches & 0x08) ? "ON" : "OFF")); | ||
741 | |||
742 | /* Reprogram internal heartbeat to 2 seconds */ | ||
743 | if (set_command_mode()) { | ||
744 | send_isa_command(CMD_ISA_DELAY_TIME_2SECS); | ||
745 | unset_command_mode(); | ||
746 | } | ||
747 | } else { | ||
748 | /* Should NEVER happen, unless get_revision() fails. */ | ||
749 | printk(KERN_INFO PFX "Unable to get revision\n"); | ||
750 | release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); | ||
751 | current_readport = 0x0000; | ||
752 | return -1; | ||
753 | } | ||
754 | 778 | ||
755 | if (supports_temp) | 779 | /* Show info about the card itself */ |
756 | printk(KERN_INFO PFX "Temperature Option Detected\n"); | 780 | pcwd_show_card_info(); |
757 | |||
758 | if (initial_status & WDIOF_CARDRESET) | ||
759 | printk(KERN_INFO PFX "Previous reboot was caused by the card\n"); | ||
760 | |||
761 | if (initial_status & WDIOF_OVERHEAT) { | ||
762 | printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n"); | ||
763 | printk(KERN_EMERG PFX "CPU Overheat\n"); | ||
764 | } | ||
765 | |||
766 | if (initial_status == 0) | ||
767 | printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); | ||
768 | 781 | ||
769 | /* Check that the heartbeat value is within it's range ; if not reset to the default */ | 782 | /* Check that the heartbeat value is within it's range ; if not reset to the default */ |
770 | if (pcwd_set_heartbeat(heartbeat)) { | 783 | if (pcwd_set_heartbeat(heartbeat)) { |
771 | pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); | 784 | pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); |
772 | printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n", | 785 | printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n", |
773 | WATCHDOG_HEARTBEAT); | 786 | WATCHDOG_HEARTBEAT); |
774 | } | 787 | } |
775 | 788 | ||
776 | ret = register_reboot_notifier(&pcwd_notifier); | 789 | ret = register_reboot_notifier(&pcwd_notifier); |
777 | if (ret) { | 790 | if (ret) { |
778 | printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | 791 | printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", |
779 | ret); | 792 | ret); |
780 | release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); | 793 | release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); |
781 | current_readport = 0x0000; | 794 | pcwd_private.io_addr = 0x0000; |
782 | return ret; | 795 | return ret; |
783 | } | 796 | } |
784 | 797 | ||
785 | if (supports_temp) { | 798 | if (pcwd_private.supports_temp) { |
786 | ret = misc_register(&temp_miscdev); | 799 | ret = misc_register(&temp_miscdev); |
787 | if (ret) { | 800 | if (ret) { |
788 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | 801 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", |
789 | TEMP_MINOR, ret); | 802 | TEMP_MINOR, ret); |
790 | unregister_reboot_notifier(&pcwd_notifier); | 803 | unregister_reboot_notifier(&pcwd_notifier); |
791 | release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); | 804 | release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); |
792 | current_readport = 0x0000; | 805 | pcwd_private.io_addr = 0x0000; |
793 | return ret; | 806 | return ret; |
794 | } | 807 | } |
795 | } | 808 | } |
@@ -798,11 +811,11 @@ static int __devinit pcwatchdog_init(int base_addr) | |||
798 | if (ret) { | 811 | if (ret) { |
799 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | 812 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", |
800 | WATCHDOG_MINOR, ret); | 813 | WATCHDOG_MINOR, ret); |
801 | if (supports_temp) | 814 | if (pcwd_private.supports_temp) |
802 | misc_deregister(&temp_miscdev); | 815 | misc_deregister(&temp_miscdev); |
803 | unregister_reboot_notifier(&pcwd_notifier); | 816 | unregister_reboot_notifier(&pcwd_notifier); |
804 | release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); | 817 | release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); |
805 | current_readport = 0x0000; | 818 | pcwd_private.io_addr = 0x0000; |
806 | return ret; | 819 | return ret; |
807 | } | 820 | } |
808 | 821 | ||
@@ -820,11 +833,12 @@ static void __devexit pcwatchdog_exit(void) | |||
820 | 833 | ||
821 | /* Deregister */ | 834 | /* Deregister */ |
822 | misc_deregister(&pcwd_miscdev); | 835 | misc_deregister(&pcwd_miscdev); |
823 | if (supports_temp) | 836 | if (pcwd_private.supports_temp) |
824 | misc_deregister(&temp_miscdev); | 837 | misc_deregister(&temp_miscdev); |
825 | unregister_reboot_notifier(&pcwd_notifier); | 838 | unregister_reboot_notifier(&pcwd_notifier); |
826 | release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); | 839 | release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); |
827 | current_readport = 0x0000; | 840 | pcwd_private.io_addr = 0x0000; |
841 | cards_found--; | ||
828 | } | 842 | } |
829 | 843 | ||
830 | /* | 844 | /* |
@@ -887,7 +901,7 @@ static int __init pcwd_init_module(void) | |||
887 | { | 901 | { |
888 | int i, found = 0; | 902 | int i, found = 0; |
889 | 903 | ||
890 | spin_lock_init(&io_lock); | 904 | spin_lock_init(&pcwd_private.io_lock); |
891 | 905 | ||
892 | for (i = 0; pcwd_ioports[i] != 0; i++) { | 906 | for (i = 0; pcwd_ioports[i] != 0; i++) { |
893 | if (pcwd_checkcard(pcwd_ioports[i])) { | 907 | if (pcwd_checkcard(pcwd_ioports[i])) { |
@@ -906,7 +920,7 @@ static int __init pcwd_init_module(void) | |||
906 | 920 | ||
907 | static void __exit pcwd_cleanup_module(void) | 921 | static void __exit pcwd_cleanup_module(void) |
908 | { | 922 | { |
909 | if (current_readport) | 923 | if (pcwd_private.io_addr) |
910 | pcwatchdog_exit(); | 924 | pcwatchdog_exit(); |
911 | return; | 925 | return; |
912 | } | 926 | } |
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c index b474ea52d6e8..522a9370db94 100644 --- a/drivers/char/watchdog/sa1100_wdt.c +++ b/drivers/char/watchdog/sa1100_wdt.c | |||
@@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, | |||
93 | { | 93 | { |
94 | int ret = -ENOIOCTLCMD; | 94 | int ret = -ENOIOCTLCMD; |
95 | int time; | 95 | int time; |
96 | void __user *argp = (void __user *)arg; | ||
97 | int __user *p = argp; | ||
96 | 98 | ||
97 | switch (cmd) { | 99 | switch (cmd) { |
98 | case WDIOC_GETSUPPORT: | 100 | case WDIOC_GETSUPPORT: |
99 | ret = copy_to_user((struct watchdog_info __user *)arg, &ident, | 101 | ret = copy_to_user(argp, &ident, |
100 | sizeof(ident)) ? -EFAULT : 0; | 102 | sizeof(ident)) ? -EFAULT : 0; |
101 | break; | 103 | break; |
102 | 104 | ||
103 | case WDIOC_GETSTATUS: | 105 | case WDIOC_GETSTATUS: |
104 | ret = put_user(0, (int __user *)arg); | 106 | ret = put_user(0, p); |
105 | break; | 107 | break; |
106 | 108 | ||
107 | case WDIOC_GETBOOTSTATUS: | 109 | case WDIOC_GETBOOTSTATUS: |
108 | ret = put_user(boot_status, (int __user *)arg); | 110 | ret = put_user(boot_status, p); |
109 | break; | 111 | break; |
110 | 112 | ||
111 | case WDIOC_SETTIMEOUT: | 113 | case WDIOC_SETTIMEOUT: |
112 | ret = get_user(time, (int __user *)arg); | 114 | ret = get_user(time, p); |
113 | if (ret) | 115 | if (ret) |
114 | break; | 116 | break; |
115 | 117 | ||
@@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file, | |||
123 | /*fall through*/ | 125 | /*fall through*/ |
124 | 126 | ||
125 | case WDIOC_GETTIMEOUT: | 127 | case WDIOC_GETTIMEOUT: |
126 | ret = put_user(pre_margin / OSCR_FREQ, (int __user *)arg); | 128 | ret = put_user(pre_margin / OSCR_FREQ, p); |
127 | break; | 129 | break; |
128 | 130 | ||
129 | case WDIOC_KEEPALIVE: | 131 | case WDIOC_KEEPALIVE: |
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index 3c128b692bce..ec6f2a48895b 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c | |||
@@ -590,6 +590,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = { | |||
590 | PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9), | 590 | PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9), |
591 | PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26), | 591 | PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26), |
592 | PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b), | 592 | PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b), |
593 | PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757), | ||
593 | PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a), | 594 | PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a), |
594 | PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e), | 595 | PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e), |
595 | PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39), | 596 | PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39), |
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index ceb0e474fde4..4138564402b8 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c | |||
@@ -85,11 +85,10 @@ static volatile enum sclp_mask_state_t { | |||
85 | /* Maximum retry counts */ | 85 | /* Maximum retry counts */ |
86 | #define SCLP_INIT_RETRY 3 | 86 | #define SCLP_INIT_RETRY 3 |
87 | #define SCLP_MASK_RETRY 3 | 87 | #define SCLP_MASK_RETRY 3 |
88 | #define SCLP_REQUEST_RETRY 3 | ||
89 | 88 | ||
90 | /* Timeout intervals in seconds.*/ | 89 | /* Timeout intervals in seconds.*/ |
91 | #define SCLP_BUSY_INTERVAL 2 | 90 | #define SCLP_BUSY_INTERVAL 10 |
92 | #define SCLP_RETRY_INTERVAL 5 | 91 | #define SCLP_RETRY_INTERVAL 15 |
93 | 92 | ||
94 | static void sclp_process_queue(void); | 93 | static void sclp_process_queue(void); |
95 | static int sclp_init_mask(int calculate); | 94 | static int sclp_init_mask(int calculate); |
@@ -153,11 +152,9 @@ __sclp_start_request(struct sclp_req *req) | |||
153 | if (sclp_running_state != sclp_running_state_idle) | 152 | if (sclp_running_state != sclp_running_state_idle) |
154 | return 0; | 153 | return 0; |
155 | del_timer(&sclp_request_timer); | 154 | del_timer(&sclp_request_timer); |
156 | if (req->start_count <= SCLP_REQUEST_RETRY) { | 155 | rc = service_call(req->command, req->sccb); |
157 | rc = service_call(req->command, req->sccb); | 156 | req->start_count++; |
158 | req->start_count++; | 157 | |
159 | } else | ||
160 | rc = -EIO; | ||
161 | if (rc == 0) { | 158 | if (rc == 0) { |
162 | /* Sucessfully started request */ | 159 | /* Sucessfully started request */ |
163 | req->status = SCLP_REQ_RUNNING; | 160 | req->status = SCLP_REQ_RUNNING; |
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 92be75d99a56..8cf9905d484b 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) | |||
232 | return 0; | 232 | return 0; |
233 | 233 | ||
234 | mask = 0x80 >> j; | 234 | mask = 0x80 >> j; |
235 | spin_lock(&sch->lock); | 235 | spin_lock_irq(&sch->lock); |
236 | 236 | ||
237 | stsch(sch->schid, &schib); | 237 | stsch(sch->schid, &schib); |
238 | if (!schib.pmcw.dnv) | 238 | if (!schib.pmcw.dnv) |
@@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) | |||
281 | if (sch->driver && sch->driver->verify) | 281 | if (sch->driver && sch->driver->verify) |
282 | sch->driver->verify(&sch->dev); | 282 | sch->driver->verify(&sch->dev); |
283 | out_unlock: | 283 | out_unlock: |
284 | spin_unlock(&sch->lock); | 284 | spin_unlock_irq(&sch->lock); |
285 | return 0; | 285 | return 0; |
286 | out_unreg: | 286 | out_unreg: |
287 | spin_unlock(&sch->lock); | 287 | spin_unlock_irq(&sch->lock); |
288 | sch->lpm = 0; | 288 | sch->lpm = 0; |
289 | if (css_enqueue_subchannel_slow(sch->schid)) { | 289 | if (css_enqueue_subchannel_slow(sch->schid)) { |
290 | css_clear_subchannel_slow_list(); | 290 | css_clear_subchannel_slow_list(); |
@@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data) | |||
652 | if (!sch) | 652 | if (!sch) |
653 | /* Check if the subchannel is now available. */ | 653 | /* Check if the subchannel is now available. */ |
654 | return __chp_add_new_sch(schid); | 654 | return __chp_add_new_sch(schid); |
655 | spin_lock(&sch->lock); | 655 | spin_lock_irq(&sch->lock); |
656 | for (i=0; i<8; i++) | 656 | for (i=0; i<8; i++) |
657 | if (sch->schib.pmcw.chpid[i] == chp->id) { | 657 | if (sch->schib.pmcw.chpid[i] == chp->id) { |
658 | if (stsch(sch->schid, &sch->schib) != 0) { | 658 | if (stsch(sch->schid, &sch->schib) != 0) { |
@@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data) | |||
674 | if (sch->driver && sch->driver->verify) | 674 | if (sch->driver && sch->driver->verify) |
675 | sch->driver->verify(&sch->dev); | 675 | sch->driver->verify(&sch->dev); |
676 | 676 | ||
677 | spin_unlock(&sch->lock); | 677 | spin_unlock_irq(&sch->lock); |
678 | put_device(&sch->dev); | 678 | put_device(&sch->dev); |
679 | return 0; | 679 | return 0; |
680 | } | 680 | } |
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 24a54a5a91b8..1c2ab3dede71 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -211,7 +211,6 @@ static struct scsi_host_template ahci_sht = { | |||
211 | .can_queue = ATA_DEF_QUEUE, | 211 | .can_queue = ATA_DEF_QUEUE, |
212 | .this_id = ATA_SHT_THIS_ID, | 212 | .this_id = ATA_SHT_THIS_ID, |
213 | .sg_tablesize = AHCI_MAX_SG, | 213 | .sg_tablesize = AHCI_MAX_SG, |
214 | .max_sectors = ATA_MAX_SECTORS, | ||
215 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 214 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
216 | .emulated = ATA_SHT_EMULATED, | 215 | .emulated = ATA_SHT_EMULATED, |
217 | .use_clustering = AHCI_USE_CLUSTERING, | 216 | .use_clustering = AHCI_USE_CLUSTERING, |
@@ -617,7 +616,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) | |||
617 | ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0); | 616 | ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0); |
618 | if (is_atapi) { | 617 | if (is_atapi) { |
619 | memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32); | 618 | memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32); |
620 | memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, ap->cdb_len); | 619 | memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, |
620 | qc->dev->cdb_len); | ||
621 | } | 621 | } |
622 | 622 | ||
623 | n_elem = 0; | 623 | n_elem = 0; |
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index 4933ba284885..4cc1108f721a 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
@@ -185,7 +185,6 @@ static struct scsi_host_template piix_sht = { | |||
185 | .can_queue = ATA_DEF_QUEUE, | 185 | .can_queue = ATA_DEF_QUEUE, |
186 | .this_id = ATA_SHT_THIS_ID, | 186 | .this_id = ATA_SHT_THIS_ID, |
187 | .sg_tablesize = LIBATA_MAX_PRD, | 187 | .sg_tablesize = LIBATA_MAX_PRD, |
188 | .max_sectors = ATA_MAX_SECTORS, | ||
189 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 188 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
190 | .emulated = ATA_SHT_EMULATED, | 189 | .emulated = ATA_SHT_EMULATED, |
191 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 190 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
@@ -415,9 +414,6 @@ static int piix_sata_probe (struct ata_port *ap) | |||
415 | int orig_mask, mask, i; | 414 | int orig_mask, mask, i; |
416 | u8 pcs; | 415 | u8 pcs; |
417 | 416 | ||
418 | mask = (PIIX_PORT_PRESENT << ap->hard_port_no) | | ||
419 | (PIIX_PORT_ENABLED << ap->hard_port_no); | ||
420 | |||
421 | pci_read_config_byte(pdev, ICH5_PCS, &pcs); | 417 | pci_read_config_byte(pdev, ICH5_PCS, &pcs); |
422 | orig_mask = (int) pcs & 0xff; | 418 | orig_mask = (int) pcs & 0xff; |
423 | 419 | ||
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index bfe0a00b1135..5ab220e9907c 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -520,6 +520,49 @@ void ata_dev_id_string(const u16 *id, unsigned char *s, | |||
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | /** | ||
524 | * ata_dev_id_c_string - Convert IDENTIFY DEVICE page into C string | ||
525 | * @id: IDENTIFY DEVICE results we will examine | ||
526 | * @s: string into which data is output | ||
527 | * @ofs: offset into identify device page | ||
528 | * @len: length of string to return. must be an odd number. | ||
529 | * | ||
530 | * This function is identical to ata_dev_id_string except that it | ||
531 | * trims trailing spaces and terminates the resulting string with | ||
532 | * null. @len must be actual maximum length (even number) + 1. | ||
533 | * | ||
534 | * LOCKING: | ||
535 | * caller. | ||
536 | */ | ||
537 | void ata_dev_id_c_string(const u16 *id, unsigned char *s, | ||
538 | unsigned int ofs, unsigned int len) | ||
539 | { | ||
540 | unsigned char *p; | ||
541 | |||
542 | WARN_ON(!(len & 1)); | ||
543 | |||
544 | ata_dev_id_string(id, s, ofs, len - 1); | ||
545 | |||
546 | p = s + strnlen(s, len - 1); | ||
547 | while (p > s && p[-1] == ' ') | ||
548 | p--; | ||
549 | *p = '\0'; | ||
550 | } | ||
551 | |||
552 | static u64 ata_id_n_sectors(const u16 *id) | ||
553 | { | ||
554 | if (ata_id_has_lba(id)) { | ||
555 | if (ata_id_has_lba48(id)) | ||
556 | return ata_id_u64(id, 100); | ||
557 | else | ||
558 | return ata_id_u32(id, 60); | ||
559 | } else { | ||
560 | if (ata_id_current_chs_valid(id)) | ||
561 | return ata_id_u32(id, 57); | ||
562 | else | ||
563 | return id[1] * id[3] * id[6]; | ||
564 | } | ||
565 | } | ||
523 | 566 | ||
524 | /** | 567 | /** |
525 | * ata_noop_dev_select - Select device 0/1 on ATA bus | 568 | * ata_noop_dev_select - Select device 0/1 on ATA bus |
@@ -609,41 +652,41 @@ void ata_dev_select(struct ata_port *ap, unsigned int device, | |||
609 | 652 | ||
610 | /** | 653 | /** |
611 | * ata_dump_id - IDENTIFY DEVICE info debugging output | 654 | * ata_dump_id - IDENTIFY DEVICE info debugging output |
612 | * @dev: Device whose IDENTIFY DEVICE page we will dump | 655 | * @id: IDENTIFY DEVICE page to dump |
613 | * | 656 | * |
614 | * Dump selected 16-bit words from a detected device's | 657 | * Dump selected 16-bit words from the given IDENTIFY DEVICE |
615 | * IDENTIFY PAGE page. | 658 | * page. |
616 | * | 659 | * |
617 | * LOCKING: | 660 | * LOCKING: |
618 | * caller. | 661 | * caller. |
619 | */ | 662 | */ |
620 | 663 | ||
621 | static inline void ata_dump_id(const struct ata_device *dev) | 664 | static inline void ata_dump_id(const u16 *id) |
622 | { | 665 | { |
623 | DPRINTK("49==0x%04x " | 666 | DPRINTK("49==0x%04x " |
624 | "53==0x%04x " | 667 | "53==0x%04x " |
625 | "63==0x%04x " | 668 | "63==0x%04x " |
626 | "64==0x%04x " | 669 | "64==0x%04x " |
627 | "75==0x%04x \n", | 670 | "75==0x%04x \n", |
628 | dev->id[49], | 671 | id[49], |
629 | dev->id[53], | 672 | id[53], |
630 | dev->id[63], | 673 | id[63], |
631 | dev->id[64], | 674 | id[64], |
632 | dev->id[75]); | 675 | id[75]); |
633 | DPRINTK("80==0x%04x " | 676 | DPRINTK("80==0x%04x " |
634 | "81==0x%04x " | 677 | "81==0x%04x " |
635 | "82==0x%04x " | 678 | "82==0x%04x " |
636 | "83==0x%04x " | 679 | "83==0x%04x " |
637 | "84==0x%04x \n", | 680 | "84==0x%04x \n", |
638 | dev->id[80], | 681 | id[80], |
639 | dev->id[81], | 682 | id[81], |
640 | dev->id[82], | 683 | id[82], |
641 | dev->id[83], | 684 | id[83], |
642 | dev->id[84]); | 685 | id[84]); |
643 | DPRINTK("88==0x%04x " | 686 | DPRINTK("88==0x%04x " |
644 | "93==0x%04x\n", | 687 | "93==0x%04x\n", |
645 | dev->id[88], | 688 | id[88], |
646 | dev->id[93]); | 689 | id[93]); |
647 | } | 690 | } |
648 | 691 | ||
649 | /* | 692 | /* |
@@ -877,12 +920,11 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) | |||
877 | { | 920 | { |
878 | struct ata_device *dev = &ap->device[device]; | 921 | struct ata_device *dev = &ap->device[device]; |
879 | unsigned int major_version; | 922 | unsigned int major_version; |
880 | u16 tmp; | ||
881 | unsigned long xfer_modes; | 923 | unsigned long xfer_modes; |
882 | unsigned int using_edd; | 924 | unsigned int using_edd; |
883 | struct ata_taskfile tf; | 925 | struct ata_taskfile tf; |
884 | unsigned int err_mask; | 926 | unsigned int err_mask; |
885 | int rc; | 927 | int i, rc; |
886 | 928 | ||
887 | if (!ata_dev_present(dev)) { | 929 | if (!ata_dev_present(dev)) { |
888 | DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n", | 930 | DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n", |
@@ -890,7 +932,8 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) | |||
890 | return; | 932 | return; |
891 | } | 933 | } |
892 | 934 | ||
893 | if (ap->flags & (ATA_FLAG_SRST | ATA_FLAG_SATA_RESET)) | 935 | if (ap->ops->probe_reset || |
936 | ap->flags & (ATA_FLAG_SRST | ATA_FLAG_SATA_RESET)) | ||
894 | using_edd = 0; | 937 | using_edd = 0; |
895 | else | 938 | else |
896 | using_edd = 1; | 939 | using_edd = 1; |
@@ -970,18 +1013,17 @@ retry: | |||
970 | if (!xfer_modes) | 1013 | if (!xfer_modes) |
971 | xfer_modes = ata_pio_modes(dev); | 1014 | xfer_modes = ata_pio_modes(dev); |
972 | 1015 | ||
973 | ata_dump_id(dev); | 1016 | ata_dump_id(dev->id); |
974 | 1017 | ||
975 | /* ATA-specific feature tests */ | 1018 | /* ATA-specific feature tests */ |
976 | if (dev->class == ATA_DEV_ATA) { | 1019 | if (dev->class == ATA_DEV_ATA) { |
1020 | dev->n_sectors = ata_id_n_sectors(dev->id); | ||
1021 | |||
977 | if (!ata_id_is_ata(dev->id)) /* sanity check */ | 1022 | if (!ata_id_is_ata(dev->id)) /* sanity check */ |
978 | goto err_out_nosup; | 1023 | goto err_out_nosup; |
979 | 1024 | ||
980 | /* get major version */ | 1025 | /* get major version */ |
981 | tmp = dev->id[ATA_ID_MAJOR_VER]; | 1026 | major_version = ata_id_major_version(dev->id); |
982 | for (major_version = 14; major_version >= 1; major_version--) | ||
983 | if (tmp & (1 << major_version)) | ||
984 | break; | ||
985 | 1027 | ||
986 | /* | 1028 | /* |
987 | * The exact sequence expected by certain pre-ATA4 drives is: | 1029 | * The exact sequence expected by certain pre-ATA4 drives is: |
@@ -1003,12 +1045,8 @@ retry: | |||
1003 | if (ata_id_has_lba(dev->id)) { | 1045 | if (ata_id_has_lba(dev->id)) { |
1004 | dev->flags |= ATA_DFLAG_LBA; | 1046 | dev->flags |= ATA_DFLAG_LBA; |
1005 | 1047 | ||
1006 | if (ata_id_has_lba48(dev->id)) { | 1048 | if (ata_id_has_lba48(dev->id)) |
1007 | dev->flags |= ATA_DFLAG_LBA48; | 1049 | dev->flags |= ATA_DFLAG_LBA48; |
1008 | dev->n_sectors = ata_id_u64(dev->id, 100); | ||
1009 | } else { | ||
1010 | dev->n_sectors = ata_id_u32(dev->id, 60); | ||
1011 | } | ||
1012 | 1050 | ||
1013 | /* print device info to dmesg */ | 1051 | /* print device info to dmesg */ |
1014 | printk(KERN_INFO "ata%u: dev %u ATA-%d, max %s, %Lu sectors:%s\n", | 1052 | printk(KERN_INFO "ata%u: dev %u ATA-%d, max %s, %Lu sectors:%s\n", |
@@ -1024,15 +1062,12 @@ retry: | |||
1024 | dev->cylinders = dev->id[1]; | 1062 | dev->cylinders = dev->id[1]; |
1025 | dev->heads = dev->id[3]; | 1063 | dev->heads = dev->id[3]; |
1026 | dev->sectors = dev->id[6]; | 1064 | dev->sectors = dev->id[6]; |
1027 | dev->n_sectors = dev->cylinders * dev->heads * dev->sectors; | ||
1028 | 1065 | ||
1029 | if (ata_id_current_chs_valid(dev->id)) { | 1066 | if (ata_id_current_chs_valid(dev->id)) { |
1030 | /* Current CHS translation is valid. */ | 1067 | /* Current CHS translation is valid. */ |
1031 | dev->cylinders = dev->id[54]; | 1068 | dev->cylinders = dev->id[54]; |
1032 | dev->heads = dev->id[55]; | 1069 | dev->heads = dev->id[55]; |
1033 | dev->sectors = dev->id[56]; | 1070 | dev->sectors = dev->id[56]; |
1034 | |||
1035 | dev->n_sectors = ata_id_u32(dev->id, 57); | ||
1036 | } | 1071 | } |
1037 | 1072 | ||
1038 | /* print device info to dmesg */ | 1073 | /* print device info to dmesg */ |
@@ -1051,7 +1086,6 @@ retry: | |||
1051 | ap->id, device, dev->multi_count); | 1086 | ap->id, device, dev->multi_count); |
1052 | } | 1087 | } |
1053 | 1088 | ||
1054 | ap->host->max_cmd_len = 16; | ||
1055 | } | 1089 | } |
1056 | 1090 | ||
1057 | /* ATAPI-specific feature tests */ | 1091 | /* ATAPI-specific feature tests */ |
@@ -1064,8 +1098,7 @@ retry: | |||
1064 | printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id); | 1098 | printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id); |
1065 | goto err_out_nosup; | 1099 | goto err_out_nosup; |
1066 | } | 1100 | } |
1067 | ap->cdb_len = (unsigned int) rc; | 1101 | dev->cdb_len = (unsigned int) rc; |
1068 | ap->host->max_cmd_len = (unsigned char) ap->cdb_len; | ||
1069 | 1102 | ||
1070 | if (ata_id_cdb_intr(dev->id)) | 1103 | if (ata_id_cdb_intr(dev->id)) |
1071 | dev->flags |= ATA_DFLAG_CDB_INTR; | 1104 | dev->flags |= ATA_DFLAG_CDB_INTR; |
@@ -1076,6 +1109,12 @@ retry: | |||
1076 | ata_mode_string(xfer_modes)); | 1109 | ata_mode_string(xfer_modes)); |
1077 | } | 1110 | } |
1078 | 1111 | ||
1112 | ap->host->max_cmd_len = 0; | ||
1113 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1114 | ap->host->max_cmd_len = max_t(unsigned int, | ||
1115 | ap->host->max_cmd_len, | ||
1116 | ap->device[i].cdb_len); | ||
1117 | |||
1079 | DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap)); | 1118 | DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap)); |
1080 | return; | 1119 | return; |
1081 | 1120 | ||
@@ -1088,9 +1127,10 @@ err_out: | |||
1088 | } | 1127 | } |
1089 | 1128 | ||
1090 | 1129 | ||
1091 | static inline u8 ata_dev_knobble(const struct ata_port *ap) | 1130 | static inline u8 ata_dev_knobble(const struct ata_port *ap, |
1131 | struct ata_device *dev) | ||
1092 | { | 1132 | { |
1093 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); | 1133 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id))); |
1094 | } | 1134 | } |
1095 | 1135 | ||
1096 | /** | 1136 | /** |
@@ -1104,13 +1144,11 @@ static inline u8 ata_dev_knobble(const struct ata_port *ap) | |||
1104 | void ata_dev_config(struct ata_port *ap, unsigned int i) | 1144 | void ata_dev_config(struct ata_port *ap, unsigned int i) |
1105 | { | 1145 | { |
1106 | /* limit bridge transfers to udma5, 200 sectors */ | 1146 | /* limit bridge transfers to udma5, 200 sectors */ |
1107 | if (ata_dev_knobble(ap)) { | 1147 | if (ata_dev_knobble(ap, &ap->device[i])) { |
1108 | printk(KERN_INFO "ata%u(%u): applying bridge limits\n", | 1148 | printk(KERN_INFO "ata%u(%u): applying bridge limits\n", |
1109 | ap->id, ap->device->devno); | 1149 | ap->id, i); |
1110 | ap->udma_mask &= ATA_UDMA5; | 1150 | ap->udma_mask &= ATA_UDMA5; |
1111 | ap->host->max_sectors = ATA_MAX_SECTORS; | 1151 | ap->device[i].max_sectors = ATA_MAX_SECTORS; |
1112 | ap->host->hostt->max_sectors = ATA_MAX_SECTORS; | ||
1113 | ap->device[i].flags |= ATA_DFLAG_LOCK_SECTORS; | ||
1114 | } | 1152 | } |
1115 | 1153 | ||
1116 | if (ap->ops->dev_config) | 1154 | if (ap->ops->dev_config) |
@@ -1144,8 +1182,11 @@ static int ata_bus_probe(struct ata_port *ap) | |||
1144 | 1182 | ||
1145 | rc = ap->ops->probe_reset(ap, classes); | 1183 | rc = ap->ops->probe_reset(ap, classes); |
1146 | if (rc == 0) { | 1184 | if (rc == 0) { |
1147 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 1185 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
1186 | if (classes[i] == ATA_DEV_UNKNOWN) | ||
1187 | classes[i] = ATA_DEV_NONE; | ||
1148 | ap->device[i].class = classes[i]; | 1188 | ap->device[i].class = classes[i]; |
1189 | } | ||
1149 | } else { | 1190 | } else { |
1150 | printk(KERN_ERR "ata%u: probe reset failed, " | 1191 | printk(KERN_ERR "ata%u: probe reset failed, " |
1151 | "disabling port\n", ap->id); | 1192 | "disabling port\n", ap->id); |
@@ -2272,24 +2313,14 @@ static const char * const ata_dma_blacklist [] = { | |||
2272 | 2313 | ||
2273 | static int ata_dma_blacklisted(const struct ata_device *dev) | 2314 | static int ata_dma_blacklisted(const struct ata_device *dev) |
2274 | { | 2315 | { |
2275 | unsigned char model_num[40]; | 2316 | unsigned char model_num[41]; |
2276 | char *s; | ||
2277 | unsigned int len; | ||
2278 | int i; | 2317 | int i; |
2279 | 2318 | ||
2280 | ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, | 2319 | ata_dev_id_c_string(dev->id, model_num, ATA_ID_PROD_OFS, |
2281 | sizeof(model_num)); | 2320 | sizeof(model_num)); |
2282 | s = &model_num[0]; | ||
2283 | len = strnlen(s, sizeof(model_num)); | ||
2284 | |||
2285 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | ||
2286 | while ((len > 0) && (s[len - 1] == ' ')) { | ||
2287 | len--; | ||
2288 | s[len] = 0; | ||
2289 | } | ||
2290 | 2321 | ||
2291 | for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++) | 2322 | for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++) |
2292 | if (!strncmp(ata_dma_blacklist[i], s, len)) | 2323 | if (!strcmp(ata_dma_blacklist[i], model_num)) |
2293 | return 1; | 2324 | return 1; |
2294 | 2325 | ||
2295 | return 0; | 2326 | return 0; |
@@ -2485,7 +2516,7 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev) | |||
2485 | 2516 | ||
2486 | swap_buf_le16(dev->id, ATA_ID_WORDS); | 2517 | swap_buf_le16(dev->id, ATA_ID_WORDS); |
2487 | 2518 | ||
2488 | ata_dump_id(dev); | 2519 | ata_dump_id(dev->id); |
2489 | 2520 | ||
2490 | DPRINTK("EXIT\n"); | 2521 | DPRINTK("EXIT\n"); |
2491 | 2522 | ||
@@ -5179,6 +5210,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release); | |||
5179 | EXPORT_SYMBOL_GPL(ata_host_intr); | 5210 | EXPORT_SYMBOL_GPL(ata_host_intr); |
5180 | EXPORT_SYMBOL_GPL(ata_dev_classify); | 5211 | EXPORT_SYMBOL_GPL(ata_dev_classify); |
5181 | EXPORT_SYMBOL_GPL(ata_dev_id_string); | 5212 | EXPORT_SYMBOL_GPL(ata_dev_id_string); |
5213 | EXPORT_SYMBOL_GPL(ata_dev_id_c_string); | ||
5182 | EXPORT_SYMBOL_GPL(ata_dev_config); | 5214 | EXPORT_SYMBOL_GPL(ata_dev_config); |
5183 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); | 5215 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); |
5184 | EXPORT_SYMBOL_GPL(ata_eh_qc_complete); | 5216 | EXPORT_SYMBOL_GPL(ata_eh_qc_complete); |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 26f07a2617f9..86da46502b3e 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -684,23 +684,23 @@ int ata_scsi_slave_config(struct scsi_device *sdev) | |||
684 | if (sdev->id < ATA_MAX_DEVICES) { | 684 | if (sdev->id < ATA_MAX_DEVICES) { |
685 | struct ata_port *ap; | 685 | struct ata_port *ap; |
686 | struct ata_device *dev; | 686 | struct ata_device *dev; |
687 | unsigned int max_sectors; | ||
687 | 688 | ||
688 | ap = (struct ata_port *) &sdev->host->hostdata[0]; | 689 | ap = (struct ata_port *) &sdev->host->hostdata[0]; |
689 | dev = &ap->device[sdev->id]; | 690 | dev = &ap->device[sdev->id]; |
690 | 691 | ||
691 | /* TODO: 1024 is an arbitrary number, not the | 692 | /* TODO: 2048 is an arbitrary number, not the |
692 | * hardware maximum. This should be increased to | 693 | * hardware maximum. This should be increased to |
693 | * 65534 when Jens Axboe's patch for dynamically | 694 | * 65534 when Jens Axboe's patch for dynamically |
694 | * determining max_sectors is merged. | 695 | * determining max_sectors is merged. |
695 | */ | 696 | */ |
696 | if ((dev->flags & ATA_DFLAG_LBA48) && | 697 | max_sectors = ATA_MAX_SECTORS; |
697 | ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) { | 698 | if (dev->flags & ATA_DFLAG_LBA48) |
698 | /* | 699 | max_sectors = 2048; |
699 | * do not overwrite sdev->host->max_sectors, since | 700 | if (dev->max_sectors) |
700 | * other drives on this host may not support LBA48 | 701 | max_sectors = dev->max_sectors; |
701 | */ | 702 | |
702 | blk_queue_max_sectors(sdev->request_queue, 2048); | 703 | blk_queue_max_sectors(sdev->request_queue, max_sectors); |
703 | } | ||
704 | 704 | ||
705 | /* | 705 | /* |
706 | * SATA DMA transfers must be multiples of 4 byte, so | 706 | * SATA DMA transfers must be multiples of 4 byte, so |
@@ -1806,15 +1806,12 @@ static int ata_dev_supports_fua(u16 *id) | |||
1806 | if (!ata_id_has_fua(id)) | 1806 | if (!ata_id_has_fua(id)) |
1807 | return 0; | 1807 | return 0; |
1808 | 1808 | ||
1809 | model[40] = '\0'; | 1809 | ata_dev_id_c_string(id, model, ATA_ID_PROD_OFS, sizeof(model)); |
1810 | fw[8] = '\0'; | 1810 | ata_dev_id_c_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw)); |
1811 | |||
1812 | ata_dev_id_string(id, model, ATA_ID_PROD_OFS, sizeof(model) - 1); | ||
1813 | ata_dev_id_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw) - 1); | ||
1814 | 1811 | ||
1815 | if (strncmp(model, "Maxtor", 6)) | 1812 | if (strcmp(model, "Maxtor")) |
1816 | return 1; | 1813 | return 1; |
1817 | if (strncmp(fw, "BANC1G10", 8)) | 1814 | if (strcmp(fw, "BANC1G10")) |
1818 | return 1; | 1815 | return 1; |
1819 | 1816 | ||
1820 | return 0; /* blacklisted */ | 1817 | return 0; /* blacklisted */ |
@@ -2149,7 +2146,7 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2149 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); | 2146 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); |
2150 | qc->dma_dir = DMA_FROM_DEVICE; | 2147 | qc->dma_dir = DMA_FROM_DEVICE; |
2151 | 2148 | ||
2152 | memset(&qc->cdb, 0, ap->cdb_len); | 2149 | memset(&qc->cdb, 0, qc->dev->cdb_len); |
2153 | qc->cdb[0] = REQUEST_SENSE; | 2150 | qc->cdb[0] = REQUEST_SENSE; |
2154 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; | 2151 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; |
2155 | 2152 | ||
@@ -2251,7 +2248,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) | |||
2251 | if (ata_check_atapi_dma(qc)) | 2248 | if (ata_check_atapi_dma(qc)) |
2252 | using_pio = 1; | 2249 | using_pio = 1; |
2253 | 2250 | ||
2254 | memcpy(&qc->cdb, scsicmd, qc->ap->cdb_len); | 2251 | memcpy(&qc->cdb, scsicmd, dev->cdb_len); |
2255 | 2252 | ||
2256 | qc->complete_fn = atapi_qc_complete; | 2253 | qc->complete_fn = atapi_qc_complete; |
2257 | 2254 | ||
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c index 0f7e45a39fd9..f32af5dc58c4 100644 --- a/drivers/scsi/pdc_adma.c +++ b/drivers/scsi/pdc_adma.c | |||
@@ -148,7 +148,6 @@ static struct scsi_host_template adma_ata_sht = { | |||
148 | .can_queue = ATA_DEF_QUEUE, | 148 | .can_queue = ATA_DEF_QUEUE, |
149 | .this_id = ATA_SHT_THIS_ID, | 149 | .this_id = ATA_SHT_THIS_ID, |
150 | .sg_tablesize = LIBATA_MAX_PRD, | 150 | .sg_tablesize = LIBATA_MAX_PRD, |
151 | .max_sectors = ATA_MAX_SECTORS, | ||
152 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 151 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
153 | .emulated = ATA_SHT_EMULATED, | 152 | .emulated = ATA_SHT_EMULATED, |
154 | .use_clustering = ENABLE_CLUSTERING, | 153 | .use_clustering = ENABLE_CLUSTERING, |
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c index d35460ff5275..e05751e7aad4 100644 --- a/drivers/scsi/sata_mv.c +++ b/drivers/scsi/sata_mv.c | |||
@@ -383,7 +383,6 @@ static struct scsi_host_template mv_sht = { | |||
383 | .can_queue = MV_USE_Q_DEPTH, | 383 | .can_queue = MV_USE_Q_DEPTH, |
384 | .this_id = ATA_SHT_THIS_ID, | 384 | .this_id = ATA_SHT_THIS_ID, |
385 | .sg_tablesize = MV_MAX_SG_CT / 2, | 385 | .sg_tablesize = MV_MAX_SG_CT / 2, |
386 | .max_sectors = ATA_MAX_SECTORS, | ||
387 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 386 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
388 | .emulated = ATA_SHT_EMULATED, | 387 | .emulated = ATA_SHT_EMULATED, |
389 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 388 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c index 94dc2e1a8f30..5168db981dde 100644 --- a/drivers/scsi/sata_nv.c +++ b/drivers/scsi/sata_nv.c | |||
@@ -234,7 +234,6 @@ static struct scsi_host_template nv_sht = { | |||
234 | .can_queue = ATA_DEF_QUEUE, | 234 | .can_queue = ATA_DEF_QUEUE, |
235 | .this_id = ATA_SHT_THIS_ID, | 235 | .this_id = ATA_SHT_THIS_ID, |
236 | .sg_tablesize = LIBATA_MAX_PRD, | 236 | .sg_tablesize = LIBATA_MAX_PRD, |
237 | .max_sectors = ATA_MAX_SECTORS, | ||
238 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 237 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
239 | .emulated = ATA_SHT_EMULATED, | 238 | .emulated = ATA_SHT_EMULATED, |
240 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 239 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index a88b563ebcc4..7fa807d7d9e1 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -117,7 +117,6 @@ static struct scsi_host_template pdc_ata_sht = { | |||
117 | .can_queue = ATA_DEF_QUEUE, | 117 | .can_queue = ATA_DEF_QUEUE, |
118 | .this_id = ATA_SHT_THIS_ID, | 118 | .this_id = ATA_SHT_THIS_ID, |
119 | .sg_tablesize = LIBATA_MAX_PRD, | 119 | .sg_tablesize = LIBATA_MAX_PRD, |
120 | .max_sectors = ATA_MAX_SECTORS, | ||
121 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 120 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
122 | .emulated = ATA_SHT_EMULATED, | 121 | .emulated = ATA_SHT_EMULATED, |
123 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 122 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c index 5730167d2e74..bfc1dc8e7779 100644 --- a/drivers/scsi/sata_qstor.c +++ b/drivers/scsi/sata_qstor.c | |||
@@ -137,7 +137,6 @@ static struct scsi_host_template qs_ata_sht = { | |||
137 | .can_queue = ATA_DEF_QUEUE, | 137 | .can_queue = ATA_DEF_QUEUE, |
138 | .this_id = ATA_SHT_THIS_ID, | 138 | .this_id = ATA_SHT_THIS_ID, |
139 | .sg_tablesize = QS_MAX_PRD, | 139 | .sg_tablesize = QS_MAX_PRD, |
140 | .max_sectors = ATA_MAX_SECTORS, | ||
141 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 140 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
142 | .emulated = ATA_SHT_EMULATED, | 141 | .emulated = ATA_SHT_EMULATED, |
143 | //FIXME .use_clustering = ATA_SHT_USE_CLUSTERING, | 142 | //FIXME .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bd2887741d78..15346888faf2 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c | |||
@@ -140,7 +140,6 @@ static struct scsi_host_template sil_sht = { | |||
140 | .can_queue = ATA_DEF_QUEUE, | 140 | .can_queue = ATA_DEF_QUEUE, |
141 | .this_id = ATA_SHT_THIS_ID, | 141 | .this_id = ATA_SHT_THIS_ID, |
142 | .sg_tablesize = LIBATA_MAX_PRD, | 142 | .sg_tablesize = LIBATA_MAX_PRD, |
143 | .max_sectors = ATA_MAX_SECTORS, | ||
144 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 143 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
145 | .emulated = ATA_SHT_EMULATED, | 144 | .emulated = ATA_SHT_EMULATED, |
146 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 145 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
@@ -337,22 +336,13 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | |||
337 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | 336 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) |
338 | { | 337 | { |
339 | unsigned int n, quirks = 0; | 338 | unsigned int n, quirks = 0; |
340 | unsigned char model_num[40]; | 339 | unsigned char model_num[41]; |
341 | const char *s; | ||
342 | unsigned int len; | ||
343 | 340 | ||
344 | ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, | 341 | ata_dev_id_c_string(dev->id, model_num, ATA_ID_PROD_OFS, |
345 | sizeof(model_num)); | 342 | sizeof(model_num)); |
346 | s = &model_num[0]; | ||
347 | len = strnlen(s, sizeof(model_num)); | ||
348 | |||
349 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | ||
350 | while ((len > 0) && (s[len - 1] == ' ')) | ||
351 | len--; | ||
352 | 343 | ||
353 | for (n = 0; sil_blacklist[n].product; n++) | 344 | for (n = 0; sil_blacklist[n].product; n++) |
354 | if (!memcmp(sil_blacklist[n].product, s, | 345 | if (!strcmp(sil_blacklist[n].product, model_num)) { |
355 | strlen(sil_blacklist[n].product))) { | ||
356 | quirks = sil_blacklist[n].quirk; | 346 | quirks = sil_blacklist[n].quirk; |
357 | break; | 347 | break; |
358 | } | 348 | } |
@@ -363,16 +353,14 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | |||
363 | (quirks & SIL_QUIRK_MOD15WRITE))) { | 353 | (quirks & SIL_QUIRK_MOD15WRITE))) { |
364 | printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n", | 354 | printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n", |
365 | ap->id, dev->devno); | 355 | ap->id, dev->devno); |
366 | ap->host->max_sectors = 15; | 356 | dev->max_sectors = 15; |
367 | ap->host->hostt->max_sectors = 15; | ||
368 | dev->flags |= ATA_DFLAG_LOCK_SECTORS; | ||
369 | return; | 357 | return; |
370 | } | 358 | } |
371 | 359 | ||
372 | /* limit to udma5 */ | 360 | /* limit to udma5 */ |
373 | if (quirks & SIL_QUIRK_UDMA5MAX) { | 361 | if (quirks & SIL_QUIRK_UDMA5MAX) { |
374 | printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n", | 362 | printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n", |
375 | ap->id, dev->devno, s); | 363 | ap->id, dev->devno, model_num); |
376 | ap->udma_mask &= ATA_UDMA5; | 364 | ap->udma_mask &= ATA_UDMA5; |
377 | return; | 365 | return; |
378 | } | 366 | } |
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 228a7fabffff..a0e35a262156 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -285,7 +285,6 @@ static struct scsi_host_template sil24_sht = { | |||
285 | .can_queue = ATA_DEF_QUEUE, | 285 | .can_queue = ATA_DEF_QUEUE, |
286 | .this_id = ATA_SHT_THIS_ID, | 286 | .this_id = ATA_SHT_THIS_ID, |
287 | .sg_tablesize = LIBATA_MAX_PRD, | 287 | .sg_tablesize = LIBATA_MAX_PRD, |
288 | .max_sectors = ATA_MAX_SECTORS, | ||
289 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 288 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
290 | .emulated = ATA_SHT_EMULATED, | 289 | .emulated = ATA_SHT_EMULATED, |
291 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 290 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
@@ -371,7 +370,7 @@ static void sil24_dev_config(struct ata_port *ap, struct ata_device *dev) | |||
371 | { | 370 | { |
372 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; | 371 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
373 | 372 | ||
374 | if (ap->cdb_len == 16) | 373 | if (dev->cdb_len == 16) |
375 | writel(PORT_CS_CDB16, port + PORT_CTRL_STAT); | 374 | writel(PORT_CS_CDB16, port + PORT_CTRL_STAT); |
376 | else | 375 | else |
377 | writel(PORT_CS_CDB16, port + PORT_CTRL_CLR); | 376 | writel(PORT_CS_CDB16, port + PORT_CTRL_CLR); |
@@ -543,7 +542,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) | |||
543 | prb = &cb->atapi.prb; | 542 | prb = &cb->atapi.prb; |
544 | sge = cb->atapi.sge; | 543 | sge = cb->atapi.sge; |
545 | memset(cb->atapi.cdb, 0, 32); | 544 | memset(cb->atapi.cdb, 0, 32); |
546 | memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len); | 545 | memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len); |
547 | 546 | ||
548 | if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { | 547 | if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { |
549 | if (qc->tf.flags & ATA_TFLAG_WRITE) | 548 | if (qc->tf.flags & ATA_TFLAG_WRITE) |
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index 2f1815715705..7fd45f86de99 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c | |||
@@ -92,7 +92,6 @@ static struct scsi_host_template sis_sht = { | |||
92 | .can_queue = ATA_DEF_QUEUE, | 92 | .can_queue = ATA_DEF_QUEUE, |
93 | .this_id = ATA_SHT_THIS_ID, | 93 | .this_id = ATA_SHT_THIS_ID, |
94 | .sg_tablesize = ATA_MAX_PRD, | 94 | .sg_tablesize = ATA_MAX_PRD, |
95 | .max_sectors = ATA_MAX_SECTORS, | ||
96 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 95 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
97 | .emulated = ATA_SHT_EMULATED, | 96 | .emulated = ATA_SHT_EMULATED, |
98 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 97 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c index f369c3003adf..4aaccd53e736 100644 --- a/drivers/scsi/sata_svw.c +++ b/drivers/scsi/sata_svw.c | |||
@@ -293,7 +293,6 @@ static struct scsi_host_template k2_sata_sht = { | |||
293 | .can_queue = ATA_DEF_QUEUE, | 293 | .can_queue = ATA_DEF_QUEUE, |
294 | .this_id = ATA_SHT_THIS_ID, | 294 | .this_id = ATA_SHT_THIS_ID, |
295 | .sg_tablesize = LIBATA_MAX_PRD, | 295 | .sg_tablesize = LIBATA_MAX_PRD, |
296 | .max_sectors = ATA_MAX_SECTORS, | ||
297 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 296 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
298 | .emulated = ATA_SHT_EMULATED, | 297 | .emulated = ATA_SHT_EMULATED, |
299 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 298 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index 04465fb86e1d..60ebe5ce32c4 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -187,7 +187,6 @@ static struct scsi_host_template pdc_sata_sht = { | |||
187 | .can_queue = ATA_DEF_QUEUE, | 187 | .can_queue = ATA_DEF_QUEUE, |
188 | .this_id = ATA_SHT_THIS_ID, | 188 | .this_id = ATA_SHT_THIS_ID, |
189 | .sg_tablesize = LIBATA_MAX_PRD, | 189 | .sg_tablesize = LIBATA_MAX_PRD, |
190 | .max_sectors = ATA_MAX_SECTORS, | ||
191 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 190 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
192 | .emulated = ATA_SHT_EMULATED, | 191 | .emulated = ATA_SHT_EMULATED, |
193 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 192 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c index c500f2490902..37a487b7d655 100644 --- a/drivers/scsi/sata_uli.c +++ b/drivers/scsi/sata_uli.c | |||
@@ -80,7 +80,6 @@ static struct scsi_host_template uli_sht = { | |||
80 | .can_queue = ATA_DEF_QUEUE, | 80 | .can_queue = ATA_DEF_QUEUE, |
81 | .this_id = ATA_SHT_THIS_ID, | 81 | .this_id = ATA_SHT_THIS_ID, |
82 | .sg_tablesize = LIBATA_MAX_PRD, | 82 | .sg_tablesize = LIBATA_MAX_PRD, |
83 | .max_sectors = ATA_MAX_SECTORS, | ||
84 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 83 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
85 | .emulated = ATA_SHT_EMULATED, | 84 | .emulated = ATA_SHT_EMULATED, |
86 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 85 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c index 2e20887dc88f..ff65a0b0457f 100644 --- a/drivers/scsi/sata_via.c +++ b/drivers/scsi/sata_via.c | |||
@@ -99,7 +99,6 @@ static struct scsi_host_template svia_sht = { | |||
99 | .can_queue = ATA_DEF_QUEUE, | 99 | .can_queue = ATA_DEF_QUEUE, |
100 | .this_id = ATA_SHT_THIS_ID, | 100 | .this_id = ATA_SHT_THIS_ID, |
101 | .sg_tablesize = LIBATA_MAX_PRD, | 101 | .sg_tablesize = LIBATA_MAX_PRD, |
102 | .max_sectors = ATA_MAX_SECTORS, | ||
103 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 102 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
104 | .emulated = ATA_SHT_EMULATED, | 103 | .emulated = ATA_SHT_EMULATED, |
105 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 104 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c index 4cfc03018ca3..976a6b124af9 100644 --- a/drivers/scsi/sata_vsc.c +++ b/drivers/scsi/sata_vsc.c | |||
@@ -228,7 +228,6 @@ static struct scsi_host_template vsc_sata_sht = { | |||
228 | .can_queue = ATA_DEF_QUEUE, | 228 | .can_queue = ATA_DEF_QUEUE, |
229 | .this_id = ATA_SHT_THIS_ID, | 229 | .this_id = ATA_SHT_THIS_ID, |
230 | .sg_tablesize = LIBATA_MAX_PRD, | 230 | .sg_tablesize = LIBATA_MAX_PRD, |
231 | .max_sectors = ATA_MAX_SECTORS, | ||
232 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 231 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
233 | .emulated = ATA_SHT_EMULATED, | 232 | .emulated = ATA_SHT_EMULATED, |
234 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 233 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 3e153d313bb0..e64ed16bd42f 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -525,11 +525,6 @@ config FB_GBE_MEM | |||
525 | This is the amount of memory reserved for the framebuffer, | 525 | This is the amount of memory reserved for the framebuffer, |
526 | which can be any value between 1MB and 8MB. | 526 | which can be any value between 1MB and 8MB. |
527 | 527 | ||
528 | config BUS_I2C | ||
529 | bool | ||
530 | depends on (FB = y) && VISWS | ||
531 | default y | ||
532 | |||
533 | config FB_SUN3 | 528 | config FB_SUN3 |
534 | bool "Sun3 framebuffer support" | 529 | bool "Sun3 framebuffer support" |
535 | depends on (FB = y) && (SUN3 || SUN3X) && BROKEN | 530 | depends on (FB = y) && (SUN3 || SUN3X) && BROKEN |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2dede6ed3e5..996c7b58564e 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1550,6 +1550,7 @@ int fb_get_options(char *name, char **option) | |||
1550 | return retval; | 1550 | return retval; |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | #ifndef MODULE | ||
1553 | /** | 1554 | /** |
1554 | * video_setup - process command line options | 1555 | * video_setup - process command line options |
1555 | * @options: string of options | 1556 | * @options: string of options |
@@ -1593,6 +1594,7 @@ static int __init video_setup(char *options) | |||
1593 | return 0; | 1594 | return 0; |
1594 | } | 1595 | } |
1595 | __setup("video=", video_setup); | 1596 | __setup("video=", video_setup); |
1597 | #endif | ||
1596 | 1598 | ||
1597 | /* | 1599 | /* |
1598 | * Visible symbols for modules | 1600 | * Visible symbols for modules |
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index dbcb8962e57d..a7c4e5e8ead6 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -138,6 +138,8 @@ static struct pci_device_id nvidiafb_pci_tbl[] = { | |||
138 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 138 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
139 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X, | 139 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X, |
140 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 140 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
141 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000, | ||
142 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
141 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO, | 143 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO, |
142 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 144 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
143 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO, | 145 | {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO, |