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 'linus' into release
This commit is contained in:
+2
-1
@@ -456,7 +456,8 @@ config PATA_MARVELL
|
||||
|
||||
config PATA_MPC52xx
|
||||
tristate "Freescale MPC52xx SoC internal IDE"
|
||||
depends on PPC_MPC52xx
|
||||
depends on PPC_MPC52xx && PPC_BESTCOMM
|
||||
select PPC_BESTCOMM_ATA
|
||||
help
|
||||
This option enables support for integrated IDE controller
|
||||
of the Freescale MPC52xx SoC.
|
||||
|
||||
+12
-6
@@ -105,7 +105,7 @@ enum {
|
||||
board_ahci_ign_iferr = 2,
|
||||
board_ahci_sb600 = 3,
|
||||
board_ahci_mv = 4,
|
||||
board_ahci_sb700 = 5,
|
||||
board_ahci_sb700 = 5, /* for SB700 and SB800 */
|
||||
board_ahci_mcp65 = 6,
|
||||
board_ahci_nopmp = 7,
|
||||
|
||||
@@ -439,7 +439,7 @@ static const struct ata_port_info ahci_port_info[] = {
|
||||
.udma_mask = ATA_UDMA6,
|
||||
.port_ops = &ahci_ops,
|
||||
},
|
||||
/* board_ahci_sb700 */
|
||||
/* board_ahci_sb700, for SB700 and SB800 */
|
||||
{
|
||||
AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL),
|
||||
.flags = AHCI_FLAG_COMMON,
|
||||
@@ -1119,14 +1119,14 @@ static void ahci_start_port(struct ata_port *ap)
|
||||
|
||||
/* turn on LEDs */
|
||||
if (ap->flags & ATA_FLAG_EM) {
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
emp = &pp->em_priv[link->pmp];
|
||||
ahci_transmit_led_message(ap, emp->led_state, 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (ap->flags & ATA_FLAG_SW_ACTIVITY)
|
||||
ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, EDGE)
|
||||
ahci_init_sw_activity(link);
|
||||
|
||||
}
|
||||
@@ -1361,7 +1361,7 @@ static ssize_t ahci_led_show(struct ata_port *ap, char *buf)
|
||||
struct ahci_em_priv *emp;
|
||||
int rc = 0;
|
||||
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
emp = &pp->em_priv[link->pmp];
|
||||
rc += sprintf(buf, "%lx\n", emp->led_state);
|
||||
}
|
||||
@@ -1941,7 +1941,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
|
||||
u32 serror;
|
||||
|
||||
/* determine active link */
|
||||
ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, EDGE)
|
||||
if (ata_link_active(link))
|
||||
break;
|
||||
if (!link)
|
||||
@@ -2446,6 +2446,8 @@ static void ahci_print_info(struct ata_host *host)
|
||||
speed_s = "1.5";
|
||||
else if (speed == 2)
|
||||
speed_s = "3";
|
||||
else if (speed == 3)
|
||||
speed_s = "6";
|
||||
else
|
||||
speed_s = "?";
|
||||
|
||||
@@ -2610,6 +2612,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
(pdev->revision == 0xa1 || pdev->revision == 0xa2))
|
||||
hpriv->flags |= AHCI_HFLAG_NO_MSI;
|
||||
|
||||
/* SB800 does NOT need the workaround to ignore SERR_INTERNAL */
|
||||
if (board_id == board_ahci_sb700 && pdev->revision >= 0x40)
|
||||
hpriv->flags &= ~AHCI_HFLAG_IGN_SERR_INTERNAL;
|
||||
|
||||
if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev))
|
||||
pci_intx(pdev, 1);
|
||||
|
||||
|
||||
@@ -57,10 +57,7 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused)
|
||||
if (pdev->vendor == PCI_VENDOR_ID_CENATEK)
|
||||
dma_enabled = 0xFF;
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
/* We don't really care */
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->dma_mode = XFER_MW_DMA_0;
|
||||
|
||||
+42
-30
@@ -154,11 +154,13 @@ struct piix_map_db {
|
||||
|
||||
struct piix_host_priv {
|
||||
const int *map;
|
||||
u32 saved_iocfg;
|
||||
void __iomem *sidpr;
|
||||
};
|
||||
|
||||
static int piix_init_one(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent);
|
||||
static void piix_remove_one(struct pci_dev *pdev);
|
||||
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline);
|
||||
static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
|
||||
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
|
||||
@@ -296,7 +298,7 @@ static struct pci_driver piix_pci_driver = {
|
||||
.name = DRV_NAME,
|
||||
.id_table = piix_pci_tbl,
|
||||
.probe = piix_init_one,
|
||||
.remove = ata_pci_remove_one,
|
||||
.remove = piix_remove_one,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = piix_pci_device_suspend,
|
||||
.resume = piix_pci_device_resume,
|
||||
@@ -308,7 +310,7 @@ static struct scsi_host_template piix_sht = {
|
||||
};
|
||||
|
||||
static struct ata_port_operations piix_pata_ops = {
|
||||
.inherits = &ata_bmdma_port_ops,
|
||||
.inherits = &ata_bmdma32_port_ops,
|
||||
.cable_detect = ata_cable_40wire,
|
||||
.set_piomode = piix_set_piomode,
|
||||
.set_dmamode = piix_set_dmamode,
|
||||
@@ -610,8 +612,9 @@ static const struct ich_laptop ich_laptop[] = {
|
||||
static int ich_pata_cable_detect(struct ata_port *ap)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
|
||||
struct piix_host_priv *hpriv = ap->host->private_data;
|
||||
const struct ich_laptop *lap = &ich_laptop[0];
|
||||
u8 tmp, mask;
|
||||
u8 mask;
|
||||
|
||||
/* Check for specials - Acer Aspire 5602WLMi */
|
||||
while (lap->device) {
|
||||
@@ -625,8 +628,7 @@ static int ich_pata_cable_detect(struct ata_port *ap)
|
||||
|
||||
/* check BIOS cable detect results */
|
||||
mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
|
||||
pci_read_config_byte(pdev, PIIX_IOCFG, &tmp);
|
||||
if ((tmp & mask) == 0)
|
||||
if ((hpriv->saved_iocfg & mask) == 0)
|
||||
return ATA_CBL_PATA40;
|
||||
return ATA_CBL_PATA80;
|
||||
}
|
||||
@@ -1072,20 +1074,13 @@ static int piix_broken_suspend(void)
|
||||
* matching is necessary because dmi_system_id.matches is
|
||||
* limited to four entries.
|
||||
*/
|
||||
if (dmi_get_system_info(DMI_SYS_VENDOR) &&
|
||||
dmi_get_system_info(DMI_PRODUCT_NAME) &&
|
||||
dmi_get_system_info(DMI_PRODUCT_VERSION) &&
|
||||
dmi_get_system_info(DMI_PRODUCT_SERIAL) &&
|
||||
dmi_get_system_info(DMI_BOARD_VENDOR) &&
|
||||
dmi_get_system_info(DMI_BOARD_NAME) &&
|
||||
dmi_get_system_info(DMI_BOARD_VERSION) &&
|
||||
!strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
|
||||
!strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") &&
|
||||
!strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") &&
|
||||
!strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") &&
|
||||
!strcmp(dmi_get_system_info(DMI_BOARD_VENDOR), "TOSHIBA") &&
|
||||
!strcmp(dmi_get_system_info(DMI_BOARD_NAME), "Portable PC") &&
|
||||
!strcmp(dmi_get_system_info(DMI_BOARD_VERSION), "Version A0"))
|
||||
if (dmi_match(DMI_SYS_VENDOR, "TOSHIBA") &&
|
||||
dmi_match(DMI_PRODUCT_NAME, "000000") &&
|
||||
dmi_match(DMI_PRODUCT_VERSION, "000000") &&
|
||||
dmi_match(DMI_PRODUCT_SERIAL, "000000") &&
|
||||
dmi_match(DMI_BOARD_VENDOR, "TOSHIBA") &&
|
||||
dmi_match(DMI_BOARD_NAME, "Portable PC") &&
|
||||
dmi_match(DMI_BOARD_VERSION, "Version A0"))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -1357,7 +1352,7 @@ static int __devinit piix_init_sidpr(struct ata_host *host)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
|
||||
static void piix_iocfg_bit18_quirk(struct ata_host *host)
|
||||
{
|
||||
static const struct dmi_system_id sysids[] = {
|
||||
{
|
||||
@@ -1374,7 +1369,8 @@ static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
|
||||
|
||||
{ } /* terminate list */
|
||||
};
|
||||
u32 iocfg;
|
||||
struct pci_dev *pdev = to_pci_dev(host->dev);
|
||||
struct piix_host_priv *hpriv = host->private_data;
|
||||
|
||||
if (!dmi_check_system(sysids))
|
||||
return;
|
||||
@@ -1383,12 +1379,11 @@ static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
|
||||
* seem to use it to disable a channel. Clear the bit on the
|
||||
* affected systems.
|
||||
*/
|
||||
pci_read_config_dword(pdev, PIIX_IOCFG, &iocfg);
|
||||
if (iocfg & (1 << 18)) {
|
||||
if (hpriv->saved_iocfg & (1 << 18)) {
|
||||
dev_printk(KERN_INFO, &pdev->dev,
|
||||
"applying IOCFG bit18 quirk\n");
|
||||
iocfg &= ~(1 << 18);
|
||||
pci_write_config_dword(pdev, PIIX_IOCFG, iocfg);
|
||||
pci_write_config_dword(pdev, PIIX_IOCFG,
|
||||
hpriv->saved_iocfg & ~(1 << 18));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1437,6 +1432,17 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
|
||||
if (!hpriv)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Save IOCFG, this will be used for cable detection, quirk
|
||||
* detection and restoration on detach. This is necessary
|
||||
* because some ACPI implementations mess up cable related
|
||||
* bits on _STM. Reported on kernel bz#11879.
|
||||
*/
|
||||
pci_read_config_dword(pdev, PIIX_IOCFG, &hpriv->saved_iocfg);
|
||||
|
||||
/* ICH6R may be driven by either ata_piix or ahci driver
|
||||
* regardless of BIOS configuration. Make sure AHCI mode is
|
||||
* off.
|
||||
@@ -1448,10 +1454,6 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
|
||||
}
|
||||
|
||||
/* SATA map init can change port_info, do it before prepping host */
|
||||
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
|
||||
if (!hpriv)
|
||||
return -ENOMEM;
|
||||
|
||||
if (port_flags & ATA_FLAG_SATA)
|
||||
hpriv->map = piix_init_sata_map(pdev, port_info,
|
||||
piix_map_db_table[ent->driver_data]);
|
||||
@@ -1470,7 +1472,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
|
||||
}
|
||||
|
||||
/* apply IOCFG bit18 quirk */
|
||||
piix_iocfg_bit18_quirk(pdev);
|
||||
piix_iocfg_bit18_quirk(host);
|
||||
|
||||
/* On ICH5, some BIOSen disable the interrupt using the
|
||||
* PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
|
||||
@@ -1495,6 +1497,16 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
|
||||
return ata_pci_sff_activate_host(host, ata_sff_interrupt, &piix_sht);
|
||||
}
|
||||
|
||||
static void piix_remove_one(struct pci_dev *pdev)
|
||||
{
|
||||
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
||||
struct piix_host_priv *hpriv = host->private_data;
|
||||
|
||||
pci_write_config_dword(pdev, PIIX_IOCFG, hpriv->saved_iocfg);
|
||||
|
||||
ata_pci_remove_one(pdev);
|
||||
}
|
||||
|
||||
static int __init piix_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -83,7 +83,7 @@ void ata_acpi_associate_sata_port(struct ata_port *ap)
|
||||
|
||||
ap->link.device->acpi_handle = NULL;
|
||||
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
acpi_integer adr = SATA_ADR(ap->port_no, link->pmp);
|
||||
|
||||
link->device->acpi_handle =
|
||||
@@ -123,8 +123,8 @@ static void ata_acpi_detach_device(struct ata_port *ap, struct ata_device *dev)
|
||||
struct ata_link *tlink;
|
||||
struct ata_device *tdev;
|
||||
|
||||
ata_port_for_each_link(tlink, ap)
|
||||
ata_link_for_each_dev(tdev, tlink)
|
||||
ata_for_each_link(tlink, ap, EDGE)
|
||||
ata_for_each_dev(tdev, tlink, ALL)
|
||||
tdev->flags |= ATA_DFLAG_DETACH;
|
||||
}
|
||||
|
||||
@@ -582,12 +582,9 @@ int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm)
|
||||
{
|
||||
struct ata_device *dev;
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ENABLED) {
|
||||
unsigned long xfer_mask, udma_mask;
|
||||
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
xfer_mask = ata_acpi_gtm_xfermask(dev, gtm);
|
||||
ata_unpack_xfermask(xfer_mask, NULL, NULL, &udma_mask);
|
||||
|
||||
@@ -887,7 +884,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
|
||||
* use values set by _STM. Cache _GTF result and
|
||||
* schedule _GTF.
|
||||
*/
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL) {
|
||||
ata_acpi_clear_gtf(dev);
|
||||
if (ata_dev_enabled(dev) &&
|
||||
ata_dev_get_GTF(dev, NULL) >= 0)
|
||||
@@ -898,7 +895,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
|
||||
* there's no reason to evaluate IDE _GTF early
|
||||
* without _STM. Clear cache and schedule _GTF.
|
||||
*/
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL) {
|
||||
ata_acpi_clear_gtf(dev);
|
||||
if (ata_dev_enabled(dev))
|
||||
dev->flags |= ATA_DFLAG_ACPI_PENDING;
|
||||
@@ -926,8 +923,8 @@ void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
|
||||
if (state.event == PM_EVENT_ON)
|
||||
acpi_bus_set_power(ap->acpi_handle, ACPI_STATE_D0);
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
if (dev->acpi_handle && ata_dev_enabled(dev))
|
||||
ata_for_each_dev(dev, &ap->link, ENABLED) {
|
||||
if (dev->acpi_handle)
|
||||
acpi_bus_set_power(dev->acpi_handle,
|
||||
state.event == PM_EVENT_ON ?
|
||||
ACPI_STATE_D0 : ACPI_STATE_D3);
|
||||
|
||||
+182
-125
@@ -56,6 +56,7 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/async.h>
|
||||
#include <scsi/scsi.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
@@ -163,42 +164,118 @@ MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
|
||||
|
||||
/*
|
||||
* Iterator helpers. Don't use directly.
|
||||
/**
|
||||
* ata_link_next - link iteration helper
|
||||
* @link: the previous link, NULL to start
|
||||
* @ap: ATA port containing links to iterate
|
||||
* @mode: iteration mode, one of ATA_LITER_*
|
||||
*
|
||||
* LOCKING:
|
||||
* Host lock or EH context.
|
||||
* LOCKING:
|
||||
* Host lock or EH context.
|
||||
*
|
||||
* RETURNS:
|
||||
* Pointer to the next link.
|
||||
*/
|
||||
struct ata_link *__ata_port_next_link(struct ata_port *ap,
|
||||
struct ata_link *link, bool dev_only)
|
||||
struct ata_link *ata_link_next(struct ata_link *link, struct ata_port *ap,
|
||||
enum ata_link_iter_mode mode)
|
||||
{
|
||||
/* NULL link indicates start of iteration */
|
||||
if (!link) {
|
||||
if (dev_only && sata_pmp_attached(ap))
|
||||
return ap->pmp_link;
|
||||
return &ap->link;
|
||||
}
|
||||
BUG_ON(mode != ATA_LITER_EDGE &&
|
||||
mode != ATA_LITER_PMP_FIRST && mode != ATA_LITER_HOST_FIRST);
|
||||
|
||||
/* we just iterated over the host master link, what's next? */
|
||||
if (link == &ap->link) {
|
||||
if (!sata_pmp_attached(ap)) {
|
||||
if (unlikely(ap->slave_link) && !dev_only)
|
||||
/* NULL link indicates start of iteration */
|
||||
if (!link)
|
||||
switch (mode) {
|
||||
case ATA_LITER_EDGE:
|
||||
case ATA_LITER_PMP_FIRST:
|
||||
if (sata_pmp_attached(ap))
|
||||
return ap->pmp_link;
|
||||
/* fall through */
|
||||
case ATA_LITER_HOST_FIRST:
|
||||
return &ap->link;
|
||||
}
|
||||
|
||||
/* we just iterated over the host link, what's next? */
|
||||
if (link == &ap->link)
|
||||
switch (mode) {
|
||||
case ATA_LITER_HOST_FIRST:
|
||||
if (sata_pmp_attached(ap))
|
||||
return ap->pmp_link;
|
||||
/* fall through */
|
||||
case ATA_LITER_PMP_FIRST:
|
||||
if (unlikely(ap->slave_link))
|
||||
return ap->slave_link;
|
||||
/* fall through */
|
||||
case ATA_LITER_EDGE:
|
||||
return NULL;
|
||||
}
|
||||
return ap->pmp_link;
|
||||
}
|
||||
|
||||
/* slave_link excludes PMP */
|
||||
if (unlikely(link == ap->slave_link))
|
||||
return NULL;
|
||||
|
||||
/* iterate to the next PMP link */
|
||||
/* we were over a PMP link */
|
||||
if (++link < ap->pmp_link + ap->nr_pmp_links)
|
||||
return link;
|
||||
|
||||
if (mode == ATA_LITER_PMP_FIRST)
|
||||
return &ap->link;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_dev_next - device iteration helper
|
||||
* @dev: the previous device, NULL to start
|
||||
* @link: ATA link containing devices to iterate
|
||||
* @mode: iteration mode, one of ATA_DITER_*
|
||||
*
|
||||
* LOCKING:
|
||||
* Host lock or EH context.
|
||||
*
|
||||
* RETURNS:
|
||||
* Pointer to the next device.
|
||||
*/
|
||||
struct ata_device *ata_dev_next(struct ata_device *dev, struct ata_link *link,
|
||||
enum ata_dev_iter_mode mode)
|
||||
{
|
||||
BUG_ON(mode != ATA_DITER_ENABLED && mode != ATA_DITER_ENABLED_REVERSE &&
|
||||
mode != ATA_DITER_ALL && mode != ATA_DITER_ALL_REVERSE);
|
||||
|
||||
/* NULL dev indicates start of iteration */
|
||||
if (!dev)
|
||||
switch (mode) {
|
||||
case ATA_DITER_ENABLED:
|
||||
case ATA_DITER_ALL:
|
||||
dev = link->device;
|
||||
goto check;
|
||||
case ATA_DITER_ENABLED_REVERSE:
|
||||
case ATA_DITER_ALL_REVERSE:
|
||||
dev = link->device + ata_link_max_devices(link) - 1;
|
||||
goto check;
|
||||
}
|
||||
|
||||
next:
|
||||
/* move to the next one */
|
||||
switch (mode) {
|
||||
case ATA_DITER_ENABLED:
|
||||
case ATA_DITER_ALL:
|
||||
if (++dev < link->device + ata_link_max_devices(link))
|
||||
goto check;
|
||||
return NULL;
|
||||
case ATA_DITER_ENABLED_REVERSE:
|
||||
case ATA_DITER_ALL_REVERSE:
|
||||
if (--dev >= link->device)
|
||||
goto check;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
check:
|
||||
if ((mode == ATA_DITER_ENABLED || mode == ATA_DITER_ENABLED_REVERSE) &&
|
||||
!ata_dev_enabled(dev))
|
||||
goto next;
|
||||
return dev;
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_dev_phys_link - find physical link for a device
|
||||
* @dev: ATA device to look up physical link for
|
||||
@@ -930,6 +1007,7 @@ static const char *sata_spd_string(unsigned int spd)
|
||||
static const char * const spd_str[] = {
|
||||
"1.5 Gbps",
|
||||
"3.0 Gbps",
|
||||
"6.0 Gbps",
|
||||
};
|
||||
|
||||
if (spd == 0 || (spd - 1) >= ARRAY_SIZE(spd_str))
|
||||
@@ -1107,8 +1185,8 @@ static void ata_lpm_enable(struct ata_host *host)
|
||||
|
||||
for (i = 0; i < host->n_ports; i++) {
|
||||
ap = host->ports[i];
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
ata_dev_disable_pm(dev);
|
||||
}
|
||||
}
|
||||
@@ -1923,6 +2001,10 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
|
||||
as the caller should know this */
|
||||
if (adev->link->ap->flags & ATA_FLAG_NO_IORDY)
|
||||
return 0;
|
||||
/* CF spec. r4.1 Table 22 says no iordy on PIO5 and PIO6. */
|
||||
if (ata_id_is_cfa(adev->id)
|
||||
&& (adev->pio_mode == XFER_PIO_5 || adev->pio_mode == XFER_PIO_6))
|
||||
return 0;
|
||||
/* PIO3 and higher it is mandatory */
|
||||
if (adev->pio_mode > XFER_PIO_2)
|
||||
return 1;
|
||||
@@ -2594,11 +2676,11 @@ int ata_bus_probe(struct ata_port *ap)
|
||||
|
||||
ata_port_probe(ap);
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link)
|
||||
ata_for_each_dev(dev, &ap->link, ALL)
|
||||
tries[dev->devno] = ATA_PROBE_MAX_TRIES;
|
||||
|
||||
retry:
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL) {
|
||||
/* If we issue an SRST then an ATA drive (not ATAPI)
|
||||
* may change configuration and be in PIO0 timing. If
|
||||
* we do a hard reset (or are coming from power on)
|
||||
@@ -2620,7 +2702,7 @@ int ata_bus_probe(struct ata_port *ap)
|
||||
/* reset and determine device classes */
|
||||
ap->ops->phy_reset(ap);
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL) {
|
||||
if (!(ap->flags & ATA_FLAG_DISABLED) &&
|
||||
dev->class != ATA_DEV_UNKNOWN)
|
||||
classes[dev->devno] = dev->class;
|
||||
@@ -2636,7 +2718,7 @@ int ata_bus_probe(struct ata_port *ap)
|
||||
specific sequence bass-ackwards so that PDIAG- is released by
|
||||
the slave device */
|
||||
|
||||
ata_link_for_each_dev_reverse(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL_REVERSE) {
|
||||
if (tries[dev->devno])
|
||||
dev->class = classes[dev->devno];
|
||||
|
||||
@@ -2653,24 +2735,19 @@ int ata_bus_probe(struct ata_port *ap)
|
||||
if (ap->ops->cable_detect)
|
||||
ap->cbl = ap->ops->cable_detect(ap);
|
||||
|
||||
/* We may have SATA bridge glue hiding here irrespective of the
|
||||
reported cable types and sensed types */
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
/* SATA drives indicate we have a bridge. We don't know which
|
||||
end of the link the bridge is which is a problem */
|
||||
/* We may have SATA bridge glue hiding here irrespective of
|
||||
* the reported cable types and sensed types. When SATA
|
||||
* drives indicate we have a bridge, we don't know which end
|
||||
* of the link the bridge is which is a problem.
|
||||
*/
|
||||
ata_for_each_dev(dev, &ap->link, ENABLED)
|
||||
if (ata_id_is_sata(dev->id))
|
||||
ap->cbl = ATA_CBL_SATA;
|
||||
}
|
||||
|
||||
/* After the identify sequence we can now set up the devices. We do
|
||||
this in the normal order so that the user doesn't get confused */
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ata_for_each_dev(dev, &ap->link, ENABLED) {
|
||||
ap->link.eh_context.i.flags |= ATA_EHI_PRINTINFO;
|
||||
rc = ata_dev_configure(dev);
|
||||
ap->link.eh_context.i.flags &= ~ATA_EHI_PRINTINFO;
|
||||
@@ -2683,9 +2760,8 @@ int ata_bus_probe(struct ata_port *ap)
|
||||
if (rc)
|
||||
goto fail;
|
||||
|
||||
ata_link_for_each_dev(dev, &ap->link)
|
||||
if (ata_dev_enabled(dev))
|
||||
return 0;
|
||||
ata_for_each_dev(dev, &ap->link, ENABLED)
|
||||
return 0;
|
||||
|
||||
/* no device present, disable port */
|
||||
ata_port_disable(ap);
|
||||
@@ -3331,13 +3407,10 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
int rc = 0, used_dma = 0, found = 0;
|
||||
|
||||
/* step 1: calculate xfer_mask */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
unsigned long pio_mask, dma_mask;
|
||||
unsigned int mode_mask;
|
||||
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
mode_mask = ATA_DMA_MASK_ATA;
|
||||
if (dev->class == ATA_DEV_ATAPI)
|
||||
mode_mask = ATA_DMA_MASK_ATAPI;
|
||||
@@ -3366,10 +3439,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
goto out;
|
||||
|
||||
/* step 2: always set host PIO timings */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
if (dev->pio_mode == 0xff) {
|
||||
ata_dev_printk(dev, KERN_WARNING, "no PIO support\n");
|
||||
rc = -EINVAL;
|
||||
@@ -3383,8 +3453,8 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
}
|
||||
|
||||
/* step 3: set host DMA timings */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (!ata_dev_enabled(dev) || !ata_dma_enabled(dev))
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
if (!ata_dma_enabled(dev))
|
||||
continue;
|
||||
|
||||
dev->xfer_mode = dev->dma_mode;
|
||||
@@ -3394,11 +3464,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
}
|
||||
|
||||
/* step 4: update devices' xfer mode */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
/* don't update suspended devices' xfer mode */
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
rc = ata_dev_set_mode(dev);
|
||||
if (rc)
|
||||
goto out;
|
||||
@@ -4048,6 +4114,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
|
||||
{ "Maxtor 7V300F0", "VA111630", ATA_HORKAGE_NONCQ },
|
||||
{ "ST380817AS", "3.42", ATA_HORKAGE_NONCQ },
|
||||
{ "ST3160023AS", "3.42", ATA_HORKAGE_NONCQ },
|
||||
{ "OCZ CORE_SSD", "02.10104", ATA_HORKAGE_NONCQ },
|
||||
|
||||
/* Seagate NCQ + FLUSH CACHE firmware bug */
|
||||
{ "ST31500341AS", "SD15", ATA_HORKAGE_NONCQ |
|
||||
@@ -4263,9 +4330,9 @@ static int cable_is_40wire(struct ata_port *ap)
|
||||
* - if you have a non detect capable drive you don't want it
|
||||
* to colour the choice
|
||||
*/
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (ata_dev_enabled(dev) && !ata_is_40wire(dev))
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
if (!ata_is_40wire(dev))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -4672,7 +4739,6 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
|
||||
/**
|
||||
* ata_qc_new_init - Request an available ATA command, and initialize it
|
||||
* @dev: Device from whom we request an available command structure
|
||||
* @tag: command tag
|
||||
*
|
||||
* LOCKING:
|
||||
* None.
|
||||
@@ -5218,7 +5284,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg,
|
||||
}
|
||||
|
||||
ap->pflags |= ATA_PFLAG_PM_PENDING;
|
||||
__ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, HOST_FIRST) {
|
||||
link->eh_info.action |= action;
|
||||
link->eh_info.flags |= ehi_flags;
|
||||
}
|
||||
@@ -5849,6 +5915,54 @@ void ata_host_init(struct ata_host *host, struct device *dev,
|
||||
host->ops = ops;
|
||||
}
|
||||
|
||||
|
||||
static void async_port_probe(void *data, async_cookie_t cookie)
|
||||
{
|
||||
int rc;
|
||||
struct ata_port *ap = data;
|
||||
/* probe */
|
||||
if (ap->ops->error_handler) {
|
||||
struct ata_eh_info *ehi = &ap->link.eh_info;
|
||||
unsigned long flags;
|
||||
|
||||
ata_port_probe(ap);
|
||||
|
||||
/* kick EH for boot probing */
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
ehi->probe_mask |= ATA_ALL_DEVICES;
|
||||
ehi->action |= ATA_EH_RESET | ATA_EH_LPM;
|
||||
ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
|
||||
|
||||
ap->pflags &= ~ATA_PFLAG_INITIALIZING;
|
||||
ap->pflags |= ATA_PFLAG_LOADING;
|
||||
ata_port_schedule_eh(ap);
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
/* wait for EH to finish */
|
||||
ata_port_wait_eh(ap);
|
||||
} else {
|
||||
DPRINTK("ata%u: bus probe begin\n", ap->print_id);
|
||||
rc = ata_bus_probe(ap);
|
||||
DPRINTK("ata%u: bus probe end\n", ap->print_id);
|
||||
|
||||
if (rc) {
|
||||
/* FIXME: do something useful here?
|
||||
* Current libata behavior will
|
||||
* tear down everything when
|
||||
* the module is removed
|
||||
* or the h/w is unplugged.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/* in order to keep device order, we need to synchronize at this point */
|
||||
async_synchronize_cookie(cookie);
|
||||
|
||||
ata_scsi_scan_host(ap, 1);
|
||||
|
||||
}
|
||||
/**
|
||||
* ata_host_register - register initialized ATA host
|
||||
* @host: ATA host to register
|
||||
@@ -5928,52 +6042,9 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
|
||||
DPRINTK("probe begin\n");
|
||||
for (i = 0; i < host->n_ports; i++) {
|
||||
struct ata_port *ap = host->ports[i];
|
||||
|
||||
/* probe */
|
||||
if (ap->ops->error_handler) {
|
||||
struct ata_eh_info *ehi = &ap->link.eh_info;
|
||||
unsigned long flags;
|
||||
|
||||
ata_port_probe(ap);
|
||||
|
||||
/* kick EH for boot probing */
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
ehi->probe_mask |= ATA_ALL_DEVICES;
|
||||
ehi->action |= ATA_EH_RESET | ATA_EH_LPM;
|
||||
ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
|
||||
|
||||
ap->pflags &= ~ATA_PFLAG_INITIALIZING;
|
||||
ap->pflags |= ATA_PFLAG_LOADING;
|
||||
ata_port_schedule_eh(ap);
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
/* wait for EH to finish */
|
||||
ata_port_wait_eh(ap);
|
||||
} else {
|
||||
DPRINTK("ata%u: bus probe begin\n", ap->print_id);
|
||||
rc = ata_bus_probe(ap);
|
||||
DPRINTK("ata%u: bus probe end\n", ap->print_id);
|
||||
|
||||
if (rc) {
|
||||
/* FIXME: do something useful here?
|
||||
* Current libata behavior will
|
||||
* tear down everything when
|
||||
* the module is removed
|
||||
* or the h/w is unplugged.
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* probes are done, now scan each port's disk(s) */
|
||||
DPRINTK("host probe begin\n");
|
||||
for (i = 0; i < host->n_ports; i++) {
|
||||
struct ata_port *ap = host->ports[i];
|
||||
|
||||
ata_scsi_scan_host(ap, 1);
|
||||
async_schedule(async_port_probe, ap);
|
||||
}
|
||||
DPRINTK("probe end\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -6047,8 +6118,6 @@ int ata_host_activate(struct ata_host *host, int irq,
|
||||
static void ata_port_detach(struct ata_port *ap)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct ata_link *link;
|
||||
struct ata_device *dev;
|
||||
|
||||
if (!ap->ops->error_handler)
|
||||
goto skip_eh;
|
||||
@@ -6056,28 +6125,15 @@ static void ata_port_detach(struct ata_port *ap)
|
||||
/* tell EH we're leaving & flush EH */
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
ap->pflags |= ATA_PFLAG_UNLOADING;
|
||||
ata_port_schedule_eh(ap);
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
/* wait till EH commits suicide */
|
||||
ata_port_wait_eh(ap);
|
||||
|
||||
/* EH is now guaranteed to see UNLOADING - EH context belongs
|
||||
* to us. Restore SControl and disable all existing devices.
|
||||
*/
|
||||
__ata_port_for_each_link(link, ap) {
|
||||
sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_dev_disable(dev);
|
||||
}
|
||||
/* it better be dead now */
|
||||
WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));
|
||||
|
||||
/* Final freeze & EH. All in-flight commands are aborted. EH
|
||||
* will be skipped and retrials will be terminated with bad
|
||||
* target.
|
||||
*/
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
ata_port_freeze(ap); /* won't be thawed */
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
ata_port_wait_eh(ap);
|
||||
cancel_rearming_delayed_work(&ap->hotplug_task);
|
||||
|
||||
skip_eh:
|
||||
@@ -6528,7 +6584,8 @@ EXPORT_SYMBOL_GPL(ata_base_port_ops);
|
||||
EXPORT_SYMBOL_GPL(sata_port_ops);
|
||||
EXPORT_SYMBOL_GPL(ata_dummy_port_ops);
|
||||
EXPORT_SYMBOL_GPL(ata_dummy_port_info);
|
||||
EXPORT_SYMBOL_GPL(__ata_port_next_link);
|
||||
EXPORT_SYMBOL_GPL(ata_link_next);
|
||||
EXPORT_SYMBOL_GPL(ata_dev_next);
|
||||
EXPORT_SYMBOL_GPL(ata_std_bios_param);
|
||||
EXPORT_SYMBOL_GPL(ata_host_init);
|
||||
EXPORT_SYMBOL_GPL(ata_host_alloc);
|
||||
|
||||
+68
-48
@@ -422,7 +422,7 @@ static void ata_eh_clear_action(struct ata_link *link, struct ata_device *dev,
|
||||
|
||||
if (!dev) {
|
||||
ehi->action &= ~action;
|
||||
ata_link_for_each_dev(tdev, link)
|
||||
ata_for_each_dev(tdev, link, ALL)
|
||||
ehi->dev_action[tdev->devno] &= ~action;
|
||||
} else {
|
||||
/* doesn't make sense for port-wide EH actions */
|
||||
@@ -430,7 +430,7 @@ static void ata_eh_clear_action(struct ata_link *link, struct ata_device *dev,
|
||||
|
||||
/* break ehi->action into ehi->dev_action */
|
||||
if (ehi->action & action) {
|
||||
ata_link_for_each_dev(tdev, link)
|
||||
ata_for_each_dev(tdev, link, ALL)
|
||||
ehi->dev_action[tdev->devno] |=
|
||||
ehi->action & action;
|
||||
ehi->action &= ~action;
|
||||
@@ -491,6 +491,31 @@ enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ata_eh_unload(struct ata_port *ap)
|
||||
{
|
||||
struct ata_link *link;
|
||||
struct ata_device *dev;
|
||||
unsigned long flags;
|
||||
|
||||
/* Restore SControl IPM and SPD for the next driver and
|
||||
* disable attached devices.
|
||||
*/
|
||||
ata_for_each_link(link, ap, PMP_FIRST) {
|
||||
sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
ata_dev_disable(dev);
|
||||
}
|
||||
|
||||
/* freeze and set UNLOADED */
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
ata_port_freeze(ap); /* won't be thawed */
|
||||
ap->pflags &= ~ATA_PFLAG_EH_PENDING; /* clear pending from freeze */
|
||||
ap->pflags |= ATA_PFLAG_UNLOADED;
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_scsi_error - SCSI layer error handler callback
|
||||
* @host: SCSI host on which error occurred
|
||||
@@ -592,7 +617,7 @@ void ata_scsi_error(struct Scsi_Host *host)
|
||||
/* fetch & clear EH info */
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
__ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, HOST_FIRST) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
struct ata_device *dev;
|
||||
|
||||
@@ -600,12 +625,9 @@ void ata_scsi_error(struct Scsi_Host *host)
|
||||
link->eh_context.i = link->eh_info;
|
||||
memset(&link->eh_info, 0, sizeof(link->eh_info));
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
int devno = dev->devno;
|
||||
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ehc->saved_xfer_mode[devno] = dev->xfer_mode;
|
||||
if (ata_ncq_enabled(dev))
|
||||
ehc->saved_ncq_enabled |= 1 << devno;
|
||||
@@ -621,8 +643,13 @@ void ata_scsi_error(struct Scsi_Host *host)
|
||||
/* invoke EH, skip if unloading or suspended */
|
||||
if (!(ap->pflags & (ATA_PFLAG_UNLOADING | ATA_PFLAG_SUSPENDED)))
|
||||
ap->ops->error_handler(ap);
|
||||
else
|
||||
else {
|
||||
/* if unloading, commence suicide */
|
||||
if ((ap->pflags & ATA_PFLAG_UNLOADING) &&
|
||||
!(ap->pflags & ATA_PFLAG_UNLOADED))
|
||||
ata_eh_unload(ap);
|
||||
ata_eh_finish(ap);
|
||||
}
|
||||
|
||||
/* process port suspend request */
|
||||
ata_eh_handle_port_suspend(ap);
|
||||
@@ -644,7 +671,7 @@ void ata_scsi_error(struct Scsi_Host *host)
|
||||
}
|
||||
|
||||
/* this run is complete, make sure EH info is clear */
|
||||
__ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, HOST_FIRST)
|
||||
memset(&link->eh_info, 0, sizeof(link->eh_info));
|
||||
|
||||
/* Clear host_eh_scheduled while holding ap->lock such
|
||||
@@ -1025,7 +1052,7 @@ int sata_async_notification(struct ata_port *ap)
|
||||
struct ata_link *link;
|
||||
|
||||
/* check and notify ATAPI AN */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
if (!(sntf & (1 << link->pmp)))
|
||||
continue;
|
||||
|
||||
@@ -2005,7 +2032,7 @@ void ata_eh_autopsy(struct ata_port *ap)
|
||||
{
|
||||
struct ata_link *link;
|
||||
|
||||
ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, EDGE)
|
||||
ata_eh_link_autopsy(link);
|
||||
|
||||
/* Handle the frigging slave link. Autopsy is done similarly
|
||||
@@ -2219,7 +2246,7 @@ void ata_eh_report(struct ata_port *ap)
|
||||
{
|
||||
struct ata_link *link;
|
||||
|
||||
__ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, HOST_FIRST)
|
||||
ata_eh_link_report(link);
|
||||
}
|
||||
|
||||
@@ -2230,7 +2257,7 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
|
||||
struct ata_device *dev;
|
||||
|
||||
if (clear_classes)
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
classes[dev->devno] = ATA_DEV_UNKNOWN;
|
||||
|
||||
return reset(link, classes, deadline);
|
||||
@@ -2294,7 +2321,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
||||
|
||||
ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
/* If we issue an SRST then an ATA drive (not ATAPI)
|
||||
* may change configuration and be in PIO0 timing. If
|
||||
* we do a hard reset (or are coming from power on)
|
||||
@@ -2355,7 +2382,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
||||
"port disabled. ignoring.\n");
|
||||
ehc->i.action &= ~ATA_EH_RESET;
|
||||
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
classes[dev->devno] = ATA_DEV_NONE;
|
||||
|
||||
rc = 0;
|
||||
@@ -2369,7 +2396,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
||||
* bang classes and return.
|
||||
*/
|
||||
if (reset && !(ehc->i.action & ATA_EH_RESET)) {
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
classes[dev->devno] = ATA_DEV_NONE;
|
||||
rc = 0;
|
||||
goto out;
|
||||
@@ -2454,7 +2481,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
||||
/*
|
||||
* Post-reset processing
|
||||
*/
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
/* After the reset, the device state is PIO 0 and the
|
||||
* controller state is undefined. Reset also wakes up
|
||||
* drives from sleeping mode.
|
||||
@@ -2510,7 +2537,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
||||
* can be reliably detected and retried.
|
||||
*/
|
||||
nr_unknown = 0;
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
/* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
|
||||
if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
|
||||
classes[dev->devno] = ATA_DEV_NONE;
|
||||
@@ -2619,8 +2646,8 @@ static inline void ata_eh_pull_park_action(struct ata_port *ap)
|
||||
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
INIT_COMPLETION(ap->park_req_pending);
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
struct ata_eh_info *ehi = &link->eh_info;
|
||||
|
||||
link->eh_context.i.dev_action[dev->devno] |=
|
||||
@@ -2675,7 +2702,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
|
||||
* be done backwards such that PDIAG- is released by the slave
|
||||
* device before the master device is identified.
|
||||
*/
|
||||
ata_link_for_each_dev_reverse(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL_REVERSE) {
|
||||
unsigned int action = ata_eh_dev_action(dev);
|
||||
unsigned int readid_flags = 0;
|
||||
|
||||
@@ -2744,7 +2771,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
|
||||
/* Configure new devices forward such that user doesn't see
|
||||
* device detection messages backwards.
|
||||
*/
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
if (!(new_mask & (1 << dev->devno)) ||
|
||||
dev->class == ATA_DEV_PMP)
|
||||
continue;
|
||||
@@ -2793,10 +2820,7 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
int rc;
|
||||
|
||||
/* if data transfer is verified, clear DUBIOUS_XFER on ering top */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
if (!(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) {
|
||||
struct ata_ering_entry *ent;
|
||||
|
||||
@@ -2813,14 +2837,11 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
|
||||
rc = ata_do_set_mode(link, r_failed_dev);
|
||||
|
||||
/* if transfer mode has changed, set DUBIOUS_XFER on device */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno];
|
||||
u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno));
|
||||
|
||||
if (!ata_dev_enabled(dev))
|
||||
continue;
|
||||
|
||||
if (dev->xfer_mode != saved_xfer_mode ||
|
||||
ata_ncq_enabled(dev) != saved_ncq)
|
||||
dev->flags |= ATA_DFLAG_DUBIOUS_XFER;
|
||||
@@ -2881,9 +2902,8 @@ static int ata_link_nr_enabled(struct ata_link *link)
|
||||
struct ata_device *dev;
|
||||
int cnt = 0;
|
||||
|
||||
ata_link_for_each_dev(dev, link)
|
||||
if (ata_dev_enabled(dev))
|
||||
cnt++;
|
||||
ata_for_each_dev(dev, link, ENABLED)
|
||||
cnt++;
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@@ -2892,7 +2912,7 @@ static int ata_link_nr_vacant(struct ata_link *link)
|
||||
struct ata_device *dev;
|
||||
int cnt = 0;
|
||||
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
if (dev->class == ATA_DEV_UNKNOWN)
|
||||
cnt++;
|
||||
return cnt;
|
||||
@@ -2918,7 +2938,7 @@ static int ata_eh_skip_recovery(struct ata_link *link)
|
||||
return 0;
|
||||
|
||||
/* skip if class codes for all vacant slots are ATA_DEV_NONE */
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
if (dev->class == ATA_DEV_UNKNOWN &&
|
||||
ehc->classes[dev->devno] != ATA_DEV_NONE)
|
||||
return 0;
|
||||
@@ -3026,7 +3046,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
DPRINTK("ENTER\n");
|
||||
|
||||
/* prep for recovery */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
|
||||
/* re-enable link? */
|
||||
@@ -3038,7 +3058,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
ata_eh_done(link, NULL, ATA_EH_ENABLE_LINK);
|
||||
}
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
if (link->flags & ATA_LFLAG_NO_RETRY)
|
||||
ehc->tries[dev->devno] = 1;
|
||||
else
|
||||
@@ -3068,19 +3088,19 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
goto out;
|
||||
|
||||
/* prep for EH */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
|
||||
/* skip EH if possible. */
|
||||
if (ata_eh_skip_recovery(link))
|
||||
ehc->i.action = 0;
|
||||
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
ehc->classes[dev->devno] = ATA_DEV_UNKNOWN;
|
||||
}
|
||||
|
||||
/* reset */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
|
||||
if (!(ehc->i.action & ATA_EH_RESET))
|
||||
@@ -3105,8 +3125,8 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
ata_eh_pull_park_action(ap);
|
||||
|
||||
deadline = jiffies;
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
unsigned long tmp;
|
||||
|
||||
@@ -3134,8 +3154,8 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
deadline = wait_for_completion_timeout(&ap->park_req_pending,
|
||||
deadline - now);
|
||||
} while (deadline);
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
if (!(link->eh_context.unloaded_mask &
|
||||
(1 << dev->devno)))
|
||||
continue;
|
||||
@@ -3146,7 +3166,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
}
|
||||
|
||||
/* the rest */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
|
||||
/* revalidate existing devices and attach new ones */
|
||||
@@ -3172,7 +3192,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
* disrupting the current users of the device.
|
||||
*/
|
||||
if (ehc->i.flags & ATA_EHI_DID_RESET) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
if (dev->class != ATA_DEV_ATAPI)
|
||||
continue;
|
||||
rc = atapi_eh_clear_ua(dev);
|
||||
@@ -3183,7 +3203,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
|
||||
/* configure link power saving */
|
||||
if (ehc->i.action & ATA_EH_LPM)
|
||||
ata_link_for_each_dev(dev, link)
|
||||
ata_for_each_dev(dev, link, ALL)
|
||||
ata_dev_enable_pm(dev, ap->pm_policy);
|
||||
|
||||
/* this link is okay now */
|
||||
@@ -3288,7 +3308,7 @@ void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
|
||||
rc = ata_eh_recover(ap, prereset, softreset, hardreset, postreset,
|
||||
NULL);
|
||||
if (rc) {
|
||||
ata_link_for_each_dev(dev, &ap->link)
|
||||
ata_for_each_dev(dev, &ap->link, ALL)
|
||||
ata_dev_disable(dev);
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -321,7 +321,7 @@ static void sata_pmp_quirks(struct ata_port *ap)
|
||||
|
||||
if (vendor == 0x1095 && devid == 0x3726) {
|
||||
/* sil3726 quirks */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
/* Class code report is unreliable and SRST
|
||||
* times out under certain configurations.
|
||||
*/
|
||||
@@ -336,7 +336,7 @@ static void sata_pmp_quirks(struct ata_port *ap)
|
||||
}
|
||||
} else if (vendor == 0x1095 && devid == 0x4723) {
|
||||
/* sil4723 quirks */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
/* class code report is unreliable */
|
||||
if (link->pmp < 2)
|
||||
link->flags |= ATA_LFLAG_ASSUME_ATA;
|
||||
@@ -348,7 +348,7 @@ static void sata_pmp_quirks(struct ata_port *ap)
|
||||
}
|
||||
} else if (vendor == 0x1095 && devid == 0x4726) {
|
||||
/* sil4726 quirks */
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
/* Class code report is unreliable and SRST
|
||||
* times out under certain configurations.
|
||||
* Config device can be at port 0 or 5 and
|
||||
@@ -450,7 +450,7 @@ int sata_pmp_attach(struct ata_device *dev)
|
||||
if (ap->ops->pmp_attach)
|
||||
ap->ops->pmp_attach(ap);
|
||||
|
||||
ata_port_for_each_link(tlink, ap)
|
||||
ata_for_each_link(tlink, ap, EDGE)
|
||||
sata_link_init_spd(tlink);
|
||||
|
||||
ata_acpi_associate_sata_port(ap);
|
||||
@@ -487,7 +487,7 @@ static void sata_pmp_detach(struct ata_device *dev)
|
||||
if (ap->ops->pmp_detach)
|
||||
ap->ops->pmp_detach(ap);
|
||||
|
||||
ata_port_for_each_link(tlink, ap)
|
||||
ata_for_each_link(tlink, ap, EDGE)
|
||||
ata_eh_detach_dev(tlink->device);
|
||||
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
@@ -700,7 +700,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
|
||||
}
|
||||
|
||||
/* PMP is reset, SErrors cannot be trusted, scan all */
|
||||
ata_port_for_each_link(tlink, ap) {
|
||||
ata_for_each_link(tlink, ap, EDGE) {
|
||||
struct ata_eh_context *ehc = &tlink->eh_context;
|
||||
|
||||
ehc->i.probe_mask |= ATA_ALL_DEVICES;
|
||||
@@ -768,7 +768,7 @@ static int sata_pmp_eh_handle_disabled_links(struct ata_port *ap)
|
||||
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
if (!(link->flags & ATA_LFLAG_DISABLED))
|
||||
continue;
|
||||
|
||||
@@ -852,7 +852,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
|
||||
int cnt, rc;
|
||||
|
||||
pmp_tries = ATA_EH_PMP_TRIES;
|
||||
ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, EDGE)
|
||||
link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES;
|
||||
|
||||
retry:
|
||||
@@ -861,7 +861,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
|
||||
rc = ata_eh_recover(ap, ops->prereset, ops->softreset,
|
||||
ops->hardreset, ops->postreset, NULL);
|
||||
if (rc) {
|
||||
ata_link_for_each_dev(dev, &ap->link)
|
||||
ata_for_each_dev(dev, &ap->link, ALL)
|
||||
ata_dev_disable(dev);
|
||||
return rc;
|
||||
}
|
||||
@@ -870,7 +870,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
|
||||
return 0;
|
||||
|
||||
/* new PMP online */
|
||||
ata_port_for_each_link(link, ap)
|
||||
ata_for_each_link(link, ap, EDGE)
|
||||
link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES;
|
||||
|
||||
/* fall through */
|
||||
@@ -942,7 +942,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
|
||||
}
|
||||
|
||||
cnt = 0;
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
if (!(gscr_error & (1 << link->pmp)))
|
||||
continue;
|
||||
|
||||
|
||||
+14
-14
@@ -517,7 +517,7 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
|
||||
/* Good values for timeout and retries? Values below
|
||||
from scsi_ioctl_send_command() for default case... */
|
||||
cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize,
|
||||
sensebuf, (10*HZ), 5, 0);
|
||||
sensebuf, (10*HZ), 5, 0, NULL);
|
||||
|
||||
if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */
|
||||
u8 *desc = sensebuf + 8;
|
||||
@@ -603,7 +603,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
|
||||
/* Good values for timeout and retries? Values below
|
||||
from scsi_ioctl_send_command() for default case... */
|
||||
cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0,
|
||||
sensebuf, (10*HZ), 5, 0);
|
||||
sensebuf, (10*HZ), 5, 0, NULL);
|
||||
|
||||
if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */
|
||||
u8 *desc = sensebuf + 8;
|
||||
@@ -3229,12 +3229,12 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
|
||||
return;
|
||||
|
||||
repeat:
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
struct scsi_device *sdev;
|
||||
int channel = 0, id = 0;
|
||||
|
||||
if (!ata_dev_enabled(dev) || dev->sdev)
|
||||
if (dev->sdev)
|
||||
continue;
|
||||
|
||||
if (ata_is_host_link(link))
|
||||
@@ -3255,9 +3255,9 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
|
||||
* failure occurred, scan would have failed silently. Check
|
||||
* whether all devices are attached.
|
||||
*/
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (ata_dev_enabled(dev) && !dev->sdev)
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
if (!dev->sdev)
|
||||
goto exit_loop;
|
||||
}
|
||||
}
|
||||
@@ -3369,7 +3369,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
|
||||
|
||||
if (sdev) {
|
||||
ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n",
|
||||
sdev->sdev_gendev.bus_id);
|
||||
dev_name(&sdev->sdev_gendev));
|
||||
|
||||
scsi_remove_device(sdev);
|
||||
scsi_device_put(sdev);
|
||||
@@ -3381,7 +3381,7 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
|
||||
struct ata_port *ap = link->ap;
|
||||
struct ata_device *dev;
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_dev(dev, link, ALL) {
|
||||
unsigned long flags;
|
||||
|
||||
if (!(dev->flags & ATA_DFLAG_DETACHED))
|
||||
@@ -3496,7 +3496,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
|
||||
if (devno == SCAN_WILD_CARD) {
|
||||
struct ata_link *link;
|
||||
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
struct ata_eh_info *ehi = &link->eh_info;
|
||||
ehi->probe_mask |= ATA_ALL_DEVICES;
|
||||
ehi->action |= ATA_EH_RESET;
|
||||
@@ -3544,11 +3544,11 @@ void ata_scsi_dev_rescan(struct work_struct *work)
|
||||
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
||||
ata_port_for_each_link(link, ap) {
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
ata_for_each_link(link, ap, EDGE) {
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
struct scsi_device *sdev = dev->sdev;
|
||||
|
||||
if (!ata_dev_enabled(dev) || !sdev)
|
||||
if (!sdev)
|
||||
continue;
|
||||
if (scsi_device_get(sdev))
|
||||
continue;
|
||||
|
||||
+121
-66
File diff suppressed because it is too large
Load Diff
+71
-38
@@ -19,7 +19,9 @@
|
||||
*
|
||||
* TODO/CHECK
|
||||
* Cannot have ATAPI on both master & slave for rev < c2 (???) but
|
||||
* otherwise should do atapi DMA.
|
||||
* otherwise should do atapi DMA (For now for old we do PIO only for
|
||||
* ATAPI)
|
||||
* Review Sunblade workaround.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
@@ -33,12 +35,14 @@
|
||||
#include <linux/dmi.h>
|
||||
|
||||
#define DRV_NAME "pata_ali"
|
||||
#define DRV_VERSION "0.7.5"
|
||||
#define DRV_VERSION "0.7.8"
|
||||
|
||||
static int ali_atapi_dma = 0;
|
||||
module_param_named(atapi_dma, ali_atapi_dma, int, 0644);
|
||||
MODULE_PARM_DESC(atapi_dma, "Enable ATAPI DMA (0=disable, 1=enable)");
|
||||
|
||||
static struct pci_dev *isa_bridge;
|
||||
|
||||
/*
|
||||
* Cable special cases
|
||||
*/
|
||||
@@ -147,8 +151,7 @@ static void ali_fifo_control(struct ata_port *ap, struct ata_device *adev, int o
|
||||
|
||||
pci_read_config_byte(pdev, pio_fifo, &fifo);
|
||||
fifo &= ~(0x0F << shift);
|
||||
if (on)
|
||||
fifo |= (on << shift);
|
||||
fifo |= (on << shift);
|
||||
pci_write_config_byte(pdev, pio_fifo, fifo);
|
||||
}
|
||||
|
||||
@@ -337,6 +340,23 @@ static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ali_c2_c3_postreset(struct ata_link *link, unsigned int *classes)
|
||||
{
|
||||
u8 r;
|
||||
int port_bit = 4 << link->ap->port_no;
|
||||
|
||||
/* If our bridge is an ALI 1533 then do the extra work */
|
||||
if (isa_bridge) {
|
||||
/* Tristate and re-enable the bus signals */
|
||||
pci_read_config_byte(isa_bridge, 0x58, &r);
|
||||
r &= ~port_bit;
|
||||
pci_write_config_byte(isa_bridge, 0x58, r);
|
||||
r |= port_bit;
|
||||
pci_write_config_byte(isa_bridge, 0x58, r);
|
||||
}
|
||||
ata_sff_postreset(link, classes);
|
||||
}
|
||||
|
||||
static struct scsi_host_template ali_sht = {
|
||||
ATA_BMDMA_SHT(DRV_NAME),
|
||||
};
|
||||
@@ -349,10 +369,11 @@ static struct ata_port_operations ali_early_port_ops = {
|
||||
.inherits = &ata_sff_port_ops,
|
||||
.cable_detect = ata_cable_40wire,
|
||||
.set_piomode = ali_set_piomode,
|
||||
.sff_data_xfer = ata_sff_data_xfer32,
|
||||
};
|
||||
|
||||
static const struct ata_port_operations ali_dma_base_ops = {
|
||||
.inherits = &ata_bmdma_port_ops,
|
||||
.inherits = &ata_bmdma32_port_ops,
|
||||
.set_piomode = ali_set_piomode,
|
||||
.set_dmamode = ali_set_dmamode,
|
||||
};
|
||||
@@ -377,6 +398,17 @@ static struct ata_port_operations ali_c2_port_ops = {
|
||||
.check_atapi_dma = ali_check_atapi_dma,
|
||||
.cable_detect = ali_c2_cable_detect,
|
||||
.dev_config = ali_lock_sectors,
|
||||
.postreset = ali_c2_c3_postreset,
|
||||
};
|
||||
|
||||
/*
|
||||
* Port operations for DMA capable ALi with cable detect
|
||||
*/
|
||||
static struct ata_port_operations ali_c4_port_ops = {
|
||||
.inherits = &ali_dma_base_ops,
|
||||
.check_atapi_dma = ali_check_atapi_dma,
|
||||
.cable_detect = ali_c2_cable_detect,
|
||||
.dev_config = ali_lock_sectors,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -401,27 +433,40 @@ static struct ata_port_operations ali_c5_port_ops = {
|
||||
static void ali_init_chipset(struct pci_dev *pdev)
|
||||
{
|
||||
u8 tmp;
|
||||
struct pci_dev *north, *isa_bridge;
|
||||
struct pci_dev *north;
|
||||
|
||||
/*
|
||||
* The chipset revision selects the driver operations and
|
||||
* mode data.
|
||||
*/
|
||||
|
||||
if (pdev->revision >= 0x20 && pdev->revision < 0xC2) {
|
||||
/* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */
|
||||
if (pdev->revision <= 0x20) {
|
||||
pci_read_config_byte(pdev, 0x53, &tmp);
|
||||
tmp |= 0x03;
|
||||
pci_write_config_byte(pdev, 0x53, tmp);
|
||||
} else {
|
||||
pci_read_config_byte(pdev, 0x4a, &tmp);
|
||||
pci_write_config_byte(pdev, 0x4a, tmp | 0x20);
|
||||
pci_read_config_byte(pdev, 0x4B, &tmp);
|
||||
/* Clear CD-ROM DMA write bit */
|
||||
tmp &= 0x7F;
|
||||
pci_write_config_byte(pdev, 0x4B, tmp);
|
||||
} else if (pdev->revision >= 0xC2) {
|
||||
/* Enable cable detection logic */
|
||||
pci_read_config_byte(pdev, 0x4B, &tmp);
|
||||
pci_write_config_byte(pdev, 0x4B, tmp | 0x08);
|
||||
if (pdev->revision < 0xC2)
|
||||
/* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */
|
||||
/* Clear CD-ROM DMA write bit */
|
||||
tmp &= 0x7F;
|
||||
/* Cable and UDMA */
|
||||
pci_write_config_byte(pdev, 0x4B, tmp | 0x09);
|
||||
/*
|
||||
* CD_ROM DMA on (0x53 bit 0). Enable this even if we want
|
||||
* to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control
|
||||
* via 0x54/55.
|
||||
*/
|
||||
pci_read_config_byte(pdev, 0x53, &tmp);
|
||||
if (pdev->revision >= 0xc7)
|
||||
tmp |= 0x03;
|
||||
else
|
||||
tmp |= 0x01; /* CD_ROM enable for DMA */
|
||||
pci_write_config_byte(pdev, 0x53, tmp);
|
||||
}
|
||||
north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
|
||||
isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
|
||||
|
||||
if (north && north->vendor == PCI_VENDOR_ID_AL && isa_bridge) {
|
||||
/* Configure the ALi bridge logic. For non ALi rely on BIOS.
|
||||
Set the south bridge enable bit */
|
||||
@@ -431,22 +476,6 @@ static void ali_init_chipset(struct pci_dev *pdev)
|
||||
else if (pdev->revision > 0xC2 && pdev->revision < 0xC5)
|
||||
pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02);
|
||||
}
|
||||
if (pdev->revision >= 0x20) {
|
||||
/*
|
||||
* CD_ROM DMA on (0x53 bit 0). Enable this even if we want
|
||||
* to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control
|
||||
* via 0x54/55.
|
||||
*/
|
||||
pci_read_config_byte(pdev, 0x53, &tmp);
|
||||
if (pdev->revision <= 0x20)
|
||||
tmp &= ~0x02;
|
||||
if (pdev->revision >= 0xc7)
|
||||
tmp |= 0x03;
|
||||
else
|
||||
tmp |= 0x01; /* CD_ROM enable for DMA */
|
||||
pci_write_config_byte(pdev, 0x53, tmp);
|
||||
}
|
||||
pci_dev_put(isa_bridge);
|
||||
pci_dev_put(north);
|
||||
ata_pci_bmdma_clear_simplex(pdev);
|
||||
}
|
||||
@@ -503,7 +532,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
.pio_mask = 0x1f,
|
||||
.mwdma_mask = 0x07,
|
||||
.udma_mask = ATA_UDMA5,
|
||||
.port_ops = &ali_c2_port_ops
|
||||
.port_ops = &ali_c4_port_ops
|
||||
};
|
||||
/* Revision 0xC5 is UDMA133 with LBA48 DMA */
|
||||
static const struct ata_port_info info_c5 = {
|
||||
@@ -516,7 +545,6 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
const struct ata_port_info *ppi[] = { NULL, NULL };
|
||||
u8 tmp;
|
||||
struct pci_dev *isa_bridge;
|
||||
int rc;
|
||||
|
||||
rc = pcim_enable_device(pdev);
|
||||
@@ -543,14 +571,12 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
ali_init_chipset(pdev);
|
||||
|
||||
isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
|
||||
if (isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) {
|
||||
/* Are we paired with a UDMA capable chip */
|
||||
pci_read_config_byte(isa_bridge, 0x5E, &tmp);
|
||||
if ((tmp & 0x1E) == 0x12)
|
||||
ppi[0] = &info_20_udma;
|
||||
}
|
||||
pci_dev_put(isa_bridge);
|
||||
|
||||
return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL);
|
||||
}
|
||||
@@ -590,13 +616,20 @@ static struct pci_driver ali_pci_driver = {
|
||||
|
||||
static int __init ali_init(void)
|
||||
{
|
||||
return pci_register_driver(&ali_pci_driver);
|
||||
int ret;
|
||||
isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
|
||||
|
||||
ret = pci_register_driver(&ali_pci_driver);
|
||||
if (ret < 0)
|
||||
pci_dev_put(isa_bridge);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void __exit ali_exit(void)
|
||||
{
|
||||
pci_unregister_driver(&ali_pci_driver);
|
||||
pci_dev_put(isa_bridge);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <linux/libata.h>
|
||||
|
||||
#define DRV_NAME "pata_amd"
|
||||
#define DRV_VERSION "0.3.10"
|
||||
#define DRV_VERSION "0.3.11"
|
||||
|
||||
/**
|
||||
* timing_setup - shared timing computation and load
|
||||
@@ -345,7 +345,7 @@ static struct scsi_host_template amd_sht = {
|
||||
};
|
||||
|
||||
static const struct ata_port_operations amd_base_port_ops = {
|
||||
.inherits = &ata_bmdma_port_ops,
|
||||
.inherits = &ata_bmdma32_port_ops,
|
||||
.prereset = amd_pre_reset,
|
||||
};
|
||||
|
||||
|
||||
@@ -356,7 +356,6 @@ static void bfin_set_piomode(struct ata_port *ap, struct ata_device *adev)
|
||||
* bfin_set_dmamode - Initialize host controller PATA DMA timings
|
||||
* @ap: Port whose timings we are configuring
|
||||
* @adev: um
|
||||
* @udma: udma mode, 0 - 6
|
||||
*
|
||||
* Set UDMA mode for device.
|
||||
*
|
||||
|
||||
+46
-67
@@ -30,7 +30,7 @@
|
||||
#define DRV_VERSION "0.6.2"
|
||||
|
||||
struct hpt_clock {
|
||||
u8 xfer_speed;
|
||||
u8 xfer_mode;
|
||||
u32 timing;
|
||||
};
|
||||
|
||||
@@ -189,28 +189,6 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
|
||||
return ata_bmdma_mode_filter(adev, mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* hpt36x_find_mode - reset the hpt36x bus
|
||||
* @ap: ATA port
|
||||
* @speed: transfer mode
|
||||
*
|
||||
* Return the 32bit register programming information for this channel
|
||||
* that matches the speed provided.
|
||||
*/
|
||||
|
||||
static u32 hpt36x_find_mode(struct ata_port *ap, int speed)
|
||||
{
|
||||
struct hpt_clock *clocks = ap->host->private_data;
|
||||
|
||||
while(clocks->xfer_speed) {
|
||||
if (clocks->xfer_speed == speed)
|
||||
return clocks->timing;
|
||||
clocks++;
|
||||
}
|
||||
BUG();
|
||||
return 0xffffffffU; /* silence compiler warning */
|
||||
}
|
||||
|
||||
static int hpt36x_cable_detect(struct ata_port *ap)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
|
||||
@@ -226,6 +204,49 @@ static int hpt36x_cable_detect(struct ata_port *ap)
|
||||
return ATA_CBL_PATA80;
|
||||
}
|
||||
|
||||
static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev,
|
||||
u8 mode)
|
||||
{
|
||||
struct hpt_clock *clocks = ap->host->private_data;
|
||||
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
|
||||
u32 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
|
||||
u32 addr2 = 0x51 + 4 * ap->port_no;
|
||||
u32 mask, reg;
|
||||
u8 fast;
|
||||
|
||||
/* Fast interrupt prediction disable, hold off interrupt disable */
|
||||
pci_read_config_byte(pdev, addr2, &fast);
|
||||
if (fast & 0x80) {
|
||||
fast &= ~0x80;
|
||||
pci_write_config_byte(pdev, addr2, fast);
|
||||
}
|
||||
|
||||
/* determine timing mask and find matching clock entry */
|
||||
if (mode < XFER_MW_DMA_0)
|
||||
mask = 0xc1f8ffff;
|
||||
else if (mode < XFER_UDMA_0)
|
||||
mask = 0x303800ff;
|
||||
else
|
||||
mask = 0x30070000;
|
||||
|
||||
while (clocks->xfer_mode) {
|
||||
if (clocks->xfer_mode == mode)
|
||||
break;
|
||||
clocks++;
|
||||
}
|
||||
if (!clocks->xfer_mode)
|
||||
BUG();
|
||||
|
||||
/*
|
||||
* Combine new mode bits with old config bits and disable
|
||||
* on-chip PIO FIFO/buffer (and PIO MST mode as well) to avoid
|
||||
* problems handling I/O errors later.
|
||||
*/
|
||||
pci_read_config_dword(pdev, addr1, ®);
|
||||
reg = ((reg & ~mask) | (clocks->timing & mask)) & ~0xc0000000;
|
||||
pci_write_config_dword(pdev, addr1, reg);
|
||||
}
|
||||
|
||||
/**
|
||||
* hpt366_set_piomode - PIO setup
|
||||
* @ap: ATA interface
|
||||
@@ -236,28 +257,7 @@ static int hpt36x_cable_detect(struct ata_port *ap)
|
||||
|
||||
static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
|
||||
u32 addr1, addr2;
|
||||
u32 reg;
|
||||
u32 mode;
|
||||
u8 fast;
|
||||
|
||||
addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
|
||||
addr2 = 0x51 + 4 * ap->port_no;
|
||||
|
||||
/* Fast interrupt prediction disable, hold off interrupt disable */
|
||||
pci_read_config_byte(pdev, addr2, &fast);
|
||||
if (fast & 0x80) {
|
||||
fast &= ~0x80;
|
||||
pci_write_config_byte(pdev, addr2, fast);
|
||||
}
|
||||
|
||||
pci_read_config_dword(pdev, addr1, ®);
|
||||
mode = hpt36x_find_mode(ap, adev->pio_mode);
|
||||
mode &= ~0x8000000; /* No FIFO in PIO */
|
||||
mode &= ~0x30070000; /* Leave config bits alone */
|
||||
reg &= 0x30070000; /* Strip timing bits */
|
||||
pci_write_config_dword(pdev, addr1, reg | mode);
|
||||
hpt366_set_mode(ap, adev, adev->pio_mode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,28 +271,7 @@ static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
|
||||
|
||||
static void hpt366_set_dmamode(struct ata_port *ap, struct ata_device *adev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
|
||||
u32 addr1, addr2;
|
||||
u32 reg;
|
||||
u32 mode;
|
||||
u8 fast;
|
||||
|
||||
addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
|
||||
addr2 = 0x51 + 4 * ap->port_no;
|
||||
|
||||
/* Fast interrupt prediction disable, hold off interrupt disable */
|
||||
pci_read_config_byte(pdev, addr2, &fast);
|
||||
if (fast & 0x80) {
|
||||
fast &= ~0x80;
|
||||
pci_write_config_byte(pdev, addr2, fast);
|
||||
}
|
||||
|
||||
pci_read_config_dword(pdev, addr1, ®);
|
||||
mode = hpt36x_find_mode(ap, adev->dma_mode);
|
||||
mode |= 0x8000000; /* FIFO in MWDMA or UDMA */
|
||||
mode &= ~0xC0000000; /* Leave config bits alone */
|
||||
reg &= 0xC0000000; /* Strip timing bits */
|
||||
pci_write_config_dword(pdev, addr1, reg | mode);
|
||||
hpt366_set_mode(ap, adev, adev->dma_mode);
|
||||
}
|
||||
|
||||
static struct scsi_host_template hpt36x_sht = {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <linux/libata.h>
|
||||
|
||||
#define DRV_NAME "pata_hpt3x3"
|
||||
#define DRV_VERSION "0.5.3"
|
||||
#define DRV_VERSION "0.6.1"
|
||||
|
||||
/**
|
||||
* hpt3x3_set_piomode - PIO setup
|
||||
@@ -80,14 +80,48 @@ static void hpt3x3_set_dmamode(struct ata_port *ap, struct ata_device *adev)
|
||||
r2 &= ~(0x11 << dn); /* Clear MWDMA and UDMA bits */
|
||||
|
||||
if (adev->dma_mode >= XFER_UDMA_0)
|
||||
r2 |= (0x10 << dn); /* Ultra mode */
|
||||
r2 |= (0x01 << dn); /* Ultra mode */
|
||||
else
|
||||
r2 |= (0x01 << dn); /* MWDMA */
|
||||
r2 |= (0x10 << dn); /* MWDMA */
|
||||
|
||||
pci_write_config_dword(pdev, 0x44, r1);
|
||||
pci_write_config_dword(pdev, 0x48, r2);
|
||||
}
|
||||
#endif /* CONFIG_PATA_HPT3X3_DMA */
|
||||
|
||||
/**
|
||||
* hpt3x3_freeze - DMA workaround
|
||||
* @ap: port to freeze
|
||||
*
|
||||
* When freezing an HPT3x3 we must stop any pending DMA before
|
||||
* writing to the control register or the chip will hang
|
||||
*/
|
||||
|
||||
static void hpt3x3_freeze(struct ata_port *ap)
|
||||
{
|
||||
void __iomem *mmio = ap->ioaddr.bmdma_addr;
|
||||
|
||||
iowrite8(ioread8(mmio + ATA_DMA_CMD) & ~ ATA_DMA_START,
|
||||
mmio + ATA_DMA_CMD);
|
||||
ata_sff_dma_pause(ap);
|
||||
ata_sff_freeze(ap);
|
||||
}
|
||||
|
||||
/**
|
||||
* hpt3x3_bmdma_setup - DMA workaround
|
||||
* @qc: Queued command
|
||||
*
|
||||
* When issuing BMDMA we must clean up the error/active bits in
|
||||
* software on this device
|
||||
*/
|
||||
|
||||
static void hpt3x3_bmdma_setup(struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ata_port *ap = qc->ap;
|
||||
u8 r = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
|
||||
r |= ATA_DMA_INTR | ATA_DMA_ERR;
|
||||
iowrite8(r, ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
|
||||
return ata_bmdma_setup(qc);
|
||||
}
|
||||
|
||||
/**
|
||||
* hpt3x3_atapi_dma - ATAPI DMA check
|
||||
@@ -101,18 +135,23 @@ static int hpt3x3_atapi_dma(struct ata_queued_cmd *qc)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PATA_HPT3X3_DMA */
|
||||
|
||||
static struct scsi_host_template hpt3x3_sht = {
|
||||
ATA_BMDMA_SHT(DRV_NAME),
|
||||
};
|
||||
|
||||
static struct ata_port_operations hpt3x3_port_ops = {
|
||||
.inherits = &ata_bmdma_port_ops,
|
||||
.check_atapi_dma= hpt3x3_atapi_dma,
|
||||
.cable_detect = ata_cable_40wire,
|
||||
.set_piomode = hpt3x3_set_piomode,
|
||||
#if defined(CONFIG_PATA_HPT3X3_DMA)
|
||||
.set_dmamode = hpt3x3_set_dmamode,
|
||||
.bmdma_setup = hpt3x3_bmdma_setup,
|
||||
.check_atapi_dma= hpt3x3_atapi_dma,
|
||||
.freeze = hpt3x3_freeze,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+16
-18
@@ -465,24 +465,22 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
|
||||
{
|
||||
struct ata_device *dev;
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (ata_dev_enabled(dev)) {
|
||||
/* We don't really care */
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->dma_mode = XFER_MW_DMA_0;
|
||||
/* We do need the right mode information for DMA or PIO
|
||||
and this comes from the current configuration flags */
|
||||
if (ata_id_has_dma(dev->id)) {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
|
||||
dev->xfer_mode = XFER_MW_DMA_0;
|
||||
dev->xfer_shift = ATA_SHIFT_MWDMA;
|
||||
dev->flags &= ~ATA_DFLAG_PIO;
|
||||
} else {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
/* We don't really care */
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->dma_mode = XFER_MW_DMA_0;
|
||||
/* We do need the right mode information for DMA or PIO
|
||||
and this comes from the current configuration flags */
|
||||
if (ata_id_has_dma(dev->id)) {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
|
||||
dev->xfer_mode = XFER_MW_DMA_0;
|
||||
dev->xfer_shift = ATA_SHIFT_MWDMA;
|
||||
dev->flags &= ~ATA_DFLAG_PIO;
|
||||
} else {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -30,14 +30,12 @@ static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error)
|
||||
{
|
||||
struct ata_device *dev;
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (ata_dev_enabled(dev)) {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n");
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n");
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -194,15 +194,12 @@ static int legacy_set_mode(struct ata_link *link, struct ata_device **unused)
|
||||
{
|
||||
struct ata_device *dev;
|
||||
|
||||
ata_link_for_each_dev(dev, link) {
|
||||
if (ata_dev_enabled(dev)) {
|
||||
ata_dev_printk(dev, KERN_INFO,
|
||||
"configured for PIO\n");
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
ata_for_each_dev(dev, link, ENABLED) {
|
||||
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
|
||||
dev->pio_mode = XFER_PIO_0;
|
||||
dev->xfer_mode = XFER_PIO_0;
|
||||
dev->xfer_shift = ATA_SHIFT_PIO;
|
||||
dev->flags |= ATA_DFLAG_PIO;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -641,7 +638,6 @@ static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
|
||||
* qdi6580dp_set_piomode - PIO setup for dual channel
|
||||
* @ap: Port
|
||||
* @adev: Device
|
||||
* @irq: interrupt line
|
||||
*
|
||||
* In dual channel mode the 6580 has one clock per channel and we have
|
||||
* to software clockswitch in qc_issue.
|
||||
@@ -1028,7 +1024,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
|
||||
/* Nothing found means we drop the port as its probably not there */
|
||||
|
||||
ret = -ENODEV;
|
||||
ata_link_for_each_dev(dev, &ap->link) {
|
||||
ata_for_each_dev(dev, &ap->link, ALL) {
|
||||
if (!ata_dev_absent(dev)) {
|
||||
legacy_host[probe->slot] = host;
|
||||
ld->platform_dev = pdev;
|
||||
|
||||
+481
-65
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,7 @@
|
||||
#include <linux/libata.h>
|
||||
|
||||
#define DRV_NAME "pata_mpiix"
|
||||
#define DRV_VERSION "0.7.6"
|
||||
#define DRV_VERSION "0.7.7"
|
||||
|
||||
enum {
|
||||
IDETIM = 0x6C, /* IDE control register */
|
||||
@@ -146,6 +146,7 @@ static struct ata_port_operations mpiix_port_ops = {
|
||||
.cable_detect = ata_cable_40wire,
|
||||
.set_piomode = mpiix_set_piomode,
|
||||
.prereset = mpiix_pre_reset,
|
||||
.sff_data_xfer = ata_sff_data_xfer32,
|
||||
};
|
||||
|
||||
static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user