Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131774
b: refs/heads/master
c: 7ba07d1
h: refs/heads/master
v: v3
  • Loading branch information
Ondrej Zary authored and Jeff Garzik committed Feb 25, 2009
1 parent 9ca4999 commit 8b68c30
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 105 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a36e4f0cab6311110d1703eafb325baead9caff8
refs/heads/master: 7ba07d16bd62f931efec1fc8e63bf1aeebfe42a9
6 changes: 2 additions & 4 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,8 @@ and is between 256 and 4096 characters. It is defined in the file
icn= [HW,ISDN]
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]

ide-core.nodma= [HW] (E)IDE subsystem
Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
.chs .ignore_cable are additional options
ide= [HW] (E)IDE subsystem
Format: ide=nodma or ide=doubler
See Documentation/ide/ide.txt.

idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/ata/pata_it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@ static unsigned int it821x_read_id(struct ata_device *adev,
id[83] |= 0x4400; /* Word 83 is valid and LBA48 */
id[86] |= 0x0400; /* LBA48 on */
id[ATA_ID_MAJOR_VER] |= 0x1F;
/* Clear the serial number because it's different each boot
which breaks validation on resume */
memset(&id[ATA_ID_SERNO], 0x20, ATA_ID_SERNO_LEN);
}
return err_mask;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ menuconfig IDE
SMART parameters from disk drives.

To compile this driver as a module, choose M here: the
module will be called ide-core.ko.
module will be called ide.

For further information, please read <file:Documentation/ide/ide.txt>.

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/amd74xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
* Check for broken FIFO support.
*/
if (dev->vendor == PCI_VENDOR_ID_AMD &&
dev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
t &= 0x0f;
else
t |= 0xf0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/ide/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void atiixp_set_pio_mode(ide_drive_t *drive, const u8 pio)
{
struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags;
int timing_shift = (drive->dn ^ 1) * 8;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 pio_timing_data;
u16 pio_mode_data;

Expand Down Expand Up @@ -85,7 +85,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed)
{
struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags;
int timing_shift = (drive->dn ^ 1) * 8;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 tmp32;
u16 tmp16;
u16 udma_ctl = 0;
Expand Down
35 changes: 9 additions & 26 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

static DEFINE_MUTEX(idecd_ref_mutex);

static void ide_cd_release(struct device *);
static void ide_cd_release(struct kref *);

static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{
Expand All @@ -67,7 +67,7 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
if (ide_device_get(cd->drive))
cd = NULL;
else
get_device(&cd->dev);
kref_get(&cd->kref);

}
mutex_unlock(&idecd_ref_mutex);
Expand All @@ -79,7 +79,7 @@ static void ide_cd_put(struct cdrom_info *cd)
ide_drive_t *drive = cd->drive;

mutex_lock(&idecd_ref_mutex);
put_device(&cd->dev);
kref_put(&cd->kref, ide_cd_release);
ide_device_put(drive);
mutex_unlock(&idecd_ref_mutex);
}
Expand Down Expand Up @@ -194,14 +194,6 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
bio_sectors = max(bio_sectors(failed_command->bio), 4U);
sector &= ~(bio_sectors - 1);

/*
* The SCSI specification allows for the value
* returned by READ CAPACITY to be up to 75 2K
* sectors past the last readable block.
* Therefore, if we hit a medium error within the
* last 75 2K sectors, we decrease the saved size
* value.
*/
if (sector < get_capacity(info->disk) &&
drive->probed_capacity - sector < 4 * 75)
set_capacity(info->disk, sector);
Expand Down Expand Up @@ -1798,17 +1790,15 @@ static void ide_cd_remove(ide_drive_t *drive)
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);

ide_proc_unregister_driver(drive, info->driver);
device_del(&info->dev);

del_gendisk(info->disk);

mutex_lock(&idecd_ref_mutex);
put_device(&info->dev);
mutex_unlock(&idecd_ref_mutex);
ide_cd_put(info);
}

