From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: IDE Linux <linux-ide@vger.kernel.org>, Doug Maxey <dwm@maxeymade.com>
Subject: [PATCH 1/1] libata: convert pata_pdc2027x to the new reset mechanism
Date: Thu, 30 Mar 2006 11:12:01 +0800 [thread overview]
Message-ID: <442B4C81.4010305@tw.ibm.com> (raw)
- Convert pata_pdc2027x to the new reset mechanism (->probe_reset)
- Increased the version to 0.74
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
Patch against the pata_drivers branch
(bbbd62abb51c5804e113859e5bdccb0c9e84250a).
For your review, thanks.
--- pdc074-0/drivers/scsi/pata_pdc2027x.c 2006-03-27 15:03:50.000000000 +0800
+++ pdc074/drivers/scsi/pata_pdc2027x.c 2006-03-27 15:19:05.000000000 +0800
@@ -36,7 +36,7 @@
#include <asm/io.h>
#define DRV_NAME "pata_pdc2027x"
-#define DRV_VERSION "0.73"
+#define DRV_VERSION "0.74"
#undef PDC_DEBUG
#ifdef PDC_DEBUG
@@ -63,7 +63,7 @@ enum {
static int pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static void pdc2027x_remove_one(struct pci_dev *pdev);
-static void pdc2027x_phy_reset(struct ata_port *ap);
+static int pdc2027x_probe_reset(struct ata_port *ap, unsigned int *classes);
static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev);
static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev);
static void pdc2027x_post_set_mode(struct ata_port *ap);
@@ -155,7 +155,7 @@ static struct ata_port_operations pdc202
.exec_command = ata_exec_command,
.dev_select = ata_std_dev_select,
- .phy_reset = pdc2027x_phy_reset,
+ .probe_reset = pdc2027x_probe_reset,
.check_atapi_dma = pdc2027x_check_atapi_dma,
.bmdma_setup = ata_bmdma_setup,
@@ -185,7 +185,7 @@ static struct ata_port_operations pdc202
.exec_command = ata_exec_command,
.dev_select = ata_std_dev_select,
- .phy_reset = pdc2027x_phy_reset,
+ .probe_reset = pdc2027x_probe_reset,
.post_set_mode = pdc2027x_post_set_mode,
.check_atapi_dma = pdc2027x_check_atapi_dma,
@@ -210,7 +210,7 @@ static struct ata_port_info pdc2027x_por
{
.sht = &pdc2027x_sht,
.host_flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_SLAVE_POSS |
- ATA_FLAG_SRST | ATA_FLAG_MMIO,
+ ATA_FLAG_MMIO,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = ATA_UDMA5, /* udma0-5 */
@@ -220,7 +220,7 @@ static struct ata_port_info pdc2027x_por
{
.sht = &pdc2027x_sht,
.host_flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_SLAVE_POSS |
- ATA_FLAG_SRST | ATA_FLAG_MMIO,
+ ATA_FLAG_MMIO,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = ATA_UDMA6, /* udma0-6 */
@@ -296,26 +296,43 @@ static inline int pdc2027x_port_enabled(
}
/**
- * pdc2027x_phy_reset - Probe specified port on PATA host controller
- * @ap: Port to probe
+ * pdc2027x_probeinit - probeinit for PATA host controller
+ * @ap: Target port
*
- * Probe PATA phy.
+ * Probeinit including cable detection.
*
* LOCKING:
* None (inherited from caller).
*/
-static void pdc2027x_phy_reset(struct ata_port *ap)
+
+static void pdc2027x_probeinit(struct ata_port *ap)
+{
+ pdc2027x_cbl_detect(ap);
+ ata_std_probeinit(ap);
+}
+
+/**
+ * pdc2027x_probe_reset - Perform reset on PATA port and classify
+ * @ap: Port to reset
+ * @classes: Resulting classes of attached devices
+ *
+ * Reset PATA phy and classify attached devices.
+ *
+ * LOCKING:
+ * None (inherited from caller).
+ */
+
+static int pdc2027x_probe_reset(struct ata_port *ap, unsigned int *classes)
{
/* Check whether port enabled */
if (!pdc2027x_port_enabled(ap)) {
- ata_port_disable(ap);
printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
- return;
+ return 0;
}
- pdc2027x_cbl_detect(ap);
- ata_port_probe(ap);
- ata_bus_reset(ap);
+ return ata_drive_probe_reset(ap, pdc2027x_probeinit,
+ ata_std_softreset, NULL,
+ ata_std_postreset, classes);
}
/**
next reply other threads:[~2006-03-30 3:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-30 3:12 Albert Lee [this message]
2006-03-31 18:24 ` [PATCH 1/1] libata: convert pata_pdc2027x to the new reset mechanism Tejun Heo
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=442B4C81.4010305@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=albertl@mail.com \
--cc=dwm@maxeymade.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.