From: Matthew Garrett <mjg@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 3/4] libata: Make it possible for host drivers to flag hotplug ports
Date: Thu, 16 Jul 2009 00:43:57 +0100 [thread overview]
Message-ID: <1247701438-18266-3-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1247701438-18266-2-git-send-email-mjg@redhat.com>
Some libata host drivers may be able to provide hotplug information
on a port by port basis. Add a port operation to allow this to be
done, and ensure that it's called during registration.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
drivers/ata/libata-core.c | 4 ++++
include/linux/libata.h | 1 +
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 045a486..e4efd68 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6120,6 +6120,10 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
xfer_mask = ata_pack_xfermask(ap->pio_mask, ap->mwdma_mask,
ap->udma_mask);
+ if (ap->ops->is_hotpluggable)
+ ap->scsi_host->hotpluggable =
+ ap->ops->is_hotpluggable(ap);
+
if (!ata_port_is_dummy(ap)) {
ata_port_printk(ap, KERN_INFO,
"%cATA max %s %s\n",
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3d501db..7b1da91 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -814,6 +814,7 @@ struct ata_port_operations {
void (*pmp_detach)(struct ata_port *ap);
int (*enable_pm)(struct ata_port *ap, enum link_pm policy);
void (*disable_pm)(struct ata_port *ap);
+ int (*is_hotpluggable)(struct ata_port *ap);
/*
* Start, stop, suspend and resume
--
1.6.2.5
next prev parent reply other threads:[~2009-07-15 23:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-15 23:43 [PATCH 1/4] scsi: Allow hosts to be flagged as hotpluggable Matthew Garrett
2009-07-15 23:43 ` [PATCH 2/4] libata: Flag most SATA ports " Matthew Garrett
2009-07-15 23:43 ` Matthew Garrett [this message]
2009-07-15 23:43 ` [PATCH 4/4] libata: Allow AHCI to flag ports as not hotpluggable Matthew Garrett
2009-07-16 1:12 ` [PATCH 1/4] scsi: Allow hosts to be flagged as hotpluggable James Bottomley
2009-07-16 1:26 ` Matthew Garrett
2009-07-16 7:59 ` Alan Cox
2009-07-16 11:59 ` Matthew Wilcox
2009-07-16 14:30 ` Stefan Richter
2009-07-16 14:36 ` Stefan Richter
2009-07-16 14:44 ` Matthew Garrett
2009-07-16 14:38 ` Matthew Garrett
2009-07-16 14:43 ` James Bottomley
2009-07-16 14:45 ` Matthew Garrett
2009-07-16 14:53 ` James Bottomley
2009-07-16 14:55 ` Matthew Garrett
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=1247701438-18266-3-git-send-email-mjg@redhat.com \
--to=mjg@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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).