static void ide_cd_release(struct device *dev)
static void ide_cd_release(struct kref *kref)
{
struct cdrom_info *info = to_ide_drv(dev, cdrom_info);
struct cdrom_info *info = to_ide_drv(kref, cdrom_info);
struct cdrom_device_info *devinfo = &info->devinfo;
ide_drive_t *drive = info->drive;
struct gendisk *g = info->disk;
Expand Down Expand Up @@ -2007,12 +1997,7 @@ static int ide_cd_probe(ide_drive_t *drive)

ide_init_disk(g, drive);

info->dev.parent = &drive->gendev;
info->dev.release = ide_cd_release;
dev_set_name(&info->dev, dev_name(&drive->gendev));

if (device_register(&info->dev))
goto out_free_disk;
kref_init(&info->kref);

info->drive = drive;
info->driver = &ide_cdrom_driver;
Expand All @@ -2026,7 +2011,7 @@ static int ide_cd_probe(ide_drive_t *drive)
g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) {
put_device(&info->dev);
ide_cd_release(&info->kref);
goto failed;
}

Expand All @@ -2036,8 +2021,6 @@ static int ide_cd_probe(ide_drive_t *drive)
add_disk(g);
return 0;

out_free_disk:
put_disk(g);
out_free_cd:
kfree(info);
failed:
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-cd.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct cdrom_info {
ide_drive_t *drive;
struct ide_driver *driver;
struct gendisk *disk;
struct device dev;
struct kref kref;

/* Buffer for table of contents. NULL if we haven't allocated
a TOC buffer for this device yet. */
Expand Down
26 changes: 9 additions & 17 deletions trunk/drivers/ide/ide-gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module_param(debug_mask, ulong, 0644);

static DEFINE_MUTEX(ide_disk_ref_mutex);

static void ide_disk_release(struct device *);
static void ide_disk_release(struct kref *);

static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
{
Expand All @@ -37,7 +37,7 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
if (ide_device_get(idkp->drive))
idkp = NULL;
else
get_device(&idkp->dev);
kref_get(&idkp->kref);
}
mutex_unlock(&ide_disk_ref_mutex);
return idkp;
Expand All @@ -48,7 +48,7 @@ static void ide_disk_put(struct ide_disk_obj *idkp)
ide_drive_t *drive = idkp->drive;

mutex_lock(&ide_disk_ref_mutex);
put_device(&idkp->dev);
kref_put(&idkp->kref, ide_disk_release);
ide_device_put(drive);
mutex_unlock(&ide_disk_ref_mutex);
}
Expand All @@ -66,18 +66,17 @@ static void ide_gd_remove(ide_drive_t *drive)
struct gendisk *g = idkp->disk;

ide_proc_unregister_driver(drive, idkp->driver);
device_del(&idkp->dev);

del_gendisk(g);

drive->disk_ops->flush(drive);

mutex_lock(&ide_disk_ref_mutex);
put_device(&idkp->dev);
mutex_unlock(&ide_disk_ref_mutex);
ide_disk_put(idkp);
}

