Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: fix ->io_32bit race in set_io_32bit()
  ide: remove stale changelog from ide-probe.c
  ide: remove stale changelog from ide-disk.c
  ide: remove dead code from __ide_dma_test_irq()
  hpt366: fix HPT37x PIO mode timings (take 2)
  pdc202xx_new: fix Promise TX4 support
  ide-cd: remove dead post_transform_command()
  ide: DMA reporting and validity checking fixes (take 3)
  ide: add /sys/bus/ide/devices/*/{model,firmware,serial} sysfs entries
  ide: coding style fixes for drivers/ide/setup-pci.c
  ide: fix ide_scan_pcibus() error message
  ide: deprecate CONFIG_BLK_DEV_OFFBOARD
  ide: add missing checks for control register existence
  ide-scsi: add ide_scsi_hex_dump() helper
  • Loading branch information
Linus Torvalds committed Dec 17, 2007
2 parents ea9e7b5 + 644a9d7 commit 07232b9
Show file tree
Hide file tree
Showing 14 changed files with 191 additions and 189 deletions.
6 changes: 5 additions & 1 deletion drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ config IDEPCI_PCIBUS_ORDER

# TODO: split it on per host driver config options (or module parameters)
config BLK_DEV_OFFBOARD
bool "Boot off-board chipsets first support"
bool "Boot off-board chipsets first support (DEPRECATED)"
depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001)
help
Normally, IDE controllers built into the motherboard (on-board
Expand All @@ -410,6 +410,10 @@ config BLK_DEV_OFFBOARD
Note that, if you do this, the order of the hd* devices will be
rearranged which may require modification of fstab and other files.

Please also note that this method of assuring stable naming of
IDE devices is unreliable and use other means for achieving it
(i.e. udev).

If in doubt, say N.

config BLK_DEV_GENERIC
Expand Down
35 changes: 1 addition & 34 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,31 +1650,6 @@ static int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason)
return 1;
}

static void post_transform_command(struct request *req)
{
u8 *c = req->cmd;
char *ibuf;

if (!blk_pc_request(req))
return;

if (req->bio)
ibuf = bio_data(req->bio);
else
ibuf = req->data;

if (!ibuf)
return;

/*
* set ansi-revision and response data as atapi
*/
if (c[0] == GPCMD_INQUIRY) {
ibuf[2] |= 2;
ibuf[3] = (ibuf[3] & 0xf0) | 2;
}
}

typedef void (xfer_func_t)(ide_drive_t *, void *, u32);

/*
Expand Down Expand Up @@ -1810,9 +1785,6 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
return ide_started;

end_request:
if (!rq->data_len)
post_transform_command(rq);

spin_lock_irqsave(&ide_lock, flags);
blkdev_dequeue_request(rq);
end_that_request_last(rq, 1);
Expand Down Expand Up @@ -3049,12 +3021,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
else
printk(" drive");

printk(", %dkB Cache", be16_to_cpu(cap.buffer_size));

if (drive->using_dma)
ide_dma_verbose(drive);

printk("\n");
printk(KERN_CONT ", %dkB Cache\n", be16_to_cpu(cap.buffer_size));

return nslots;
}
Expand Down
33 changes: 2 additions & 31 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,6 @@
* and Andre Hedrick <andre@linux-ide.org>
*
* This is the IDE/ATA disk driver, as evolved from hd.c and ide.c.
*
* Version 1.00 move disk only code from ide.c to ide-disk.c
* support optional byte-swapping of all data
* Version 1.01 fix previous byte-swapping code
* Version 1.02 remove ", LBA" from drive identification msgs
* Version 1.03 fix display of id->buf_size for big-endian
* Version 1.04 add /proc configurable settings and S.M.A.R.T support
* Version 1.05 add capacity support for ATA3 >= 8GB
* Version 1.06 get boot-up messages to show full cyl count
* Version 1.07 disable door-locking if it fails
* Version 1.08 fixed CHS/LBA translations for ATA4 > 8GB,
* process of adding new ATA4 compliance.
* fixed problems in allowing fdisk to see
* the entire disk.
* Version 1.09 added increment of rq->sector in ide_multwrite
* added UDMA 3/4 reporting
* Version 1.10 request queue changes, Ultra DMA 100
* Version 1.11 added 48-bit lba
* Version 1.12 adding taskfile io access method
* Version 1.13 added standby and flush-cache for notifier
* Version 1.14 added acoustic-wcache
* Version 1.15 convert all calls to ide_raw_taskfile
* since args will return register content.
* Version 1.16 added suspend-resume-checkpower
* Version 1.17 do flush on standby, do flush on ATA < ATA6
* fix wcache setup.
*/

