History log of /drivers/ata/pata_isapnp.c
Revision Date Author Comments
fc0012ec533def054e1ac57d54ed781fc0ab6b71 12-Sep-2013 Ondrej Zary <linux@rainbow-software.org> pata_isapnp: Don't use invalid I/O ports

The test for 2nd I/O port validity is broken (reversed): On devices
with no control port, the driver attempts to use invalid port 0,
resulting in logs full of bad_io_access errors. On devices with
control port, the driver does not use it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
c96f1732e25362d10ee7bcac1df8412a2e6b7d23 24-Mar-2009 Alan Cox <alan@redhat.com> [libata] Improve timeout handling

On a timeout call a device specific handler early in the recovery so that
we can complete and process successful commands which timed out due to IRQ
loss or the like rather more elegantly.

[Revised to exclude the timeout handling on a few devices that inherit from
SFF but are not SFF enough to use the default timeout handler]

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14bdef982caeda19afe34010482867c18217c641 14-Mar-2009 Erik Inge Bolsø <knan-lkml@anduin.net> [libata] convert drivers to use ata.h mode mask defines

No functional changes in this patch.

Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
ab77163008c596aad9624ceab190d840c0143fa8 27-Oct-2008 Alan Cox <alan@lxorguk.ukuu.org.uk> ata: Switch all my stuff to a common address

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
9363c3825ea9ad76561eb48a395349dd29211ed6 07-Apr-2008 Tejun Heo <htejun@gmail.com> libata: rename SFF functions

SFF functions have confusing names. Some have sff prefix, some have
bmdma, some std, some pci and some none. Unify the naming by...

* SFF functions which are common to both BMDMA and non-BMDMA are
prefixed with ata_sff_.

* SFF functions which are specific to BMDMA are prefixed with
ata_bmdma_.

* SFF functions which are specific to PCI but apply to both BMDMA and
non-BMDMA are prefixed with ata_pci_sff_.

* SFF functions which are specific to PCI and BMDMA are prefixed with
ata_pci_bmdma_.

* Drop generic prefixes from LLD specific routines. For example,
bfin_std_dev_select -> bfin_dev_select.

The following renames are noteworthy.

ata_qc_issue_prot() -> ata_sff_qc_issue()
ata_pci_default_filter() -> ata_bmdma_mode_filter()
ata_dev_try_classify() -> ata_sff_dev_classify()

This rename is in preparation of separating SFF support out of libata
core layer. This patch strictly renames functions and doesn't
introduce any behavior difference.

Signed-off-by: Tejun Heo <htejun@gmail.com>
029cfd6b74fc5c517865fad78cf4a3ea8d9b664a 24-Mar-2008 Tejun Heo <htejun@gmail.com> libata: implement and use ops inheritance

libata lets low level drivers build ata_port_operations table and
register it with libata core layer. This allows low level drivers
high level of flexibility but also burdens them with lots of
boilerplate entries.

This becomes worse for drivers which support related similar
controllers which differ slightly. They share most of the operations
except for a few. However, the driver still needs to list all
operations for each variant. This results in large number of
duplicate entries, which is not only inefficient but also error-prone
as it becomes very difficult to tell what the actual differences are.

This duplicate boilerplates all over the low level drivers also make
updating the core layer exteremely difficult and error-prone. When
compounded with multi-branched development model, it ends up
accumulating inconsistencies over time. Some of those inconsistencies
cause immediate problems and fixed. Others just remain there dormant
making maintenance increasingly difficult.

To rectify the problem, this patch implements ata_port_operations
inheritance. To allow LLDs to easily re-use their own ops tables
overriding only specific methods, this patch implements poor man's
class inheritance. An ops table has ->inherits field which can be set
to any ops table as long as it doesn't create a loop. When the host
is started, the inheritance chain is followed and any operation which
isn't specified is taken from the nearest ancestor which has it
specified. This operation is called finalization and done only once
per an ops table and the LLD doesn't have to do anything special about
it other than making the ops table non-const such that libata can
update it.

libata provides four base ops tables lower drivers can inherit from -
base, sata, pmp, sff and bmdma. To avoid overriding these ops
accidentaly, these ops are declared const and LLDs should always
inherit these instead of using them directly.

After finalization, all the ops table are identical before and after
the patch except for setting .irq_handler to ata_interrupt in drivers
which didn't use to. The .irq_handler doesn't have any actual effect
and the field will soon be removed by later patch.

* sata_sx4 is still using old style EH and currently doesn't take
advantage of ops inheritance.

Signed-off-by: Tejun Heo <htejun@gmail.com>
68d1d07b510bb57a504588adc2bd2758adea0965 24-Mar-2008 Tejun Heo <htejun@gmail.com> libata: implement and use SHT initializers

libata lets low level drivers build scsi_host_template and register it
to the SCSI layer. This allows low level drivers high level of
flexibility but also burdens them with lots of boilerplate entries.