static void ide_disk_release(struct device *dev)
static void ide_disk_release(struct kref *kref)
{
struct ide_disk_obj *idkp = to_ide_drv(dev, ide_disk_obj);
struct ide_disk_obj *idkp = to_ide_drv(kref, ide_disk_obj);
ide_drive_t *drive = idkp->drive;
struct gendisk *g = idkp->disk;

Expand Down Expand Up @@ -349,12 +348,7 @@ static int ide_gd_probe(ide_drive_t *drive)

ide_init_disk(g, drive);

idkp->dev.parent = &drive->gendev;
idkp->dev.release = ide_disk_release;
dev_set_name(&idkp->dev, dev_name(&drive->gendev));

if (device_register(&idkp->dev))
goto out_free_disk;
kref_init(&idkp->kref);

idkp->drive = drive;
idkp->driver = &ide_gd_driver;
Expand All @@ -379,8 +373,6 @@ static int ide_gd_probe(ide_drive_t *drive)
add_disk(g);
return 0;

out_free_disk:
put_disk(g);
out_free_idkp:
kfree(idkp);
failed:
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-gd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ide_disk_obj {
ide_drive_t *drive;
struct ide_driver *driver;
struct gendisk *disk;
struct device dev;
struct kref kref;
unsigned int openers; /* protected by BKL for now */

/* Last failed packet command */
Expand Down
29 changes: 10 additions & 19 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ typedef struct ide_tape_obj {
ide_drive_t *drive;
struct ide_driver *driver;
struct gendisk *disk;
struct device dev;
struct kref kref;

/*
* failed_pc points to the last failed packet command, or contains
Expand Down Expand Up @@ -267,7 +267,7 @@ static DEFINE_MUTEX(idetape_ref_mutex);

static struct class *idetape_sysfs_class;

static void ide_tape_release(struct device *);
static void ide_tape_release(struct kref *);

static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
{
Expand All @@ -279,7 +279,7 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
if (ide_device_get(tape->drive))
tape = NULL;
else
get_device(&tape->dev);
kref_get(&tape->kref);
}
mutex_unlock(&idetape_ref_mutex);
return tape;
Expand All @@ -290,7 +290,7 @@ static void ide_tape_put(struct ide_tape_obj *tape)
ide_drive_t *drive = tape->drive;

mutex_lock(&idetape_ref_mutex);
put_device(&tape->dev);
kref_put(&tape->kref, ide_tape_release);
ide_device_put(drive);
mutex_unlock(&idetape_ref_mutex);
}
Expand All @@ -308,7 +308,7 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i)
mutex_lock(&idetape_ref_mutex);
tape = idetape_devs[i];
if (tape)
get_device(&tape->dev);
kref_get(&tape->kref);
mutex_unlock(&idetape_ref_mutex);
return tape;
}
Expand Down Expand Up @@ -2256,17 +2256,15 @@ static void ide_tape_remove(ide_drive_t *drive)
idetape_tape_t *tape = drive->driver_data;

ide_proc_unregister_driver(drive, tape->driver);
device_del(&tape->dev);

ide_unregister_region(tape->disk);

mutex_lock(&idetape_ref_mutex);
put_device(&tape->dev);
mutex_unlock(&idetape_ref_mutex);
ide_tape_put(tape);
}

static void ide_tape_release(struct device *dev)
static void ide_tape_release(struct kref *kref)
{
struct ide_tape_obj *tape = to_ide_drv(dev, ide_tape_obj);
struct ide_tape_obj *tape = to_ide_drv(kref, ide_tape_obj);
ide_drive_t *drive = tape->drive;
struct gendisk *g = tape->disk;

Expand Down Expand Up @@ -2409,12 +2407,7 @@ static int ide_tape_probe(ide_drive_t *drive)

ide_init_disk(g, drive);

tape->dev.parent = &drive->gendev;
tape->dev.release = ide_tape_release;
dev_set_name(&tape->dev, dev_name(&drive->gendev));

if (device_register(&tape->dev))
goto out_free_disk;
kref_init(&tape->kref);

tape->drive = drive;
tape->driver = &idetape_driver;
Expand Down Expand Up @@ -2443,8 +2436,6 @@ static int ide_tape_probe(ide_drive_t *drive)

return 0;

out_free_disk:
put_disk(g);
out_free_tape:
kfree(tape);
failed:
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
int a, b, i, j = 1;
unsigned int *dev_param_mask = (unsigned int *)kp->arg;

/* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
sscanf(s, "%d.%d", &a, &b) != 2)
return -EINVAL;
Expand All @@ -350,7 +349,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
if (j)
*dev_param_mask |= (1 << i);
else
*dev_param_mask &= ~(1 << i);
*dev_param_mask &= (1 << i);

return 0;
}
Expand Down Expand Up @@ -393,8 +392,6 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
{
int a, b, c = 0, h = 0, s = 0, i, j = 1;

/* controller . device (0 or 1) : Cylinders , Heads , Sectors */
/* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
return -EINVAL;
Expand All @@ -410,7 +407,7 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
if (j)
ide_disks |= (1 << i);
else
ide_disks &= ~(1 << i);
ide_disks &= (1 << i);

ide_disks_chs[i].cyl = c;
ide_disks_chs[i].head = h;
Expand Down Expand Up @@ -472,8 +469,6 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
{
int i, j = 1;

/* controller (ignore) */
/* controller : 1 (ignore) | 0 (use) */
if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
return -EINVAL;

Expand All @@ -483,7 +478,7 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
if (j)
ide_ignore_cable |= (1 << i);
else
ide_ignore_cable &= ~(1 << i);
ide_ignore_cable &= (1 << i);

return 0;
}
Expand Down
Loading

0 comments on commit 8b68c30

Please sign in to comment.