Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [libata] Add support for the RB500 PATA CompactFlash
  ahci: logical-bitwise and confusion in ahci_save_initial_config()
  libata: don't allow sysfs read access to force param
  ahci: add the Device IDs for nvidia MCP7B AHCI
  libata-sff: handle controllers w/o ctl register
  libata: allow LLDs w/o any reset method
  ata: replace remaining __FUNCTION__ occurrences
  • Loading branch information
Linus Torvalds committed Mar 11, 2008
2 parents 2b752ac + 3db691d commit 2f44bbb
Show file tree
Hide file tree
Showing 9 changed files with 383 additions and 28 deletions.
9 changes: 9 additions & 0 deletions drivers/ata/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,15 @@ config PATA_RADISYS

If unsure, say N.

config PATA_RB500
tristate "RouterBoard 500 PATA CompactFlash support"
depends on MIKROTIK_RB500
help
This option enables support for the RouterBoard 500
PATA CompactFlash controller.

If unsure, say N.

config PATA_RZ1000
tristate "PC Tech RZ1000 PATA support"
depends on PCI
Expand Down
1 change: 1 addition & 0 deletions drivers/ata/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ obj-$(CONFIG_PATA_PDC2027X) += pata_pdc2027x.o
obj-$(CONFIG_PATA_PDC_OLD) += pata_pdc202xx_old.o
obj-$(CONFIG_PATA_QDI) += pata_qdi.o
obj-$(CONFIG_PATA_RADISYS) += pata_radisys.o
obj-$(CONFIG_PATA_RB500) += pata_rb500_cf.o
obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o
obj-$(CONFIG_PATA_SC1200) += pata_sc1200.o
obj-$(CONFIG_PATA_SERVERWORKS) += pata_serverworks.o
Expand Down
14 changes: 13 additions & 1 deletion drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,18 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(NVIDIA, 0x0abd), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0abe), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0abf), board_ahci }, /* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0bc8), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bc9), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bca), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bcb), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bcc), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bcd), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bce), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bcf), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bd0), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bd1), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bd2), board_ahci }, /* MCP7B */
{ PCI_VDEVICE(NVIDIA, 0x0bd3), board_ahci }, /* MCP7B */

/* SiS */
{ PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */
Expand Down Expand Up @@ -672,7 +684,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
cap &= ~HOST_CAP_NCQ;
}

if ((cap && HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
dev_printk(KERN_INFO, &pdev->dev,
"controller can't do PMP, turning off CAP_PMP\n");
cap &= ~HOST_CAP_PMP;
Expand Down
8 changes: 4 additions & 4 deletions drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)

if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",
__FUNCTION__, ap->port_no);
__func__, ap->port_no);

/* _GTF has no input parameters */
status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output);
Expand All @@ -402,7 +402,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: "
"length or ptr is NULL (0x%llx, 0x%p)\n",
__FUNCTION__,
__func__,
(unsigned long long)output.length,
output.pointer);
rc = -EINVAL;
Expand Down Expand Up @@ -432,7 +432,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG,
"%s: returning gtf=%p, gtf_count=%d\n",
__FUNCTION__, *gtf, rc);
__func__, *gtf, rc);
}
return rc;

Expand Down Expand Up @@ -725,7 +725,7 @@ static int ata_acpi_push_id(struct ata_device *dev)

if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ix = %d, port#: %d\n",
__FUNCTION__, dev->devno, ap->port_no);
__func__, dev->devno, ap->port_no);

/* Give the drive Identify data to the drive via the _SDD method */
/* _SDD: set up input parameters */
Expand Down
17 changes: 9 additions & 8 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static struct ata_force_ent *ata_force_tbl;
static int ata_force_tbl_size;

static char ata_force_param_buf[PAGE_SIZE] __initdata;
module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0444);
/* param_buf is thrown away after initialization, disallow read */
module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0);
MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)");

int atapi_enabled = 1;
Expand Down Expand Up @@ -1719,7 +1720,7 @@ void ata_port_flush_task(struct ata_port *ap)
cancel_rearming_delayed_work(&ap->port_task);

if (ata_msg_ctl(ap))
ata_port_printk(ap, KERN_DEBUG, "%s: EXIT\n", __FUNCTION__);
ata_port_printk(ap, KERN_DEBUG, "%s: EXIT\n", __func__);
}

static void ata_qc_complete_internal(struct ata_queued_cmd *qc)
Expand Down Expand Up @@ -2056,7 +2057,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
int rc;

if (ata_msg_ctl(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __FUNCTION__);
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__);

ata_dev_select(ap, dev->devno, 1, 1); /* select device 0/1 */
retry:
Expand Down Expand Up @@ -2253,12 +2254,12 @@ int ata_dev_configure(struct ata_device *dev)

if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
ata_dev_printk(dev, KERN_INFO, "%s: ENTER/EXIT -- nodev\n",
__FUNCTION__);
__func__);
return 0;
}

if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __FUNCTION__);
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__);

/* set horkage */
dev->horkage |= ata_dev_blacklisted(dev);
Expand All @@ -2279,7 +2280,7 @@ int ata_dev_configure(struct ata_device *dev)
ata_dev_printk(dev, KERN_DEBUG,
"%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x "
"85:%04x 86:%04x 87:%04x 88:%04x\n",
__FUNCTION__,
__func__,
id[49], id[82], id[83], id[84],
id[85], id[86], id[87], id[88]);

Expand Down Expand Up @@ -2511,13 +2512,13 @@ int ata_dev_configure(struct ata_device *dev)

if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: EXIT, drv_stat = 0x%x\n",
__FUNCTION__, ata_chk_status(ap));
__func__, ata_chk_status(ap));
return 0;

err_out_nosup:
if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG,
"%s: EXIT, err\n", __FUNCTION__);
"%s: EXIT, err\n", __func__);
return rc;
}

Expand Down
10 changes: 10 additions & 0 deletions drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,15 @@ int ata_eh_reset(struct ata_link *link, int classify,
ap->ops->set_piomode(ap, dev);
}

if (!softreset && !hardreset) {
if (verbose)
ata_link_printk(link, KERN_INFO, "no reset method "
"available, skipping reset\n");
if (!(lflags & ATA_LFLAG_ASSUME_CLASS))
lflags |= ATA_LFLAG_ASSUME_ATA;
goto done;
}

/* Determine which reset to use and record in ehc->i.action.
* prereset() may examine and modify it.
*/
Expand Down Expand Up @@ -2254,6 +2263,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
lflags |= ATA_LFLAG_ASSUME_ATA;
}

done:
ata_link_for_each_dev(dev, link) {
/* After the reset, the device state is PIO 0 and the
* controller state is undefined. Reset also wakes up
Expand Down
36 changes: 22 additions & 14 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ u8 ata_irq_on(struct ata_port *ap)
ap->ctl &= ~ATA_NIEN;
ap->last_ctl = ap->ctl;

iowrite8(ap->ctl, ioaddr->ctl_addr);
if (ioaddr->ctl_addr)
iowrite8(ap->ctl, ioaddr->ctl_addr);
tmp = ata_wait_idle(ap);

ap->ops->irq_clear(ap);
Expand All @@ -81,12 +82,14 @@ void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;

if (tf->ctl != ap->last_ctl) {
iowrite8(tf->ctl, ioaddr->ctl_addr);
if (ioaddr->ctl_addr)
iowrite8(tf->ctl, ioaddr->ctl_addr);
ap->last_ctl = tf->ctl;
ata_wait_idle(ap);
}

if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
WARN_ON(!ioaddr->ctl_addr);
iowrite8(tf->hob_feature, ioaddr->feature_addr);
iowrite8(tf->hob_nsect, ioaddr->nsect_addr);
iowrite8(tf->hob_lbal, ioaddr->lbal_addr);
Expand Down Expand Up @@ -167,14 +170,17 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
tf->device = ioread8(ioaddr->device_addr);

if (tf->flags & ATA_TFLAG_LBA48) {
iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
tf->hob_feature = ioread8(ioaddr->error_addr);
tf->hob_nsect = ioread8(ioaddr->nsect_addr);
tf->hob_lbal = ioread8(ioaddr->lbal_addr);
tf->hob_lbam = ioread8(ioaddr->lbam_addr);
tf->hob_lbah = ioread8(ioaddr->lbah_addr);
iowrite8(tf->ctl, ioaddr->ctl_addr);
ap->last_ctl = tf->ctl;
if (likely(ioaddr->ctl_addr)) {
iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
tf->hob_feature = ioread8(ioaddr->error_addr);
tf->hob_nsect = ioread8(ioaddr->nsect_addr);
tf->hob_lbal = ioread8(ioaddr->lbal_addr);
tf->hob_lbam = ioread8(ioaddr->lbam_addr);
tf->hob_lbah = ioread8(ioaddr->lbah_addr);
iowrite8(tf->ctl, ioaddr->ctl_addr);
ap->last_ctl = tf->ctl;
} else
WARN_ON(1);
}
}

Expand Down Expand Up @@ -352,7 +358,8 @@ void ata_bmdma_freeze(struct ata_port *ap)
ap->ctl |= ATA_NIEN;
ap->last_ctl = ap->ctl;

iowrite8(ap->ctl, ioaddr->ctl_addr);
if (ioaddr->ctl_addr)
iowrite8(ap->ctl, ioaddr->ctl_addr);

/* Under certain circumstances, some controllers raise IRQ on
* ATA_NIEN manipulation. Also, many controllers fail to mask
Expand Down Expand Up @@ -459,13 +466,14 @@ void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
*/
void ata_bmdma_error_handler(struct ata_port *ap)
{
ata_reset_fn_t hardreset;
ata_reset_fn_t softreset = NULL, hardreset = NULL;

hardreset = NULL;
if (ap->ioaddr.ctl_addr)
softreset = ata_std_softreset;
if (sata_scr_valid(&ap->link))
hardreset = sata_std_hardreset;

ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, hardreset,
ata_bmdma_drive_eh(ap, ata_std_prereset, softreset, hardreset,
ata_std_postreset);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/pata_pdc2027x.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#undef PDC_DEBUG

#ifdef PDC_DEBUG
#define PDPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
#define PDPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
#else
#define PDPRINTK(fmt, args...)
#endif
Expand Down
Loading

0 comments on commit 2f44bbb

Please sign in to comment.