This patch implements SHT initializers which can be used to initialize
all the boilerplate entries in a sht. Three variants of them are
implemented - BASE, BMDMA and NCQ - for different types of drivers.
Note that entries can be overriden by putting individual initializers
after the helper macro.

All sht tables are identical before and after this patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
358f9a77a668660729e705fde9c3cf69f013aa98 24-Mar-2008 Tejun Heo <htejun@gmail.com> libata: implement and use ata_noop_irq_clear()

->irq_clear() is used to clear IRQ bit of a SFF controller and isn't
useful for drivers which don't use libata SFF HSM implementation.
However, it's a required callback and many drivers implement their own
noop version as placeholder. This patch implements ata_noop_irq_clear
and use it to replace those custom placeholders.

Also, SFF drivers which don't support BMDMA don't need to use
ata_bmdma_irq_clear(). It becomes noop if BMDMA address isn't
initialized. Convert them to use ata_noop_irq_clear().

Signed-off-by: Tejun Heo <htejun@gmail.com>
91e33d31096a2b518ae5744c345af15c1ff06fd5 19-Nov-2007 Alan Cox <alan@lxorguk.ukuu.org.uk> pata_isapnp: Polled devices

If a card has no IRQ then pass no interrupt handler but allow polled
usage.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
cbcdd87593a1d85c5c4b259945a3a09eee12814d 18-Aug-2007 Tejun Heo <htejun@gmail.com> libata: implement and use ata_port_desc() to report port configuration

Currently, port configuration reporting has the following problems.

* iomapped address is reported instead of raw address
* report contains irrelevant fields or lacks necessary fields for
non-SFF controllers.
* host->irq/irq2 are there just for reporting and hacky.

This patch implements and uses ata_port_desc() and
ata_port_pbar_desc(). ata_port_desc() is almost identical to
ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no
locking requirement, can only be used during host initialization and "
" is used as separator instead of ", ". ata_port_pbar_desc() is a
helper to ease reporting of a PCI BAR or an offsetted address into it.

LLD pushes whatever description it wants using the above two
functions. The accumulated description is printed on host
registration after "[S/P]ATA max MAX_XFERMODE ".

SFF init helpers and ata_host_activate() automatically add
descriptions for addresses and irq respectively, so only LLDs which
isn't standard SFF need to add custom descriptions. In many cases,
such controllers need to report different things anyway.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
81ad1837b590775336f68eafcae8dab13a975b3a 22-Aug-2007 Alan Cox <alan@lxorguk.ukuu.org.uk> libata: Switch most of the remaining SFF drivers to ata_sff_port_start

This avoids allocating DMA buffers if not needed but at the moment is
mostly just a neatness item.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
ac8869d56d95a8c74403e6f7a47d74fcfcc1b988 16-Aug-2007 Jeff Garzik <jeff@garzik.org> [libata] Remove ->port_disable() hook

It was always set to ata_port_disable(). Removed the hook, and replaced
the very few ap->ops->port_disable() callsites with direct calls to
ata_port_disable().

Signed-off-by: Jeff Garzik <jeff@garzik.org>
6d32d30f55020d766388df7515f771f68c973033 15-Aug-2007 Jeff Garzik <jeff@garzik.org> [libata] Remove ->irq_ack() hook, and ata_dummy_irq_on()

* ->irq_ack() is redundant to what the irq handler already
performs... chk-status + irq-clear. Furthermore, it is only
called in one place, when screaming-irq-debugging is enabled,
so we don't want to bother with a hook just for that.

* ata_dummy_irq_on() is only ever used in drivers that have
no callpath reaching ->irq_on(). Remove .irq_on hook from
those drivers, and the now-unused ata_dummy_irq_on()

Signed-off-by: Jeff Garzik <jeff@garzik.org>
2a3103ce4357a09c2289405f969acec0edf4398f 31-Aug-2007 Jeff Garzik <jeff@garzik.org> [libata] Bump driver versions

Bump the versions for drivers that were modified, but had not already
had a version number bump.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
6a286a6d85bb0da687011b15f268c0e52e8eaba4 03-Aug-2007 Jeff Garzik <jeff@garzik.org> [libata] pata_isapnp: replace missing module device table

Signed-off-by: Jeff Garzik <jeff@garzik.org>
c3a44a47e8f60e8e4ae58d3a024b9a7ab293e673 05-Jun-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> remove unused variable in pata_isapnp

This patch has removed unused variable in pata_ispnp.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
8bc3fc470eb25af4d70c72485cbcb130cc657691 22-May-2007 Jeff Garzik <jeff@garzik.org> libata: bump versions

Signed-off-by: Jeff Garzik <jeff@garzik.org>
5d728824efeda61d304153bfcf1378a3c18b7d70 17-Apr-2007 Tejun Heo <htejun@gmail.com> libata: convert the remaining PATA drivers to new init model

