History log of /drivers/ide/ide-generic.c
Revision Date Author Comments
9f36d31437922354d104a2db407f397e79e4027e 17-May-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: remove hw_regs_t typedef

Remove hw_regs_t typedef and rename struct hw_regs_s to struct ide_hw.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
dca3983059a4481e4ae97bbf0ac4b4c21429e1a5 17-May-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: pass number of ports to ide_host_{alloc,add}() (v2)

Pass number of ports to ide_host_{alloc,add}() and then update
all users accordingly.

v2:
- drop no longer needed NULL initializers in buddha.c, cmd640.c and gayle.c
(noticed by Sergei)

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
29e52cf793ded6bece50de50e738596f94f07d9f 17-May-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: remove chipset field from hw_regs_t

* Convert host drivers that still use hw_regs_t's chipset field to use
the one in struct ide_port_info instead.

* Move special handling of ide_pci chipset type from ide_hw_configure()
to ide_init_port().

* Remove chipset field from hw_regs_t.

While at it:
- remove stale comment in delkin_cb.c

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
4465461ece2b9249d6c0cf57bc0002100823e361 31-Mar-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: merge ide_arm and ide_generic host drivers

There is no need for a separate ide_arm host driver nowadays
so merge it into ide_generic one.

While at it:
- return -EBUSY from ide_generic_init() if I/O resources are busy
- scale down ide_generic_check_pci_legacy_iobases() for CONFIG_PCI=n

Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Alexander Schulz <alex@shark-linux.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
52913ab2c6f760c2af9f9396765ce8fa1a2baf17 31-Mar-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: remove no longer needed sysfs interface

Nowadays we have "ide_generic.probe_mask=" module parameter
and ide_platform host driver so sysfs interface for adding
IDE interfaces is no longer needed.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
e518e58779d946f01bf93428be8791d5f07b4984 27-Mar-2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: use struct ide_port_info

This fixes hwif->channel and drive->dn assignments.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
cf4049103be931fca133f66b3181490284a521c6 13-Oct-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: remove no longer needed ide_probe_legacy()

There is now a generic solution [ide_generic_check_pci_legacy_iobases()]
so MIPS-specific ide_probe_legacy() is no longer necessary.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
6ccc6d7ecbb427580d045699e434bc5c6f45e227 13-Oct-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: no need to probe all ports at once

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
20df429dd6671804999493baf2952f82582869fa 10-Oct-2008 Borislav Petkov <petkovbb@gmail.com> ide-generic: handle probing of legacy io-ports v5

Avoid probing the io-ports in case an IDE PCI controller is present and it
uses the legacy iobases. If we still want to enforce the probing, we do

ide_generic.probe_mask=0x3f

on the kernel command line. The iobase checking code is
adapted from drivers/ata/pata_legacy.c after converting hex
pci ids into their corresponding macros in <linux/pci_ids.h>.

Also, check only BAR0/2 resources since those are guaranteed
by the workaround in drivers/pci/probe.c:pci_setup_device().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[bart: trivial printk() fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
f01d35d87f39ab794ddcdefadb79c11054bcbfbc 24-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: remove ide_default_{io_base,irq}() inlines (take 3)

Replace ide_default_{io_base,irq}() inlines by legacy_{bases,irqs}[].

v2:
Add missing zero-ing of hws[] (caught during testing by Borislav Petkov).

v3:
Fix zero-oing of hws[] for _real_ this time.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
dbdec839c4c2bfc8f2da8e50c06b9947e5ad0394 24-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: minor fix for mips

Move ide_probe_legacy() call to ide_generic_init() so it fails
early if necessary and returns the proper error value (nowadays
ide_default_io_base() is used only by ide-generic).

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
8a69580e1ea9516caada5eed202afd39546e9809 23-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: add ide_host_free() helper (take 2)

* Add ide_host_free() helper and convert ide_host_remove() to use it.

* Fix handling of ide_host_register() failure in ide_host_add(),
icside.c, ide-generic.c, falconide.c and sgiioc4.c.

While at it:

* Fix handling of ide_host_alloc_all() failure in ide-generic.c.

* Fix handling of ide_host_alloc() failure in falconide.c
(also return the correct error value if no device is found).

v2:
* falconide build fix. (From Stephen Rothwell)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
6f904d015262dfa43eb1cecc00b0998b4c3543f2 23-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: add ide_host_add() helper

Add ide_host_add() helper which does ide_host_alloc()+ide_host_register(),
then convert ide_setup_pci_device[s](), ide_legacy_device_add() and some
host drivers to use it.

While at it:

* Fix ide_setup_pci_device[s](), ide_arm.c, gayle.c, ide-4drives.c,
macide.c, q40ide.c, cmd640.c and cs5520.c to return correct error value.

* -ENOENT -> -ENOMEM in rapide.c, ide-h8300.c, ide-generic.c, au1xxx-ide.c
and pmac.c

* -ENODEV -> -ENOMEM in palm_bk3710.c, ide_platform.c and delkin_cb.c

* -1 -> -ENOMEM in ide-pnp.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
48c3c1072651922ed153bcf0a33ea82cf20df390 23-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: add struct ide_host (take 3)

* Add struct ide_host which keeps pointers to host's ports.

* Add ide_host_alloc[_all]() and ide_host_remove() helpers.

* Pass 'struct ide_host *host' instead of 'u8 *idx' to
ide_device_add[_all]() and rename it to ide_host_register[_all]().

* Convert host drivers and core code to use struct ide_host.

* Remove no longer needed ide_find_port().

* Make ide_find_port_slot() static.

* Unexport ide_unregister().

v2:
* Add missing 'struct ide_host *host' to macide.c.

v3:
* Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/)
(Noticed by Stephen Rothwell).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
edc74b247bedb3a1f80eb6371d4171f2d49c1c77 23-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: probing fix