#define IDEDISK_VERSION "1.18"
Expand Down Expand Up @@ -961,11 +935,8 @@ static void idedisk_setup (ide_drive_t *drive)
if (id->buf_size)
printk (" w/%dKiB Cache", id->buf_size/2);

printk(", CHS=%d/%d/%d",
drive->bios_cyl, drive->bios_head, drive->bios_sect);
if (drive->using_dma)
ide_dma_verbose(drive);
printk("\n");
printk(KERN_CONT ", CHS=%d/%d/%d\n",
drive->bios_cyl, drive->bios_head, drive->bios_sect);

/* write cache enabled? */
if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5)))
Expand Down
66 changes: 15 additions & 51 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,6 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
ide_hwif_t *hwif = HWIF(drive);
u8 dma_stat = hwif->INB(hwif->dma_status);

#if 0 /* do not set unless you know what you are doing */
if (dma_stat & 4) {
u8 stat = hwif->INB(IDE_STATUS_REG);
hwif->OUTB(hwif->dma_status, dma_stat & 0xE4);
}
#endif
/* return 1 if INTR asserted */
if ((dma_stat & 4) == 4)
return 1;
Expand Down Expand Up @@ -753,10 +747,12 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
mode = XFER_MW_DMA_1;
}

printk(KERN_DEBUG "%s: %s mode selected\n", drive->name,
mode = min(mode, req_mode);

printk(KERN_INFO "%s: %s mode selected\n", drive->name,
mode ? ide_xfer_verbose(mode) : "no DMA");

return min(mode, req_mode);
return mode;
}

EXPORT_SYMBOL_GPL(ide_find_dma_mode);
Expand All @@ -772,6 +768,9 @@ static int ide_tune_dma(ide_drive_t *drive)
if (__ide_dma_bad_drive(drive))
return 0;

if (ide_id_dma_bug(drive))
return 0;

if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
return config_drive_for_dma(drive);

Expand Down Expand Up @@ -806,58 +805,23 @@ static int ide_dma_check(ide_drive_t *drive)
return vdma ? 0 : -1;
}

void ide_dma_verbose(ide_drive_t *drive)
int ide_id_dma_bug(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
ide_hwif_t *hwif = HWIF(drive);
struct hd_driveid *id = drive->id;

if (id->field_valid & 4) {
if ((id->dma_ultra >> 8) && (id->dma_mword >> 8))
goto bug_dma_off;
if (id->dma_ultra & ((id->dma_ultra >> 8) & hwif->ultra_mask)) {
if (((id->dma_ultra >> 11) & 0x1F) &&
eighty_ninty_three(drive)) {
if ((id->dma_ultra >> 15) & 1) {
printk(", UDMA(mode 7)");
} else if ((id->dma_ultra >> 14) & 1) {
printk(", UDMA(133)");
} else if ((id->dma_ultra >> 13) & 1) {
printk(", UDMA(100)");
} else if ((id->dma_ultra >> 12) & 1) {
printk(", UDMA(66)");
} else if ((id->dma_ultra >> 11) & 1) {
printk(", UDMA(44)");
} else
goto mode_two;
} else {
mode_two:
if ((id->dma_ultra >> 10) & 1) {
printk(", UDMA(33)");
} else if ((id->dma_ultra >> 9) & 1) {
printk(", UDMA(25)");
} else if ((id->dma_ultra >> 8) & 1) {
printk(", UDMA(16)");
}
}
} else {
printk(", (U)DMA"); /* Can be BIOS-enabled! */
}
goto err_out;
} else if (id->field_valid & 2) {
if ((id->dma_mword >> 8) && (id->dma_1word >> 8))
goto bug_dma_off;
printk(", DMA");
} else if (id->field_valid & 1) {
goto bug_dma_off;
goto err_out;
}
return;
bug_dma_off:
printk(", BUG DMA OFF");
hwif->dma_off_quietly(drive);
return;
return 0;
err_out:
printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name);
return 1;
}

EXPORT_SYMBOL(ide_dma_verbose);

int ide_set_dma(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
Expand Down
3 changes: 2 additions & 1 deletion drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,8 @@ static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
if (rc)
printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
SELECT_DRIVE(drive);
HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
if (IDE_CONTROL_REG)
HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
rc = ide_wait_not_busy(HWIF(drive), 100000);
if (rc)
printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
Expand Down
3 changes: 3 additions & 0 deletions drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ int ide_driveid_update(ide_drive_t *drive)
drive->id->dma_1word = id->dma_1word;
/* anything more ? */
kfree(id);

if (drive->using_dma && ide_id_dma_bug(drive))
ide_dma_off(drive);
}

