Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a36e4f0c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: fix refcounting in device drivers
  ide-cd: document capacity hack
  it821x: remove dead URL
  atiixp: fix missing parentheses
  amd74xx: device/vendor confusion
  ide: ide.c 'clear' fix, update "ide=nodma" documentation
parents 0b0a0806 8fed4368
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -868,8 +868,10 @@ and is between 256 and 4096 characters. It is defined in the file
	icn=		[HW,ISDN]
			Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]

	ide=		[HW] (E)IDE subsystem
			Format: ide=nodma or ide=doubler
	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
			See Documentation/ide/ide.txt.

	idebus=		[HW] (E)IDE subsystem - VLB/PCI bus speed
+1 −1
Original line number Diff line number Diff line
@@ -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.
	  module will be called ide-core.ko.

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

+1 −1
Original line number Diff line number Diff line
@@ -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->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
	    dev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
		t &= 0x0f;
	else
		t |= 0xf0;
+2 −2
Original line number Diff line number Diff line
@@ -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 & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
	int timing_shift = (drive->dn ^ 1) * 8;
	u32 pio_timing_data;
	u16 pio_mode_data;

@@ -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 & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
	int timing_shift = (drive->dn ^ 1) * 8;
	u32 tmp32;
	u16 tmp16;
	u16 udma_ctl = 0;
+26 −9
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@

static DEFINE_MUTEX(idecd_ref_mutex);

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

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

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

	mutex_lock(&idecd_ref_mutex);
	kref_put(&cd->kref, ide_cd_release);
	put_device(&cd->dev);
	ide_device_put(drive);
	mutex_unlock(&idecd_ref_mutex);
}
@@ -194,6 +194,14 @@ 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);
@@ -1790,15 +1798,17 @@ 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);

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

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

	ide_init_disk(g, drive);

	kref_init(&info->kref);
	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;

	info->drive = drive;
	info->driver = &ide_cdrom_driver;
@@ -2011,7 +2026,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)) {
		ide_cd_release(&info->kref);
		put_device(&info->dev);
		goto failed;
	}

@@ -2021,6 +2036,8 @@ 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:
Loading