* Don't skip probing IDE port if the corresponding ide_hwifs[] slot
is already occupied.

* Remove duplicate idx[i] assignment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
c97c6aca75fd5f718056fde7cff798b8cbdb07c0 23-Jul-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: pass hw_regs_t-s to ide_device_add[_all]() (take 3)

* Add 'hw_regs_t **hws' argument to ide_device_add[_all]() and convert
host drivers + ide_legacy_init_one() + ide_setup_pci_device[s]() to use
it instead of calling ide_init_port_hw() directly.

[ However if host has > 1 port we must still set hwif->chipset to hint
consecutive ide_find_port() call that the previous slot is occupied. ]

* Unexport ide_init_port_hw().

v2:
* Use defines instead of hard-coded values in buddha.c, gayle.c and q40ide.c.
(Suggested by Geert Uytterhoeven)

* Better patch description.

v3:
* Fix build problem in ide-cs.c. (Noticed by Stephen Rothwell)

There should be no functional changes caused by this patch.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
0cbccbc30a60ff60dbeb203154f1f527c632de9b 15-Jun-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: don't probe all legacy ISA IDE ports by default

We can't probe all legacy ISA IDE ports by default as the resources may be
occupied by other ISA devices. Add "probe_mask" module parameter and probe
only first two ISA IDE ports by default leaving the decision about probing
the rest to the user (systems with ISA ide2-6 should be very, very rare).

This fixes a regression caused by:

commit 343a3451e20314d5959b59b992e33fbaadfe52bf
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date: Tue Jun 10 20:56:36 2008 +0200

ide-generic: add missing hwif->chipset setup
...

Reported-by: Mikael Pettersson <mikpe@it.uu.se>
Bisected-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
343a3451e20314d5959b59b992e33fbaadfe52bf 10-Jun-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: add missing hwif->chipset setup

hwif->chipset need to be set properly or ide-generic driver will break once
we make a final step in fixing host drivers' dependence on ide_hwifs[].

Problem was catched early thanks to IDE tree exposure in -mm / -next trees
and reported by people listed people (thank you guys!).

Reported-by: "John Keller" <jpk@sgi.com>
Reported-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Reported-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
3dd89a9b2af37d8e3efd785e20b12b785e50e48f 26-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: cleanup setting hwif->mmio flag

It is no longer needed to set hwif->mmio flag to tell IDE layer to not
manage resources so cleanup host drivers that used hwif->mmio flag only
for this purpose.

Ditto for ide_legacy_init_one().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1664949843e8c0782c8f2e40897285a8dfffdf27 26-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: manage I/O resources in driver

* Tell IDE layer to not manage resources by setting hwif->mmio flag.

* Use {request,release}_region() for resources management.

* Use driver name for resources management.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
dc9114e27acecc5a2ce2394a284a07e4e6ae5849 26-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: use ide_find_port() (take 3)

There should be no functional changes caused by this patch.

v2:
* Fix comment (noticed by Sergei Shtylyov).

v3:
* Fix no initalization of idx in some case. (Johann Felix Soden)

Cc: Johann Felix Soden <johfel@users.sourceforge.net>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
59bff5ba5529feac3a0214d897b1920cbe4e2278 26-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: cleanup ide_find_port()

Remove no longer needed matching against I/O base and 'base' argument.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
273b8385e5817a4765f82257004c5ec661a6a5b2 18-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: remove ide_init_default_irq() macro

* Use ide_default_irq() instead of ide_init_default_irq() in
ide_generic host driver (so the correct IRQ is always set
regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI).

* Remove no longer needed ide_init_default_irq() macro.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
486c92e2900d618c650a7099536310651aa6cf1b 18-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: move default IDE ports setup to ide_generic host driver

* Make CONFIG_IDE_GENERIC depended on CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS.

* Move default IDE ports setup from init_ide_data() to ide_generic.

* Use ide_init_port_hw() in ide_generic.

* Remove no longer needed CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
9a0e77f28b50128df0c9e26ae489e44e29a7270a 18-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters (take 2)

* Remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters
and update Documentation/ide/ide.txt.

* Remove no longer needed ide_forced chipset type.

v2:
* is_chipset_set[] -> is_chipset_set in ide.c.

