You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (29 commits)
ide: re-implement ide_pci_init_one() on top of ide_pci_init_two()
ide: unexport ide_find_dma_mode()
ide: fix PowerMac bootup oops
ide: skip probe if there are no devices on the port (v2)
sl82c105: add printk() logging facility
ide-tape: fix proc warning
ide: add IDE_DFLAG_NIEN_QUIRK device flag
ide: respect quirk_drives[] list on all controllers
hpt366: enable all quirks for devices on quirk_drives[] list
hpt366: sync quirk_drives[] list with pdc202xx_{new,old}.c
ide: remove superfluous SELECT_MASK() call from do_rw_taskfile()
ide: remove superfluous SELECT_MASK() call from ide_driveid_update()
icside: remove superfluous ->maskproc method
ide-tape: fix IDE_AFLAG_* atomic accesses
ide-tape: change IDE_AFLAG_IGNORE_DSC non-atomically
pdc202xx_old: kill resetproc() method
pdc202xx_old: don't call pdc202xx_reset() on IRQ timeout
pdc202xx_old: use ide_dma_test_irq()
ide: preserve Host Protected Area by default (v2)
ide-gd: implement block device ->set_capacity method (v2)
...
This commit is contained in:
@@ -216,6 +216,8 @@ Other kernel parameters for ide_core are:
|
||||
|
||||
* "noflush=[interface_number.device_number]" to disable flush requests
|
||||
|
||||
* "nohpa=[interface_number.device_number]" to disable Host Protected Area
|
||||
|
||||
* "noprobe=[interface_number.device_number]" to skip probing
|
||||
|
||||
* "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit
|
||||
|
||||
@@ -887,11 +887,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||
|
||||
ide-core.nodma= [HW] (E)IDE subsystem
|
||||
Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
|
||||
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
|
||||
.chs .ignore_cable are additional options
|
||||
See Documentation/ide/ide.txt.
|
||||
|
||||
idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
|
||||
.vlb_clock .pci_clock .noflush .nohpa .noprobe .nowerr
|
||||
.cdrom .chs .ignore_cable are additional options
|
||||
See Documentation/ide/ide.txt.
|
||||
|
||||
ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
|
||||
|
||||
@@ -216,6 +216,7 @@ static const struct ide_port_info at91_ide_port_info __initdata = {
|
||||
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
|
||||
IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
|
||||
.pio_mask = ATA_PIO6,
|
||||
.chipset = ide_generic,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -246,8 +247,7 @@ irqreturn_t at91_irq_handler(int irq, void *dev_id)
|
||||
static int __init at91_ide_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
hw_regs_t hw;
|
||||
hw_regs_t *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
struct ide_host *host;
|
||||
struct resource *res;
|
||||
unsigned long tf_base = 0, ctl_base = 0;
|
||||
@@ -304,10 +304,9 @@ static int __init at91_ide_probe(struct platform_device *pdev)
|
||||
ide_std_init_ports(&hw, tf_base, ctl_base + 6);
|
||||
|
||||
hw.irq = board->irq_pin;
|
||||
hw.chipset = ide_generic;
|
||||
hw.dev = &pdev->dev;
|
||||
|
||||
host = ide_host_alloc(&at91_ide_port_info, hws);
|
||||
host = ide_host_alloc(&at91_ide_port_info, hws, 1);
|
||||
if (!host) {
|
||||
perr("failed to allocate ide host\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -449,7 +449,7 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif)
|
||||
static void auide_setup_ports(struct ide_hw *hw, _auide_hwif *ahwif)
|
||||
{
|
||||
int i;
|
||||
unsigned long *ata_regs = hw->io_ports_array;
|
||||
@@ -499,6 +499,7 @@ static const struct ide_port_info au1xxx_port_info = {
|
||||
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
|
||||
.mwdma_mask = ATA_MWDMA2,
|
||||
#endif
|
||||
.chipset = ide_au1xxx,
|
||||
};
|
||||
|
||||
static int au_ide_probe(struct platform_device *dev)
|
||||
@@ -507,7 +508,7 @@ static int au_ide_probe(struct platform_device *dev)
|
||||
struct resource *res;
|
||||
struct ide_host *host;
|
||||
int ret = 0;
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
|
||||
char *mode = "MWDMA2";
|
||||
@@ -548,9 +549,8 @@ static int au_ide_probe(struct platform_device *dev)
|
||||
auide_setup_ports(&hw, ahwif);
|
||||
hw.irq = ahwif->irq;
|
||||
hw.dev = &dev->dev;
|
||||
hw.chipset = ide_au1xxx;
|
||||
|
||||
ret = ide_host_add(&au1xxx_port_info, hws, &host);
|
||||
ret = ide_host_add(&au1xxx_port_info, hws, 1, &host);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ static int xsurf_ack_intr(ide_hwif_t *hwif)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
|
||||
static void __init buddha_setup_ports(struct ide_hw *hw, unsigned long base,
|
||||
unsigned long ctl, unsigned long irq_port,
|
||||
ide_ack_intr_t *ack_intr)
|
||||
{
|
||||
@@ -139,13 +139,12 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
|
||||
|
||||
hw->irq = IRQ_AMIGA_PORTS;
|
||||
hw->ack_intr = ack_intr;
|
||||
|
||||
hw->chipset = ide_generic;
|
||||
}
|
||||
|
||||
static const struct ide_port_info buddha_port_info = {
|
||||
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
|
||||
.irq_flags = IRQF_SHARED,
|
||||
.chipset = ide_generic,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -161,7 +160,7 @@ static int __init buddha_init(void)
|
||||
|
||||
while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
|
||||
unsigned long board;
|
||||
hw_regs_t hw[MAX_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
|
||||
struct ide_hw hw[MAX_NUM_HWIFS], *hws[MAX_NUM_HWIFS];
|
||||
|
||||
if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
|
||||
buddha_num_hwifs = BUDDHA_NUM_HWIFS;
|
||||
@@ -225,7 +224,7 @@ fail_base2:
|
||||
hws[i] = &hw[i];
|
||||
}
|
||||
|
||||
ide_host_add(&buddha_port_info, hws, NULL);
|
||||
ide_host_add(&buddha_port_info, hws, i, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -708,7 +708,7 @@ static int __init cmd640x_init(void)
|
||||
int second_port_cmd640 = 0, rc;
|
||||
const char *bus_type, *port2;
|
||||
u8 b, cfr;
|
||||
hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
|
||||
struct ide_hw hw[2], *hws[2];
|
||||
|
||||
if (cmd640_vlb && probe_for_cmd640_vlb()) {
|
||||
bus_type = "VLB";
|
||||
@@ -762,11 +762,9 @@ static int __init cmd640x_init(void)
|
||||
|
||||
ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
|
||||
hw[0].irq = 14;
|
||||
hw[0].chipset = ide_cmd640;
|
||||
|
||||
ide_std_init_ports(&hw[1], 0x170, 0x376);
|
||||
hw[1].irq = 15;
|
||||
hw[1].chipset = ide_cmd640;
|
||||
|
||||
printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
|
||||
"\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
|
||||
@@ -824,7 +822,8 @@ static int __init cmd640x_init(void)
|
||||
cmd640_dump_regs();
|
||||
#endif
|
||||
|
||||
return ide_host_add(&cmd640_port_info, hws, NULL);
|
||||
return ide_host_add(&cmd640_port_info, hws, second_port_cmd640 ? 2 : 1,
|
||||
NULL);
|
||||
}
|
||||
|
||||
module_param_named(probe_vlb, cmd640_vlb, bool, 0);
|
||||
|
||||
@@ -110,7 +110,7 @@ static const struct ide_port_info cyrix_chipset __devinitdata = {
|
||||
static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
{
|
||||
const struct ide_port_info *d = &cyrix_chipset;
|
||||
hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
|
||||
struct ide_hw hw[2], *hws[] = { NULL, NULL };
|
||||
|
||||
ide_setup_pci_noise(dev, d);
|
||||
|
||||
@@ -136,7 +136,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
|
||||
ide_pci_setup_ports(dev, d, &hw[0], &hws[0]);
|
||||
hw[0].irq = 14;
|
||||
|
||||
return ide_host_add(d, hws, NULL);
|
||||
return ide_host_add(d, hws, 2, NULL);
|
||||
}
|
||||
|
||||
static const struct pci_device_id cs5520_pci_tbl[] = {
|
||||
|
||||
@@ -68,6 +68,7 @@ static const struct ide_port_info delkin_cb_port_info = {
|
||||
IDE_HFLAG_NO_DMA,
|
||||
.irq_flags = IRQF_SHARED,
|
||||
.init_chipset = delkin_cb_init_chipset,
|
||||
.chipset = ide_pci,
|
||||
};
|
||||
|
||||
static int __devinit
|
||||
@@ -76,7 +77,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
|
||||
struct ide_host *host;
|
||||
unsigned long base;
|
||||
int rc;
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
|
||||
rc = pci_enable_device(dev);
|
||||
if (rc) {
|
||||
@@ -97,9 +98,8 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
|
||||
ide_std_init_ports(&hw, base + 0x10, base + 0x1e);
|
||||
hw.irq = dev->irq;
|
||||
hw.dev = &dev->dev;
|
||||
hw.chipset = ide_pci; /* this enables IRQ sharing */
|
||||
|
||||
rc = ide_host_add(&delkin_cb_port_info, hws, &host);
|
||||
rc = ide_host_add(&delkin_cb_port_info, hws, 1, &host);
|
||||
if (rc)
|
||||
goto out_disable;
|
||||
|
||||
|
||||
@@ -111,9 +111,10 @@ static const struct ide_port_info falconide_port_info = {
|
||||
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
|
||||
IDE_HFLAG_NO_DMA,
|
||||
.irq_flags = IRQF_SHARED,
|
||||
.chipset = ide_generic,
|
||||
};
|
||||
|
||||
static void __init falconide_setup_ports(hw_regs_t *hw)
|
||||
static void __init falconide_setup_ports(struct ide_hw *hw)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -128,8 +129,6 @@ static void __init falconide_setup_ports(hw_regs_t *hw)
|
||||
|
||||
hw->irq = IRQ_MFP_IDE;
|
||||
hw->ack_intr = NULL;
|
||||
|
||||
hw->chipset = ide_generic;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -139,7 +138,7 @@ static void __init falconide_setup_ports(hw_regs_t *hw)
|
||||
static int __init falconide_init(void)
|
||||
{
|
||||
struct ide_host *host;
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
int rc;
|
||||
|
||||
if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE))
|
||||
@@ -154,7 +153,7 @@ static int __init falconide_init(void)
|
||||
|
||||
falconide_setup_ports(&hw);
|
||||
|
||||
host = ide_host_alloc(&falconide_port_info, hws);
|
||||
host = ide_host_alloc(&falconide_port_info, hws, 1);
|
||||
if (host == NULL) {
|
||||
rc = -ENOMEM;
|
||||
goto err;
|
||||
|
||||
+4
-5
@@ -88,7 +88,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
|
||||
static void __init gayle_setup_ports(struct ide_hw *hw, unsigned long base,
|
||||
unsigned long ctl, unsigned long irq_port,
|
||||
ide_ack_intr_t *ack_intr)
|
||||
{
|
||||
@@ -106,14 +106,13 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
|
||||
|
||||
hw->irq = IRQ_AMIGA_PORTS;
|
||||
hw->ack_intr = ack_intr;
|
||||
|
||||
hw->chipset = ide_generic;
|
||||
}
|
||||
|
||||
static const struct ide_port_info gayle_port_info = {
|
||||
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
|
||||
IDE_HFLAG_NO_DMA,
|
||||
.irq_flags = IRQF_SHARED,
|
||||
.chipset = ide_generic,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -126,7 +125,7 @@ static int __init gayle_init(void)
|
||||
unsigned long base, ctrlport, irqport;
|
||||
ide_ack_intr_t *ack_intr;
|
||||
int a4000, i, rc;
|
||||
hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
|
||||
struct ide_hw hw[GAYLE_NUM_HWIFS], *hws[GAYLE_NUM_HWIFS];
|
||||
|
||||
if (!MACH_IS_AMIGA)
|
||||
return -ENODEV;
|
||||
@@ -171,7 +170,7 @@ found:
|
||||
hws[i] = &hw[i];
|
||||
}
|
||||
|
||||
rc = ide_host_add(&gayle_port_info, hws, NULL);
|
||||
rc = ide_host_add(&gayle_port_info, hws, i, NULL);
|
||||
if (rc)
|
||||
release_mem_region(res_start, res_n);
|
||||
|
||||
|
||||
+1
-24
@@ -138,14 +138,6 @@
|
||||
#undef HPT_RESET_STATE_ENGINE
|
||||
#undef HPT_DELAY_INTERRUPT
|
||||
|
||||
static const char *quirk_drives[] = {
|
||||
"QUANTUM FIREBALLlct08 08",
|
||||
"QUANTUM FIREBALLP KA6.4",
|
||||
"QUANTUM FIREBALLP LM20.4",
|
||||
"QUANTUM FIREBALLP LM20.5",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *bad_ata100_5[] = {
|
||||
"IBM-DTLA-307075",
|
||||
"IBM-DTLA-307060",
|
||||
@@ -729,27 +721,13 @@ static void hpt3xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
|
||||
hpt3xx_set_mode(drive, XFER_PIO_0 + pio);
|
||||
}
|
||||
|
||||
static void hpt3xx_quirkproc(ide_drive_t *drive)
|
||||
{
|
||||
char *m = (char *)&drive->id[ATA_ID_PROD];
|
||||
const char **list = quirk_drives;
|
||||
|
||||
while (*list)
|
||||
if (strstr(m, *list++)) {
|
||||
drive->quirk_list = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
drive->quirk_list = 0;
|
||||
}
|
||||
|
||||
static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
struct pci_dev *dev = to_pci_dev(hwif->dev);
|
||||
struct hpt_info *info = hpt3xx_get_info(hwif->dev);
|
||||
|
||||
if (drive->quirk_list == 0)
|
||||
if ((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
|
||||
return;
|
||||
|
||||
if (info->chip_type >= HPT370) {
|
||||
@@ -1404,7 +1382,6 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2)
|
||||
static const struct ide_port_ops hpt3xx_port_ops = {
|
||||
.set_pio_mode = hpt3xx_set_pio_mode,
|
||||
.set_dma_mode = hpt3xx_set_mode,
|
||||
.quirkproc = hpt3xx_quirkproc,
|
||||
.maskproc = hpt3xx_maskproc,
|
||||
.mdma_filter = hpt3xx_mdma_filter,
|
||||
.udma_filter = hpt3xx_udma_filter,
|
||||
|
||||
+11
-66
@@ -65,8 +65,6 @@ static struct cardinfo icside_cardinfo_v6_2 = {
|
||||
};
|
||||
|
||||
struct icside_state {
|
||||
unsigned int channel;
|
||||
unsigned int enabled;
|
||||
void __iomem *irq_port;
|
||||
void __iomem *ioc_base;
|
||||
unsigned int sel;
|
||||
@@ -116,18 +114,11 @@ static void icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
|
||||
struct icside_state *state = ec->irq_data;
|
||||
void __iomem *base = state->irq_port;
|
||||
|
||||
state->enabled = 1;
|
||||
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
readb(base + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
|
||||
switch (state->channel) {
|
||||
case 0:
|
||||
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
readb(base + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
break;
|
||||
case 1:
|
||||
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
readb(base + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
break;
|
||||
}
|
||||
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
readb(base + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
}
|
||||
|
||||
/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
|
||||
@@ -137,8 +128,6 @@ static void icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
|
||||
{
|
||||
struct icside_state *state = ec->irq_data;
|
||||
|
||||
state->enabled = 0;
|
||||
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
}
|
||||
@@ -160,44 +149,6 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
|
||||
.irqpending = icside_irqpending_arcin_v6,
|
||||
};
|
||||
|
||||
/*
|
||||
* Handle routing of interrupts. This is called before
|
||||
* we write the command to the drive.
|
||||
*/
|
||||
static void icside_maskproc(ide_drive_t *drive, int mask)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
struct expansion_card *ec = ECARD_DEV(hwif->dev);
|
||||
struct icside_state *state = ecard_get_drvdata(ec);
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
state->channel = hwif->channel;
|
||||
|
||||
if (state->enabled && !mask) {
|
||||
switch (hwif->channel) {
|
||||
case 0:
|
||||
writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
break;
|
||||
case 1:
|
||||
writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
|
||||
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
|
||||
}
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static const struct ide_port_ops icside_v6_no_dma_port_ops = {
|
||||
.maskproc = icside_maskproc,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
|
||||
/*
|
||||
* SG-DMA support.
|
||||
@@ -275,7 +226,6 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
|
||||
|
||||
static const struct ide_port_ops icside_v6_port_ops = {
|
||||
.set_dma_mode = icside_set_dma_mode,
|
||||
.maskproc = icside_maskproc,
|
||||
};
|
||||
|
||||
static void icside_dma_host_set(ide_drive_t *drive, int on)
|
||||
@@ -319,11 +269,6 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
|
||||
*/
|
||||
BUG_ON(dma_channel_active(ec->dma));
|
||||
|
||||
/*
|
||||
* Ensure that we have the right interrupt routed.
|
||||
*/
|
||||
icside_maskproc(drive, 0);
|
||||
|
||||
/*
|
||||
* Route the DMA signals to the correct interface.
|
||||
*/
|
||||
@@ -381,7 +326,7 @@ static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static void icside_setup_ports(hw_regs_t *hw, void __iomem *base,
|
||||
static void icside_setup_ports(struct ide_hw *hw, void __iomem *base,
|
||||
struct cardinfo *info, struct expansion_card *ec)
|
||||
{
|
||||
unsigned long port = (unsigned long)base + info->dataoffset;
|
||||
@@ -398,11 +343,11 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base,
|
||||
|
||||
hw->irq = ec->irq;
|
||||
hw->dev = &ec->dev;
|
||||
hw->chipset = ide_acorn;
|
||||
}
|
||||
|
||||
static const struct ide_port_info icside_v5_port_info = {
|
||||
.host_flags = IDE_HFLAG_NO_DMA,
|
||||
.chipset = ide_acorn,
|
||||
};
|
||||
|
||||
static int __devinit
|
||||
@@ -410,7 +355,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
|
||||
{
|
||||
void __iomem *base;
|
||||
struct ide_host *host;
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
int ret;
|
||||
|
||||
base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
|
||||
@@ -431,7 +376,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
|
||||
|
||||
icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec);
|
||||
|
||||
host = ide_host_alloc(&icside_v5_port_info, hws);
|
||||
host = ide_host_alloc(&icside_v5_port_info, hws, 1);
|
||||
if (host == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -452,11 +397,11 @@ err_free:
|
||||
|
||||
static const struct ide_port_info icside_v6_port_info __initdata = {
|
||||
.init_dma = icside_dma_off_init,
|
||||
.port_ops = &icside_v6_no_dma_port_ops,
|
||||
.dma_ops = &icside_v6_dma_ops,
|
||||
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
|
||||
.mwdma_mask = ATA_MWDMA2,
|
||||
.swdma_mask = ATA_SWDMA2,
|
||||
.chipset = ide_acorn,
|
||||
};
|
||||
|
||||
static int __devinit
|
||||
@@ -466,7 +411,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
|
||||
struct ide_host *host;
|
||||
unsigned int sel = 0;
|
||||
int ret;
|
||||
hw_regs_t hw[2], *hws[] = { &hw[0], &hw[1], NULL, NULL };
|
||||
struct ide_hw hw[2], *hws[] = { &hw[0], &hw[1] };
|
||||
struct ide_port_info d = icside_v6_port_info;
|
||||
|
||||
ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
|
||||
@@ -506,7 +451,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
|
||||
icside_setup_ports(&hw[0], easi_base, &icside_cardinfo_v6_1, ec);
|
||||
icside_setup_ports(&hw[1], easi_base, &icside_cardinfo_v6_2, ec);
|
||||
|
||||
host = ide_host_alloc(&d, hws);
|
||||
host = ide_host_alloc(&d, hws, 2);
|
||||
if (host == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
@@ -25,12 +25,13 @@ static const struct ide_port_info ide_4drives_port_info = {
|
||||
.port_ops = &ide_4drives_port_ops,
|
||||
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA |
|
||||
IDE_HFLAG_4DRIVES,
|
||||
.chipset = ide_4drives,
|
||||
};
|
||||
|
||||
static int __init ide_4drives_init(void)
|
||||
{
|
||||
unsigned long base = 0x1f0, ctl = 0x3f6;
|
||||
hw_regs_t hw, *hws[] = { &hw, &hw, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw, &hw };
|
||||
|
||||
if (probe_4drives == 0)
|
||||
return -ENODEV;
|
||||
@@ -52,9 +53,8 @@ static int __init ide_4drives_init(void)
|
||||
|
||||
ide_std_init_ports(&hw, base, ctl);
|
||||
hw.irq = 14;
|
||||
hw.chipset = ide_4drives;
|
||||
|
||||
return ide_host_add(&ide_4drives_port_info, hws, NULL);
|
||||
return ide_host_add(&ide_4drives_port_info, hws, 2, NULL);
|
||||
}
|
||||
|
||||
module_init(ide_4drives_init);
|
||||
|
||||
@@ -259,7 +259,7 @@ void ide_retry_pc(ide_drive_t *drive)
|
||||
pc->req_xfer = blk_rq_bytes(sense_rq);
|
||||
|
||||
if (drive->media == ide_tape)
|
||||
set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags);
|
||||
drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
|
||||
|
||||
/*
|
||||
* Push back the failed request and put request sense on top
|
||||
|
||||
@@ -155,6 +155,7 @@ static const struct ide_port_info idecs_port_info = {
|
||||
.port_ops = &idecs_port_ops,
|
||||
.host_flags = IDE_HFLAG_NO_DMA,
|
||||
.irq_flags = IRQF_SHARED,
|
||||
.chipset = ide_pci,
|
||||
};
|
||||
|
||||
static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
|
||||
@@ -163,7 +164,7 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
|
||||
struct ide_host *host;
|
||||
ide_hwif_t *hwif;
|
||||
int i, rc;
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
|
||||
if (!request_region(io, 8, DRV_NAME)) {
|
||||
printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
|
||||
@@ -181,10 +182,9 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
|
||||
memset(&hw, 0, sizeof(hw));
|
||||
ide_std_init_ports(&hw, io, ctl);
|
||||
hw.irq = irq;
|
||||
hw.chipset = ide_pci;
|
||||
hw.dev = &handle->dev;
|
||||
|
||||
rc = ide_host_add(&idecs_port_info, hws, &host);
|
||||
rc = ide_host_add(&idecs_port_info, hws, 1, &host);
|
||||
if (rc)
|
||||
goto out_release;
|
||||
|
||||
|
||||
+63
-12
@@ -302,14 +302,12 @@ static const struct drive_list_entry hpa_list[] = {
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static void idedisk_check_hpa(ide_drive_t *drive)
|
||||
static u64 ide_disk_hpa_get_native_capacity(ide_drive_t *drive, int lba48)
|
||||
{
|
||||
unsigned long long capacity, set_max;
|
||||
int lba48 = ata_id_lba48_enabled(drive->id);
|
||||
u64 capacity, set_max;
|
||||
|
||||
capacity = drive->capacity64;
|
||||
|
||||
set_max = idedisk_read_native_max_address(drive, lba48);
|
||||
set_max = idedisk_read_native_max_address(drive, lba48);
|
||||
|
||||
if (ide_in_drive_list(drive->id, hpa_list)) {
|
||||
/*
|
||||
@@ -320,9 +318,31 @@ static void idedisk_check_hpa(ide_drive_t *drive)
|
||||
set_max--;
|
||||
}
|
||||
|
||||
return set_max;
|
||||
}
|
||||
|
||||
static u64 ide_disk_hpa_set_capacity(ide_drive_t *drive, u64 set_max, int lba48)
|
||||
{
|
||||
set_max = idedisk_set_max_address(drive, set_max, lba48);
|
||||
if (set_max)
|
||||
drive->capacity64 = set_max;
|
||||
|
||||
return set_max;
|
||||
}
|
||||
|
||||
static void idedisk_check_hpa(ide_drive_t *drive)
|
||||
{
|
||||
u64 capacity, set_max;
|
||||
int lba48 = ata_id_lba48_enabled(drive->id);
|
||||
|
||||
capacity = drive->capacity64;
|
||||
set_max = ide_disk_hpa_get_native_capacity(drive, lba48);
|
||||
|
||||
if (set_max <= capacity)
|
||||
return;
|
||||
|
||||
drive->probed_capacity = set_max;
|
||||
|
||||
printk(KERN_INFO "%s: Host Protected Area detected.\n"
|
||||
"\tcurrent capacity is %llu sectors (%llu MB)\n"
|
||||
"\tnative capacity is %llu sectors (%llu MB)\n",
|
||||
@@ -330,13 +350,13 @@ static void idedisk_check_hpa(ide_drive_t *drive)
|
||||
capacity, sectors_to_MB(capacity),
|
||||
set_max, sectors_to_MB(set_max));
|
||||
|
||||
set_max = idedisk_set_max_address(drive, set_max, lba48);
|
||||
if ((drive->dev_flags & IDE_DFLAG_NOHPA) == 0)
|
||||
return;
|
||||
|
||||
if (set_max) {
|
||||
drive->capacity64 = set_max;
|
||||
set_max = ide_disk_hpa_set_capacity(drive, set_max, lba48);
|
||||
if (set_max)
|
||||
printk(KERN_INFO "%s: Host Protected Area disabled.\n",
|
||||
drive->name);
|
||||
}
|
||||
}
|
||||
|
||||
static int ide_disk_get_capacity(ide_drive_t *drive)
|
||||
@@ -358,6 +378,8 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
|
||||
drive->capacity64 = drive->cyl * drive->head * drive->sect;
|
||||
}
|
||||
|
||||
drive->probed_capacity = drive->capacity64;
|
||||
|
||||
if (lba) {
|
||||
drive->dev_flags |= IDE_DFLAG_LBA;
|
||||
|
||||
@@ -376,7 +398,7 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
|
||||
"%llu sectors (%llu MB)\n",
|
||||
drive->name, (unsigned long long)drive->capacity64,
|
||||
sectors_to_MB(drive->capacity64));
|
||||
drive->capacity64 = 1ULL << 28;
|
||||
drive->probed_capacity = drive->capacity64 = 1ULL << 28;
|
||||
}
|
||||
|
||||
if ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) &&
|
||||
@@ -392,6 +414,34 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u64 ide_disk_set_capacity(ide_drive_t *drive, u64 capacity)
|
||||
{
|
||||
u64 set = min(capacity, drive->probed_capacity);
|
||||
u16 *id = drive->id;
|
||||
int lba48 = ata_id_lba48_enabled(id);
|
||||
|
||||
if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 ||
|
||||
ata_id_hpa_enabled(id) == 0)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* according to the spec the SET MAX ADDRESS command shall be
|
||||
* immediately preceded by a READ NATIVE MAX ADDRESS command
|
||||
*/
|
||||
capacity = ide_disk_hpa_get_native_capacity(drive, lba48);
|
||||
if (capacity == 0)
|
||||
goto out;
|
||||
|
||||
set = ide_disk_hpa_set_capacity(drive, set, lba48);
|
||||
if (set) {
|
||||
/* needed for ->resume to disable HPA */
|
||||
drive->dev_flags |= IDE_DFLAG_NOHPA;
|
||||
return set;
|
||||
}
|
||||
out:
|
||||
return drive->capacity64;
|
||||
}
|
||||
|
||||
static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
|
||||
{
|
||||
ide_drive_t *drive = q->queuedata;
|
||||
@@ -428,14 +478,14 @@ static int set_multcount(ide_drive_t *drive, int arg)
|
||||
if (arg < 0 || arg > (drive->id[ATA_ID_MAX_MULTSECT] & 0xff))
|
||||
return -EINVAL;
|
||||
|
||||
if (drive->special.b.set_multmode)
|
||||
if (drive->special_flags & IDE_SFLAG_SET_MULTMODE)
|
||||
return -EBUSY;
|
||||
|
||||
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
|
||||
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
|
||||
|
||||
drive->mult_req = arg;
|
||||
drive->special.b.set_multmode = 1;
|
||||
drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
|
||||
error = blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
blk_put_request(rq);
|
||||
|
||||
@@ -740,6 +790,7 @@ static int ide_disk_set_doorlock(ide_drive_t *drive, struct gendisk *disk,
|
||||
|
||||
const struct ide_disk_ops ide_ata_disk_ops = {
|
||||
.check = ide_disk_check,
|
||||
.set_capacity = ide_disk_set_capacity,
|
||||
.get_capacity = ide_disk_get_capacity,
|
||||
.setup = ide_disk_setup,
|
||||
.flush = ide_disk_flush,
|
||||
|
||||
@@ -347,7 +347,6 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
|
||||
|
||||
return mode;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ide_find_dma_mode);
|
||||
|
||||
static int ide_tune_dma(ide_drive_t *drive)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq,
|
||||
}
|
||||
|
||||
if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
|
||||
drive->special.b.recalibrate = 1;
|
||||
drive->special_flags |= IDE_SFLAG_RECALIBRATE;
|
||||
|
||||
++rq->errors;
|
||||
|
||||
@@ -268,9 +268,8 @@ static void ide_disk_pre_reset(ide_drive_t *drive)
|
||||
{
|
||||
int legacy = (drive->id[ATA_ID_CFS_ENABLE_2] & 0x0400) ? 0 : 1;
|
||||
|
||||
drive->special.all = 0;
|
||||
drive->special.b.set_geometry = legacy;
|
||||
drive->special.b.recalibrate = legacy;
|
||||
drive->special_flags =
|
||||
legacy ? (IDE_SFLAG_SET_GEOMETRY | IDE_SFLAG_RECALIBRATE) : 0;
|
||||
|
||||
drive->mult_count = 0;
|
||||
drive->dev_flags &= ~IDE_DFLAG_PARKED;
|
||||
@@ -280,7 +279,7 @@ static void ide_disk_pre_reset(ide_drive_t *drive)
|
||||
drive->mult_req = 0;
|
||||
|
||||
if (drive->mult_req != drive->mult_count)
|
||||
drive->special.b.set_multmode = 1;
|
||||
drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
|
||||
}
|
||||
|
||||
static void pre_reset(ide_drive_t *drive)
|
||||
@@ -408,8 +407,9 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
|
||||
/* more than enough time */
|
||||
udelay(10);
|
||||
/* clear SRST, leave nIEN (unless device is on the quirk list) */
|
||||
tp_ops->write_devctl(hwif, (drive->quirk_list == 2 ? 0 : ATA_NIEN) |
|
||||
ATA_DEVCTL_OBS);
|
||||
tp_ops->write_devctl(hwif,
|
||||
((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) ? 0 : ATA_NIEN) |
|
||||
ATA_DEVCTL_OBS);
|
||||
/* more than enough time */
|
||||
udelay(10);
|
||||
hwif->poll_timeout = jiffies + WAIT_WORSTCASE;
|
||||
|
||||
@@ -287,6 +287,19 @@ static int ide_gd_media_changed(struct gendisk *disk)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned long long ide_gd_set_capacity(struct gendisk *disk,
|
||||
unsigned long long capacity)
|
||||
{
|
||||
struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
|
||||
ide_drive_t *drive = idkp->drive;
|
||||
const struct ide_disk_ops *disk_ops = drive->disk_ops;
|
||||
|
||||
if (disk_ops->set_capacity)
|
||||
return disk_ops->set_capacity(drive, capacity);
|
||||
|
||||
return drive->capacity64;
|
||||
}
|
||||
|
||||
static int ide_gd_revalidate_disk(struct gendisk *disk)
|
||||
{
|
||||
struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
|
||||
@@ -315,6 +328,7 @@ static struct block_device_operations ide_gd_ops = {
|
||||
.locked_ioctl = ide_gd_ioctl,
|
||||
.getgeo = ide_gd_getgeo,
|
||||
.media_changed = ide_gd_media_changed,
|
||||
.set_capacity = ide_gd_set_capacity,
|
||||
.revalidate_disk = ide_gd_revalidate_disk
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports");
|
||||
|
||||
static const struct ide_port_info ide_generic_port_info = {
|
||||
.host_flags = IDE_HFLAG_NO_DMA,
|
||||
.chipset = ide_generic,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
@@ -85,7 +86,7 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
|
||||
|
||||
static int __init ide_generic_init(void)
|
||||
{
|
||||
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
unsigned long io_addr;
|
||||
int i, rc = 0, primary = 0, secondary = 0;
|
||||
|
||||
@@ -132,9 +133,7 @@ static int __init ide_generic_init(void)
|
||||
#else
|
||||
hw.irq = legacy_irqs[i];
|
||||
#endif
|
||||
hw.chipset = ide_generic;
|
||||
|
||||
rc = ide_host_add(&ide_generic_port_info, hws, NULL);
|
||||
rc = ide_host_add(&ide_generic_port_info, hws, 1, NULL);
|
||||
if (rc) {
|
||||
release_region(io_addr + 0x206, 1);
|
||||
release_region(io_addr, 8);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user