summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
Commit message (Collapse)AuthorAgeFilesLines
* ide: remove ide_task_t typedefBartlomiej Zolnierkiewicz2009-03-271-9/+9
| | | | | | | | | | | | | | While at it: - rename struct ide_task_s to struct ide_cmd - remove stale comments from idedisk_{read_native,set}_max_address() - drop unused 'cmd' argument from ide_{cmd,task}_ioctl() - drop unused 'task' argument from tx4939ide_tf_load_fixup() - rename ide_complete_task() to ide_complete_cmd() - use consistent naming for struct ide_cmd variables There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_4DRIVES host flagBartlomiej Zolnierkiewicz2009-03-271-2/+2
| | | | | | | | | Add IDE_HFLAG_4DRIVES host flag and use it instead of ide_4drives chipset type in ide_init_port(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add IDE_HFLAG_DTC2278 host flagBartlomiej Zolnierkiewicz2009-03-271-1/+1
| | | | | | | | | Add IDE_HFLAG_DTC2278 host flag and use it instead of ide_dtc2278 chipset type in ide_init_port(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove now superfluous check from ide_host_register()Bartlomiej Zolnierkiewicz2009-03-271-12/+7
| | | | | | There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: allow host drivers to specify IRQ flagsBartlomiej Zolnierkiewicz2009-03-271-10/+3
| | | | | | | | | | | | | * Add ->irq_flags field to struct ide_port_info and struct ide_host. * Update host drivers and IDE PCI code to use ->irq_flags field. * Convert init_irq() and ide_intr() to use host->irq_flags. This fixes handling of shared IRQs for non-PCI hosts and removes ugly ifdeffery from core IDE code. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix memleak on failure in probe_for_drive()Bartlomiej Zolnierkiewicz2009-03-271-13/+9
| | | | | | | | | | Always free drive->id in probe_for_drive() if device is not present. While at it: - remove dead IDE_DFLAG_DEAD flag - remove superfluous IDE_DFLAG_PRESENT check Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove IDE_ARCH_LOCK (v2)Bartlomiej Zolnierkiewicz2009-03-271-0/+2
| | | | | | | | | | | | | | | | | | * Add ->{get,release}_lock methods to struct ide_port_info and struct ide_host. * Convert core IDE code, m68k IDE code and falconide support to use ->{get,release}_lock methods instead of ide_{get,release}_lock(). * Remove IDE_ARCH_LOCK. v2: * Build fix from Geert updating ide_{get,release}_lock() callers in falconide.c. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Michael Schmitz <schmitz@debian.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move ->rqsize init from init_irq() to ide_init_port()Bartlomiej Zolnierkiewicz2009-03-271-8/+7
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use try_to_identify() in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-12/+12
| | | | | | | | | | | | | * Pass pointer to buffer for IDENTIFY data to do_identify() and try_to_identify(). * Un-static try_to_identify() and use it in ide_driveid_update(). * Rename try_to_identify() to ide_dev_read_id(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: classify device type in do_probe()Bartlomiej Zolnierkiewicz2009-03-241-13/+13
| | | | | | | | Defer classifying device type from do_identify() to do_probe(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove broken EXABYTENEST supportBartlomiej Zolnierkiewicz2009-03-241-37/+0
| | | | | | | | | | do_identify() marks EXABYTENEST device as non-present and frees drive->id so enable_nest() has absolutely no chance of working. The code was like this since at least 2.6.12-rc2 and nobody has noticed so just remove broken EXABYTENEST support. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove try_to_identify() wrapperBartlomiej Zolnierkiewicz2009-03-241-25/+9
| | | | | | There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)Bartlomiej Zolnierkiewicz2009-03-241-43/+7
| | | | | | | v2: Update actual_try_to_identify() documentation. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove no longer needed IRQ fallback code from hwif_init()Bartlomiej Zolnierkiewicz2009-03-241-26/+4
| | | | | | Then remove no longer used __ide_default_irq(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()Bartlomiej Zolnierkiewicz2009-03-241-4/+0
| | | | | | | | | Move handling of IDE_HFLAG[_FORCE]_LEGACY_IRQS from ide_init_port() to ide_pci_init_{one,two}(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: sanitize ACPI initializationBartlomiej Zolnierkiewicz2009-03-241-1/+1
| | | | | | | | | | | * ide_acpi_init() -> ide_acpi_init_port() * ide_acpi_blacklist() -> ide_acpi_init() * Call ide_acpi_init() only once (do it during IDE core initialization) and cleanup the function accordingly. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_for_each_present_dev() iteratorBartlomiej Zolnierkiewicz2009-03-241-25/+13
| | | | | | | | | | * Add ide_for_each_present_dev() iterator and convert IDE code to use it. * Do some drive-by CodingStyle fixups in ide-acpi.c while at it. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: init_irq() doesn't need to hold ide_cfg_mtxBartlomiej Zolnierkiewicz2009-03-241-4/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move ->lock and ->timer init from init_irq() to ide_init_port_data()Bartlomiej Zolnierkiewicz2009-03-241-5/+6
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: no need to touch local IRQs in ide_probe_port()Bartlomiej Zolnierkiewicz2009-03-241-6/+0
| | | | | | | | | | | | | | | Remove superfluous local_save_flags() local_irq_enable_in_hardirq() ... local_irq_restore() combo. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix IDE_DFLAG_NO_IO_32BIT handlingBartlomiej Zolnierkiewicz2009-03-241-7/+2
| | | | | | | | | * IDE_DFLAG_NO_IO_32BIT may be set by cmd640's ->init_dev method so don't clear it in ide_port_tune_devices() (+ no need to do it). * Move IDE_DFLAG_NO_IO_32BIT handling to ide_port_init_devices(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: allow to wrap interrupt handlerStanislaw Gruszka2009-03-051-1/+6
| | | | | | | Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Cc: Andrew Victor <linux@maxim.org.za> [bart: minor checkpatch.pl / CodingStyle fixups] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* IDE: Unregister and disable devices if initialization fails.Ian Campbell2009-02-021-1/+2
| | | | | | | | | | On reboot the loop in device_shutdown gets confused by these partially initialized devices and goes into an infinite loop. Therefore unregister and disable these devices. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [bart: remove leftover hwif->present clearing + update patch description] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix ide_register_port() failure handlingBartlomiej Zolnierkiewicz2009-02-021-8/+32
| | | | | | | | | * Factor out port freeing from ide_host_free() to ide_free_port(). * Add ide_disable_port() and use it on ide_register_port() failure. Cc: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix IDE PMAC breakageAndreas Schwab2009-01-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> writes: > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > --- > drivers/ide/ide-probe.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > Index: b/drivers/ide/ide-probe.c > =================================================================== > --- a/drivers/ide/ide-probe.c > +++ b/drivers/ide/ide-probe.c > @@ -640,14 +640,9 @@ static int ide_register_port(ide_hwif_t > /* register with global device tree */ > dev_set_name(&hwif->gendev, hwif->name); > hwif->gendev.driver_data = hwif; > - if (hwif->gendev.parent == NULL) { > - if (hwif->dev) > - hwif->gendev.parent = hwif->dev; > - else > - /* Would like to do = &device_legacy */ > - hwif->gendev.parent = NULL; > - } > + hwif->gendev.parent = hwif->dev; This [bart: commit 96d40941236722777c259775640b8880b7dc6f33 ("ide: small ide_register_port() cleanup")] breaks ide-pmac. It overwrites the parent that pmac_ide_macio_attach has set. Signed-off-by: Andreas Schwab <schwab@suse.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix accidental LOCKDEP breakage caused by local_irq_set() removalBartlomiej Zolnierkiewicz2009-01-141-1/+1
| | | | | | | | | | | commit 54cc1428cfa619e16d75baae8cb041a2eff015f0 ("ide: remove local_irq_set() macro") accidentally replaced local_save_flags() by local_irq_set() in ide_probe_port() and __ide_wait_stat() which resulted in LOCKDEP breakage. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move read_sff_dma_status() method to 'struct ide_dma_ops'Sergei Shtylyov2009-01-061-2/+5
| | | | | | | | | | | | Move apparently misplaced read_sff_dma_status() method from 'struct ide_tp_ops' to 'struct ide_dma_ops', renaming it to dma_sff_read_status() and making only required for SFF-8038i compatible IDE controller drivers (greatly cutting down the number of initializers) as its only user (outside ide-dma-sff.c and such drivers) appears to be ide_pci_check_simplex() which is only called for such controllers... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix ide_port_scan() to do ACPI setup after initializing request queuesBartlomiej Zolnierkiewicz2009-01-061-1/+1
| | | | | | | | This makes ide_port_scan()'s behavior match ide_host_register()'s one and fixes OOPS in elv_may_queue() during port re-scan. Reported-and-tested-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: Fix drive's DWORD-IO handlingMario Schwalbe2009-01-061-2/+1
| | | | | | | | | | | | According the documentation, id[ATA_ID_DWORD_IO] is non-zero if the drive supports dword IO, while the code disables support by setting IDE_DFLAG_NO_IO_32BIT. In addition, this word has been reused by the ATA8 specification. This patch fixes both cases. Signed-off-by: Mario Schwalbe <schwalbe@inf.tu-dresden.de> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> [bart: remove id[ATA_ID_DWORD_IO] check altogether per Sergei's suggestion] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add port and host iteratorsBartlomiej Zolnierkiewicz2009-01-061-58/+38
| | | | | | | | | | | | | | | Add ide_port_for_each_dev() / ide_host_for_each_port() iterators and update IDE code to use them. While at it: - s/unit/i/ variable in ide_port_wait_ready(), ide_probe_port(), ide_port_tune_devices(), ide_port_init_devices_data(), do_reset1(), ide_acpi_set_state() and scc_dma_end() - s/d/i/ variable in ide_proc_port_register_devices() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: dynamic allocation of device structuresBartlomiej Zolnierkiewicz2009-01-061-20/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate device structures dynamically instead of having them embedded in ide_hwif_t: * Remove needless zeroing of port structure from ide_init_port_data(). * Add ide_hwif_t.devices[MAX_DRIVES] (table of pointers to the devices). * Add ide_port_{alloc,free}_devices() helpers and use them respectively in ide_{host,free}_alloc(). * Convert all users of ->drives[] to use ->devices[] instead. While at it: * Use drive->dn for the slave device check in scc_pata.c. As a nice side-effect this patch cuts ~1kB (x86-32) from the resulting code size: text data bss dec hex filename 53963 1244 237 55444 d894 drivers/ide/ide-core.o.before 52981 1244 237 54462 d4be drivers/ide/ide-core.o.after Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: NUMA aware allocation of host and port structuresBartlomiej Zolnierkiewicz2009-01-061-4/+5
| | | | | | kzalloc() -> kzalloc_node() in ide_host_alloc(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove local_irq_set() macroBartlomiej Zolnierkiewicz2009-01-061-1/+2
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove HWIF() macroBartlomiej Zolnierkiewicz2009-01-061-6/+6
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move ide_init_port_data() and friends to ide-probe.cBartlomiej Zolnierkiewicz2009-01-061-0/+135
| | | | | | | | | | | | | | | | | * Move IDE_DEFAULT_MAX_FAILURES to <linux/ide.h>. * Move ide_cfg_mtx, ide_hwif_to_major[], ide_port_init_devices_data(), ide_init_port_data(), ide_init_port_hw() and ide_unregister() to ide-probe.c from ide.c. * Make ide_unregister(), ide_init_port_data(), ide_init_port_hw() and ide_cfg_mtx static. While at it: * Remove stale ide_init_port_data() documentation and ide_lock extern. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: merge ide_hwgroup_t with ide_hwif_t (v2)Bartlomiej Zolnierkiewicz2009-01-061-74/+13
| | | | | | | | | | | | | | | | | | | * Merge ide_hwgroup_t with ide_hwif_t. * Cleanup init_irq() accordingly, then remove no longer needed ide_remove_port_from_hwgroup() and ide_ports[]. * Remove now unused HWGROUP() macro. While at it: * ide_dump_ata_error() fixups v2: * Fix ->quirk_list check in do_ide_request() (s/hwif->cur_dev/prev_port->cur_dev). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove hwgroup->hwif and {drive,hwif}->nextBartlomiej Zolnierkiewicz2009-01-061-84/+6
| | | | | | | | | | | | | | | | | | | | | * Add 'int port_count' field to ide_hwgroup_t to keep the track of the number of ports in the hwgroup. Then update init_irq() and ide_remove_port_from_hwgroup() to use it. * Remove no longer needed hwgroup->hwif, {drive,hwif}->next, ide_add_drive_to_hwgroup() and ide_remove_drive_from_hwgroup() (hwgroup->drive now only denotes the currently active device in the hwgroup). * Update locking documentation in <linux/ide.h>. While at it: * Rename ->drive field in ide_hwgroup_t to ->cur_dev. * Use __func__ in ide_timer_expiry(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use per-port IRQ handlersBartlomiej Zolnierkiewicz2009-01-061-13/+8
| | | | | | | | | Use hwif instead of hwgroup as {request,free}_irq()'s cookie, teach ide_intr() to return early for non-active serialized ports, modify unexpected_intr() accordingly and then use per-port IRQ handlers instead of per-hwgroup ones. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove the last ide-scsi remnantsBorislav Petkov2009-01-021-2/+0
| | | | | Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use per-device request queue locks (v2)Bartlomiej Zolnierkiewicz2009-01-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Move hack for flush requests from choose_drive() to do_ide_request(). * Add ide_plug_device() helper and convert core IDE code from using per-hwgroup lock as a request lock to use the ->queue_lock instead. * Remove no longer needed: - choose_drive() function - WAKEUP() macro - 'sleeping' flag from ide_hwif_t - 'service_{start,time}' fields from ide_drive_t This patch results in much simpler and more maintainable code (besides being a scalability improvement). v2: * Fixes/improvements based on review from Elias: - take as many requests off the queue as possible - remove now redundant BUG_ON() Cc: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move sysfs support to ide-sysfs.cBartlomiej Zolnierkiewicz2009-01-021-52/+0
| | | | | | | | | While at it: - media_string() -> ide_media_string() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: factor out device type classifying from do_identify()Bartlomiej Zolnierkiewicz2009-01-021-73/+81
| | | | | | | | | Factor out device type classifying from do_identify() to ide_classify_ata_dev() and ide_classify_atapi_dev(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: small ide_register_port() cleanupBartlomiej Zolnierkiewicz2009-01-021-7/+2
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove chipset type fixup from ide_host_register()Bartlomiej Zolnierkiewicz2009-01-021-3/+0
| | | | | | | | | | | * Set chipset type explicitly in tx4938ide and tx4939ide host drivers (all other host drivers were updated already). * Remove no longer used chipset type fixup from ide_host_register(). Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: push local_irq_{save,restore}() to do_identify()Bartlomiej Zolnierkiewicz2008-12-291-7/+4
| | | | | | | | Push local_irq_{save,restore}() from actual_try_to_identify() to do_identify() and remove no longer needed local_irq_enable(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move legacy ISA/VLB ports handling to ide-legacy.c (v2)Bartlomiej Zolnierkiewicz2008-12-291-56/+0
| | | | | | | | | | | | | | | * Move legacy ISA/VLB ports handling from ide-probe.c to ide-legacy.c. * Add CONFIG_IDE_LEGACY config option to be selected by host drivers needing ide-legacy.c. v2: Fix CONFIG_IDE_LEGACY not being defined in Kconfig. (from Takashi Iwai <tiwai@suse.de>) There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove inline tags from ide-probe.cBartlomiej Zolnierkiewicz2008-12-291-4/+4
| | | | | | Let the compiler handle it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2008-12-291-2/+2
| | | | | | Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: rework handling of serialized ports (v2)Bartlomiej Zolnierkiewicz2008-12-291-45/+5
| | | | | | | | | | | | | | | | | | | | | | | * hpt366: set IDE_HFLAG_SERIALIZE in ->host_flags if needed in init_hwif_hpt366(). Remove HPT_SERIALIZE_IO while at it. * Set IDE_HFLAG_SERIALIZE in ->host_flags if needed in ide_init_port(). * Convert init_irq() to use IDE_HFLAG_SERIALIZE together with hwif->host to find out ports which need to be serialized. * Remove no longer needed save_match() and ide_hwif_t.serialized. v2: * Set host's ->host_flags field instead of port's copy. This patch should fix the incorrect grouping of port(s) from host(s) that need serialization with port(s) that happen to use the same IRQ(s) but are from the host(s) that don't need it. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ->max_sectors field to struct ide_port_infoBartlomiej Zolnierkiewicz2008-12-291-2/+2
| | | | | | | | | | | | | * Add ->max_sectors field to struct ide_port_info to allow host drivers to specify value used for hwif->rqsize (if smaller than the default). * Convert pdc202xx_old to use ->max_sectors and remove no longer needed IDE_HFLAG_RQSIZE_256 flag. There should be no functional changes caused by this patch. Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
OpenPOWER on IntegriCloud