Commit faaab2cf authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linuxusb.bkbits.net/agpgart-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents aa3202b2 84f4a1c4
......@@ -708,7 +708,14 @@ CONFIG_BLK_DEV_IDE_TCQ
Digital drives in the Expert series (by nature of really being IBM
drives).
If you have such a drive, say Y here.
However, please, note that there are host chip controllers which will
not cooperate properly if TCQ is enabled. This may cause serious
data loss!
Since enabling TCQ doesn't appear to have any noticeable performance
impact on Linux: [feel free to correct me if you wish too please]
Generally say N here.
CONFIG_BLK_DEV_IDE_TCQ_DEPTH
Maximum size of commands to enable per-drive. Any value between 1
......
......@@ -34,7 +34,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO
define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ATA tagged command queueing (EXPERIMENTAL)' CONFIG_BLK_DEV_IDE_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL
dep_bool ' ATA tagged command queueing (DANGEROUS)' CONFIG_BLK_DEV_IDE_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL
dep_bool ' TCQ on by default' CONFIG_BLK_DEV_IDE_TCQ_DEFAULT $CONFIG_BLK_DEV_IDE_TCQ
if [ "$CONFIG_BLK_DEV_IDE_TCQ" != "n" ]; then
int ' Default queue depth' CONFIG_BLK_DEV_IDE_TCQ_DEPTH 32
......
......@@ -61,22 +61,25 @@
#define AEC_CABLEPINS_INPUT 0x10
static unsigned char aec_cyc2udma[9] = { 5, 5, 5, 4, 3, 2, 2, 1, 1 };
static unsigned char aec_cyc2act[16] = { 1, 1, 2, 3, 4, 5, 6, 0, 0, 7, 7, 7, 7, 7, 7, 7 };
static unsigned char aec_cyc2rec[16] = { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 };
static unsigned char aec_cyc2act[16] =
{ 1, 1, 2, 3, 4, 5, 6, 0, 0, 7, 7, 7, 7, 7, 7, 7 };
static unsigned char aec_cyc2rec[16] =
{ 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 };
/*
* aec_set_speed_old() writes timing values to
* the chipset registers for ATP850UF
*/
static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing)
static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn,
struct ata_timing *timing)
{
unsigned char t;
pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1),
aec_cyc2act[FIT(timing->active, 0, 15)]);
aec_cyc2act[FIT(timing->active, 0, 15)]);
pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1) + 1,
aec_cyc2rec[FIT(timing->recover, 0, 15)]);
aec_cyc2rec[FIT(timing->recover, 0, 15)]);
pci_read_config_byte(dev, AEC_UDMA_OLD, &t);
t &= ~(3 << (dn << 1));
......@@ -90,19 +93,22 @@ static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_
* other Artop chips
*/
static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing)
static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn,
struct ata_timing *timing)
{
unsigned char t;
pci_write_config_byte(dev, AEC_DRIVE_TIMING + dn,
(aec_cyc2act[FIT(timing->active, 0, 15)] << 4)
| aec_cyc2rec[FIT(timing->recover, 0, 15)]);
(aec_cyc2act[FIT(timing->active, 0, 15)] <<
4)
| aec_cyc2rec[FIT(timing->recover, 0, 15)]);
pci_read_config_byte(dev, AEC_UDMA_NEW + (dn >> 1), &t);
t &= ~(0xf << ((dn & 1) << 2));
if (timing->udma) {
if (timing->udma >= 2)
t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] << ((dn & 1) << 2);
t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] <<
((dn & 1) << 2);
if (timing->mode == XFER_UDMA_5)
t |= 6;
if (timing->mode == XFER_UDMA_6)
......@@ -123,12 +129,15 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed)
int T, UT;
int aec_old;
aec_old = (drive->channel->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF);
aec_old =
(drive->channel->pci_dev->device ==
PCI_DEVICE_ID_ARTOP_ATP850UF);
if (speed != XFER_PIO_SLOW && speed != drive->current_speed)
if (ide_config_drive_speed(drive, speed))
printk(KERN_WARNING "ide%d: Drive %d didn't accept speed setting. Oh, well.\n",
drive->dn >> 1, drive->dn & 1);
printk(KERN_WARNING
"ide%d: Drive %d didn't accept speed setting. Oh, well.\n",
drive->dn >> 1, drive->dn & 1);
T = 1000000000 / system_bus_speed;
UT = T / (aec_old ? 1 : 2);
......@@ -152,7 +161,9 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed)
static void aec62xx_tune_drive(struct ata_device *drive, unsigned char pio)
{
if (pio == 255) {
aec_set_drive(drive, ata_timing_mode(drive, XFER_PIO | XFER_EPIO));
aec_set_drive(drive,
ata_timing_mode(drive,
XFER_PIO | XFER_EPIO));
return;
}
......@@ -169,14 +180,17 @@ static int __init aec62xx_modes_map(struct ata_channel *ch)
if (ch->udma_four)
switch (ch->pci_dev->device) {
case PCI_DEVICE_ID_ARTOP_ATP865R:
case PCI_DEVICE_ID_ARTOP_ATP865:
/* Can't use these modes simultaneously,
based on which PLL clock was chosen. */
map |= inb (bmide + AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ? XFER_UDMA_133 : XFER_UDMA_100;
case PCI_DEVICE_ID_ARTOP_ATP860R:
case PCI_DEVICE_ID_ARTOP_ATP860:
map |= XFER_UDMA_66;
case PCI_DEVICE_ID_ARTOP_ATP865R:
case PCI_DEVICE_ID_ARTOP_ATP865:
/* Can't use these modes simultaneously,
based on which PLL clock was chosen. */
map |=
inb(bmide +
AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ?
XFER_UDMA_133 : XFER_UDMA_100;
case PCI_DEVICE_ID_ARTOP_ATP860R:
case PCI_DEVICE_ID_ARTOP_ATP860:
map |= XFER_UDMA_66;
}
return map;
......@@ -200,27 +214,28 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev)
switch (dev->device) {
case PCI_DEVICE_ID_ARTOP_ATP865R:
case PCI_DEVICE_ID_ARTOP_ATP865:
case PCI_DEVICE_ID_ARTOP_ATP865R:
case PCI_DEVICE_ID_ARTOP_ATP865:
/* Clear reset and test bits. */
pci_read_config_byte(dev, AEC_MISC, &t);
pci_write_config_byte(dev, AEC_MISC, t & ~0x30);
/* Clear reset and test bits. */
pci_read_config_byte(dev, AEC_MISC, &t);
pci_write_config_byte(dev, AEC_MISC, t & ~0x30);
/* Enable chip interrupt output. */
pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01);
/* Enable chip interrupt output. */
pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01);
#ifdef CONFIG_AEC6280_BURST
/* Must be greater than 0x80 for burst mode. */
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90);
/* Must be greater than 0x80 for burst mode. */
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90);
/* Enable burst mode. */
pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80);
/* Enable burst mode. */
pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80);
#endif
/* switch cable detection pins to input-only. */
outb (inb (bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT, bmide + AEC_BM_STAT_SCH);
/* switch cable detection pins to input-only. */
outb(inb(bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT,
bmide + AEC_BM_STAT_SCH);
}
/*
......@@ -229,7 +244,7 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev)
pci_read_config_byte(dev, PCI_REVISION_ID, &t);
printk(KERN_INFO "AEC_IDE: %s (rev %02x) controller on pci%s\n",
dev->name, t, dev->slot_name);
dev->name, t, dev->slot_name);
return dev->irq;
}
......@@ -274,7 +289,8 @@ static void __init aec62xx_init_channel(struct ata_channel *ch)
/*
* We allow the BM-DMA driver only work on enabled interfaces.
*/
static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabase)
static void __init aec62xx_init_dma(struct ata_channel *ch,
unsigned long dmabase)
{
unsigned char t;
......@@ -286,50 +302,49 @@ static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabas
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP850UF,
init_chipset: aec62xx_init_chipset,
init_channel: aec62xx_init_channel,
init_dma: aec62xx_init_dma,
enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
bootable: OFF_BOARD,
flags: ATA_F_SER | ATA_F_IRQ | ATA_F_DMA
.vendor = PCI_VENDOR_ID_ARTOP,
.device = PCI_DEVICE_ID_ARTOP_ATP850UF,
.init_chipset = aec62xx_init_chipset,
.init_channel = aec62xx_init_channel,
.init_dma = aec62xx_init_dma,
.enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
.bootable = OFF_BOARD,
.flags = ATA_F_SER | ATA_F_IRQ | ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860,
init_chipset: aec62xx_init_chipset,
init_channel: aec62xx_init_channel,
enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
bootable: NEVER_BOARD,
flags: ATA_F_IRQ | ATA_F_DMA
.vendor = PCI_VENDOR_ID_ARTOP,
.device = PCI_DEVICE_ID_ARTOP_ATP860,
.init_chipset = aec62xx_init_chipset,
.init_channel = aec62xx_init_channel,
.enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
.bootable = NEVER_BOARD,
.flags = ATA_F_IRQ | ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860R,
init_chipset: aec62xx_init_chipset,
init_channel: aec62xx_init_channel,
enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
bootable: OFF_BOARD,
flags: ATA_F_IRQ | ATA_F_DMA
},
.vendor = PCI_VENDOR_ID_ARTOP,
.device = PCI_DEVICE_ID_ARTOP_ATP860R,
.init_chipset = aec62xx_init_chipset,
.init_channel = aec62xx_init_channel,
.enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
.bootable = OFF_BOARD,
.flags = ATA_F_IRQ | ATA_F_DMA},
{
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865,
init_chipset: aec62xx_init_chipset,
init_channel: aec62xx_init_channel,
enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
bootable: NEVER_BOARD,
flags: ATA_F_IRQ | ATA_F_DMA
.vendor = PCI_VENDOR_ID_ARTOP,
.device = PCI_DEVICE_ID_ARTOP_ATP865,
.init_chipset = aec62xx_init_chipset,
.init_channel = aec62xx_init_channel,
.enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
.bootable = NEVER_BOARD,
.flags = ATA_F_IRQ | ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865R,
init_chipset: aec62xx_init_chipset,
init_channel: aec62xx_init_channel,
enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
bootable: OFF_BOARD,
flags: ATA_F_IRQ | ATA_F_DMA
.vendor = PCI_VENDOR_ID_ARTOP,
.device = PCI_DEVICE_ID_ARTOP_ATP865R,
.init_chipset = aec62xx_init_chipset,
.init_channel = aec62xx_init_channel,
.enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
.bootable = OFF_BOARD,
.flags = ATA_F_IRQ | ATA_F_DMA
}
};
......
......@@ -46,11 +46,12 @@
/* port addresses for auto-detection */
#define ALI_NUM_PORTS 4
static int ports[ALI_NUM_PORTS] __initdata = { 0x074, 0x0f4, 0x034, 0x0e4 };
static int ports[ALI_NUM_PORTS] __initdata =
{ 0x074, 0x0f4, 0x034, 0x0e4 };
/* register initialization data */
struct reg_initializer {
u8 reg, data;
u8 reg, data;
};
static struct reg_initializer init_data[] __initdata = {
......@@ -67,17 +68,21 @@ static struct reg_initializer init_data[] __initdata = {
static struct {
u8 reg1, reg2, reg3, reg4;
} reg_tab[4] = {
{ 0x03, 0x26, 0x04, 0x27 }, /* drive 0 */
{ 0x05, 0x28, 0x06, 0x29 }, /* drive 1 */
{ 0x2b, 0x30, 0x2c, 0x31 }, /* drive 2 */
{ 0x2d, 0x32, 0x2e, 0x33 }, /* drive 3 */
{
0x03, 0x26, 0x04, 0x27}, /* drive 0 */
{
0x05, 0x28, 0x06, 0x29}, /* drive 1 */
{
0x2b, 0x30, 0x2c, 0x31}, /* drive 2 */
{
0x2d, 0x32, 0x2e, 0x33}, /* drive 3 */
};
static int base_port; /* base port address */
static int reg_port; /* port for register number */
static int data_port; /* port for register data */
static u8 reg_on; /* output to base port to access registers */
static u8 reg_off; /* output to base port to close registers */
static int base_port; /* base port address */
static int reg_port; /* port for register number */
static int data_port; /* port for register data */
static u8 reg_on; /* output to base port to access registers */
static u8 reg_off; /* output to base port to close registers */
/*
* Read a controller register.
......@@ -121,13 +126,16 @@ static void ali14xx_tune_drive(struct ata_device *drive, u8 pio)
time1 = t->cycle;
time2 = t->active;
param3 = param1 = (time2 * system_bus_speed + 999999) / 1000000;
param4 = param2 = (time1 * system_bus_speed + 999999) / 1000000 - param1;
param4 = param2 =
(time1 * system_bus_speed + 999999) / 1000000 - param1;
if (pio < XFER_PIO_3) {
param3 += 8;
param4 += 8;
}
printk(KERN_DEBUG "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
drive->name, pio - XFER_PIO_0, time1, time2, param1, param2, param3, param4);
printk(KERN_DEBUG
"%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
drive->name, pio - XFER_PIO_0, time1, time2, param1, param2,
param3, param4);
/* stuff timing parameters into controller registers */
drive_num = (drive->channel->index << 1) + drive->select.b.unit;
......@@ -150,8 +158,7 @@ static int __init find_port(void)
int i;
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
for (i = 0; i < ALI_NUM_PORTS; i++) {
base_port = ports[i];
reg_off = inb(base_port);
......@@ -163,7 +170,7 @@ static int __init find_port(void)
data_port = base_port + 8;
t = in_reg(0) & 0xf0;
outb_p(reg_off, base_port);
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
if (t != 0x50)
return 0;
return 1; /* success */
......@@ -171,7 +178,8 @@ static int __init find_port(void)
}
outb_p(reg_off, base_port);
}
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
return 0;
}
......@@ -184,15 +192,15 @@ static int __init init_registers(void)
unsigned long flags;
u8 t;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
outb_p(reg_on, base_port);
for (p = init_data; p->reg != 0; ++p)
out_reg(p->data, p->reg);
outb_p(0x01, reg_port);
t = inb(reg_port) & 0x01;
outb_p(reg_off, base_port);
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
return t;
}
......@@ -205,7 +213,7 @@ void __init init_ali14xx(void)
}
printk(KERN_DEBUG "ali14xx: base=%#03x, reg_on=%#02x\n",
base_port, reg_on);
base_port, reg_on);
ide_hwifs[0].chipset = ide_ali14xx;
ide_hwifs[1].chipset = ide_ali14xx;
ide_hwifs[0].tuneproc = &ali14xx_tune_drive;
......
......@@ -73,10 +73,10 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
if (r_clc >= 16)
r_clc = 0;
}
__save_flags(flags);
__cli();
/*
local_irq_save(flags);
/*
* PIO mode => ATA FIFO on, ATAPI FIFO off
*/
pci_read_config_byte(dev, portFIFO, &cd_dma_fifo);
......@@ -96,7 +96,8 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
pci_write_config_byte(dev, port, s_clc);
pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc);
__restore_flags(flags);
local_irq_restore(flags);
}
static int ali15x3_tune_chipset(struct ata_device *drive, byte speed)
......@@ -216,8 +217,7 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
unsigned long flags;
byte tmpbyte;
__save_flags(flags);
__cli();
local_irq_save(flags);
if (m5229_revision >= 0xC2) {
/*
......@@ -297,9 +297,9 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
pci_write_config_byte(dev, 0x53, tmpbyte);
__restore_flags(flags);
local_irq_restore(flags);
return(ata66);
return (ata66);
}
static void __init ali15x3_init_channel(struct ata_channel *hwif)
......@@ -374,22 +374,22 @@ static void __init ali15x3_init_dma(struct ata_channel *ch, unsigned long dmabas
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_AL,
device: PCI_DEVICE_ID_AL_M5219,
.vendor = PCI_VENDOR_ID_AL,
.device = PCI_DEVICE_ID_AL_M5219,
/* FIXME: Perhaps we should use the same init routines
* as below here. */
enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
bootable: ON_BOARD,
flags: ATA_F_SIMPLEX
.enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
.bootable = ON_BOARD,
.flags = ATA_F_SIMPLEX
},
{
vendor: PCI_VENDOR_ID_AL,
device: PCI_DEVICE_ID_AL_M5229,
init_chipset: ali15x3_init_chipset,
init_channel: ali15x3_init_channel,
init_dma: ali15x3_init_dma,
enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_AL,
.device = PCI_DEVICE_ID_AL_M5229,
.init_chipset = ali15x3_init_chipset,
.init_channel = ali15x3_init_channel,
.init_dma = ali15x3_init_dma,
.enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
.bootable = ON_BOARD
}
};
......@@ -397,9 +397,8 @@ int __init init_ali15x3(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......@@ -303,59 +303,59 @@ static void __init amd74xx_init_dma(struct ata_channel *ch, unsigned long dmabas
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_COBRA_7401,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_COBRA_7401,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7409,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
flags: ATA_F_SIMPLEX
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_VIPER_7409,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
.bootable = ON_BOARD,
.flags = ATA_F_SIMPLEX
},
{
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7411,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_VIPER_7411,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_OPUS_7441,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_OPUS_7441,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_8111_IDE,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_AMD,
.device = PCI_DEVICE_ID_AMD_8111_IDE,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_NVIDIA,
device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
init_chipset: amd74xx_init_chipset,
init_channel: amd74xx_init_channel,
init_dma: amd74xx_init_dma,
enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_NVIDIA,
.device = PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
.init_chipset = amd74xx_init_chipset,
.init_channel = amd74xx_init_channel,
.init_dma = amd74xx_init_dma,
.enablebits = {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
.bootable = ON_BOARD
},
};
......@@ -363,9 +363,8 @@ int __init init_amd74xx(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......@@ -27,6 +27,7 @@
#include <linux/blkdev.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/cdrom.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
......@@ -115,6 +116,66 @@ void atapi_write(struct ata_device *drive, u8 *buf, unsigned int n)
outsw(IDE_DATA_REG, buf + (n & ~0x03), 1);
}
/*
* This function issues a special IDE device request onto the request queue.
*
* If action is ide_wait, then the rq is queued at the end of the request
* queue, and the function sleeps until it has been processed. This is for use
* when invoked from an ioctl handler.
*
* If action is ide_preempt, then the rq is queued at the head of the request
* queue, displacing the currently-being-processed request and this function
* returns immediately without waiting for the new rq to be completed. This is
* VERY DANGEROUS, and is intended for careful use by the ATAPI tape/cdrom
* driver code.
*
* If action is ide_end, then the rq is queued at the end of the request queue,
* and the function returns immediately without waiting for the new rq to be
* completed. This is again intended for careful use by the ATAPI tape/cdrom
* driver code.
*/
int ide_do_drive_cmd(struct ata_device *drive, struct request *rq, ide_action_t action)
{
unsigned long flags;
struct ata_channel *ch = drive->channel;
unsigned int major = ch->major;
request_queue_t *q = &drive->queue;
struct list_head *queue_head = &q->queue_head;
DECLARE_COMPLETION(wait);
#ifdef CONFIG_BLK_DEV_PDC4030
if (ch->chipset == ide_pdc4030 && rq->buffer)
return -ENOSYS; /* special drive cmds not supported */
#endif
rq->errors = 0;
rq->rq_status = RQ_ACTIVE;
rq->rq_dev = mk_kdev(major, (drive->select.b.unit) << PARTN_BITS);
if (action == ide_wait)
rq->waiting = &wait;
spin_lock_irqsave(ch->lock, flags);
if (action == ide_preempt)
drive->rq = NULL;
else if (!blk_queue_empty(&drive->queue))
queue_head = queue_head->prev; /* ide_end and ide_wait */
__elv_add_request(q, rq, queue_head);
do_ide_request(q);
spin_unlock_irqrestore(ch->lock, flags);
if (action == ide_wait) {
wait_for_completion(&wait); /* wait for it to be serviced */
return rq->errors ? -EIO : 0; /* return -EIO if errors */
}
return 0;
}
EXPORT_SYMBOL(ide_do_drive_cmd);
EXPORT_SYMBOL(atapi_discard_data);
EXPORT_SYMBOL(atapi_write_zeros);
EXPORT_SYMBOL(atapi_init_pc);
......
......@@ -34,12 +34,14 @@
#include "ataraid.h"
static struct raid_device_operations* ataraid_ops[16];
static struct raid_device_operations *ataraid_ops[16];
static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
static int ataraid_open(struct inode * inode, struct file * filp);
static int ataraid_release(struct inode * inode, struct file * filp);
static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh);
static int ataraid_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static int ataraid_open(struct inode *inode, struct file *filp);
static int ataraid_release(struct inode *inode, struct file *filp);
static void ataraid_split_request(request_queue_t * q, int rw,
struct buffer_head *bh);
struct gendisk ataraid_gendisk;
......@@ -47,12 +49,12 @@ static int ataraid_gendisk_sizes[256];
static int ataraid_readahead[256];
static struct block_device_operations ataraid_fops = {
owner: THIS_MODULE,
open: ataraid_open,
release: ataraid_release,
ioctl: ataraid_ioctl,
.owner = THIS_MODULE,
.open = ataraid_open,
.release = ataraid_release,
.ioctl = ataraid_ioctl,
};
static DECLARE_MUTEX(ataraid_sem);
......@@ -63,48 +65,50 @@ static unsigned int ataraiduse;
/* stub fops functions */
static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static int ataraid_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int minor;
minor = minor(inode->i_rdev)>>SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl))
return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg);
minor = minor(inode->i_rdev) >> SHIFT;
if ((ataraid_ops[minor]) && (ataraid_ops[minor]->ioctl))
return (ataraid_ops[minor]->ioctl) (inode, file, cmd, arg);
return -EINVAL;
}
static int ataraid_open(struct inode * inode, struct file * filp)
static int ataraid_open(struct inode *inode, struct file *filp)
{
int minor;
minor = minor(inode->i_rdev)>>SHIFT;
minor = minor(inode->i_rdev) >> SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open))
return (ataraid_ops[minor]->open)(inode,filp);
if ((ataraid_ops[minor]) && (ataraid_ops[minor]->open))
return (ataraid_ops[minor]->open) (inode, filp);
return -EINVAL;
}
static int ataraid_release(struct inode * inode, struct file * filp)
static int ataraid_release(struct inode *inode, struct file *filp)
{
int minor;
minor = minor(inode->i_rdev)>>SHIFT;
minor = minor(inode->i_rdev) >> SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release))
return (ataraid_ops[minor]->release)(inode,filp);
if ((ataraid_ops[minor]) && (ataraid_ops[minor]->release))
return (ataraid_ops[minor]->release) (inode, filp);
return -EINVAL;
}
static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
static int ataraid_make_request(request_queue_t * q, int rw,
struct buffer_head *bh)
{
int minor;
int retval;
minor = minor(bh->b_rdev)>>SHIFT;
minor = minor(bh->b_rdev) >> SHIFT;
if ((ataraid_ops[minor]) && (ataraid_ops[minor]->make_request)) {
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) {
retval= (ataraid_ops[minor]->make_request)(q,rw,bh);
retval = (ataraid_ops[minor]->make_request) (q, rw, bh);
if (retval == -1) {
ataraid_split_request(q,rw,bh);
ataraid_split_request(q, rw, bh);
return 0;
} else
return retval;
......@@ -116,7 +120,7 @@ struct buffer_head *ataraid_get_bhead(void)
{
void *ptr = NULL;
while (!ptr) {
ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO);
ptr = kmalloc(sizeof(struct buffer_head), GFP_NOIO);
if (!ptr)
yield();
}
......@@ -129,7 +133,7 @@ struct ataraid_bh_private *ataraid_get_private(void)
{
void *ptr = NULL;
while (!ptr) {
ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO);
ptr = kmalloc(sizeof(struct ataraid_bh_private), GFP_NOIO);
if (!ptr)
yield();
}
......@@ -142,11 +146,11 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate)
{
struct ataraid_bh_private *private = bh->b_private;
if (private==NULL)
if (private == NULL)
BUG();
if (atomic_dec_and_test(&private->count)) {
private->parent->b_end_io(private->parent,uptodate);
private->parent->b_end_io(private->parent, uptodate);
private->parent = NULL;
kfree(private);
}
......@@ -155,23 +159,24 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate)
EXPORT_SYMBOL(ataraid_end_request);
static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh)
static void ataraid_split_request(request_queue_t * q, int rw,
struct buffer_head *bh)
{
struct buffer_head *bh1,*bh2;
struct buffer_head *bh1, *bh2;
struct ataraid_bh_private *private;
bh1=ataraid_get_bhead();
bh2=ataraid_get_bhead();
bh1 = ataraid_get_bhead();
bh2 = ataraid_get_bhead();
/* If either of those ever fails we're doomed */
if ((!bh1)||(!bh2))
if ((!bh1) || (!bh2))
BUG();
private = ataraid_get_private();
if (private==NULL)
if (private == NULL)
BUG();
memcpy(bh1, bh, sizeof(*bh));
memcpy(bh2, bh, sizeof(*bh));
bh1->b_end_io = ataraid_end_request;
bh2->b_end_io = ataraid_end_request;
......@@ -182,12 +187,12 @@ static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head
bh1->b_private = private;
bh2->b_private = private;
atomic_set(&private->count,2);
atomic_set(&private->count, 2);
bh2->b_data += bh->b_size/2;
bh2->b_data += bh->b_size / 2;
generic_make_request(rw,bh1);
generic_make_request(rw,bh2);
generic_make_request(rw, bh1);
generic_make_request(rw, bh2);
}
......@@ -200,12 +205,12 @@ int ataraid_get_device(struct raid_device_operations *fops)
{
int bit;
down(&ataraid_sem);
if (ataraiduse==~0U) {
if (ataraiduse == ~0U) {
up(&ataraid_sem);
return -ENODEV;
}
bit=ffz(ataraiduse);
ataraiduse |= 1<<bit;
bit = ffz(ataraiduse);
ataraiduse |= 1 << bit;
ataraid_ops[bit] = fops;
up(&ataraid_sem);
return bit;
......@@ -214,58 +219,63 @@ int ataraid_get_device(struct raid_device_operations *fops)
void ataraid_release_device(int device)
{
down(&ataraid_sem);
if ((ataraiduse & (1<<device))==0)
BUG(); /* device wasn't registered at all */
ataraiduse &= ~(1<<device);
if ((ataraiduse & (1 << device)) == 0)
BUG(); /* device wasn't registered at all */
ataraiduse &= ~(1 << device);
ataraid_ops[device] = NULL;
up(&ataraid_sem);
}
void ataraid_register_disk(int device,long size)
void ataraid_register_disk(int device, long size)
{
register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR,16*device),16,
&ataraid_fops,size);
register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR, 16 * device), 16,
&ataraid_fops, size);
}
static __init int ataraid_init(void)
static __init int ataraid_init(void)
{
int i;
for(i=0;i<256;i++)
for (i = 0; i < 256; i++)
ataraid_readahead[i] = 1023;
/* setup the gendisk structure */
ataraid_gendisk.part = kmalloc(256 * sizeof(struct hd_struct),GFP_KERNEL);
if (ataraid_gendisk.part==NULL) {
printk(KERN_ERR "ataraid: Couldn't allocate memory, aborting \n");
/* setup the gendisk structure */
ataraid_gendisk.part =
kmalloc(256 * sizeof(struct hd_struct), GFP_KERNEL);
if (ataraid_gendisk.part == NULL) {
printk(KERN_ERR
"ataraid: Couldn't allocate memory, aborting \n");
return -1;
}
memset(&ataraid_gendisk.part[0],0,256*sizeof(struct hd_struct));
ataraid_gendisk.major = ATAMAJOR;
ataraid_gendisk.major_name = "ataraid";
memset(&ataraid_gendisk.part[0], 0,
256 * sizeof(struct hd_struct));
ataraid_gendisk.major = ATAMAJOR;
ataraid_gendisk.major_name = "ataraid";
ataraid_gendisk.minor_shift = 4;
ataraid_gendisk.sizes = &ataraid_gendisk_sizes[0];
ataraid_gendisk.nr_real = 16;
ataraid_gendisk.fops = &ataraid_fops;
ataraid_gendisk.sizes = &ataraid_gendisk_sizes[0];
ataraid_gendisk.nr_real = 16;
ataraid_gendisk.fops = &ataraid_fops;
add_gendisk(&ataraid_gendisk);
if (register_blkdev(ATAMAJOR, "ataraid", &ataraid_fops)) {
printk(KERN_ERR "ataraid: Could not get major %d \n",ATAMAJOR);
printk(KERN_ERR "ataraid: Could not get major %d \n",
ATAMAJOR);
return -1;
}
blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),ataraid_make_request);
return 0;
blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),
ataraid_make_request);
return 0;
}
......@@ -275,7 +285,7 @@ static void __exit ataraid_exit(void)
blk_size[ATAMAJOR] = NULL;
del_gendisk(&ataraid_gendisk);
if (ataraid_gendisk.part) {
kfree(ataraid_gendisk.part);
ataraid_gendisk.part = NULL;
......@@ -292,4 +302,3 @@ EXPORT_SYMBOL(ataraid_release_device);
EXPORT_SYMBOL(ataraid_gendisk);
EXPORT_SYMBOL(ataraid_register_disk);
MODULE_LICENSE("GPL");
......@@ -135,8 +135,7 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
/*
* Now that everything is ready, program the new timings
*/
__save_flags (flags);
__cli();
local_irq_save(flags);
/*
* Program the address_setup clocks into ARTTIM reg,
* and then the active/recovery counts into the DRWTIM reg
......@@ -148,7 +147,7 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
(byte) ((active_count << 4) | recovery_count));
cmdprintk ("Write %x to %x\n", ((byte) setup_count) | (temp_b & 0x3f), arttim_regs[channel][slave]);
cmdprintk ("Write %x to %x\n", (byte) ((active_count << 4) | recovery_count), drwtim_regs[channel][slave]);
__restore_flags(flags);
local_irq_restore(flags);
}
/*
......@@ -808,45 +807,45 @@ static void __init cmd64x_init_channel(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_643,
init_chipset: cmd64x_init_chipset,
init_channel: cmd64x_init_channel,
bootable: ON_BOARD,
flags: ATA_F_SIMPLEX,
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_643,
.init_chipset = cmd64x_init_chipset,
.init_channel = cmd64x_init_channel,
.bootable = ON_BOARD,
.flags = ATA_F_SIMPLEX,
},
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_646,
init_chipset: cmd64x_init_chipset,
init_channel: cmd64x_init_channel,
enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_646,
.init_chipset = cmd64x_init_chipset,
.init_channel = cmd64x_init_channel,
.enablebits = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
.bootable = ON_BOARD,
.flags = ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_648,
init_chipset: cmd64x_init_chipset,
init_channel: cmd64x_init_channel,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_648,
.init_chipset = cmd64x_init_chipset,
.init_channel = cmd64x_init_channel,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_649,
init_chipset: cmd64x_init_chipset,
init_channel: cmd64x_init_channel,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_649,
.init_chipset = cmd64x_init_chipset,
.init_channel = cmd64x_init_channel,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_680,
init_chipset: cmd64x_init_chipset,
init_channel: cmd64x_init_channel,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_680,
.init_chipset = cmd64x_init_chipset,
.init_channel = cmd64x_init_channel,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
},
};
......
......@@ -314,12 +314,12 @@ static void __init ide_init_cs5530(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipset __initdata = {
vendor: PCI_VENDOR_ID_CYRIX,
device: PCI_DEVICE_ID_CYRIX_5530_IDE,
init_chipset: pci_init_cs5530,
init_channel: ide_init_cs5530,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CYRIX,
.device = PCI_DEVICE_ID_CYRIX_5530_IDE,
.init_chipset = pci_init_cs5530,
.init_channel = ide_init_cs5530,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
};
int __init init_cs5530(void)
......
......@@ -426,12 +426,12 @@ static void __init ide_init_cy82c693(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipset __initdata = {
vendor: PCI_VENDOR_ID_CONTAQ,
device: PCI_DEVICE_ID_CONTAQ_82C693,
init_chipset: pci_init_cy82c693,
init_channel: ide_init_cy82c693,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_CONTAQ,
.device = PCI_DEVICE_ID_CONTAQ_82C693,
.init_chipset = pci_init_cy82c693,
.init_channel = ide_init_cy82c693,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
};
int __init init_cy82c693(void)
......
......@@ -79,6 +79,8 @@ void ata_mask(struct ata_device *drive)
ch->maskproc(drive);
}
EXPORT_SYMBOL(ata_mask);
/*
* Check the state of the status register.
*/
......@@ -93,6 +95,39 @@ int ata_status(struct ata_device *drive, u8 good, u8 bad)
EXPORT_SYMBOL(ata_status);
/*
* This is used to check for the drive status on the IRQ handling code path.
*/
int ata_status_irq(struct ata_device *drive)
{
if (test_bit(IDE_DMA, drive->channel->active))
return udma_irq_status(drive);
/* Need to guarantee 400ns since last command was issued?
*/
#ifdef CONFIG_IDEPCI_SHARE_IRQ
/*
* We do a passive status test under shared PCI interrupts on cards
* that truly share the ATA side interrupt, but may also share an
* interrupt with another pci card/device.
*/
if (drive->channel->io_ports[IDE_CONTROL_OFFSET])
drive->status = IN_BYTE(drive->channel->io_ports[IDE_CONTROL_OFFSET]);
else
#endif
ata_status(drive, 0, 0); /* Note: this may clear a pending IRQ! */
if (drive->status & BUSY_STAT)
return 0; /* drive busy: definitely not interrupting */
else
return 1; /* drive ready: *might* be interrupting */
}
EXPORT_SYMBOL(ata_status_irq);
/*
* Busy-wait for the drive status to be not "busy". Check then the status for
* all of the "good" bits and none of the "bad" bits, and if all is okay it
......@@ -116,7 +151,7 @@ int ata_status_poll(struct ata_device *drive, u8 good, u8 bad,
unsigned long flags;
__save_flags(flags);
ide__sti();
local_irq_enable();
timeout += jiffies;
while (!ata_status(drive, 0, BUSY_STAT)) {
if (time_after(jiffies, timeout)) {
......@@ -210,6 +245,8 @@ void ata_out_regfile(struct ata_device *drive, struct hd_drive_task_hdr *rf)
OUT_BYTE(rf->high_cylinder, ch->io_ports[IDE_HCYL_OFFSET]);
}
EXPORT_SYMBOL(ata_out_regfile);
/*
* Input a complete register file.
*/
......@@ -223,5 +260,4 @@ void ata_in_regfile(struct ata_device *drive, struct hd_drive_task_hdr *rf)
rf->high_cylinder = IN_BYTE(ch->io_ports[IDE_HCYL_OFFSET]);
}
MODULE_LICENSE("GPL");
......@@ -95,8 +95,7 @@ void __init init_dtc2278 (void)
{
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
/*
* This enables the second interface
*/
......@@ -112,7 +111,7 @@ void __init init_dtc2278 (void)
sub22(1,0xc3);
sub22(0,0xa0);
#endif
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
ide_hwifs[0].serialized = 1;
ide_hwifs[1].serialized = 1;
......
......@@ -106,9 +106,9 @@ static int gayle_ack_intr_a1200(struct ata_channel *hwif)
return 1;
}
/*
* Probe for a Gayle IDE interface (and optionally for an IDE doubler)
*/
/*
* Probe for a Gayle IDE interface (and optionally for an IDE doubler)
*/
void __init gayle_init(void)
{
......@@ -122,7 +122,7 @@ void __init gayle_init(void)
for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) {
ide_ioreg_t base, ctrlport, irqport;
ide_ack_intr_t *ack_intr;
int (*ack_intr)(struct ata_channel *);
hw_regs_t hw;
int index;
unsigned long phys_base, res_start, res_n;
......
......@@ -132,16 +132,16 @@ unsigned long last_req;
unsigned long read_timer(void)
{
extern spinlock_t i8253_lock;
unsigned long t, flags;
int i;
save_flags(flags);
cli();
spin_lock_irqsave(&i8253_lock, flags);
t = jiffies * 11932;
outb_p(0, 0x43);
i = inb_p(0x40);
i |= inb(0x40) << 8;
restore_flags(flags);
spin_unlock_irqrestore(&i8253_lock, flags);
return(t - i);
}
#endif
......@@ -693,12 +693,12 @@ static int hd_release(struct inode * inode, struct file * file)
extern struct block_device_operations hd_fops;
static struct gendisk hd_gendisk = {
major: MAJOR_NR,
major_name: "hd",
minor_shift: 6,
part: hd,
sizes: hd_sizes,
fops: &hd_fops,
.major = MAJOR_NR,
.major_name = "hd",
.minor_shift = 6,
.part = hd,
.sizes = hd_sizes,
.fops = &hd_fops,
};
static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
......@@ -714,9 +714,9 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
static struct block_device_operations hd_fops = {
open: hd_open,
release: hd_release,
ioctl: hd_ioctl,
.open = hd_open,
.release = hd_release,
.ioctl = hd_ioctl,
};
/*
......@@ -817,8 +817,19 @@ static void __init hd_geninit(void)
NR_HD = 0;
return;
}
request_region(HD_DATA, 8, "hd");
request_region(HD_CMD, 1, "hd(cmd)");
if (!request_region(HD_DATA, 8, "hd")) {
printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA);
NR_HD = 0;
free_irq(HD_IRQ, NULL);
return;
}
if (!request_region(HD_CMD, 1, "hd(cmd)")) {
printk(KERN_WARNING "hd: port 0x%x busy\n", HD_CMD);
NR_HD = 0;
free_irq(HD_IRQ, NULL);
release_region(HD_DATA, 8);
return;
}
hd_gendisk.nr_real = NR_HD;
......
......@@ -135,8 +135,7 @@ static unsigned int __init pci_init_hpt34x(struct pci_dev *dev)
unsigned short cmd;
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
pci_write_config_byte(dev, HPT34X_PCI_INIT_REG, 0x00);
pci_read_config_word(dev, PCI_COMMAND, &cmd);
......@@ -167,7 +166,7 @@ static unsigned int __init pci_init_hpt34x(struct pci_dev *dev)
pci_write_config_dword(dev, PCI_BASE_ADDRESS_3, dev->resource[3].start);
pci_write_config_word(dev, PCI_COMMAND, cmd);
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
return dev->irq;
}
......@@ -202,13 +201,13 @@ static void __init ide_init_hpt34x(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipset __initdata = {
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT343,
init_chipset: pci_init_hpt34x,
init_channel: ide_init_hpt34x,
bootable: NEVER_BOARD,
extra: 16,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_TTI,
.device = PCI_DEVICE_ID_TTI_HPT343,
.init_chipset = pci_init_hpt34x,
.init_channel = ide_init_hpt34x,
.bootable = NEVER_BOARD,
.extra = 16,
.flags = ATA_F_DMA
};
int __init init_hpt34x(void)
......
......@@ -1222,34 +1222,34 @@ static void __init hpt366_init_dma(struct ata_channel *ch, unsigned long dmabase
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT366,
init_chipset: hpt366_init_chipset,
init_channel: hpt366_init_channel,
init_dma: hpt366_init_dma,
bootable: OFF_BOARD,
extra: 240,
flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
.vendor = PCI_VENDOR_ID_TTI,
.device = PCI_DEVICE_ID_TTI_HPT366,
.init_chipset = hpt366_init_chipset,
.init_channel = hpt366_init_channel,
.init_dma = hpt366_init_dma,
.bootable = OFF_BOARD,
.extra = 240,
.flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT372,
init_chipset: hpt366_init_chipset,
init_channel: hpt366_init_channel,
init_dma: hpt366_init_dma,
bootable: OFF_BOARD,
extra: 0,
flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
.vendor = PCI_VENDOR_ID_TTI,
.device = PCI_DEVICE_ID_TTI_HPT372,
.init_chipset = hpt366_init_chipset,
.init_channel = hpt366_init_channel,
.init_dma = hpt366_init_dma,
.bootable = OFF_BOARD,
.extra = 0,
.flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT374,
init_chipset: hpt366_init_chipset,
init_channel: hpt366_init_channel,
init_dma: hpt366_init_dma,
bootable: OFF_BOARD,
extra: 0,
flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
.vendor = PCI_VENDOR_ID_TTI,
.device = PCI_DEVICE_ID_TTI_HPT374,
.init_chipset = hpt366_init_chipset,
.init_channel = hpt366_init_channel,
.init_dma = hpt366_init_dma,
.bootable = OFF_BOARD,
.extra = 0,
.flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
},
};
......
This diff is collapsed.
......@@ -127,8 +127,7 @@ static void ht6560b_selectproc(struct ata_device *drive)
static u8 current_timing = 0;
u8 select, timing;
__save_flags (flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
select = HT_CONFIG(drive);
timing = HT_TIMING(drive);
......@@ -152,7 +151,7 @@ static void ht6560b_selectproc(struct ata_device *drive)
printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, select, timing);
#endif
}
__restore_flags (flags); /* local CPU only */
local_irq_restore(flags);
}
/*
......
......@@ -556,7 +556,7 @@ static void cdrom_end_request(struct ata_device *drive, struct request *rq, int
if ((rq->flags & REQ_CMD) && !rq->current_nr_sectors)
uptodate = 1;
__ata_end_request(drive, rq, uptodate, 0);
ata_end_request(drive, rq, uptodate, 0);
}
......@@ -912,7 +912,7 @@ static ide_startstop_t cdrom_read_intr(struct ata_device *drive, struct request
if (dma) {
if (!dma_error) {
__ata_end_request(drive, rq, 1, rq->nr_sectors);
ata_end_request(drive, rq, 1, rq->nr_sectors);
return ATA_OP_FINISHED;
} else
......@@ -1497,7 +1497,7 @@ static ide_startstop_t cdrom_write_intr(struct ata_device *drive, struct request
if (dma_error)
return ata_error(drive, rq, "dma error");
__ata_end_request(drive, rq, 1, rq->nr_sectors);
ata_end_request(drive, rq, 1, rq->nr_sectors);
return ATA_OP_FINISHED;
}
......@@ -1936,7 +1936,7 @@ static int cdrom_read_toc(struct ata_device *drive, struct request_sense *sense)
If we get an error for the regular case, we assume
a CDI without additional audio tracks. In this case
the readable TOC is empty (CDI tracks are not included)
and only holds the Leadout entry. Heiko Eißfeldt */
and only holds the Leadout entry. Heiko EiÃ^ßfeldt */
ntracks = 0;
stat = cdrom_read_tocentry(drive, CDROM_LEADOUT, 1, 0,
(char *)&toc->hdr,
......@@ -2453,26 +2453,26 @@ void ide_cdrom_release_real (struct cdrom_device_info *cdi)
* Device initialization.
*/
static struct cdrom_device_ops ide_cdrom_dops = {
open: ide_cdrom_open_real,
release: ide_cdrom_release_real,
drive_status: ide_cdrom_drive_status,
media_changed: ide_cdrom_check_media_change_real,
tray_move: ide_cdrom_tray_move,
lock_door: ide_cdrom_lock_door,
select_speed: ide_cdrom_select_speed,
get_last_session: ide_cdrom_get_last_session,
get_mcn: ide_cdrom_get_mcn,
reset: ide_cdrom_reset,
audio_ioctl: ide_cdrom_audio_ioctl,
dev_ioctl: ide_cdrom_dev_ioctl,
capability: CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
.open = ide_cdrom_open_real,
.release = ide_cdrom_release_real,
.drive_status = ide_cdrom_drive_status,
.media_changed = ide_cdrom_check_media_change_real,
.tray_move = ide_cdrom_tray_move,
.lock_door = ide_cdrom_lock_door,
.select_speed = ide_cdrom_select_speed,
.get_last_session = ide_cdrom_get_last_session,
.get_mcn = ide_cdrom_get_mcn,
.reset = ide_cdrom_reset,
.audio_ioctl = ide_cdrom_audio_ioctl,
.dev_ioctl = ide_cdrom_dev_ioctl,
.capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
CDC_SELECT_SPEED | CDC_SELECT_DISC |
CDC_MULTI_SESSION | CDC_MCN |
CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET |
CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R |
CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM |
CDC_GENERIC_PACKET,
generic_packet: ide_cdrom_packet,
.generic_packet = ide_cdrom_packet,
};
static int ide_cdrom_register(struct ata_device *drive, int nslots)
......@@ -2840,11 +2840,11 @@ static int ide_cdrom_setup(struct ata_device *drive)
}
/* Forwarding functions to generic routines. */
static int ide_cdrom_ioctl (struct ata_device *drive,
static int ide_cdrom_ioctl(struct ata_device *drive,
struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
return cdrom_ioctl (inode, file, cmd, arg);
return cdrom_ioctl(inode, file, cmd, arg);
}
static int ide_cdrom_open (struct inode *ip, struct file *fp, struct ata_device *drive)
......@@ -2932,18 +2932,18 @@ int ide_cdrom_cleanup(struct ata_device *drive)
static void ide_cdrom_attach(struct ata_device *drive);
static struct ata_operations ide_cdrom_driver = {
owner: THIS_MODULE,
attach: ide_cdrom_attach,
cleanup: ide_cdrom_cleanup,
standby: NULL,
do_request: ide_cdrom_do_request,
end_request: NULL,
ioctl: ide_cdrom_ioctl,
open: ide_cdrom_open,
release: ide_cdrom_release,
check_media_change: ide_cdrom_check_media_change,
revalidate: ide_cdrom_revalidate,
capacity: ide_cdrom_capacity,
.owner = THIS_MODULE,
.attach = ide_cdrom_attach,
.cleanup = ide_cdrom_cleanup,
.standby = NULL,
.do_request = ide_cdrom_do_request,
.end_request = NULL,
.ioctl = ide_cdrom_ioctl,
.open = ide_cdrom_open,
.release = ide_cdrom_release,
.check_media_change = ide_cdrom_check_media_change,
.revalidate = ide_cdrom_revalidate,
.capacity = ide_cdrom_capacity,
};
/* options */
......
......@@ -140,7 +140,7 @@ static ide_startstop_t task_in_intr(struct ata_device *drive, struct request *rq
--rq->current_nr_sectors;
if (rq->current_nr_sectors <= 0) {
if (!__ata_end_request(drive, rq, 1, 0)) {
if (!ata_end_request(drive, rq, 1, 0)) {
// printk("Request Ended stat: %02x\n", drive->status);
return ATA_OP_FINISHED;
......@@ -166,7 +166,7 @@ static ide_startstop_t task_out_intr(struct ata_device *drive, struct request *r
if (!ata_status(drive, DRIVE_READY, drive->bad_wstat))
return ata_error(drive, rq, __FUNCTION__);
if (!rq->current_nr_sectors && !__ata_end_request(drive, rq, 1, 0)) {
if (!rq->current_nr_sectors && !ata_end_request(drive, rq, 1, 0)) {
ret = ATA_OP_FINISHED;
} else {
if ((rq->nr_sectors == 1) != (drive->status & DRQ_STAT)) {
......@@ -235,7 +235,7 @@ static ide_startstop_t task_mulin_intr(struct ata_device *drive, struct request
/* FIXME: this seems buggy */
if (rq->current_nr_sectors <= 0) {
if (!__ata_end_request(drive, rq, 1, 0))
if (!ata_end_request(drive, rq, 1, 0))
return ATA_OP_FINISHED;
}
msect -= nsect;
......@@ -269,7 +269,7 @@ static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request
return ata_error(drive, rq, __FUNCTION__);
}
if (!rq->nr_sectors) {
__ata_end_request(drive, rq, 1, rq->hard_nr_sectors);
ata_end_request(drive, rq, 1, rq->hard_nr_sectors);
rq->bio = NULL;
ret = ATA_OP_FINISHED;
} else if (!ok) {
......@@ -349,7 +349,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
/* FIXME: this check doesn't make sense */
if (!(rq->flags & REQ_CMD)) {
blk_dump_rq_flags(rq, "idedisk_do_request - bad command");
__ata_end_request(drive, rq, 0, 0);
ata_end_request(drive, rq, 0, 0);
return ATA_OP_FINISHED;
}
......@@ -514,8 +514,8 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
printk("sectors=%ld, ", rq->nr_sectors);
printk("buffer=%p\n", rq->buffer);
#endif
ar->cmd = cmd;
rq->special = ar;
ar->cmd = cmd;
rq->special = ar;
}
/* (ks/hs): Moved to start, do not use for multiple out commands.
......@@ -548,10 +548,9 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
return ATA_OP_CONTINUES;
}
/* FIXME: Warning check for race between handler and prehandler
* for writing first block of data. however since we are well
* inside the boundaries of the seek, we should be okay.
* FIXME: should be fixed --bzolnier
/* FIXME: Warning check for race between handlers for writing
* first block of data. However since we are well inside the
* boundaries of the seek, we should be okay.
*/
if (ar->command_type == IDE_DRIVE_TASK_RAW_WRITE) {
ide_startstop_t ret;
......@@ -596,13 +595,15 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
*
* FIXME: Replace hard-coded 100, what about
* error handling?
*
* FIXME: Whatabout the IRE clearing and not clearing case?!
*/
for (i = 0; i < 100; ++i) {
if (drive_is_ready(drive))
if (ata_status_irq(drive))
break;
}
if (!drive_is_ready(drive)) {
if (!ata_status_irq(drive)) {
/* We are compleatly missing an error
* return path here.
* FIXME: We have only one? -alat
......@@ -1290,7 +1291,9 @@ static int idedisk_cleanup(struct ata_device *drive)
return ret;
}
static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static int idedisk_ioctl(struct ata_device *drive,
struct inode *inode, struct file *__fp,
unsigned int cmd, unsigned long arg)
{
struct hd_driveid *id = drive->id;
......@@ -1440,18 +1443,18 @@ static void idedisk_attach(struct ata_device *drive);
* Subdriver functions.
*/
static struct ata_operations idedisk_driver = {
owner: THIS_MODULE,
attach: idedisk_attach,
cleanup: idedisk_cleanup,
standby: idedisk_standby,
do_request: idedisk_do_request,
end_request: NULL,
ioctl: idedisk_ioctl,
open: idedisk_open,
release: idedisk_release,
check_media_change: idedisk_check_media_change,
revalidate: NULL, /* use default method */
capacity: idedisk_capacity,
.owner = THIS_MODULE,
.attach = idedisk_attach,
.cleanup = idedisk_cleanup,
.standby = idedisk_standby,
.do_request = idedisk_do_request,
.end_request = NULL,
.ioctl = idedisk_ioctl,
.open = idedisk_open,
.release = idedisk_release,
.check_media_change = idedisk_check_media_change,
.revalidate = NULL, /* use default method */
.capacity = idedisk_capacity,
};
static void idedisk_attach(struct ata_device *drive)
......
......@@ -96,6 +96,7 @@
#include <linux/cdrom.h>
#include <linux/ide.h>
#include <linux/atapi.h>
#include <linux/buffer_head.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
......@@ -367,7 +368,7 @@ static int idefloppy_end_request(struct ata_device *drive, struct request *rq, i
return 0;
if (!(rq->flags & REQ_SPECIAL)) {
__ata_end_request(drive, rq, uptodate, 0);
ata_end_request(drive, rq, uptodate, 0);
return 0;
}
......@@ -592,9 +593,9 @@ static ide_startstop_t idefloppy_pc_intr(struct ata_device *drive, struct reques
#if IDEFLOPPY_DEBUG_LOG
printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred);
#endif /* IDEFLOPPY_DEBUG_LOG */
clear_bit (PC_DMA_IN_PROGRESS, &pc->flags);
clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
ide__sti(); /* local CPU only */
local_irq_enable();
if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { /* Error detected */
#if IDEFLOPPY_DEBUG_LOG
......@@ -731,7 +732,6 @@ static ide_startstop_t idefloppy_transfer_pc2(struct ata_device *drive, struct r
static ide_startstop_t idefloppy_transfer_pc1(struct ata_device *drive, struct request *rq)
{
idefloppy_floppy_t *floppy = drive->driver_data;
ide_startstop_t startstop;
atapi_ireason_reg_t ireason;
int ret;
......@@ -1345,18 +1345,18 @@ static int idefloppy_get_format_progress(struct ata_device *drive,
progress_indication=floppy->progress_indication;
}
/* Else assume format_unit has finished, and we're
** at 0x10000 */
* at 0x10000
*/
}
else
{
atapi_status_reg_t status;
unsigned long flags;
__save_flags(flags);
__cli();
local_irq_save(flags);
ata_status(drive, 0, 0);
status.all = drive->status;
__restore_flags(flags);
local_irq_restore(flags);
progress_indication= !status.b.dsc ? 0:0x10000;
}
......@@ -1735,18 +1735,18 @@ static void idefloppy_attach(struct ata_device *drive);
* IDE subdriver functions, registered with ide.c
*/
static struct ata_operations idefloppy_driver = {
owner: THIS_MODULE,
attach: idefloppy_attach,
cleanup: idefloppy_cleanup,
standby: NULL,
do_request: idefloppy_do_request,
end_request: idefloppy_end_request,
ioctl: idefloppy_ioctl,
open: idefloppy_open,
release: idefloppy_release,
check_media_change: idefloppy_check_media_change,
revalidate: NULL, /* use default method */
capacity: idefloppy_capacity,
.owner = THIS_MODULE,
.attach = idefloppy_attach,
.cleanup = idefloppy_cleanup,
.standby = NULL,
.do_request = idefloppy_do_request,
.end_request = idefloppy_end_request,
.ioctl = idefloppy_ioctl,
.open = idefloppy_open,
.release = idefloppy_release,
.check_media_change = idefloppy_check_media_change,
.revalidate = NULL, /* use default method */
.capacity = idefloppy_capacity,
};
static void idefloppy_attach(struct ata_device *drive)
......
......@@ -50,7 +50,7 @@ static void print_fixed (volatile unsigned char *p);
static void print_funcid (int func);
static int check_ide_device (unsigned long base);
static void ide_interrupt_ack (void *dev);
static int ide_interrupt_ack(struct ata_channel *);
static void m8xx_ide_tuneproc(struct ata_device *drive, byte pio);
typedef struct ide_ioport_desc {
......@@ -326,7 +326,7 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
/* register routine to tune PIO mode */
ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc;
hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack;
hw->ack_intr = ide_interrupt_ack;
/* Enable Harddisk Interrupt,
* and make it edge sensitive
*/
......@@ -401,7 +401,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw,
ioport_dsc[data_port].reg_off[i],
i, base + ioport_dsc[data_port].reg_off[i]);
#endif
*p++ = base + ioport_dsc[data_port].reg_off[i];
*p++ = base + ioport_dsc[data_port].reg_off[i];
}
if (irq) {
......@@ -412,16 +412,16 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw,
/* register routine to tune PIO mode */
ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc;
hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack;
hw->ack_intr = ide_interrupt_ack;
/* Enable Harddisk Interrupt,
* and make it edge sensitive
*/
/* (11-18) Set edge detect for irq, no wakeup from low power mode */
((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |=
(0x80000000 >> ioport_dsc[data_port].irq);
} /* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */
} /* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */
#endif /* CONFIG_IDE_8xx_DIRECT */
#endif
/* -------------------------------------------------------------------- */
......@@ -493,11 +493,10 @@ m8xx_ide_tuneproc(struct ata_device *drive, byte pio)
printk("%s[%d] %s: not implemented yet!\n",
__FILE__,__LINE__,__FUNCTION__);
#endif /* defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_PCMCIA */
#endif
}
static void
ide_interrupt_ack (void *dev)
static int ide_interrupt_ack(struct ata_channel *ch)
{
#ifdef CONFIG_IDE_8xx_PCCARD
u_int pscr, pipr;
......@@ -529,17 +528,17 @@ ide_interrupt_ack (void *dev)
/* clear the interrupt sources */
((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr = pscr;
#else /* ! CONFIG_IDE_8xx_PCCARD */
#else
/*
* Only CONFIG_IDE_8xx_PCCARD is using the interrupt of the
* MPC8xx's PCMCIA controller, so there is nothing to be done here
* for CONFIG_IDE_8xx_DIRECT and CONFIG_IDE_EXT_DIRECT.
* The interrupt is handled somewhere else. -- Steven
*/
#endif /* CONFIG_IDE_8xx_PCCARD */
}
#endif
return 0;
}
/*
* CIS Tupel codes
......@@ -655,7 +654,7 @@ static int check_ide_device (unsigned long base)
q+= 2;
}
}
#endif /* DEBUG_PCMCIA */
#endif
switch (code) {
case CISTPL_VERS_1:
ident = p + 4;
......
......@@ -158,6 +158,80 @@ static int __init setup_pci_baseregs(struct pci_dev *dev, const char *name)
return 0;
}
#ifdef CONFIG_BLK_DEV_IDEDMA
/*
* Setup DMA transfers on the channel.
*/
static void __init setup_channel_dma(struct pci_dev *dev,
struct ata_pci_device* d,
int autodma,
struct ata_channel *ch)
{
unsigned long dma_base;
if (d->flags & ATA_F_NOADMA)
autodma = 0;
if (autodma)
ch->autodma = 1;
if (!((d->flags & ATA_F_DMA) || ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80))))
return;
/*
* Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space:
*/
dma_base = pci_resource_start(dev, 4);
if (dma_base) {
/* PDC20246, PDC20262, HPT343, & HPT366 */
if ((ch->unit == ATA_PRIMARY) && d->extra) {
request_region(dma_base + 16, d->extra, dev->name);
ch->dma_extra = d->extra;
}
/* If we are on the second channel, the dma base address will
* be one entry away from the primary interface.
*/
if (ch->unit == ATA_SECONDARY)
dma_base += 8;
if (d->flags & ATA_F_SIMPLEX) {
outb(inb(dma_base + 2) & 0x60, dma_base + 2);
if (inb(dma_base + 2) & 0x80)
printk(KERN_INFO "%s: simplex device: DMA forced\n", dev->name);
} else {
/* If the device claims "simplex" DMA, this means only
* one of the two interfaces can be trusted with DMA at
* any point in time. So we should enable DMA only on
* one of the two interfaces.
*/
if ((inb(dma_base + 2) & 0x80)) {
if ((!ch->drives[0].present && !ch->drives[1].present) ||
ch->unit == ATA_SECONDARY) {
printk(KERN_INFO "%s: simplex device: DMA disabled\n", dev->name);
dma_base = 0;
}
}
}
} else {
printk(KERN_INFO "%s: %s Bus-Master DMA was disabled by BIOS\n",
ch->name, dev->name);
return;
}
/* The function below will check itself whatever there is something to
* be done or not. We don't have therefore to care whatever it was
* already enabled by the primary channel run.
*/
pci_set_master(dev);
if (d->init_dma)
d->init_dma(ch, dma_base);
else
ata_init_dma(ch, dma_base);
}
#endif
/*
* Setup a particular port on an ATA host controller.
*
......@@ -171,7 +245,6 @@ static int __init setup_host_channel(struct pci_dev *dev,
int autodma)
{
unsigned long base = 0;
unsigned long dma_base;
unsigned long ctl = 0;
ide_pci_enablebit_t *e = &(d->enablebits[port]);
struct ata_channel *ch;
......@@ -260,69 +333,13 @@ static int __init setup_host_channel(struct pci_dev *dev,
if (ch->udma_four)
printk("%s: warning: ATA-66/100 forced bit set!\n", dev->name);
#ifdef CONFIG_BLK_DEV_IDEDMA
/*
* Setup DMA transfers on the channel.
*/
if (!((d->flags & ATA_F_DMA) || ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80))))
goto no_dma;
/*
* Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space:
*/
dma_base = pci_resource_start(dev, 4);
if (dma_base) {
/* PDC20246, PDC20262, HPT343, & HPT366 */
if ((ch->unit == ATA_PRIMARY) && d->extra) {
request_region(dma_base + 16, d->extra, dev->name);
ch->dma_extra = d->extra;
}
/* If we are on the second channel, the dma base address will
* be one entry away from the primary interface.
*/
if (ch->unit == ATA_SECONDARY)
dma_base += 8;
if (d->flags & ATA_F_SIMPLEX) {
outb(inb(dma_base + 2) & 0x60, dma_base + 2);
if (inb(dma_base + 2) & 0x80)
printk(KERN_INFO "%s: simplex device: DMA forced\n", dev->name);
} else {
/* If the device claims "simplex" DMA, this means only
* one of the two interfaces can be trusted with DMA at
* any point in time. So we should enable DMA only on
* one of the two interfaces.
*/
if ((inb(dma_base + 2) & 0x80)) {
if ((!ch->drives[0].present && !ch->drives[1].present) ||
ch->unit == ATA_SECONDARY) {
printk(KERN_INFO "%s: simplex device: DMA disabled\n", dev->name);
dma_base = 0;
}
}
}
} else {
printk(KERN_INFO "%s: %s Bus-Master DMA was disabled by BIOS\n",
ch->name, dev->name);
goto no_dma;
}
/* The function below will check itself whatever there is something to
* be done or not. We don't have therefore to care whatever it was
* already enabled by the primary channel run.
*/
pci_set_master(dev);
if (autodma)
ch->autodma = 1;
if (d->init_dma)
d->init_dma(ch, dma_base);
else
ata_init_dma(ch, dma_base);
setup_channel_dma(dev, d, autodma, ch);
#endif
no_dma:
/* Call chipset-specific routine for each enabled channel. */
if (d->init_channel)
......@@ -680,75 +697,75 @@ void __init ide_scan_pcibus(int scan_direction)
*/
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_PCTECH,
.device = PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_640,
init_channel: ATA_PCI_IGNORE,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_CMD_640,
.init_channel = ATA_PCI_IGNORE,
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87410,
enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_NS,
.device = PCI_DEVICE_ID_NS_87410,
.enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_HINT,
device: PCI_DEVICE_ID_HINT_VXPROII_IDE,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_HINT,
.device = PCI_DEVICE_ID_HINT_VXPROII_IDE,
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_HOLTEK,
device: PCI_DEVICE_ID_HOLTEK_6565,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_HOLTEK,
.device = PCI_DEVICE_ID_HOLTEK_6565,
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371MX,
enablebits: {{0x6D,0x80,0x80}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
flags: ATA_F_NODMA
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82371MX,
.enablebits = {{0x6D,0x80,0x80}, {0x00,0x00,0x00}},
.bootable = ON_BOARD,
.flags = ATA_F_NODMA
},
{
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8673F,
bootable: ON_BOARD,
flags: ATA_F_FIXIRQ
.vendor = PCI_VENDOR_ID_UMC,
.device = PCI_DEVICE_ID_UMC_UM8673F,
.bootable = ON_BOARD,
.flags = ATA_F_FIXIRQ
},
{
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886A,
bootable: ON_BOARD,
flags: ATA_F_FIXIRQ
.vendor = PCI_VENDOR_ID_UMC,
.device = PCI_DEVICE_ID_UMC_UM8886A,
.bootable = ON_BOARD,
.flags = ATA_F_FIXIRQ
},
{
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886BF,
bootable: ON_BOARD,
flags: ATA_F_FIXIRQ
.vendor = PCI_VENDOR_ID_UMC,
.device = PCI_DEVICE_ID_UMC_UM8886BF,
.bootable = ON_BOARD,
.flags = ATA_F_FIXIRQ
},
{
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C561,
bootable: ON_BOARD,
flags: ATA_F_NOADMA
.vendor = PCI_VENDOR_ID_VIA,
.device = PCI_DEVICE_ID_VIA_82C561,
.bootable = ON_BOARD,
.flags = ATA_F_NOADMA
},
{
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C586_1,
bootable: ON_BOARD,
flags: ATA_F_NOADMA
.vendor = PCI_VENDOR_ID_VIA,
.device = PCI_DEVICE_ID_VIA_82C586_1,
.bootable = ON_BOARD,
.flags = ATA_F_NOADMA
},
{
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT366,
bootable: OFF_BOARD,
extra: 240,
flags: ATA_F_IRQ | ATA_F_HPTHACK
.vendor = PCI_VENDOR_ID_TTI,
.device = PCI_DEVICE_ID_TTI_HPT366,
.bootable = OFF_BOARD,
.extra = 240,
.flags = ATA_F_IRQ | ATA_F_HPTHACK
}
};
......
......@@ -419,10 +419,10 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command)
OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG);
OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG);
udelay(1);
__save_flags(flags); /* local CPU only */
ide__sti(); /* local CPU only -- for jiffies */
__save_flags(flags);
local_irq_enable();
result = wait_for_ready(drive);
__restore_flags(flags); /* local CPU only */
__restore_flags(flags);
ata_irq_enable(drive, 1);
if (result)
printk(KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n");
......
......@@ -421,6 +421,7 @@
#include <linux/completion.h>
#include <linux/ide.h>
#include <linux/atapi.h>
#include <linux/buffer_head.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
......@@ -1880,9 +1881,9 @@ static ide_startstop_t idetape_pc_intr(struct ata_device *drive, struct request
if (tape->debug_level >= 2)
printk (KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred);
#endif
clear_bit (PC_DMA_IN_PROGRESS, &pc->flags);
clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
ide__sti(); /* local CPU only */
local_irq_enable();
#if SIMULATE_ERRORS
if ((pc->c[0] == IDETAPE_WRITE_CMD || pc->c[0] == IDETAPE_READ_CMD) && (++error_sim_count % 100) == 0) {
......@@ -2445,7 +2446,7 @@ static ide_startstop_t idetape_do_request(struct ata_device *drive, struct reque
* We do not support buffer cache originated requests.
*/
printk (KERN_NOTICE "ide-tape: %s: Unsupported command in request queue (%ld)\n", drive->name, rq->flags);
__ata_end_request(drive, rq, 0, 0); /* Let the common code handle it */
ata_end_request(drive, rq, 0, 0); /* Let the common code handle it */
return ATA_OP_FINISHED;
}
......@@ -5925,17 +5926,17 @@ static void idetape_revalidate(struct ata_device *_dummy)
static void idetape_attach(struct ata_device *);
static struct ata_operations idetape_driver = {
owner: THIS_MODULE,
attach: idetape_attach,
cleanup: idetape_cleanup,
standby: NULL,
do_request: idetape_do_request,
end_request: idetape_end_request,
ioctl: idetape_blkdev_ioctl,
open: idetape_blkdev_open,
release: idetape_blkdev_release,
check_media_change: NULL,
revalidate: idetape_revalidate,
.owner = THIS_MODULE,
.attach = idetape_attach,
.cleanup = idetape_cleanup,
.standby = NULL,
.do_request = idetape_do_request,
.end_request = idetape_end_request,
.ioctl = idetape_blkdev_ioctl,
.open = idetape_blkdev_open,
.release = idetape_blkdev_release,
.check_media_change = NULL,
.revalidate = idetape_revalidate,
};
......@@ -5944,12 +5945,12 @@ static struct ata_operations idetape_driver = {
* Our character device supporting functions, passed to register_chrdev.
*/
static struct file_operations idetape_fops = {
owner: THIS_MODULE,
read: idetape_chrdev_read,
write: idetape_chrdev_write,
ioctl: idetape_chrdev_ioctl,
open: idetape_chrdev_open,
release: idetape_chrdev_release,
.owner = THIS_MODULE,
.read = idetape_chrdev_read,
.write = idetape_chrdev_write,
.ioctl = idetape_chrdev_ioctl,
.open = idetape_chrdev_open,
.release = idetape_chrdev_release,
};
static void idetape_attach(struct ata_device *drive)
......
......@@ -33,18 +33,9 @@
#include <asm/io.h>
#include <asm/bitops.h>
#define DEBUG_TASKFILE 0 /* unset when fixed */
#if DEBUG_TASKFILE
#define DTF(x...) printk(##x)
#else
#define DTF(x...)
#endif
/*
* Data transfer functions for polled IO.
*/
static void ata_read_32(struct ata_device *drive, void *buffer, unsigned int wcount)
{
insl(IDE_DATA_REG, buffer, wcount);
......@@ -143,109 +134,16 @@ void ata_write(struct ata_device *drive, void *buffer, unsigned int wcount)
}
}
/*
* Needed for PCI irq sharing
*/
int drive_is_ready(struct ata_device *drive)
{
if (test_bit(IDE_DMA, drive->channel->active))
return udma_irq_status(drive);
/*
* Need to guarantee 400ns since last command was issued?
*/
/* FIXME: promote this to the general status read method perhaps.
*/
#ifdef CONFIG_IDEPCI_SHARE_IRQ
/*
* We do a passive status test under shared PCI interrupts on
* cards that truly share the ATA side interrupt, but may also share
* an interrupt with another pci card/device. We make no assumptions
* about possible isa-pnp and pci-pnp issues yet.
*/
if (drive->channel->io_ports[IDE_CONTROL_OFFSET])
drive->status = GET_ALTSTAT();
else
#endif
ata_status(drive, 0, 0); /* Note: this may clear a pending IRQ! */
if (drive->status & BUSY_STAT)
return 0; /* drive busy: definitely not interrupting */
return 1; /* drive ready: *might* be interrupting */
}
/*
* This function issues a special IDE device request onto the request queue.
*
* If action is ide_wait, then the rq is queued at the end of the request
* queue, and the function sleeps until it has been processed. This is for use
* when invoked from an ioctl handler.
*
* If action is ide_preempt, then the rq is queued at the head of the request
* queue, displacing the currently-being-processed request and this function
* returns immediately without waiting for the new rq to be completed. This is
* VERY DANGEROUS, and is intended for careful use by the ATAPI tape/cdrom
* driver code.
*
* If action is ide_end, then the rq is queued at the end of the request queue,
* and the function returns immediately without waiting for the new rq to be
* completed. This is again intended for careful use by the ATAPI tape/cdrom
* driver code.
*/
int ide_do_drive_cmd(struct ata_device *drive, struct request *rq, ide_action_t action)
{
unsigned long flags;
struct ata_channel *ch = drive->channel;
unsigned int major = ch->major;
request_queue_t *q = &drive->queue;
struct list_head *queue_head = &q->queue_head;
DECLARE_COMPLETION(wait);
#ifdef CONFIG_BLK_DEV_PDC4030
if (ch->chipset == ide_pdc4030 && rq->buffer)
return -ENOSYS; /* special drive cmds not supported */
#endif
rq->errors = 0;
rq->rq_status = RQ_ACTIVE;
rq->rq_dev = mk_kdev(major,(drive->select.b.unit)<<PARTN_BITS);
if (action == ide_wait)
rq->waiting = &wait;
spin_lock_irqsave(ch->lock, flags);
if (action == ide_preempt)
drive->rq = NULL;
else if (!blk_queue_empty(&drive->queue))
queue_head = queue_head->prev; /* ide_end and ide_wait */
__elv_add_request(q, rq, queue_head);
do_ide_request(q);
spin_unlock_irqrestore(ch->lock, flags);
if (action == ide_wait) {
wait_for_completion(&wait); /* wait for it to be serviced */
return rq->errors ? -EIO : 0; /* return -EIO if errors */
}
return 0;
}
/*
* Invoked on completion of a special REQ_SPECIAL command.
*/
static ide_startstop_t special_intr(struct ata_device *drive, struct
request *rq) {
static ide_startstop_t special_intr(struct ata_device *drive, struct request *rq) {
unsigned long flags;
struct ata_channel *ch =drive->channel;
struct ata_taskfile *ar = rq->special;
ide_startstop_t ret = ATA_OP_FINISHED;
ide__sti();
local_irq_enable();
if (rq->buffer && ar->taskfile.sector_number) {
if (!ata_status(drive, 0, DRQ_STAT) && ar->taskfile.sector_number) {
......@@ -290,21 +188,52 @@ static ide_startstop_t special_intr(struct ata_device *drive, struct
int ide_raw_taskfile(struct ata_device *drive, struct ata_taskfile *ar, char *buf)
{
struct request req;
struct request *rq;
unsigned long flags;
struct ata_channel *ch = drive->channel;
request_queue_t *q = &drive->queue;
struct list_head *queue_head = &q->queue_head;
DECLARE_COMPLETION(wait);
#ifdef CONFIG_BLK_DEV_PDC4030
if (ch->chipset == ide_pdc4030 && buf)
return -ENOSYS; /* special drive cmds not supported */
#endif
rq = __blk_get_request(&drive->queue, READ);
if (!rq)
rq = __blk_get_request(&drive->queue, WRITE);
/*
* FIXME: Make sure there is a free slot on the list!
*/
BUG_ON(!rq);
rq->flags = REQ_SPECIAL;
rq->buffer = buf;
rq->special = ar;
rq->errors = 0;
rq->rq_status = RQ_ACTIVE;
rq->waiting = &wait;
ar->command_type = IDE_DRIVE_TASK_NO_DATA;
ar->XXX_handler = special_intr;
ar->command_type = IDE_DRIVE_TASK_NO_DATA;
spin_lock_irqsave(ch->lock, flags);
if (!blk_queue_empty(&drive->queue))
queue_head = queue_head->prev;
__elv_add_request(q, rq, queue_head);
q->request_fn(q);
spin_unlock_irqrestore(ch->lock, flags);
memset(&req, 0, sizeof(req));
req.flags = REQ_SPECIAL;
req.buffer = buf;
req.special = ar;
wait_for_completion(&wait); /* wait for it to be serviced */
return ide_do_drive_cmd(drive, &req, ide_wait);
return rq->errors ? -EIO : 0; /* return -EIO if errors */
}
EXPORT_SYMBOL(drive_is_ready);
EXPORT_SYMBOL(ide_do_drive_cmd);
EXPORT_SYMBOL(ata_read);
EXPORT_SYMBOL(ata_write);
EXPORT_SYMBOL(ide_raw_taskfile);
This diff is collapsed.
......@@ -225,12 +225,12 @@ static void __init ide_init_it8172(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipset __initdata = {
vendor: PCI_VENDOR_ID_ITE,
device: PCI_DEVICE_ID_ITE_IT8172G,
init_chipset: pci_init_it8172,
init_channel: ide_init_it8172,
exnablebits: {{0x00,0x00,0x00}, {0x40,0x00,0x01} },
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_ITE,
.device = PCI_DEVICE_ID_ITE_IT8172G,
.init_chipset = pci_init_it8172,
.init_channel = ide_init_it8172,
.exnablebits = {{0x00,0x00,0x00}, {0x40,0x00,0x01} },
.bootable = ON_BOARD
};
int __init init_it8172(void)
......
......@@ -140,12 +140,9 @@ struct ata_channel ide_hwifs[MAX_HWIFS]; /* master data repository */
* Setup hw_regs_t structure described by parameters. You may set up the hw
* structure yourself OR use this routine to do it for you.
*/
void ide_setup_ports(hw_regs_t *hw,
ide_ioreg_t base,
int *offsets,
ide_ioreg_t ctrl,
ide_ioreg_t intr,
ide_ack_intr_t *ack_intr,
void ide_setup_ports(hw_regs_t *hw, ide_ioreg_t base, int *offsets,
ide_ioreg_t ctrl, ide_ioreg_t intr,
int (*ack_intr)(struct ata_channel *),
int irq)
{
int i;
......@@ -637,17 +634,6 @@ int ide_register_hw(hw_regs_t *hw)
* FIXME: rewrite the following crap:
*/
/*
* stridx() returns the offset of c within s,
* or -1 if c is '\0' or not found within s.
*/
static int __init stridx (const char *s, char c)
{
char *i = strchr(s, c);
return (i && c) ? i - s : -1;
}
/*
* Parsing for ide_setup():
*
......@@ -657,14 +643,14 @@ static int __init stridx (const char *s, char c)
* 3. if the remainder is a series of no more than max_vals numbers
* separated by commas, the numbers are saved in vals[] and a
* count of how many were saved is returned. Base10 is assumed,
* and base16 is allowed when prefixed with "0x".
* and base16 is allowed when prefixed with "0x". The number of
* values read will be placed in vals[0], and the values read will
* placed in vals[1] to vals[max_vals].
* 4. otherwise, zero is returned.
*/
static int __init match_parm (char *s, const char *keywords[], int vals[], int max_vals)
{
static const char decimal[] = "0123456789";
static const char hex[] = "0123456789abcdef";
int i, n;
int i;
if (*s++ == '=') {
/*
......@@ -683,23 +669,10 @@ static int __init match_parm (char *s, const char *keywords[], int vals[], int m
* or base16 when prefixed with "0x".
* Return a count of how many were found.
*/
for (n = 0; (i = stridx(decimal, *s)) >= 0;) {
vals[n] = i;
while ((i = stridx(decimal, *++s)) >= 0)
vals[n] = (vals[n] * 10) + i;
if (*s == 'x' && !vals[n]) {
while ((i = stridx(hex, *++s)) >= 0)
vals[n] = (vals[n] * 0x10) + i;
}
if (++n == max_vals)
break;
if (*s == ',' || *s == ';')
++s;
}
if (!*s)
return n;
get_options(s, max_vals+1, vals);
return vals[0];
}
return 0; /* zero = nothing matched */
return 0;
}
/*
......@@ -744,7 +717,7 @@ static void __init init_global_data(void)
*/
int __init ide_setup(char *s)
{
int i, vals[3];
int i, vals[4];
struct ata_channel *ch;
struct ata_device *drive;
unsigned int hw, unit;
......@@ -755,7 +728,6 @@ int __init ide_setup(char *s)
return 0;
if (strncmp(s,"ide",3) &&
strncmp(s,"idebus",6) &&
strncmp(s,"hd",2)) /* hdx= & hdxlun= */
return 0;
......@@ -801,24 +773,24 @@ int __init ide_setup(char *s)
unit = unit % MAX_DRIVES;
ch = &ide_hwifs[hw];
drive = &ch->drives[unit];
if (!strncmp(s + 4, "ide-", 4)) {
if (!strncmp(s+3, "=ide-", 5)) {
strncpy(drive->driver_req, s + 4, 9);
goto done;
}
/*
* Look for last lun option: "hdxlun="
*/
if (!strncmp(&s[3], "lun", 3)) {
if (match_parm(&s[6], NULL, vals, 1) != 1)
if (!strncmp(s+3, "lun=", 4)) {
if (*get_options(s+7, 2, vals) || vals[0]!=1)
goto bad_option;
if (vals[0] >= 0 && vals[0] <= 7) {
drive->last_lun = vals[0];
if (vals[1] >= 0 && vals[1] <= 7) {
drive->last_lun = vals[1];
drive->forced_lun = 1;
} else
printk(" -- BAD LAST LUN! Expected value from 0 to 7");
goto done;
}
switch (match_parm(&s[3], hd_words, vals, 3)) {
switch (match_parm(s+3, hd_words, vals, 3)) {
case -1: /* "none" */
drive->nobios = 1; /* drop into "noprobe" */
case -2: /* "noprobe" */
......@@ -864,9 +836,9 @@ int __init ide_setup(char *s)
#endif
case 3: /* cyl,head,sect */
drive->type = ATA_DISK;
drive->cyl = drive->bios_cyl = vals[0];
drive->head = drive->bios_head = vals[1];
drive->sect = drive->bios_sect = vals[2];
drive->cyl = drive->bios_cyl = vals[1];
drive->head = drive->bios_head = vals[2];
drive->sect = drive->bios_sect = vals[3];
drive->present = 1;
drive->forced_geom = 1;
ch->noprobe = 0;
......@@ -879,10 +851,10 @@ int __init ide_setup(char *s)
/*
* Look for bus speed option: "idebus="
*/
if (!strncmp(s, "idebus", 6)) {
if (match_parm(&s[6], NULL, vals, 1) != 1)
if (!strncmp(s, "idebus=", 7)) {
if (*get_options(s+7, 2, vals) || vals[0] != 1)
goto bad_option;
idebus_parameter = vals[0];
idebus_parameter = vals[1];
goto done;
}
......@@ -892,33 +864,72 @@ int __init ide_setup(char *s)
if (!strncmp(s, "ide", 3) && s[3] >= '0' && s[3] <= max_ch) {
/*
* Be VERY CAREFUL changing this: note hardcoded indexes below
* -8,-9,-10. -11 : are reserved for future idex calls to ease the hardcoding.
*/
const char *ide_options[] = {
"noprobe", "serialize", "autotune", "noautotune", "reset", "dma", "ata66", NULL };
const char *ide_words[] = {
"noprobe", "serialize", "autotune", "noautotune", "reset", "dma", "ata66",
"minus8", "minus9", "minus10", "minus11",
"qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", NULL };
hw = s[3] - '0';
ch = &ide_hwifs[hw];
switch (match_parm(s+4, ide_options, vals, 1)) {
case -7: /* ata66 */
#ifdef CONFIG_PCI
ch->udma_four = 1;
goto done;
#else
ch->udma_four = 0;
goto bad_channel;
#endif
case -6: /* dma */
ch->autodma = 1;
goto done;
case -5: /* reset */
ch->reset = 1;
goto done;
case -4: /* noautotune */
ch->drives[0].autotune = 2;
ch->drives[1].autotune = 2;
goto done;
case -3: /* autotune */
ch->drives[0].autotune = 1;
ch->drives[1].autotune = 1;
goto done;
case -2: /* "serialize" */
do_serialize:
{
struct ata_channel *mate;
mate = &ide_hwifs[hw ^ 1];
ch->serialized = 1;
mate->serialized = 1;
}
goto done;
case -1: /* "noprobe" */
ch->noprobe = 1;
goto done;
}
i = match_parm(&s[4], ide_words, vals, 3);
/*
* Cryptic check to ensure chipset not already set for a channel:
*/
if (i > 0 || i <= -11) { /* is parameter a chipset name? */
if (ch->chipset != ide_unknown)
if (i) { /* is parameter a chipset name? */
if (ide_hwifs[hw].chipset != ide_unknown)
goto bad_option; /* chipset already specified */
if (i <= -11 && i != -18 && hw != 0)
if (i != -7 && hw != 0)
goto bad_channel; /* chipset drivers are for "ide0=" only */
if (i <= -11 && i != -18 && ide_hwifs[hw+1].chipset != ide_unknown)
if (i != -7 && ide_hwifs[1].chipset != ide_unknown)
goto bad_option; /* chipset for 2nd port already specified */
printk("\n");
}
switch (i) {
#ifdef CONFIG_BLK_DEV_PDC4030
case -18: /* "dc4030" */
case -7: /* "dc4030" */
{
extern void init_pdc4030(void);
init_pdc4030();
......@@ -926,7 +937,7 @@ int __init ide_setup(char *s)
}
#endif
#ifdef CONFIG_BLK_DEV_ALI14XX
case -17: /* "ali14xx" */
case -6: /* "ali14xx" */
{
extern void init_ali14xx (void);
init_ali14xx();
......@@ -934,7 +945,7 @@ int __init ide_setup(char *s)
}
#endif
#ifdef CONFIG_BLK_DEV_UMC8672
case -16: /* "umc8672" */
case -5: /* "umc8672" */
{
extern void init_umc8672 (void);
init_umc8672();
......@@ -942,7 +953,7 @@ int __init ide_setup(char *s)
}
#endif
#ifdef CONFIG_BLK_DEV_DTC2278
case -15: /* "dtc2278" */
case -4: /* "dtc2278" */
{
extern void init_dtc2278 (void);
init_dtc2278();
......@@ -950,7 +961,7 @@ int __init ide_setup(char *s)
}
#endif
#ifdef CONFIG_BLK_DEV_CMD640
case -14: /* "cmd640_vlb" */
case -3: /* "cmd640_vlb" */
{
extern int cmd640_vlb; /* flag for cmd640.c */
cmd640_vlb = 1;
......@@ -958,7 +969,7 @@ int __init ide_setup(char *s)
}
#endif
#ifdef CONFIG_BLK_DEV_HT6560B
case -13: /* "ht6560b" */
case -2: /* "ht6560b" */
{
extern void init_ht6560b (void);
init_ht6560b();
......@@ -966,64 +977,22 @@ int __init ide_setup(char *s)
}
#endif
#if CONFIG_BLK_DEV_QD65XX
case -12: /* "qd65xx" */
case -1: /* "qd65xx" */
{
extern void init_qd65xx (void);
init_qd65xx();
goto done;
}
#endif
case -11: /* minus11 */
case -10: /* minus10 */
case -9: /* minus9 */
case -8: /* minus8 */
goto bad_option;
case -7: /* ata66 */
#ifdef CONFIG_PCI
ch->udma_four = 1;
goto done;
#else
ch->udma_four = 0;
goto bad_channel;
#endif
case -6: /* dma */
ch->autodma = 1;
goto done;
case -5: /* reset */
ch->reset = 1;
goto done;
case -4: /* noautotune */
ch->drives[0].autotune = 2;
ch->drives[1].autotune = 2;
goto done;
case -3: /* autotune */
ch->drives[0].autotune = 1;
ch->drives[1].autotune = 1;
goto done;
case -2: /* "serialize" */
do_serialize:
{
struct ata_channel *mate;
mate = &ide_hwifs[hw ^ 1];
ch->serialized = 1;
mate->serialized = 1;
}
goto done;
case -1: /* "noprobe" */
ch->noprobe = 1;
goto done;
case 1: /* base */
vals[1] = vals[0] + 0x206; /* default ctl */
vals[2] = vals[1] + 0x206; /* default ctl */
case 2: /* base,ctl */
vals[2] = 0; /* default irq = probe for it */
vals[3] = 0; /* default irq = probe for it */
case 3: /* base,ctl,irq */
ch->hw.irq = vals[2];
ide_init_hwif_ports(&ch->hw, (ide_ioreg_t) vals[0], (ide_ioreg_t) vals[1], &ch->irq);
ch->hw.irq = vals[3];
ide_init_hwif_ports(&ch->hw, (ide_ioreg_t) vals[1], (ide_ioreg_t) vals[2], &ch->irq);
memcpy(ch->io_ports, ch->hw.io_ports, sizeof(ch->io_ports));
ch->irq = vals[2];
ch->irq = vals[3];
ch->noprobe = 0;
ch->chipset = ide_generic;
goto done;
......
......@@ -40,8 +40,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma
struct pci_dev *dev = hwif->pci_dev;
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
new = *old;
/* Adjust IRQ enable bit */
......@@ -75,7 +74,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma
udelay(10);
}
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
}
static void ns87415_selectproc(struct ata_device *drive)
......@@ -215,10 +214,10 @@ static void __init ide_init_ns87415(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipset __initdata = {
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87415,
init_channel: ide_init_ns87415,
bootable: ON_BOARD,
.vendor = PCI_VENDOR_ID_NS,
.device = PCI_DEVICE_ID_NS_87415,
.init_channel = ide_init_ns87415,
.bootable = ON_BOARD,
};
int __init init_ns87415(void)
......
......@@ -323,18 +323,18 @@ static void __init ide_init_opti621(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C621,
init_channel: ide_init_opti621,
enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_OPTI,
.device = PCI_DEVICE_ID_OPTI_82C621,
.init_channel = ide_init_opti621,
.enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C825,
init_channel: ide_init_opti621,
enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_OPTI,
.device = PCI_DEVICE_ID_OPTI_82C825,
.init_channel = ide_init_opti621,
.enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
.bootable = ON_BOARD
},
};
......
......@@ -46,7 +46,7 @@ ide_startstop_t ide_dma_intr(struct ata_device *drive, struct request *rq)
if (ata_status(drive, DRIVE_READY, drive->bad_wstat | DRQ_STAT)) {
if (!dma_stat) {
__ata_end_request(drive, rq, 1, rq->nr_sectors);
ata_end_request(drive, rq, 1, rq->nr_sectors);
return ATA_OP_FINISHED;
}
......@@ -510,7 +510,7 @@ int udma_pci_irq_status(struct ata_device *drive)
void udma_pci_timeout(struct ata_device *drive)
{
printk(KERN_ERR "ATA: UDMA timeout occured %s!\n", drive->name);
printk(KERN_ERR "%s: UDMA timeout!\n", drive->name);
}
void udma_pci_irq_lost(struct ata_device *drive)
......
This diff is collapsed.
......@@ -106,26 +106,24 @@ static void read_vlb(struct ata_device *drive, void *buffer, unsigned int wcount
{
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
inb(IDE_NSECTOR_REG);
inb(IDE_NSECTOR_REG);
inb(IDE_NSECTOR_REG);
insl(IDE_DATA_REG, buffer, wcount);
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
}
static void write_vlb(struct ata_device *drive, void *buffer, unsigned int wcount)
{
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
local_irq_save(flags);
inb(IDE_NSECTOR_REG);
inb(IDE_NSECTOR_REG);
inb(IDE_NSECTOR_REG);
outsl(IDE_DATA_REG, buffer, wcount);
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags);
}
static void read_16(struct ata_device *drive, void *buffer, unsigned int wcount)
......@@ -415,7 +413,7 @@ static ide_startstop_t promise_read_intr(struct ata_device *drive, struct reques
rq->nr_sectors -= nsect;
total_remaining = rq->nr_sectors;
if ((rq->current_nr_sectors -= nsect) <= 0)
__ata_end_request(drive, rq, 1, 0);
ata_end_request(drive, rq, 1, 0);
/*
* Now the data has been read in, do the following:
......@@ -477,7 +475,7 @@ static ide_startstop_t promise_complete_pollfunc(struct ata_device *drive, struc
#ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name);
#endif
__ata_end_request(drive, rq, 1, rq->nr_sectors);
ata_end_request(drive, rq, 1, rq->nr_sectors);
return ATA_OP_FINISHED;
}
......@@ -629,7 +627,7 @@ ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *arg
/* Check that it's a regular command. If not, bomb out early. */
if (!(rq->flags & REQ_CMD)) {
blk_dump_rq_flags(rq, "pdc4030 bad flags");
__ata_end_request(drive, rq, 0, 0);
ata_end_request(drive, rq, 0, 0);
return ATA_OP_FINISHED;
}
......@@ -701,7 +699,7 @@ ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *arg
return ret;
}
if (!drive->channel->unmask)
__cli(); /* local CPU only */
local_irq_disable();
return promise_do_write(drive, rq);
}
......@@ -709,7 +707,7 @@ ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *arg
default:
printk(KERN_ERR "pdc4030: command not READ or WRITE! Huh?\n");
__ata_end_request(drive, rq, 0, 0);
ata_end_request(drive, rq, 0, 0);
return ATA_OP_FINISHED;
}
}
......
This diff is collapsed.
......@@ -388,130 +388,130 @@ static void __init piix_init_dma(struct ata_channel *ch, unsigned long dmabase)
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371FB_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82371FB_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371SB_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82371SB_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371AB,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82371AB,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82443MX_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82443MX_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82372FB_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82372FB_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AA_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801AA_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AB_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801AB_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_9,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801BA_9,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_8,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801BA_8,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801E_9,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801E_9,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_10,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801CA_10,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_11,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801CA_11,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801DB_9,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82801DB_9,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_EFAR,
device: PCI_DEVICE_ID_EFAR_SLC90E66_1,
init_chipset: piix_init_chipset,
init_channel: piix_init_channel,
init_dma: piix_init_dma,
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_EFAR,
.device = PCI_DEVICE_ID_EFAR_SLC90E66_1,
.init_chipset = piix_init_chipset,
.init_channel = piix_init_channel,
.init_dma = piix_init_dma,
.enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
.bootable = ON_BOARD
},
};
......@@ -519,9 +519,8 @@ int __init init_piix(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......@@ -97,11 +97,15 @@ int ide_xlate_1024(kdev_t i_rdev, int xparm, int ptheads, const char *msg)
}
}
/* There used to be code here that assigned drive->id->CHS
to drive->CHS and that to drive->bios_CHS. However, some disks have
id->C/H/S = 4092/16/63 but are larger than 2.1 GB. In such cases
that code was wrong. Moreover, there seems to be no reason to do
any of these things. */
/* There used to be code here that assigned drive->id->CHS to
* drive->CHS and that to drive->bios_CHS. However, some disks have
* id->C/H/S = 4092/16/63 but are larger than 2.1 GB. In such cases
* that code was wrong. Moreover, there seems to be no reason to do
* any of these things.
*
* Please note that recent RedHat changes to the disk utils are bogous
* and will report spurious errors.
*/
/* translate? */
if (drive->forced_geom)
......@@ -169,8 +173,8 @@ int ide_xlate_1024(kdev_t i_rdev, int xparm, int ptheads, const char *msg)
}
/*
* hd_driveid data come as little endian, it needs to be converted on big
* endian machines.
* Drive ID data come as little endian, it needs to be converted on big endian
* machines.
*/
void ata_fix_driveid(struct hd_driveid *id)
{
......@@ -319,11 +323,8 @@ int ide_config_drive_speed(struct ata_device *drive, byte speed)
outb(inb(ch->dma_base + 2) & ~(1 << (5 + unit)), ch->dma_base + 2);
#endif
/* Don't use ide_wait_cmd here - it will attempt to set_geometry and
* recalibrate, but for some reason these don't work at this point
* (lost interrupt).
*
* Select the drive, and issue the SETFEATURES command
/*
* Select the drive, and issue the SETFEATURES command.
*/
disable_irq(ch->irq); /* disable_irq_nosync ?? */
udelay(1);
......@@ -339,7 +340,6 @@ int ide_config_drive_speed(struct ata_device *drive, byte speed)
udelay(1);
ret = ata_status_poll(drive, 0, BUSY_STAT, WAIT_CMD, NULL);
ata_mask(drive);
enable_irq(ch->irq);
if (ret != ATA_OP_READY) {
......@@ -403,7 +403,7 @@ static inline void do_identify(struct ata_device *drive, u8 cmd)
*/
ata_read(drive, id, SECTOR_WORDS);
ide__sti(); /* local CPU only */
local_irq_enable();
ata_fix_driveid(id);
if (id->word156 == 0x4d42) {
......@@ -616,12 +616,12 @@ static int identify(struct ata_device *drive, u8 cmd)
if (ata_status(drive, DRQ_STAT, BAD_R_STAT)) {
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only; some systems need this */
local_irq_save(flags); /* some systems need this */
do_identify(drive, cmd); /* drive returned ID */
rc = 0; /* drive responded with ID */
ata_status(drive, 0, 0); /* clear drive IRQ */
__restore_flags(flags); /* local CPU only */
local_irq_restore(flags); /* local CPU only */
} else
rc = 2; /* drive refused ID */
......@@ -733,8 +733,8 @@ static void channel_probe(struct ata_channel *ch)
ch->straight8 = 0;
__save_flags(flags); /* local CPU only */
__sti(); /* local CPU only; needed for jiffies and irq probing */
__save_flags(flags);
local_irq_enable(); /* needed for jiffies and irq probing */
/*
* Check for the presence of a channel by probing for drives on it.
......@@ -852,7 +852,7 @@ static void channel_probe(struct ata_channel *ch)
if (ch->reset)
ata_reset(ch);
__restore_flags(flags); /* local CPU only */
__restore_flags(flags);
/*
* Now setup the PIO transfer modes of the drives on this channel.
......@@ -1127,6 +1127,7 @@ static void channel_init(struct ata_channel *ch)
gd->sizes = kmalloc(ATA_MINORS * sizeof(int), GFP_KERNEL);
if (!gd->sizes)
goto err_kmalloc_gd_sizes;
memset(gd->sizes, 0, ATA_MINORS*sizeof(gd->sizes[0]));
gd->part = kmalloc(ATA_MINORS * sizeof(struct hd_struct), GFP_KERNEL);
if (!gd->part)
......
......@@ -57,7 +57,7 @@ static const int pcide_offsets[IDE_NR_PORTS] = {
static int q40ide_default_irq(q40ide_ioreg_t base)
{
switch (base) {
switch (base) {
case 0x1f0: return 14;
case 0x170: return 15;
case 0x1e8: return 11;
......@@ -66,12 +66,9 @@ static int q40ide_default_irq(q40ide_ioreg_t base)
}
}
/*
* Probe for Q40 IDE interfaces
*/
/*
* Probe for Q40 IDE interfaces
*/
void q40ide_init(void)
{
int i;
......
......@@ -51,16 +51,16 @@ static void __init rz1000_init_channel(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1000,
init_channel: rz1000_init_channel,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_PCTECH,
.device = PCI_DEVICE_ID_PCTECH_RZ1000,
.init_channel = rz1000_init_channel,
.bootable = ON_BOARD
},
{
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1001,
init_channel: rz1000_init_channel,
bootable: ON_BOARD
.vendor = PCI_VENDOR_ID_PCTECH,
.device = PCI_DEVICE_ID_PCTECH_RZ1001,
.init_channel = rz1000_init_channel,
.bootable = ON_BOARD
},
};
......@@ -68,9 +68,8 @@ int __init init_rz1000(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......
......@@ -394,20 +394,20 @@ static void __init ide_init_svwks(struct ata_channel *hwif)
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
init_chipset: svwks_init_chipset,
init_channel: ide_init_svwks,
bootable: ON_BOARD,
flags: ATA_F_DMA
.vendor = PCI_VENDOR_ID_SERVERWORKS,
.device = PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
.init_chipset = svwks_init_chipset,
.init_channel = ide_init_svwks,
.bootable = ON_BOARD,
.flags = ATA_F_DMA
},
{
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
init_chipset: svwks_init_chipset,
init_channel: ide_init_svwks,
bootable: ON_BOARD,
flags: ATA_F_SIMPLEX
.vendor = PCI_VENDOR_ID_SERVERWORKS,
.device = PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
.init_chipset = svwks_init_chipset,
.init_channel = ide_init_svwks,
.bootable = ON_BOARD,
.flags = ATA_F_SIMPLEX
},
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -19,8 +19,6 @@
#define MAX_HWIFS 4
#endif
#define ide__sti() __sti()
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
switch (base) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment