Now that BMDMA status is recorded in irq handler. ata_bmdma_freeze()
is free to manipulate host status. Under certain circumstances, some
controllers (ICH7 in enhanced mode w/ IRQ shared) raise IRQ when CTL
register is written to and ATA_NIEN doesn't mask it.
This patch makes ata_bmdma_freeze() clear all pending IRQs after
freezing a port. This change makes explicit clearing in
ata_device_add() unnecessary and thus kills it. The removed code was
SFF-specific and was in the wrong place.
Note that ->freeze() handler is always called under ap->lock held and
irq disabled. Even if CTL manipulation causes stuck IRQ, it's cleared
immediately. This should be safe (enough) even in SMP environment.
More correct solution is to mask the IRQ from IRQ controller but that
would be an overkill.
Signed-off-by: Tejun Heo <htejun@gmail.com>
For certain errors, interrupt handler alter BMDMA host status before
entering EH (clears active and intr). Thus altered BMDMA host status
value is recorded by BMDMA EH and reported to user. Move BMDMA host
status recording from EH to interrupt handler.
Signed-off-by: Tejun Heo <htejun@gmail.com>
There are machines out there which share legacy PCI IDE IRQs w/ other
devices. libata SFF interrupt/HSM code is ready for shared IRQ and
has been setting IRQF_SHARED for devices in native PCI mode. Device
in legacy mode is still a PCI device and thus supposedly uses
active-low level triggered IRQ.
Machines with such setup should be quite rare and w/o this flag libata
is likely to fail loading and render the system unuseable. Also, IDE
driver has been setting IRQF_SHARED for devices in legacy mode for a
looooong time.
Signed-off-by: Tejun Heo <htejun@gmail.com>
ata_irq_on() isn't used outside of libata core layer. The function is
TF/SFF interface specific but currently used by core path with some
hack too. Move it from include/linux/libata.h to
drivers/ata/libata-sff.c.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This patch adds support for ADMA mode on NVIDIA nForce4 (CK804/MCP04) SATA
controllers to the sata_nv driver. Benefits of ADMA mode include:
- NCQ support
- Reduced CPU overhead (controller DMAs command information from memory
instead of them being pushed in by the CPU)
- Full 64-bit DMA support
ADMA mode is enabled by default in this version. To disable it, set the
module parameter adma_enabled=0.
Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
There are some Linux supported platforms that simply cannot hit the low
I/O addresses used by ATA legacy mode PCI mappings. These platforms have
a window for PCI space that is fixed by the board logic and doesn't
include the neccessary locations.
Provide a config option so that such platforms faced with a controller
that they cannot support simply error it and punt
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Don't write the same code twice, in two different functions, when they
both call the same initialization function, with the same private_data
pointer info.
Also, note a bug found with a FIXME.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
* Replace needless 'n_ports > 2' check with a simple BUG_ON().
No existing driver ever wants more than 2 ports.
* Delete ATA_FLAG_NO_LEGACY check. No current driver uses
ata_pci_init_one(), that sets this flag.
* Move PCI_CLASS_PROG register read below pci_enable_device()
* Handle ata_device_add() failure
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Non-uniform ports handling got broken while updating libata to handle
those in the same host. Only separate irq for the non-uniform
secondary port was implemented while all other fields (host flags,
transfer mode...) of the secondary port simply shared those of the
first.
For ata_piix combined mode, which ATM is the only user of non-uniform
ports, this causes the secondary port assume the wrong type. This can
cause PATA port to use SATA ops, which results in bogus check on PCS
and detection failure.
This patch adds ata_probe_ent->pinfo2 which points to optional
port_info for the secondary port. For the time being, this seems to
be the simplest solution. This workaround will be removed together
with ata_probe_ent itself after init model is updated to allow more
flexibility.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Nelson A. de Oliveira <naoliv@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>