return 1;
Expand Down
55 changes: 29 additions & 26 deletions drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,44 @@
* Add common non I/O op stuff here. Make sure it has proper
* kernel-doc function headers or your patch will be rejected
*/


static const char *udma_str[] =
{ "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44",
"UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
static const char *mwdma_str[] =
{ "MWDMA0", "MWDMA1", "MWDMA2" };
static const char *swdma_str[] =
{ "SWDMA0", "SWDMA1", "SWDMA2" };
static const char *pio_str[] =
{ "PIO0", "PIO1", "PIO2", "PIO3", "PIO4", "PIO5" };

/**
* ide_xfer_verbose - return IDE mode names
* @xfer_rate: rate to name
* @mode: transfer mode
*
* Returns a constant string giving the name of the mode
* requested.
*/

char *ide_xfer_verbose (u8 xfer_rate)
const char *ide_xfer_verbose(u8 mode)
{
switch(xfer_rate) {
case XFER_UDMA_7: return("UDMA 7");
case XFER_UDMA_6: return("UDMA 6");
case XFER_UDMA_5: return("UDMA 5");
case XFER_UDMA_4: return("UDMA 4");
case XFER_UDMA_3: return("UDMA 3");
case XFER_UDMA_2: return("UDMA 2");
case XFER_UDMA_1: return("UDMA 1");
case XFER_UDMA_0: return("UDMA 0");
case XFER_MW_DMA_2: return("MW DMA 2");
case XFER_MW_DMA_1: return("MW DMA 1");
case XFER_MW_DMA_0: return("MW DMA 0");
case XFER_SW_DMA_2: return("SW DMA 2");
case XFER_SW_DMA_1: return("SW DMA 1");
case XFER_SW_DMA_0: return("SW DMA 0");
case XFER_PIO_4: return("PIO 4");
case XFER_PIO_3: return("PIO 3");
case XFER_PIO_2: return("PIO 2");
case XFER_PIO_1: return("PIO 1");
case XFER_PIO_0: return("PIO 0");
case XFER_PIO_SLOW: return("PIO SLOW");
default: return("XFER ERROR");
}
const char *s;
u8 i = mode & 0xf;

if (mode >= XFER_UDMA_0 && mode <= XFER_UDMA_7)
s = udma_str[i];
else if (mode >= XFER_MW_DMA_0 && mode <= XFER_MW_DMA_2)
s = mwdma_str[i];
else if (mode >= XFER_SW_DMA_0 && mode <= XFER_SW_DMA_2)
s = swdma_str[i];
else if (mode >= XFER_PIO_0 && mode <= XFER_PIO_5)
s = pio_str[i & 0x7];
else if (mode == XFER_PIO_SLOW)
s = "PIO SLOW";
else
s = "XFER ERROR";

return s;
}

EXPORT_SYMBOL(ide_xfer_verbose);
Expand Down
21 changes: 4 additions & 17 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@
*
* This is the IDE probe module, as evolved from hd.c and ide.c.
*
* Version 1.00 move drive probing code from ide.c to ide-probe.c
* Version 1.01 fix compilation problem for m68k
* Version 1.02 increase WAIT_PIDENTIFY to avoid CD-ROM locking at boot
* by Andrea Arcangeli
* Version 1.03 fix for (hwif->chipset == ide_4drives)
* Version 1.04 fixed buggy treatments of known flash memory cards
*
* Version 1.05 fix for (hwif->chipset == ide_pdc4030)
* added ide6/7/8/9
* allowed for secondary flash card to be detectable
* with new flag : drive->ata_flash : 1;
* Version 1.06 stream line request queue and prep for cascade project.
* Version 1.07 max_sect <= 255; slower disks would get behind and
* then fall over when they get to 256. Paul G.
* Version 1.10 Update set for new IDE. drive->id is now always
* valid after probe time even with noprobe
* -- increase WAIT_PIDENTIFY to avoid CD-ROM locking at boot
* by Andrea Arcangeli
*/

#include <linux/module.h>
Expand Down Expand Up @@ -667,7 +653,8 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
/* Ignore disks that we will not probe for later. */
if (!drive->noprobe || drive->present) {
SELECT_DRIVE(drive);
hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
if (IDE_CONTROL_REG)
hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
mdelay(2);
rc = ide_wait_not_busy(hwif, 35000);
if (rc)
Expand Down
Loading

0 comments on commit 07232b9

Please sign in to comment.