From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, linux-ide@vger.kernel.org, albertcc@tw.ibm.com
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 03/12] libata: new ->probe_reset operation
Date: Tue, 24 Jan 2006 17:05:22 +0900 [thread overview]
Message-ID: <11380899223211-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1138089921565-git-send-email-htejun@gmail.com>
Add new ->probe_reset operation to ata_port_operations obsoleting
->phy_reset. The main difference from ->phy_reset is that the new
operation is not allowed to manipulate libata internals directly.
It's not allowed to configure or disable the port or devices. It can
only succeed or fail and classify attached devices into passed
@classes.
This change gives more control to higher level and eases sharing reset
methods with EH.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/scsi/libata-core.c | 19 ++++++++++++++++++-
include/linux/libata.h | 8 +++++---
2 files changed, 23 insertions(+), 4 deletions(-)
65ce0d036067942117a705c7293aa544804e47a1
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index e10169d..c70151a 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1532,7 +1532,24 @@ static int ata_bus_probe(struct ata_port
{
unsigned int i, found = 0;
- ap->ops->phy_reset(ap);
+ if (ap->ops->probe_reset) {
+ unsigned int classes[ATA_MAX_DEVICES];
+ int rc;
+
+ ata_port_probe(ap);
+
+ rc = ap->ops->probe_reset(ap, classes);
+ if (rc == 0) {
+ for (i = 0; i < ATA_MAX_DEVICES; i++)
+ ap->device[i].class = classes[i];
+ } else {
+ printk(KERN_ERR "ata%u: probe reset failed, "
+ "disabling port\n", ap->id);
+ ata_port_disable(ap);
+ }
+ } else
+ ap->ops->phy_reset(ap);
+
if (ap->flags & ATA_FLAG_PORT_DISABLED)
goto err_out;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b33f035..6f36d9a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -148,9 +148,9 @@ enum {
ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */
ATA_FLAG_SATA = (1 << 3),
ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */
- ATA_FLAG_SRST = (1 << 5), /* use ATA SRST, not E.D.D. */
+ ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */
ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */
- ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */
+ ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */
ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once
* proper HSM is in place. */
@@ -422,7 +422,9 @@ struct ata_port_operations {
u8 (*check_altstatus)(struct ata_port *ap);
void (*dev_select)(struct ata_port *ap, unsigned int device);
- void (*phy_reset) (struct ata_port *ap);
+ void (*phy_reset) (struct ata_port *ap); /* obsolete */
+ int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
+
void (*post_set_mode) (struct ata_port *ap);
int (*check_atapi_dma) (struct ata_queued_cmd *qc);
--
1.1.3
next prev parent reply other threads:[~2006-01-24 8:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-24 8:05 [PATCHSET] libata: new reset mechanism, take#2 Tejun Heo
2006-01-24 8:05 ` [PATCH 01/12] libata: export ata_busy_sleep Tejun Heo
2006-01-27 4:18 ` Jeff Garzik
2006-01-24 8:05 ` [PATCH 08/12] sata_sil24: add hardreset Tejun Heo
2006-01-24 8:05 ` [PATCH 07/12] sata_sil24: convert to new reset mechanism Tejun Heo
2006-01-24 8:05 ` [PATCH 10/12] ata_piix: convert sata " Tejun Heo
2006-01-24 8:05 ` [PATCH 11/12] ahci: convert " Tejun Heo
2006-01-24 8:05 ` [PATCH 02/12] libata: modify ata_dev_try_classify Tejun Heo
2006-01-27 4:20 ` Jeff Garzik
2006-01-24 8:05 ` [PATCH 04/12] libata: implement ata_drive_probe_reset() Tejun Heo
2006-01-28 1:58 ` Jeff Garzik
2006-01-24 8:05 ` [PATCH 09/12] ata_piix: convert pata to new reset mechanism Tejun Heo
2006-01-24 8:05 ` [PATCH 12/12] ahci: add softreset Tejun Heo
2006-01-24 8:05 ` [PATCH 05/12] libata: implement standard reset component operations and ->probe_reset Tejun Heo
2006-01-28 1:58 ` Jeff Garzik
2006-01-24 8:05 ` Tejun Heo [this message]
2006-01-24 8:05 ` [PATCH 06/12] sata_sil: convert to new reset mechanism Tejun Heo
2006-01-28 18:09 ` Jeff Garzik
2006-01-28 18:27 ` Jeff Garzik
2006-01-28 23:17 ` Tejun
2006-01-29 2:41 ` Jeff Garzik
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=11380899223211-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=albertcc@tw.ibm.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 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).