aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorGreg KH <gregkh@suse.de>2005-09-12 15:45:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-12 15:45:04 -0400
commitd58dde0f552a5c5c4485b962d8b6e9dd54fefb30 (patch)
treed9a7e35eb88fea6265d5aadcc3d4ed39122b052a /drivers/block
parent877599fdef5ea4a7dd1956e22fa9d6923add97f8 (diff)
parent2ade81473636b33aaac64495f89a7dc572c529f0 (diff)
Merge ../torvalds-2.6/
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/acsi.c2
-rw-r--r--drivers/block/acsi_slm.c2
-rw-r--r--drivers/block/ataflop.c14
-rw-r--r--drivers/block/cciss.c7
-rw-r--r--drivers/block/cfq-iosched.c3
-rw-r--r--drivers/block/deadline-iosched.c5
-rw-r--r--drivers/block/floppy.c4
-rw-r--r--drivers/block/paride/pcd.c3
-rw-r--r--drivers/block/paride/pf.c3
-rw-r--r--drivers/block/paride/pg.c3
-rw-r--r--drivers/block/paride/pt.c3
-rw-r--r--drivers/block/ps2esdi.c3
-rw-r--r--drivers/block/swim3.c9
-rw-r--r--drivers/block/swim_iop.c3
-rw-r--r--drivers/block/umem.c11
-rw-r--r--drivers/block/xd.c21
-rw-r--r--drivers/block/z2ram.c2
17 files changed, 40 insertions, 58 deletions
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index ce933de48084..0e1f34fef0c8 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -371,7 +371,7 @@ static int acsi_revalidate (struct gendisk *disk);
371/************************* End of Prototypes **************************/ 371/************************* End of Prototypes **************************/
372 372
373 373
374struct timer_list acsi_timer = TIMER_INITIALIZER(acsi_times_out, 0, 0); 374DEFINE_TIMER(acsi_timer, acsi_times_out, 0, 0);
375 375
376 376
377#ifdef CONFIG_ATARI_SLM 377#ifdef CONFIG_ATARI_SLM
diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c
index e3be8c31a74c..a5c1c8e871ec 100644
--- a/drivers/block/acsi_slm.c
+++ b/drivers/block/acsi_slm.c
@@ -268,7 +268,7 @@ static int slm_get_pagesize( int device, int *w, int *h );
268/************************* End of Prototypes **************************/ 268/************************* End of Prototypes **************************/
269 269
270 270
271static struct timer_list slm_timer = TIMER_INITIALIZER(slm_test_ready, 0, 0); 271static DEFINE_TIMER(slm_timer, slm_test_ready, 0, 0);
272 272
273static struct file_operations slm_fops = { 273static struct file_operations slm_fops = {
274 .owner = THIS_MODULE, 274 .owner = THIS_MODULE,
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index db05a5a99f35..22bda05fc693 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -371,16 +371,10 @@ static int floppy_release( struct inode * inode, struct file * filp );
371 371
372/************************* End of Prototypes **************************/ 372/************************* End of Prototypes **************************/
373 373
374static struct timer_list motor_off_timer = 374static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
375 TIMER_INITIALIZER(fd_motor_off_timer, 0, 0); 375static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
376static struct timer_list readtrack_timer = 376static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
377 TIMER_INITIALIZER(fd_readtrack_check, 0, 0); 377static DEFINE_TIMER(fd_timer, check_change, 0, 0);
378
379static struct timer_list timeout_timer =
380 TIMER_INITIALIZER(fd_times_out, 0, 0);
381
382static struct timer_list fd_timer =
383 TIMER_INITIALIZER(check_change, 0, 0);
384 378
385static inline void start_motor_off_timer(void) 379static inline void start_motor_off_timer(void)
386{ 380{
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 418b1469d75d..28f2c177a541 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1713,10 +1713,9 @@ static unsigned long pollcomplete(int ctlr)
1713 1713
1714 for (i = 20 * HZ; i > 0; i--) { 1714 for (i = 20 * HZ; i > 0; i--) {
1715 done = hba[ctlr]->access.command_completed(hba[ctlr]); 1715 done = hba[ctlr]->access.command_completed(hba[ctlr]);
1716 if (done == FIFO_EMPTY) { 1716 if (done == FIFO_EMPTY)
1717 set_current_state(TASK_UNINTERRUPTIBLE); 1717 schedule_timeout_uninterruptible(1);
1718 schedule_timeout(1); 1718 else
1719 } else
1720 return (done); 1719 return (done);
1721 } 1720 }
1722 /* Invalid address to tell caller we ran out of time */ 1721 /* Invalid address to tell caller we ran out of time */
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 30c0903c7cdd..cd056e7e64ec 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -2260,6 +2260,8 @@ static void cfq_put_cfqd(struct cfq_data *cfqd)
2260 if (!atomic_dec_and_test(&cfqd->ref)) 2260 if (!atomic_dec_and_test(&cfqd->ref))
2261 return; 2261 return;
2262 2262
2263 blk_put_queue(q);
2264
2263 cfq_shutdown_timer_wq(cfqd); 2265 cfq_shutdown_timer_wq(cfqd);
2264 q->elevator->elevator_data = NULL; 2266 q->elevator->elevator_data = NULL;
2265 2267
@@ -2316,6 +2318,7 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
2316 e->elevator_data = cfqd; 2318 e->elevator_data = cfqd;
2317 2319
2318 cfqd->queue = q; 2320 cfqd->queue = q;
2321 atomic_inc(&q->refcnt);
2319 2322
2320 cfqd->max_queued = q->nr_requests / 4; 2323 cfqd->max_queued = q->nr_requests / 4;
2321 q->nr_batching = cfq_queued; 2324 q->nr_batching = cfq_queued;
diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
index 24594c57c323..52a3ae5289a0 100644
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -512,7 +512,10 @@ static int deadline_dispatch_requests(struct deadline_data *dd)
512 /* 512 /*
513 * batches are currently reads XOR writes 513 * batches are currently reads XOR writes
514 */ 514 */
515 drq = dd->next_drq[WRITE] ? : dd->next_drq[READ]; 515 if (dd->next_drq[WRITE])
516 drq = dd->next_drq[WRITE];
517 else
518 drq = dd->next_drq[READ];
516 519
517 if (drq) { 520 if (drq) {
518 /* we have a "next request" */ 521 /* we have a "next request" */
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 888dad5eef34..00895477155e 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -628,7 +628,7 @@ static inline void debugt(const char *message) { }
628#endif /* DEBUGT */ 628#endif /* DEBUGT */
629 629
630typedef void (*timeout_fn) (unsigned long); 630typedef void (*timeout_fn) (unsigned long);
631static struct timer_list fd_timeout = TIMER_INITIALIZER(floppy_shutdown, 0, 0); 631static DEFINE_TIMER(fd_timeout, floppy_shutdown, 0, 0);
632 632
633static const char *timeout_message; 633static const char *timeout_message;
634 634
@@ -1012,7 +1012,7 @@ static void schedule_bh(void (*handler) (void))
1012 schedule_work(&floppy_work); 1012 schedule_work(&floppy_work);
1013} 1013}
1014 1014
1015static struct timer_list fd_timer = TIMER_INITIALIZER(NULL, 0, 0); 1015static DEFINE_TIMER(fd_timer, NULL, 0, 0);
1016 1016
1017static void cancel_activity(void) 1017static void cancel_activity(void)
1018{ 1018{
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 7289f67e9568..ac5ba462710b 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -516,8 +516,7 @@ static int pcd_tray_move(struct cdrom_device_info *cdi, int position)
516 516
517static void pcd_sleep(int cs) 517static void pcd_sleep(int cs)
518{ 518{
519 current->state = TASK_INTERRUPTIBLE; 519 schedule_timeout_interruptible(cs);
520 schedule_timeout(cs);
521} 520}
522 521
523static int pcd_reset(struct pcd_unit *cd) 522static int pcd_reset(struct pcd_unit *cd)
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 060b1f2a91dd..711d2f314ac3 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -507,8 +507,7 @@ static void pf_eject(struct pf_unit *pf)
507 507
508static void pf_sleep(int cs) 508static void pf_sleep(int cs)
509{ 509{
510 current->state = TASK_INTERRUPTIBLE; 510 schedule_timeout_interruptible(cs);
511 schedule_timeout(cs);
512} 511}
513 512
514/* the ATAPI standard actually specifies the contents of all 7 registers 513/* the ATAPI standard actually specifies the contents of all 7 registers
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 84d8e291ed96..b3982395f22b 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -276,8 +276,7 @@ static inline u8 DRIVE(struct pg *dev)
276 276
277static void pg_sleep(int cs) 277static void pg_sleep(int cs)
278{ 278{
279 current->state = TASK_INTERRUPTIBLE; 279 schedule_timeout_interruptible(cs);
280 schedule_timeout(cs);
281} 280}
282 281
283static int pg_wait(struct pg *dev, int go, int stop, unsigned long tmo, char *msg) 282static int pg_wait(struct pg *dev, int go, int stop, unsigned long tmo, char *msg)
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 5fe8ee86f095..d8d35233cf49 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -383,8 +383,7 @@ static int pt_atapi(struct pt_unit *tape, char *cmd, int dlen, char *buf, char *
383 383
384static void pt_sleep(int cs) 384static void pt_sleep(int cs)
385{ 385{
386 current->state = TASK_INTERRUPTIBLE; 386 schedule_timeout_interruptible(cs);
387 schedule_timeout(cs);
388} 387}
389 388
390static int pt_poll_dsc(struct pt_unit *tape, int pause, int tmo, char *msg) 389static int pt_poll_dsc(struct pt_unit *tape, int pause, int tmo, char *msg)
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 29548784cb7b..29d1518be72a 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -99,8 +99,7 @@ static DECLARE_WAIT_QUEUE_HEAD(ps2esdi_int);
99static int no_int_yet; 99static int no_int_yet;
100static int ps2esdi_drives; 100static int ps2esdi_drives;
101static u_short io_base; 101static u_short io_base;
102static struct timer_list esdi_timer = 102static DEFINE_TIMER(esdi_timer, ps2esdi_reset_timer, 0, 0);
103 TIMER_INITIALIZER(ps2esdi_reset_timer, 0, 0);
104static int reset_status; 103static int reset_status;
105static int ps2esdi_slot = -1; 104static int ps2esdi_slot = -1;
106static int tp720esdi = 0; /* Is it Integrated ESDI of ThinkPad-720? */ 105static int tp720esdi = 0; /* Is it Integrated ESDI of ThinkPad-720? */
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index e5f7494c00ee..e425ad3eebba 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -834,8 +834,7 @@ static int fd_eject(struct floppy_state *fs)
834 break; 834 break;
835 } 835 }
836 swim3_select(fs, RELAX); 836 swim3_select(fs, RELAX);
837 current->state = TASK_INTERRUPTIBLE; 837 schedule_timeout_interruptible(1);
838 schedule_timeout(1);
839 if (swim3_readbit(fs, DISK_IN) == 0) 838 if (swim3_readbit(fs, DISK_IN) == 0)
840 break; 839 break;
841 } 840 }
@@ -906,8 +905,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
906 break; 905 break;
907 } 906 }
908 swim3_select(fs, RELAX); 907 swim3_select(fs, RELAX);
909 current->state = TASK_INTERRUPTIBLE; 908 schedule_timeout_interruptible(1);
910 schedule_timeout(1);
911 } 909 }
912 if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0 910 if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0
913 || swim3_readbit(fs, DISK_IN) == 0)) 911 || swim3_readbit(fs, DISK_IN) == 0))
@@ -992,8 +990,7 @@ static int floppy_revalidate(struct gendisk *disk)
992 if (signal_pending(current)) 990 if (signal_pending(current))
993 break; 991 break;
994 swim3_select(fs, RELAX); 992 swim3_select(fs, RELAX);
995 current->state = TASK_INTERRUPTIBLE; 993 schedule_timeout_interruptible(1);
996 schedule_timeout(1);
997 } 994 }
998 ret = swim3_readbit(fs, SEEK_COMPLETE) == 0 995 ret = swim3_readbit(fs, SEEK_COMPLETE) == 0
999 || swim3_readbit(fs, DISK_IN) == 0; 996 || swim3_readbit(fs, DISK_IN) == 0;
diff --git a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c
index a1283f6dc018..89e3c2f8b776 100644
--- a/drivers/block/swim_iop.c
+++ b/drivers/block/swim_iop.c
@@ -338,8 +338,7 @@ static int swimiop_eject(struct floppy_state *fs)
338 err = -EINTR; 338 err = -EINTR;
339 break; 339 break;
340 } 340 }
341 current->state = TASK_INTERRUPTIBLE; 341 schedule_timeout_interruptible(1);
342 schedule_timeout(1);
343 } 342 }
344 release_drive(fs); 343 release_drive(fs);
345 return cmd->error; 344 return cmd->error;
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 0c4c121d2e79..0f48301342da 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -34,6 +34,7 @@
34 * - set initialised bit then. 34 * - set initialised bit then.
35 */ 35 */
36 36
37//#define DEBUG /* uncomment if you want debugging info (pr_debug) */
37#include <linux/config.h> 38#include <linux/config.h>
38#include <linux/sched.h> 39#include <linux/sched.h>
39#include <linux/fs.h> 40#include <linux/fs.h>
@@ -58,10 +59,6 @@
58#include <asm/uaccess.h> 59#include <asm/uaccess.h>
59#include <asm/io.h> 60#include <asm/io.h>
60 61
61#define PRINTK(x...) do {} while (0)
62#define dprintk(x...) do {} while (0)
63/*#define dprintk(x...) printk(x) */
64
65#define MM_MAXCARDS 4 62#define MM_MAXCARDS 4
66#define MM_RAHEAD 2 /* two sectors */ 63#define MM_RAHEAD 2 /* two sectors */
67#define MM_BLKSIZE 1024 /* 1k blocks */ 64#define MM_BLKSIZE 1024 /* 1k blocks */
@@ -299,7 +296,7 @@ static void mm_start_io(struct cardinfo *card)
299 296
300 /* make the last descriptor end the chain */ 297 /* make the last descriptor end the chain */
301 page = &card->mm_pages[card->Active]; 298 page = &card->mm_pages[card->Active];
302 PRINTK("start_io: %d %d->%d\n", card->Active, page->headcnt, page->cnt-1); 299 pr_debug("start_io: %d %d->%d\n", card->Active, page->headcnt, page->cnt-1);
303 desc = &page->desc[page->cnt-1]; 300 desc = &page->desc[page->cnt-1];
304 301
305 desc->control_bits |= cpu_to_le32(DMASCR_CHAIN_COMP_EN); 302 desc->control_bits |= cpu_to_le32(DMASCR_CHAIN_COMP_EN);
@@ -532,7 +529,7 @@ static void process_page(unsigned long data)
532 activate(card); 529 activate(card);
533 } else { 530 } else {
534 /* haven't finished with this one yet */ 531 /* haven't finished with this one yet */
535 PRINTK("do some more\n"); 532 pr_debug("do some more\n");
536 mm_start_io(card); 533 mm_start_io(card);
537 } 534 }
538 out_unlock: 535 out_unlock:
@@ -555,7 +552,7 @@ static void process_page(unsigned long data)
555static int mm_make_request(request_queue_t *q, struct bio *bio) 552static int mm_make_request(request_queue_t *q, struct bio *bio)
556{ 553{
557 struct cardinfo *card = q->queuedata; 554 struct cardinfo *card = q->queuedata;
558 PRINTK("mm_make_request %ld %d\n", bh->b_rsector, bh->b_size); 555 pr_debug("mm_make_request %ld %d\n", bh->b_rsector, bh->b_size);
559 556
560 bio->bi_phys_segments = bio->bi_idx; /* count of completed segments*/ 557 bio->bi_phys_segments = bio->bi_idx; /* count of completed segments*/
561 spin_lock_irq(&card->lock); 558 spin_lock_irq(&card->lock);
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 1676033da6c6..68b6d7b154cf 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -47,6 +47,7 @@
47#include <linux/wait.h> 47#include <linux/wait.h>
48#include <linux/blkdev.h> 48#include <linux/blkdev.h>
49#include <linux/blkpg.h> 49#include <linux/blkpg.h>
50#include <linux/delay.h>
50 51
51#include <asm/system.h> 52#include <asm/system.h>
52#include <asm/io.h> 53#include <asm/io.h>
@@ -62,7 +63,7 @@ static int xd[5] = { -1,-1,-1,-1, };
62 63
63#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using 64#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using
64 "nodma" module option */ 65 "nodma" module option */
65#define XD_INIT_DISK_DELAY (30*HZ/1000) /* 30 ms delay during disk initialization */ 66#define XD_INIT_DISK_DELAY (30) /* 30 ms delay during disk initialization */
66 67
67/* Above may need to be increased if a problem with the 2nd drive detection 68/* Above may need to be increased if a problem with the 2nd drive detection
68 (ST11M controller) or resetting a controller (WD) appears */ 69 (ST11M controller) or resetting a controller (WD) appears */
@@ -529,10 +530,8 @@ static inline u_char xd_waitport (u_short port,u_char flags,u_char mask,u_long t
529 int success; 530 int success;
530 531
531 xdc_busy = 1; 532 xdc_busy = 1;
532 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry)) { 533 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry))
533 set_current_state(TASK_UNINTERRUPTIBLE); 534 schedule_timeout_uninterruptible(1);
534 schedule_timeout(1);
535 }
536 xdc_busy = 0; 535 xdc_busy = 0;
537 return (success); 536 return (success);
538} 537}
@@ -633,14 +632,12 @@ static u_char __init xd_initdrives (void (*init_drive)(u_char drive))
633 for (i = 0; i < XD_MAXDRIVES; i++) { 632 for (i = 0; i < XD_MAXDRIVES; i++) {
634 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0); 633 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0);
635 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) { 634 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) {
636 set_current_state(TASK_INTERRUPTIBLE); 635 msleep_interruptible(XD_INIT_DISK_DELAY);
637 schedule_timeout(XD_INIT_DISK_DELAY);
638 636
639 init_drive(count); 637 init_drive(count);
640 count++; 638 count++;
641 639
642 set_current_state(TASK_INTERRUPTIBLE); 640 msleep_interruptible(XD_INIT_DISK_DELAY);
643 schedule_timeout(XD_INIT_DISK_DELAY);
644 } 641 }
645 } 642 }
646 return (count); 643 return (count);
@@ -761,8 +758,7 @@ static void __init xd_wd_init_controller (unsigned int address)
761 758
762 outb(0,XD_RESET); /* reset the controller */ 759 outb(0,XD_RESET); /* reset the controller */
763 760
764 set_current_state(TASK_UNINTERRUPTIBLE); 761 msleep(XD_INIT_DISK_DELAY);
765 schedule_timeout(XD_INIT_DISK_DELAY);
766} 762}
767 763
768static void __init xd_wd_init_drive (u_char drive) 764static void __init xd_wd_init_drive (u_char drive)
@@ -936,8 +932,7 @@ If you need non-standard settings use the xd=... command */
936 xd_maxsectors = 0x01; 932 xd_maxsectors = 0x01;
937 outb(0,XD_RESET); /* reset the controller */ 933 outb(0,XD_RESET); /* reset the controller */
938 934
939 set_current_state(TASK_UNINTERRUPTIBLE); 935 msleep(XD_INIT_DISK_DELAY);
940 schedule_timeout(XD_INIT_DISK_DELAY);
941} 936}
942 937
943static void __init xd_xebec_init_drive (u_char drive) 938static void __init xd_xebec_init_drive (u_char drive)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 007f6a662439..bb5e8d665a2a 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -296,7 +296,7 @@ z2_open( struct inode *inode, struct file *filp )
296 return 0; 296 return 0;
297 297
298err_out_kfree: 298err_out_kfree:
299 kfree( z2ram_map ); 299 kfree(z2ram_map);
300err_out: 300err_out:
301 return rc; 301 return rc;
302} 302}