Convert pdc_adma, pata_cs5520, pata_isapnp, pata_ixp4xx_cf,
pata_legacy, pata_mpc52xx, pata_mpiix, pata_pcmcia, pata_pdc2027x,
pata_platform, pata_qdi, pata_scc and pata_winbond to new init model.

* init_one()'s now follow more consistent init order

* cs5520 now registers one host with two ports, not two hosts. If any
of the two ports are disabled, it's made dummy as other drivers do.

Tested pdc_adma and pata_legacy. Both are as broken as before. The
rest are compile tested only.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
a73984a0d5664fa1bfdd9f0a475b8d74af7f44a6 09-Mar-2007 Jeff Garzik <jeff@garzik.org> [libata] More PATA driver ->cable_detect support

Roll-up of ->cable_detect feature addition patches, authored and
signed-off-by Alan Cox.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
1aa56cca5bfa396c791e93b38e4776ef39b590a7 27-Feb-2007 Tejun Heo <htejun@gmail.com> libata: clear drvdata in ata_host_release(), take#2

Clearing drvdata in ->remove_one causes NULL pointer deference. Clear
drvdata only in ata_host_release() after all resources are freed.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
cb48cab7f363014e0a5dc21f7b4892c15d626d41 26-Feb-2007 Jeff Garzik <jeff@garzik.org> [libata] bump versions

Bump versions based on changes submitted during 2.6.21 merge window.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
246ce3b675843e0369643cceb4faeb6cf6d19a30 26-Jan-2007 Akira Iguchi <akira2.iguchi@toshiba.co.jp> libata: add another IRQ calls (libata drivers)

This patch is against each libata driver.

Two IRQ calls are added in ata_port_operations.
- irq_on() is used to enable interrupts.
- irq_ack() is used to acknowledge a device interrupt.

In most drivers, ata_irq_on() and ata_irq_ack() are used for
irq_on and irq_ack respectively.

In some drivers (ex: ahci, sata_sil24) which cannot use them
as is, ata_dummy_irq_on() and ata_dummy_irq_ack() are used.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
0d5ff566779f894ca9937231a181eb31e4adff0e 01-Feb-2007 Tejun Heo <htejun@gmail.com> libata: convert to iomap

Convert libata core layer and LLDs to use iomap.

* managed iomap is used. Pointer to pcim_iomap_table() is cached at
host->iomap and used through out LLDs. This basically replaces
host->mmio_base.

* if possible, pcim_iomap_regions() is used

Most iomap operation conversions are taken from Jeff Garzik
<jgarzik@pobox.com>'s iomap branch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
24dc5f33ea4b504cfbd23fa159a4cacba8e4d800 20-Jan-2007 Tejun Heo <htejun@gmail.com> libata: update libata LLDs to use devres

Update libata LLDs to use devres. Core layer is already converted to
support managed LLDs. This patch simplifies initialization and fixes
many resource related bugs in init failure and detach path. For
example, all converted drivers now handle ata_device_add() failure
gracefully without excessive resource rollback code.

As most resources are released automatically on driver detach, many
drivers don't need or can do with much simpler ->{port|host}_stop().
In general, stop callbacks are need iff port or host needs to be given
commands to shut it down. Note that freezing is enough in many cases
and ports are automatically frozen before being detached.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2eab80ac0c96fb98267afeb12a4899801564c75b 28-Nov-2006 Tejun Heo <htejun@gmail.com> [PATCH] libata: kill unnecessary sht->max_sectors initializations

sht->max_sectors is overrided unconditionally in ->slave_configure.
There's no reason to set it to any value.

Signed-off-by: Tejun Heo <htejun@gmail.com>
afdfe899e6420eac6c5eb3bc8c89456dff38d40e 29-Nov-2006 Tejun Heo <htejun@gmail.com> [PATCH] libata: add missing sht->slave_destroy

Many LLDs are missing sht->slave_destroy. The method is mandatory to
support device warm unplugging (echo 1 > /sys/.../delete). Without
it, libata might access released scsi device.

Signed-off-by: Tejun Heo <htejun@gmail.com>
bda3028813bd07f34f30288a492fbf6f7b8712dd 27-Sep-2006 Jeff Garzik <jeff@garzik.org> [libata] Don't use old-EH ->eng_timeout() hook when not needed

The PATA driver set got converted to the new error handling setup, but
the old hooks were accidentally left in place. Now, removed.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
669a5db411d85a14f86cd92bc16bf7ab5b8aa235 30-Aug-2006 Jeff Garzik <jeff@garzik.org> [libata] Add a bunch of PATA drivers.

The vast majority of drivers and changes are from Alan Cox. Albert Lee
contributed and maintains pata_pdc2027x. Adrian Bunk, Andrew Morton,
and Tejun Heo contributed various minor fixes and updates.

Signed-off-by: Jeff Garzik <jeff@garzik.org>