diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
commit | 79072f38909e3d9883317238887460c39ddcc4cb (patch) | |
tree | 28369f5a844535ff836565eefd62695b0e890fa3 /drivers/ide | |
parent | 200d5a7684cc49ef4be40e832daf3f217e70dfbb (diff) | |
parent | 55d8ca4f8094246da6e71889a4e04bfafaa78b10 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 111 | ||||
-rw-r--r-- | drivers/ide/ide-disk.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 11 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 9 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 24 | ||||
-rw-r--r-- | drivers/ide/ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/generic.c | 3 | ||||
-rw-r--r-- | drivers/ide/pci/sis5513.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 2 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 2 |
12 files changed, 101 insertions, 88 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 3325660f7248..b4a41d6d0714 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -313,6 +313,7 @@ | |||
313 | #include <linux/cdrom.h> | 313 | #include <linux/cdrom.h> |
314 | #include <linux/ide.h> | 314 | #include <linux/ide.h> |
315 | #include <linux/completion.h> | 315 | #include <linux/completion.h> |
316 | #include <linux/mutex.h> | ||
316 | 317 | ||
317 | #include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */ | 318 | #include <scsi/scsi.h> /* For SCSI -> ATAPI command conversion */ |
318 | 319 | ||
@@ -324,7 +325,7 @@ | |||
324 | 325 | ||
325 | #include "ide-cd.h" | 326 | #include "ide-cd.h" |
326 | 327 | ||
327 | static DECLARE_MUTEX(idecd_ref_sem); | 328 | static DEFINE_MUTEX(idecd_ref_mutex); |
328 | 329 | ||
329 | #define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) | 330 | #define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) |
330 | 331 | ||
@@ -335,11 +336,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk) | |||
335 | { | 336 | { |
336 | struct cdrom_info *cd = NULL; | 337 | struct cdrom_info *cd = NULL; |
337 | 338 | ||
338 | down(&idecd_ref_sem); | 339 | mutex_lock(&idecd_ref_mutex); |
339 | cd = ide_cd_g(disk); | 340 | cd = ide_cd_g(disk); |
340 | if (cd) | 341 | if (cd) |
341 | kref_get(&cd->kref); | 342 | kref_get(&cd->kref); |
342 | up(&idecd_ref_sem); | 343 | mutex_unlock(&idecd_ref_mutex); |
343 | return cd; | 344 | return cd; |
344 | } | 345 | } |
345 | 346 | ||
@@ -347,9 +348,9 @@ static void ide_cd_release(struct kref *); | |||
347 | 348 | ||
348 | static void ide_cd_put(struct cdrom_info *cd) | 349 | static void ide_cd_put(struct cdrom_info *cd) |
349 | { | 350 | { |
350 | down(&idecd_ref_sem); | 351 | mutex_lock(&idecd_ref_mutex); |
351 | kref_put(&cd->kref, ide_cd_release); | 352 | kref_put(&cd->kref, ide_cd_release); |
352 | up(&idecd_ref_sem); | 353 | mutex_unlock(&idecd_ref_mutex); |
353 | } | 354 | } |
354 | 355 | ||
355 | /**************************************************************************** | 356 | /**************************************************************************** |
@@ -2142,6 +2143,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
2142 | req.cmd[0] = GPCMD_READ_CDVD_CAPACITY; | 2143 | req.cmd[0] = GPCMD_READ_CDVD_CAPACITY; |
2143 | req.data = (char *)&capbuf; | 2144 | req.data = (char *)&capbuf; |
2144 | req.data_len = sizeof(capbuf); | 2145 | req.data_len = sizeof(capbuf); |
2146 | req.flags |= REQ_QUIET; | ||
2145 | 2147 | ||
2146 | stat = cdrom_queue_packet_command(drive, &req); | 2148 | stat = cdrom_queue_packet_command(drive, &req); |
2147 | if (stat == 0) { | 2149 | if (stat == 0) { |
@@ -2471,52 +2473,6 @@ static int ide_cdrom_packet(struct cdrom_device_info *cdi, | |||
2471 | } | 2473 | } |
2472 | 2474 | ||
2473 | static | 2475 | static |
2474 | int ide_cdrom_dev_ioctl (struct cdrom_device_info *cdi, | ||
2475 | unsigned int cmd, unsigned long arg) | ||
2476 | { | ||
2477 | struct packet_command cgc; | ||
2478 | char buffer[16]; | ||
2479 | int stat; | ||
2480 | |||
2481 | init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_UNKNOWN); | ||
2482 | |||
2483 | /* These will be moved into the Uniform layer shortly... */ | ||
2484 | switch (cmd) { | ||
2485 | case CDROMSETSPINDOWN: { | ||
2486 | char spindown; | ||
2487 | |||
2488 | if (copy_from_user(&spindown, (void __user *) arg, sizeof(char))) | ||
2489 | return -EFAULT; | ||
2490 | |||
2491 | if ((stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CDROM_PAGE, 0))) | ||
2492 | return stat; | ||
2493 | |||
2494 | buffer[11] = (buffer[11] & 0xf0) | (spindown & 0x0f); | ||
2495 | |||
2496 | return cdrom_mode_select(cdi, &cgc); | ||
2497 | } | ||
2498 | |||
2499 | case CDROMGETSPINDOWN: { | ||
2500 | char spindown; | ||
2501 | |||
2502 | if ((stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CDROM_PAGE, 0))) | ||
2503 | return stat; | ||
2504 | |||
2505 | spindown = buffer[11] & 0x0f; | ||
2506 | |||
2507 | if (copy_to_user((void __user *) arg, &spindown, sizeof (char))) | ||
2508 | return -EFAULT; | ||
2509 | |||
2510 | return 0; | ||
2511 | } | ||
2512 | |||
2513 | default: | ||
2514 | return -EINVAL; | ||
2515 | } | ||
2516 | |||
2517 | } | ||
2518 | |||
2519 | static | ||
2520 | int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi, | 2476 | int ide_cdrom_audio_ioctl (struct cdrom_device_info *cdi, |
2521 | unsigned int cmd, void *arg) | 2477 | unsigned int cmd, void *arg) |
2522 | 2478 | ||
@@ -2852,12 +2808,11 @@ static struct cdrom_device_ops ide_cdrom_dops = { | |||
2852 | .get_mcn = ide_cdrom_get_mcn, | 2808 | .get_mcn = ide_cdrom_get_mcn, |
2853 | .reset = ide_cdrom_reset, | 2809 | .reset = ide_cdrom_reset, |
2854 | .audio_ioctl = ide_cdrom_audio_ioctl, | 2810 | .audio_ioctl = ide_cdrom_audio_ioctl, |
2855 | .dev_ioctl = ide_cdrom_dev_ioctl, | ||
2856 | .capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK | | 2811 | .capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK | |
2857 | CDC_SELECT_SPEED | CDC_SELECT_DISC | | 2812 | CDC_SELECT_SPEED | CDC_SELECT_DISC | |
2858 | CDC_MULTI_SESSION | CDC_MCN | | 2813 | CDC_MULTI_SESSION | CDC_MCN | |
2859 | CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET | | 2814 | CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET | |
2860 | CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R | | 2815 | CDC_DRIVE_STATUS | CDC_CD_R | |
2861 | CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM | | 2816 | CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM | |
2862 | CDC_GENERIC_PACKET | CDC_MO_DRIVE | CDC_MRW | | 2817 | CDC_GENERIC_PACKET | CDC_MO_DRIVE | CDC_MRW | |
2863 | CDC_MRW_W | CDC_RAM, | 2818 | CDC_MRW_W | CDC_RAM, |
@@ -3367,6 +3322,45 @@ static int idecd_release(struct inode * inode, struct file * file) | |||
3367 | return 0; | 3322 | return 0; |
3368 | } | 3323 | } |
3369 | 3324 | ||
3325 | static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg) | ||
3326 | { | ||
3327 | struct packet_command cgc; | ||
3328 | char buffer[16]; | ||
3329 | int stat; | ||
3330 | char spindown; | ||
3331 | |||
3332 | if (copy_from_user(&spindown, (void __user *)arg, sizeof(char))) | ||
3333 | return -EFAULT; | ||
3334 | |||
3335 | init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_UNKNOWN); | ||
3336 | |||
3337 | stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CDROM_PAGE, 0); | ||
3338 | if (stat) | ||
3339 | return stat; | ||
3340 | |||
3341 | buffer[11] = (buffer[11] & 0xf0) | (spindown & 0x0f); | ||
3342 | return cdrom_mode_select(cdi, &cgc); | ||
3343 | } | ||
3344 | |||
3345 | static int idecd_get_spindown(struct cdrom_device_info *cdi, unsigned long arg) | ||
3346 | { | ||
3347 | struct packet_command cgc; | ||
3348 | char buffer[16]; | ||
3349 | int stat; | ||
3350 | char spindown; | ||
3351 | |||
3352 | init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_UNKNOWN); | ||
3353 | |||
3354 | stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CDROM_PAGE, 0); | ||
3355 | if (stat) | ||
3356 | return stat; | ||
3357 | |||
3358 | spindown = buffer[11] & 0x0f; | ||
3359 | if (copy_to_user((void __user *)arg, &spindown, sizeof (char))) | ||
3360 | return -EFAULT; | ||
3361 | return 0; | ||
3362 | } | ||
3363 | |||
3370 | static int idecd_ioctl (struct inode *inode, struct file *file, | 3364 | static int idecd_ioctl (struct inode *inode, struct file *file, |
3371 | unsigned int cmd, unsigned long arg) | 3365 | unsigned int cmd, unsigned long arg) |
3372 | { | 3366 | { |
@@ -3374,7 +3368,16 @@ static int idecd_ioctl (struct inode *inode, struct file *file, | |||
3374 | struct cdrom_info *info = ide_cd_g(bdev->bd_disk); | 3368 | struct cdrom_info *info = ide_cd_g(bdev->bd_disk); |
3375 | int err; | 3369 | int err; |
3376 | 3370 | ||
3377 | err = generic_ide_ioctl(info->drive, file, bdev, cmd, arg); | 3371 | switch (cmd) { |
3372 | case CDROMSETSPINDOWN: | ||
3373 | return idecd_set_spindown(&info->devinfo, arg); | ||
3374 | case CDROMGETSPINDOWN: | ||
3375 | return idecd_get_spindown(&info->devinfo, arg); | ||
3376 | default: | ||
3377 | break; | ||
3378 | } | ||
3379 | |||
3380 | err = generic_ide_ioctl(info->drive, file, bdev, cmd, arg); | ||
3378 | if (err == -EINVAL) | 3381 | if (err == -EINVAL) |
3379 | err = cdrom_ioctl(file, &info->devinfo, inode, cmd, arg); | 3382 | err = cdrom_ioctl(file, &info->devinfo, inode, cmd, arg); |
3380 | 3383 | ||
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 09086b8b6486..ccf528d733bf 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/genhd.h> | 60 | #include <linux/genhd.h> |
61 | #include <linux/slab.h> | 61 | #include <linux/slab.h> |
62 | #include <linux/delay.h> | 62 | #include <linux/delay.h> |
63 | #include <linux/mutex.h> | ||
63 | 64 | ||
64 | #define _IDE_DISK | 65 | #define _IDE_DISK |
65 | 66 | ||
@@ -78,7 +79,7 @@ struct ide_disk_obj { | |||
78 | struct kref kref; | 79 | struct kref kref; |
79 | }; | 80 | }; |
80 | 81 | ||
81 | static DECLARE_MUTEX(idedisk_ref_sem); | 82 | static DEFINE_MUTEX(idedisk_ref_mutex); |
82 | 83 | ||
83 | #define to_ide_disk(obj) container_of(obj, struct ide_disk_obj, kref) | 84 | #define to_ide_disk(obj) container_of(obj, struct ide_disk_obj, kref) |
84 | 85 | ||
@@ -89,11 +90,11 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) | |||
89 | { | 90 | { |
90 | struct ide_disk_obj *idkp = NULL; | 91 | struct ide_disk_obj *idkp = NULL; |
91 | 92 | ||
92 | down(&idedisk_ref_sem); | 93 | mutex_lock(&idedisk_ref_mutex); |
93 | idkp = ide_disk_g(disk); | 94 | idkp = ide_disk_g(disk); |
94 | if (idkp) | 95 | if (idkp) |
95 | kref_get(&idkp->kref); | 96 | kref_get(&idkp->kref); |
96 | up(&idedisk_ref_sem); | 97 | mutex_unlock(&idedisk_ref_mutex); |
97 | return idkp; | 98 | return idkp; |
98 | } | 99 | } |
99 | 100 | ||
@@ -101,9 +102,9 @@ static void ide_disk_release(struct kref *); | |||
101 | 102 | ||
102 | static void ide_disk_put(struct ide_disk_obj *idkp) | 103 | static void ide_disk_put(struct ide_disk_obj *idkp) |
103 | { | 104 | { |
104 | down(&idedisk_ref_sem); | 105 | mutex_lock(&idedisk_ref_mutex); |
105 | kref_put(&idkp->kref, ide_disk_release); | 106 | kref_put(&idkp->kref, ide_disk_release); |
106 | up(&idedisk_ref_sem); | 107 | mutex_unlock(&idedisk_ref_mutex); |
107 | } | 108 | } |
108 | 109 | ||
109 | /* | 110 | /* |
@@ -977,8 +978,6 @@ static void idedisk_setup (ide_drive_t *drive) | |||
977 | ide_dma_verbose(drive); | 978 | ide_dma_verbose(drive); |
978 | printk("\n"); | 979 | printk("\n"); |
979 | 980 | ||
980 | drive->no_io_32bit = id->dword_io ? 1 : 0; | ||
981 | |||
982 | /* write cache enabled? */ | 981 | /* write cache enabled? */ |
983 | if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5))) | 982 | if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5))) |
984 | drive->wcache = 1; | 983 | drive->wcache = 1; |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 0523da77425a..c481be8b807f 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -175,7 +175,7 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive) | |||
175 | if (rq->rq_disk) { | 175 | if (rq->rq_disk) { |
176 | ide_driver_t *drv; | 176 | ide_driver_t *drv; |
177 | 177 | ||
178 | drv = *(ide_driver_t **)rq->rq_disk->private_data;; | 178 | drv = *(ide_driver_t **)rq->rq_disk->private_data; |
179 | drv->end_request(drive, 1, rq->nr_sectors); | 179 | drv->end_request(drive, 1, rq->nr_sectors); |
180 | } else | 180 | } else |
181 | ide_end_request(drive, 1, rq->nr_sectors); | 181 | ide_end_request(drive, 1, rq->nr_sectors); |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 1f8db9ac05d1..a53e3ce4a142 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -98,6 +98,7 @@ | |||
98 | #include <linux/cdrom.h> | 98 | #include <linux/cdrom.h> |
99 | #include <linux/ide.h> | 99 | #include <linux/ide.h> |
100 | #include <linux/bitops.h> | 100 | #include <linux/bitops.h> |
101 | #include <linux/mutex.h> | ||
101 | 102 | ||
102 | #include <asm/byteorder.h> | 103 | #include <asm/byteorder.h> |
103 | #include <asm/irq.h> | 104 | #include <asm/irq.h> |
@@ -517,7 +518,7 @@ typedef struct { | |||
517 | u8 reserved[4]; | 518 | u8 reserved[4]; |
518 | } idefloppy_mode_parameter_header_t; | 519 | } idefloppy_mode_parameter_header_t; |
519 | 520 | ||
520 | static DECLARE_MUTEX(idefloppy_ref_sem); | 521 | static DEFINE_MUTEX(idefloppy_ref_mutex); |
521 | 522 | ||
522 | #define to_ide_floppy(obj) container_of(obj, struct ide_floppy_obj, kref) | 523 | #define to_ide_floppy(obj) container_of(obj, struct ide_floppy_obj, kref) |
523 | 524 | ||
@@ -528,11 +529,11 @@ static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk) | |||
528 | { | 529 | { |
529 | struct ide_floppy_obj *floppy = NULL; | 530 | struct ide_floppy_obj *floppy = NULL; |
530 | 531 | ||
531 | down(&idefloppy_ref_sem); | 532 | mutex_lock(&idefloppy_ref_mutex); |
532 | floppy = ide_floppy_g(disk); | 533 | floppy = ide_floppy_g(disk); |
533 | if (floppy) | 534 | if (floppy) |
534 | kref_get(&floppy->kref); | 535 | kref_get(&floppy->kref); |
535 | up(&idefloppy_ref_sem); | 536 | mutex_unlock(&idefloppy_ref_mutex); |
536 | return floppy; | 537 | return floppy; |
537 | } | 538 | } |
538 | 539 | ||
@@ -540,9 +541,9 @@ static void ide_floppy_release(struct kref *); | |||
540 | 541 | ||
541 | static void ide_floppy_put(struct ide_floppy_obj *floppy) | 542 | static void ide_floppy_put(struct ide_floppy_obj *floppy) |
542 | { | 543 | { |
543 | down(&idefloppy_ref_sem); | 544 | mutex_lock(&idefloppy_ref_mutex); |
544 | kref_put(&floppy->kref, ide_floppy_release); | 545 | kref_put(&floppy->kref, ide_floppy_release); |
545 | up(&idefloppy_ref_sem); | 546 | mutex_unlock(&idefloppy_ref_mutex); |
546 | } | 547 | } |
547 | 548 | ||
548 | /* | 549 | /* |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 427d1c204174..1b7b4c531bc2 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -858,6 +858,15 @@ static void probe_hwif(ide_hwif_t *hwif) | |||
858 | } | 858 | } |
859 | } | 859 | } |
860 | } | 860 | } |
861 | |||
862 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | ||
863 | ide_drive_t *drive = &hwif->drives[unit]; | ||
864 | |||
865 | if (hwif->no_io_32bit) | ||
866 | drive->no_io_32bit = 1; | ||
867 | else | ||
868 | drive->no_io_32bit = drive->id->dword_io ? 1 : 0; | ||
869 | } | ||
861 | } | 870 | } |
862 | 871 | ||
863 | static int hwif_init(ide_hwif_t *hwif); | 872 | static int hwif_init(ide_hwif_t *hwif); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 0101d0def7c5..f04791a58df0 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -433,6 +433,7 @@ | |||
433 | #include <linux/timer.h> | 433 | #include <linux/timer.h> |
434 | #include <linux/mm.h> | 434 | #include <linux/mm.h> |
435 | #include <linux/interrupt.h> | 435 | #include <linux/interrupt.h> |
436 | #include <linux/jiffies.h> | ||
436 | #include <linux/major.h> | 437 | #include <linux/major.h> |
437 | #include <linux/devfs_fs_kernel.h> | 438 | #include <linux/devfs_fs_kernel.h> |
438 | #include <linux/errno.h> | 439 | #include <linux/errno.h> |
@@ -443,6 +444,7 @@ | |||
443 | #include <linux/smp_lock.h> | 444 | #include <linux/smp_lock.h> |
444 | #include <linux/completion.h> | 445 | #include <linux/completion.h> |
445 | #include <linux/bitops.h> | 446 | #include <linux/bitops.h> |
447 | #include <linux/mutex.h> | ||
446 | 448 | ||
447 | #include <asm/byteorder.h> | 449 | #include <asm/byteorder.h> |
448 | #include <asm/irq.h> | 450 | #include <asm/irq.h> |
@@ -1011,7 +1013,7 @@ typedef struct ide_tape_obj { | |||
1011 | int debug_level; | 1013 | int debug_level; |
1012 | } idetape_tape_t; | 1014 | } idetape_tape_t; |
1013 | 1015 | ||
1014 | static DECLARE_MUTEX(idetape_ref_sem); | 1016 | static DEFINE_MUTEX(idetape_ref_mutex); |
1015 | 1017 | ||
1016 | static struct class *idetape_sysfs_class; | 1018 | static struct class *idetape_sysfs_class; |
1017 | 1019 | ||
@@ -1024,11 +1026,11 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk) | |||
1024 | { | 1026 | { |
1025 | struct ide_tape_obj *tape = NULL; | 1027 | struct ide_tape_obj *tape = NULL; |
1026 | 1028 | ||
1027 | down(&idetape_ref_sem); | 1029 | mutex_lock(&idetape_ref_mutex); |
1028 | tape = ide_tape_g(disk); | 1030 | tape = ide_tape_g(disk); |
1029 | if (tape) | 1031 | if (tape) |
1030 | kref_get(&tape->kref); | 1032 | kref_get(&tape->kref); |
1031 | up(&idetape_ref_sem); | 1033 | mutex_unlock(&idetape_ref_mutex); |
1032 | return tape; | 1034 | return tape; |
1033 | } | 1035 | } |
1034 | 1036 | ||
@@ -1036,9 +1038,9 @@ static void ide_tape_release(struct kref *); | |||
1036 | 1038 | ||
1037 | static void ide_tape_put(struct ide_tape_obj *tape) | 1039 | static void ide_tape_put(struct ide_tape_obj *tape) |
1038 | { | 1040 | { |
1039 | down(&idetape_ref_sem); | 1041 | mutex_lock(&idetape_ref_mutex); |
1040 | kref_put(&tape->kref, ide_tape_release); | 1042 | kref_put(&tape->kref, ide_tape_release); |
1041 | up(&idetape_ref_sem); | 1043 | mutex_unlock(&idetape_ref_mutex); |
1042 | } | 1044 | } |
1043 | 1045 | ||
1044 | /* | 1046 | /* |
@@ -1290,11 +1292,11 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i) | |||
1290 | { | 1292 | { |
1291 | struct ide_tape_obj *tape = NULL; | 1293 | struct ide_tape_obj *tape = NULL; |
1292 | 1294 | ||
1293 | down(&idetape_ref_sem); | 1295 | mutex_lock(&idetape_ref_mutex); |
1294 | tape = idetape_devs[i]; | 1296 | tape = idetape_devs[i]; |
1295 | if (tape) | 1297 | if (tape) |
1296 | kref_get(&tape->kref); | 1298 | kref_get(&tape->kref); |
1297 | up(&idetape_ref_sem); | 1299 | mutex_unlock(&idetape_ref_mutex); |
1298 | return tape; | 1300 | return tape; |
1299 | } | 1301 | } |
1300 | 1302 | ||
@@ -2335,7 +2337,7 @@ static ide_startstop_t idetape_rw_callback (ide_drive_t *drive) | |||
2335 | } | 2337 | } |
2336 | if (time_after(jiffies, tape->insert_time)) | 2338 | if (time_after(jiffies, tape->insert_time)) |
2337 | tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time); | 2339 | tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time); |
2338 | if (jiffies - tape->avg_time >= HZ) { | 2340 | if (time_after_eq(jiffies, tape->avg_time + HZ)) { |
2339 | tape->avg_speed = tape->avg_size * HZ / (jiffies - tape->avg_time) / 1024; | 2341 | tape->avg_speed = tape->avg_size * HZ / (jiffies - tape->avg_time) / 1024; |
2340 | tape->avg_size = 0; | 2342 | tape->avg_size = 0; |
2341 | tape->avg_time = jiffies; | 2343 | tape->avg_time = jiffies; |
@@ -2496,7 +2498,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
2496 | } else { | 2498 | } else { |
2497 | return ide_do_reset(drive); | 2499 | return ide_do_reset(drive); |
2498 | } | 2500 | } |
2499 | } else if (jiffies - tape->dsc_polling_start > IDETAPE_DSC_MA_THRESHOLD) | 2501 | } else if (time_after(jiffies, tape->dsc_polling_start + IDETAPE_DSC_MA_THRESHOLD)) |
2500 | tape->dsc_polling_frequency = IDETAPE_DSC_MA_SLOW; | 2502 | tape->dsc_polling_frequency = IDETAPE_DSC_MA_SLOW; |
2501 | idetape_postpone_request(drive); | 2503 | idetape_postpone_request(drive); |
2502 | return ide_stopped; | 2504 | return ide_stopped; |
@@ -4870,11 +4872,11 @@ static int ide_tape_probe(ide_drive_t *drive) | |||
4870 | 4872 | ||
4871 | drive->driver_data = tape; | 4873 | drive->driver_data = tape; |
4872 | 4874 | ||
4873 | down(&idetape_ref_sem); | 4875 | mutex_lock(&idetape_ref_mutex); |
4874 | for (minor = 0; idetape_devs[minor]; minor++) | 4876 | for (minor = 0; idetape_devs[minor]; minor++) |
4875 | ; | 4877 | ; |
4876 | idetape_devs[minor] = tape; | 4878 | idetape_devs[minor] = tape; |
4877 | up(&idetape_ref_sem); | 4879 | mutex_unlock(&idetape_ref_mutex); |
4878 | 4880 | ||
4879 | idetape_setup(drive, tape, minor); | 4881 | idetape_setup(drive, tape, minor); |
4880 | 4882 | ||
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index b2cc43702f65..3fdab563fec2 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -2058,7 +2058,7 @@ static void __init parse_options (char *line) | |||
2058 | } | 2058 | } |
2059 | } | 2059 | } |
2060 | 2060 | ||
2061 | int init_module (void) | 2061 | int __init init_module (void) |
2062 | { | 2062 | { |
2063 | parse_options(options); | 2063 | parse_options(options); |
2064 | return ide_init(); | 2064 | return ide_init(); |
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 21965e5ef25e..b22ee5462318 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -347,10 +347,8 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch | |||
347 | break; | 347 | break; |
348 | 348 | ||
349 | case AMD_UDMA_66: | 349 | case AMD_UDMA_66: |
350 | pci_read_config_dword(dev, AMD_UDMA_TIMING, &u); | 350 | /* no host side cable detection */ |
351 | for (i = 24; i >= 0; i -= 8) | 351 | amd_80w = 0x03; |
352 | if ((u >> i) & 4) | ||
353 | amd_80w |= (1 << (1 - (i >> 4))); | ||
354 | break; | 352 | break; |
355 | } | 353 | } |
356 | 354 | ||
@@ -386,8 +384,6 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch | |||
386 | if (amd_clock < 20000 || amd_clock > 50000) { | 384 | if (amd_clock < 20000 || amd_clock > 50000) { |
387 | printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n", | 385 | printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n", |
388 | amd_chipset->name, amd_clock); | 386 | amd_chipset->name, amd_clock); |
389 | printk(KERN_WARNING "%s: Use ide0=ata66 if you want to assume 80-wire cable\n", | ||
390 | amd_chipset->name); | ||
391 | amd_clock = 33333; | 387 | amd_clock = 33333; |
392 | } | 388 | } |
393 | 389 | ||
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index 6e3ab0c38c4d..f82e82109728 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -41,14 +41,15 @@ | |||
41 | 41 | ||
42 | static int ide_generic_all; /* Set to claim all devices */ | 42 | static int ide_generic_all; /* Set to claim all devices */ |
43 | 43 | ||
44 | #ifndef MODULE | ||
44 | static int __init ide_generic_all_on(char *unused) | 45 | static int __init ide_generic_all_on(char *unused) |
45 | { | 46 | { |
46 | ide_generic_all = 1; | 47 | ide_generic_all = 1; |
47 | printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n"); | 48 | printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n"); |
48 | return 1; | 49 | return 1; |
49 | } | 50 | } |
50 | |||
51 | __setup("all-generic-ide", ide_generic_all_on); | 51 | __setup("all-generic-ide", ide_generic_all_on); |
52 | #endif | ||
52 | 53 | ||
53 | static void __devinit init_hwif_generic (ide_hwif_t *hwif) | 54 | static void __devinit init_hwif_generic (ide_hwif_t *hwif) |
54 | { | 55 | { |
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 75a2253a3e68..8e9d87701ce2 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -112,6 +112,7 @@ static const struct { | |||
112 | 112 | ||
113 | { "SiS5596", PCI_DEVICE_ID_SI_5596, ATA_16 }, | 113 | { "SiS5596", PCI_DEVICE_ID_SI_5596, ATA_16 }, |
114 | { "SiS5571", PCI_DEVICE_ID_SI_5571, ATA_16 }, | 114 | { "SiS5571", PCI_DEVICE_ID_SI_5571, ATA_16 }, |
115 | { "SiS5517", PCI_DEVICE_ID_SI_5517, ATA_16 }, | ||
115 | { "SiS551x", PCI_DEVICE_ID_SI_5511, ATA_16 }, | 116 | { "SiS551x", PCI_DEVICE_ID_SI_5511, ATA_16 }, |
116 | }; | 117 | }; |
117 | 118 | ||
@@ -524,6 +525,7 @@ static void config_art_rwp_pio (ide_drive_t *drive, u8 pio) | |||
524 | case 3: test1 = 0x30|0x03; break; | 525 | case 3: test1 = 0x30|0x03; break; |
525 | case 2: test1 = 0x40|0x04; break; | 526 | case 2: test1 = 0x40|0x04; break; |
526 | case 1: test1 = 0x60|0x07; break; | 527 | case 1: test1 = 0x60|0x07; break; |
528 | case 0: test1 = 0x00; break; | ||
527 | default: break; | 529 | default: break; |
528 | } | 530 | } |
529 | pci_write_config_byte(dev, drive_pci, test1); | 531 | pci_write_config_byte(dev, drive_pci, test1); |
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index c85b87cb59d1..3e677c4f8c28 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -440,7 +440,7 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) | |||
440 | 440 | ||
441 | 441 | ||
442 | #if defined(CONFIG_PPC_CHRP) && defined(CONFIG_PPC32) | 442 | #if defined(CONFIG_PPC_CHRP) && defined(CONFIG_PPC32) |
443 | if(_machine == _MACH_chrp && _chrp_type == _CHRP_Pegasos) { | 443 | if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) { |
444 | hwif->irq = hwif->channel ? 15 : 14; | 444 | hwif->irq = hwif->channel ? 15 : 14; |
445 | } | 445 | } |
446 | #endif | 446 | #endif |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 5013b1285e22..78e30f803671 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -1677,7 +1677,7 @@ MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); | |||
1677 | void __init | 1677 | void __init |
1678 | pmac_ide_probe(void) | 1678 | pmac_ide_probe(void) |
1679 | { | 1679 | { |
1680 | if (_machine != _MACH_Pmac) | 1680 | if (!machine_is(powermac)) |
1681 | return; | 1681 | return; |
1682 | 1682 | ||
1683 | #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST | 1683 | #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST |