Message ID | 201104191120.31061.bzolnier@gmail.com |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > Subject: [PATCH v2] pata_cmd64x: add enablebits checking > > Fixes IDE -> libata regression. And causes a regression too With the check for parent bridge not being a split bridge I think however it'll do the job nicely. Alan -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Apr 19, 2011 at 12:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: >> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> >> Subject: [PATCH v2] pata_cmd64x: add enablebits checking >> >> Fixes IDE -> libata regression. > > And causes a regression too Could you be more explicit? Regression in this patch would mean that old driver currently doesn't work which is not true.. Thanks, Bartlomiej -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 19 Apr 2011 13:50:12 +0200 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote: > On Tue, Apr 19, 2011 at 12:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > >> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > >> Subject: [PATCH v2] pata_cmd64x: add enablebits checking > >> > >> Fixes IDE -> libata regression. > > > > And causes a regression too > > Could you be more explicit? > > Regression in this patch would mean that old driver currently doesn't > work which is not true.. The old driver fails on some of the hot plug boxes because the enable bits don't seem to be valid. See the rest of the discussion on this thread Hence the comment I made about needing to also check the parent bridge Alan -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 2011-04-19 at 11:20 +0200, Bartlomiej Zolnierkiewicz wrote: > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > Subject: [PATCH v2] pata_cmd64x: add enablebits checking > > Fixes IDE -> libata regression. > > IDE's cmd64x host driver has been supporting enablebits checking > since the initial driver's merge. Actually, the thread discussing the proposed patches is here: http://marc.info/?t=130315227100005 I much prefer the dummy interface approach to the prereset one because it prevents any possible poke at the registers which will crash the box. James -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Index: b/drivers/ata/pata_cmd64x.c =================================================================== --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c @@ -79,6 +79,40 @@ static int cmd648_cable_detect(struct at } /** + * cmd64x_prereset - perform reset handling + * @link: ATA link + * @deadline: deadline jiffies for the operation + * + * Reset sequence checking enable bits to see which ports are + * active. + */ + +static int cmd64x_prereset(struct ata_link *link, unsigned long deadline) +{ + static const struct pci_bits cmd64x_enable_bits[] = { + { 0x51, 1, 0x04, 0x04 }, + { 0x51, 1, 0x08, 0x08 } + }; + + struct ata_port *ap = link->ap; + struct pci_dev *pdev = to_pci_dev(ap->host->dev); + + /* + * The original PCI0643 and PCI0646 didn't have the primary + * channel enable bit, it appeared starting with PCI0646U + * (i.e. revision ID 3). + */ + if (ap->port_no == 0 && (pdev->device == PCI_DEVICE_ID_CMD_643 || + (pdev->device == PCI_DEVICE_ID_CMD_646 && pdev->revision < 3))) + goto out; + + if (!pci_test_config_bits(pdev, &cmd64x_enable_bits[ap->port_no])) + return -ENOENT; +out: + return ata_sff_prereset(link, deadline); +} + +/** * cmd64x_set_timing - set PIO and MWDMA timing * @ap: ATA interface * @adev: ATA device @@ -266,6 +300,7 @@ static const struct ata_port_operations .inherits = &ata_bmdma_port_ops, .set_piomode = cmd64x_set_piomode, .set_dmamode = cmd64x_set_dmamode, + .prereset = cmd64x_prereset, }; static struct ata_port_operations cmd64x_port_ops = {