From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 21/86] pata_cmd64x: add enablebits checking
Date: Wed, 25 Nov 2009 18:04:50 +0100 [thread overview]
Message-ID: <20091125170450.5446.70158.sendpatchset@localhost> (raw)
In-Reply-To: <20091125170218.5446.13513.sendpatchset@localhost>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_cmd64x: add enablebits checking
There shouldn't be any problems with it as IDE cmd64x host driver
has been supporting enablebits checking for years.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ata/pata_cmd64x.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
Index: b/drivers/ata/pata_cmd64x.c
===================================================================
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -2,6 +2,7 @@
* pata_cmd64x.c - CMD64x PATA for new ATA layer
* (C) 2005 Red Hat Inc
* Alan Cox <alan@lxorguk.ukuu.org.uk>
+ * (C) 2009 Bartlomiej Zolnierkiewicz
*
* Based upon
* linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002
@@ -88,6 +89,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 (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_piomode - set PIO and MWDMA timing
* @ap: ATA interface
* @adev: ATA device
@@ -278,6 +313,7 @@ static const struct ata_port_operations
static struct ata_port_operations cmd64x_port_ops = {
.inherits = &cmd64x_base_ops,
.cable_detect = ata_cable_40wire,
+ .prereset = cmd64x_prereset,
};
static struct ata_port_operations cmd646r1_port_ops = {
next prev parent reply other threads:[~2009-11-25 17:04 UTC|newest]
Thread overview: 188+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 17:02 [PATCH 00/86] PATA fixes Bartlomiej Zolnierkiewicz
2009-11-25 17:02 ` [PATCH 01/86] ata_piix: fix MWDMA handling on PIIX3 Bartlomiej Zolnierkiewicz
2009-11-25 17:02 ` [PATCH 02/86] ata_piix: unify code for programming PIO and MWDMA timings Bartlomiej Zolnierkiewicz
2009-11-25 17:02 ` [PATCH 03/86] pata_artop: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` Alan Cox
2009-11-25 17:18 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:59 ` Alan Cox
2009-11-25 17:02 ` [PATCH 04/86] pata_artop: fix chipsets naming Bartlomiej Zolnierkiewicz
2009-11-25 17:02 ` [PATCH 05/86] pata_artop: add Power Management support Bartlomiej Zolnierkiewicz
2009-12-01 18:34 ` Sergei Shtylyov
2009-11-25 17:03 ` [PATCH 06/86] pata_artop: unify ->prereset methods Bartlomiej Zolnierkiewicz
2009-11-25 17:03 ` [PATCH 07/86] pata_artop: remove dead 34MHz PCI clock support Bartlomiej Zolnierkiewicz
2009-12-01 17:23 ` Sergei Shtylyov
2009-11-25 17:03 ` [PATCH 08/86] pata_atiixp: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:03 ` [PATCH 09/86] pata_atiixp: no need to program PIO timings for MWDMA Bartlomiej Zolnierkiewicz
2009-11-25 17:25 ` Alan Cox
2009-11-25 17:03 ` [PATCH 10/86] pata_atiixp: add MWDMA0 support Bartlomiej Zolnierkiewicz
2009-11-25 17:03 ` [PATCH 11/86] pata_atiixp: remove custom BMDMA methods Bartlomiej Zolnierkiewicz
2009-11-25 17:34 ` Alan Cox
2009-11-25 17:03 ` [PATCH 12/86] pata_atiixp: add proper ->prereset method Bartlomiej Zolnierkiewicz
2009-11-25 17:15 ` Alan Cox
2009-11-25 17:03 ` [PATCH 13/86] pata_efar: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:03 ` [PATCH 14/86] pata_efar: fix wrong PIO timings being programmed Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` [PATCH 15/86] pata_efar: fix wrong MWDMA " Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` [PATCH 16/86] pata_efar: MWDMA0 is unsupported Bartlomiej Zolnierkiewicz
2009-11-25 17:25 ` Alan Cox
2009-11-26 14:53 ` Bartlomiej Zolnierkiewicz
2009-11-26 15:15 ` Alan Cox
2009-11-26 15:33 ` Sergei Shtylyov
2009-11-26 15:40 ` Bartlomiej Zolnierkiewicz
2009-11-26 16:17 ` Sergei Shtylyov
2009-11-26 16:29 ` Bartlomiej Zolnierkiewicz
2009-11-26 16:44 ` Sergei Shtylyov
2009-12-03 20:50 ` Jeff Garzik
2009-11-25 17:04 ` [PATCH 17/86] pata_efar: fix register naming used in efar_set_piomode() Bartlomiej Zolnierkiewicz
2009-11-25 17:25 ` Alan Cox
2009-11-25 17:32 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` [PATCH 18/86] pata_efar: unify code for programming PIO and MWDMA timings Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` [PATCH 19/86] pata_cmd640: document known issues Bartlomiej Zolnierkiewicz
2009-11-25 17:26 ` Alan Cox
2009-11-25 17:34 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:14 ` Alan Cox
2009-11-25 17:37 ` Jeff Garzik
2009-11-25 17:44 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` [PATCH 20/86] pata_cmd64x: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:04 ` Bartlomiej Zolnierkiewicz [this message]
2009-11-25 17:04 ` [PATCH 22/86] pata_cmd64x: add cmd64x_fixup() Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 23/86] pata_cs5520: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 24/86] pata_cs5520: remove dead VDMA support Bartlomiej Zolnierkiewicz
2009-11-25 17:28 ` Alan Cox
2009-11-25 17:05 ` [PATCH 25/86] pata_cs5530: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 26/86] pata_cs5535: " Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 27/86] pata_cs5535: no need to program PIO0 timings during device init Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 28/86] pata_cypress: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 29/86] pata_cypress: document known issues Bartlomiej Zolnierkiewicz
2009-11-25 17:05 ` [PATCH 30/86] pata_hpt366: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 31/86] pata_hpt37x: " Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 32/86] pata_hpt3x2n: " Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 33/86] pata_hpt3x3: Power Management fix Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 34/86] pata_it8213: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 35/86] pata_it8213: fix UDMA handling Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 36/86] pata_it8213: add UDMA100 and UDMA133 support Bartlomiej Zolnierkiewicz
2009-11-26 15:05 ` Sergei Shtylyov
2009-11-26 15:17 ` Sergei Shtylyov
2009-11-26 15:36 ` Bartlomiej Zolnierkiewicz
2009-11-26 18:10 ` Sergei Shtylyov
2009-11-25 17:06 ` [PATCH 37/86] pata_it8213: fix wrong PIO timings being programmed Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 38/86] pata_it8213: fix PIO2 underclocking Bartlomiej Zolnierkiewicz
2009-11-25 17:06 ` [PATCH 39/86] pata_it8213: fix wrong MWDMA timings being programmed Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 40/86] pata_it8213: fix register naming used in it8213_set_piomode() Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 41/86] pata_efar: unify code for programming PIO and MWDMA timings Bartlomiej Zolnierkiewicz
2009-11-26 18:29 ` Sergei Shtylyov
2009-11-25 17:07 ` [PATCH 42/86] pata_it8213: fix it8213_pre_reset() documentation Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 43/86] pata_it821x: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 44/86] pata_jmicron: " Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 45/86] pata_legacy: do not probe extra ports automatically if PCI is not present Bartlomiej Zolnierkiewicz
2009-11-25 17:32 ` Alan Cox
2009-11-25 17:45 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:12 ` Alan Cox
2009-11-25 18:20 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 46/86] pata_legacy: fix QDI6580DP support Bartlomiej Zolnierkiewicz
2009-11-25 17:07 ` [PATCH 47/86] pata_legacy: fix access to control register for QDI6580 Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 48/86] pata_legacy: add pointers to QDI65x0 documentation Bartlomiej Zolnierkiewicz
2009-11-25 17:38 ` Alan Cox
2009-11-25 17:44 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:12 ` Alan Cox
2009-11-25 18:21 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 49/86] pata_legacy: unify QDI ->set_piomode methods Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 50/86] pata_legacy: use PIO mask defines Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 51/86] libata: remove no longer needed pata_qdi driver Bartlomiej Zolnierkiewicz
2009-11-25 17:41 ` Alan Cox
2009-11-25 17:08 ` [PATCH 52/86] libata: remove no longer needed pata_winbond driver Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 53/86] pata_marvell: fix marvell_pre_reset() documentation Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 54/86] pata_ns87415: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:08 ` [PATCH 55/86] pata_ns87415: Power Management fix Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 56/86] pata_oldpiix: unify code for programming PIO and MWDMA timings Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 57/86] pata_opti: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 58/86] pata_pdc2027x: " Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 59/86] pata_pdc2027x: add Power Management support Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 60/86] pata_pdc202xx_old: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 61/86] pata_sis: Power Management fix Bartlomiej Zolnierkiewicz
2009-11-25 17:09 ` [PATCH 62/86] pata_pdc202xx_old: document known issues Bartlomiej Zolnierkiewicz
2009-11-25 17:46 ` Alan Cox
2009-11-25 17:50 ` Jeff Garzik
2009-11-25 17:52 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:04 ` Jeff Garzik
2009-11-25 18:29 ` Bartlomiej Zolnierkiewicz
2009-11-25 20:38 ` Jeff Garzik
2009-11-25 22:02 ` Bartlomiej Zolnierkiewicz
2009-11-26 3:14 ` Jeff Garzik
2009-11-26 11:57 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:09 ` Alan Cox
2009-11-25 17:09 ` [PATCH 63/86] pata_radisys: fix UDMA handling Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 64/86] pata_radisys: unify code for programming PIO and MWDMA timings Bartlomiej Zolnierkiewicz
2009-11-26 19:03 ` Sergei Shtylyov
2009-11-25 17:10 ` [PATCH 65/86] pata_rdc: " Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 66/86] pata_rz1000: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 67/86] pata_rz1000: Power Management fix Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 68/86] pata_sc1200: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 69/86] pata_scc: " Bartlomiej Zolnierkiewicz
2009-11-25 17:48 ` Alan Cox
2009-11-25 17:49 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 70/86] pata_scc: add proper cable detection method Bartlomiej Zolnierkiewicz
2009-11-25 17:10 ` [PATCH 71/86] pata_sch: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 72/86] pata_serverworks: " Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 73/86] pata_serverworks: use standard cable detection methods Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 74/86] pata_serverworks: add serverworks_fixup() Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 75/86] pata_sl82c105: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 76/86] pata_sl82c105: add Power Management support Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 77/86] pata_sis: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 78/86] pata_sis: Power Management fix Bartlomiej Zolnierkiewicz
2009-11-25 17:11 ` [PATCH 79/86] pata_triflex: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` [PATCH 80/86] libata: make ata_sff_data_xfer_noirq() work with 32-bit PIO Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` [PATCH 81/86] pata_via: add 32-bit PIO support Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` [PATCH 82/86] pata_via: clear UDMA transfer mode bit for PIO and MWDMA Bartlomiej Zolnierkiewicz
2009-11-25 17:52 ` Alan Cox
2009-11-25 17:58 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:06 ` Alan Cox
2009-11-25 18:10 ` Bartlomiej Zolnierkiewicz
2009-11-25 19:34 ` Alan Cox
2009-11-25 19:53 ` Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` [PATCH 83/86] pata_via: add via_fixup() Bartlomiej Zolnierkiewicz
2009-11-25 17:12 ` [PATCH 84/86] libata: add ata_mwdma_to_pio() inline helper Bartlomiej Zolnierkiewicz
2009-12-04 18:07 ` Sergei Shtylyov
2009-11-25 17:12 ` [PATCH 85/86] libata: add ->init_host method Bartlomiej Zolnierkiewicz
2009-11-25 17:56 ` Alan Cox
2009-11-25 17:12 ` [PATCH 86/86] libata: add private driver field to struct ata_device Bartlomiej Zolnierkiewicz
2009-11-25 17:56 ` Alan Cox
2009-11-25 18:02 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:17 ` Alan Cox
2009-12-03 8:04 ` Jeff Garzik
2009-12-03 12:37 ` Bartlomiej Zolnierkiewicz
2009-12-03 17:45 ` Jeff Garzik
2009-11-25 17:19 ` [PATCH 00/86] PATA fixes Jeff Garzik
2009-11-25 17:24 ` Bartlomiej Zolnierkiewicz
2009-11-25 18:01 ` Alan Cox
2009-12-03 8:07 ` Jeff Garzik
2009-12-03 12:39 ` Bartlomiej Zolnierkiewicz
2009-12-03 17:53 ` Jeff Garzik
2009-12-03 19:45 ` Bartlomiej Zolnierkiewicz
2009-12-03 20:11 ` Jeff Garzik
2009-12-03 20:26 ` Bartlomiej Zolnierkiewicz
2009-12-03 20:39 ` Jeff Garzik
2009-12-03 21:01 ` Bartlomiej Zolnierkiewicz
2009-12-03 21:28 ` Jeff Garzik
2009-12-12 2:02 ` david
2009-12-12 3:23 ` Bartlomiej Zolnierkiewicz
2009-12-03 21:16 ` Jeff Garzik
2009-12-03 21:42 ` Bartlomiej Zolnierkiewicz
2009-12-03 21:51 ` Jeff Garzik
2009-12-03 21:56 ` Bartlomiej Zolnierkiewicz
2009-12-03 22:02 ` Jeff Garzik
2009-12-03 22:06 ` Bartlomiej Zolnierkiewicz
2009-12-03 22:10 ` Jeff Garzik
2009-12-03 22:22 ` Jeff Garzik
2009-12-03 22:23 ` Bartlomiej Zolnierkiewicz
2009-12-03 22:30 ` Jeff Garzik
2009-12-03 22:45 ` Bartlomiej Zolnierkiewicz
2009-12-03 22:02 ` Sergei Shtylyov
2009-12-03 22:08 ` Jeff Garzik
2009-12-04 0:17 ` Alan Cox
2009-12-03 22:57 ` Jeff Garzik
2009-12-04 12:16 ` Alan Cox
2009-12-03 16:59 ` Alan Cox
2009-12-03 17:39 ` Jeff Garzik
2009-12-03 20:48 ` David Miller
2009-12-03 21:32 ` Jeff Garzik
2009-12-03 21:41 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091125170450.5446.70158.sendpatchset@localhost \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).