* Documentation/ide/ide.txt fix.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
f0298512c86ebc2eae9f4556d0b15087aa750646 18-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: add ide_generic class and attribute for adding new interfaces

* Add ide_generic_sysfs_init() helper registering 'ide_generic' class
(together with ide_generic_class_release() ->class_release method)
and use it in ide_generic_init().

* Add "add" class attribute to 'ide_generic' class for adding new interfaces
(it is intended to be a replacement for obsoleted "idex=base[,ctl[,irq]]"
kernel parameters).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
ce9b248bb451134fcb41e189e83e3838fb57caf0 18-Apr-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: set hwif->chipset

This hwif->chipset fixup is already present in ide_device_add_all()
but for warm-plug support we also need to reserve not currently present
interfaces.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
d684b21f89b96af3adc06877f29fd9f5214b23c8 19-Feb-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> falconide: locking bugfix

commit 8ac4ce742c66100931b6f2d7a36b0df08bc721fe ("ide: fix host drivers
depending on ide_generic to probe for interfaces (take 2)") moved probing
to falconide but forgot to take care of Atari specific locking - fix it.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
b2a53bc636b0e7e9ce4c899ad605432339ef5861 06-Feb-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide-generic: probing bugfix

On Tuesday 05 February 2008, Linus Torvalds wrote:
>
> On Sat, 2 Feb 2008, Bartlomiej Zolnierkiewicz wrote:
> >
> > * next part of IDE probing code re-organization saga
> >   (that would be me)
>
> This seems to cause very irritating and bogus messages for me:
>
>       Probing IDE interface ide0...
>       Probing IDE interface ide1...
>       ide2: I/O resource 0x0-0x7 not free.
>       ide2: ports already in use, skipping probe
>       ide3: I/O resource 0x0-0x7 not free.
>       ide3: ports already in use, skipping probe
>       ide4: I/O resource 0x0-0x7 not free.
>       ide4: ports already in use, skipping probe
>       ide5: I/O resource 0x0-0x7 not free.
>       ide5: ports already in use, skipping probe
>       ide6: I/O resource 0x0-0x7 not free.
>       ide6: ports already in use, skipping probe
>       ide7: I/O resource 0x0-0x7 not free.
>       ide7: ports already in use, skipping probe
>       ide8: I/O resource 0x0-0x7 not free.
>       ide8: ports already in use, skipping probe
>       ide9: I/O resource 0x0-0x7 not free.
>       ide9: ports already in use, skipping probe
>
> and that's just totally bogus. It shouldn't even request that region,
> since it's not been allocated!

The commit 139ddfcab50e5eabcc88341c8743a990ac1be6a2 ("ide: move handling of
I/O resources out of ide_probe_port()") changed the ordering of hwif->noprobe
check vs ide_hwif_request_regions() call (so that we now reserve I/O regions
before checking for hwif->noprobe). However ide-generic host driver depended
on hwif->noprobe to be set for skipping probing of empty ide_hwifs[] slots.

Fix it by passing only indexes of non-empty slots to ide_device_add_all()
from ide_generic_init().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd 02-Feb-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: add struct ide_port_info instances to legacy host drivers

* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().

* Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.

* Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().

* Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
move it to ide-probe.c and call it in in ide_device_add_all() instead of
ide_pci_setup_ports().

* Move ->mate setup to ide_device_add_all() from ide_port_init().

* Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
->autotune currently.

* Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
(to not override setup done by ide_hwif_configure()).

* Add ETRAX host handling to ide_device_add_all().

* cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.

* pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
setup to pmac_ide_setup_device().

* Add 'struct ide_port_info' instances to legacy host drivers, pass them to
ide_device_add() calls and then remove open-coded ports initialization.

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
151575e4644f917d3a9f83c777ac3543284954f8 26-Jan-2008 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: remove ideprobe_init()

* Rename ide_device_add() to ide_device_add_all() and make it accept
'u8 idx[MAX_HWIFS]' instead of 'u8 idx[4]' as an argument.

* Add ide_device_add() wrapper for ide_device_add_all().

* Convert ide_generic_init() to use ide_device_add_all().

* Remove no longer needed ideprobe_init().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
5cbf79cdb37be2aa2a1b4fa94144526b14557060 10-May-2007 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ide: add ide_proc_register_port()

* create_proc_ide_interfaces() tries to add /proc entries for every probed
and initialized IDE port, replace it by ide_proc_register_port() which does
it only for the given port (also rename destroy_proc_ide_interface() to
ide_proc_unregister_port() for consistency)

* convert {create,destroy}_proc_ide_interface[s]() users to use new functions

* pmac driver depended on proc_ide_create() to add /proc port entries, fix it

* au1xxx-ide, swarm and cs5520 drivers depended indirectly on ide-generic
driver (CONFIG_IDE_GENERIC=y) to add port /proc entries, fix them

* there is now no need to add /proc entries for IDE ports in proc_ide_create()
so don't do it

* proc_ide_create() needs now to be called before drivers are probed - fix it,
while at it make proc_ide_create() create /proc "ide" directory

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!