From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: johnrose@austin.ibm.com
Subject: [PATCH] PCI Hotplug: remove incorrect rpaphp firmware dependency
Date: Thu, 3 Feb 2005 09:40:21 -0800 [thread overview]
Message-ID: <1107452421934@kroah.com> (raw)
In-Reply-To: <11074524213464@kroah.com>
ChangeSet 1.2044, 2005/02/03 00:41:04-08:00, johnrose@austin.ibm.com
[PATCH] PCI Hotplug: remove incorrect rpaphp firmware dependency
The RPA PCI Hotplug module incorrectly uses a certain firmware property when
determining the hotplug capabilities of a slot. Recent firmware changes have
demonstrated that this property should not be referenced or depended upon by
the OS. This patch removes the dependency, and implements a correct set of
logic for determining hotplug capabilities.
Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
diff -puN drivers/pci/hotplug/rpadlpar_core.c~02_rpadebug drivers/pci/hotplug/rpadlpar_core.c
drivers/pci/hotplug/rpaphp.h | 7 ------
drivers/pci/hotplug/rpaphp_core.c | 39 +++++++++++++++++++++++++++-----------
2 files changed, 28 insertions(+), 18 deletions(-)
diff -Nru a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
--- a/drivers/pci/hotplug/rpaphp.h 2005-02-03 09:28:39 -08:00
+++ b/drivers/pci/hotplug/rpaphp.h 2005-02-03 09:28:39 -08:00
@@ -109,13 +109,6 @@
extern struct list_head rpaphp_slot_head;
extern int num_slots;
-static inline int is_hotplug_capable(struct device_node *dn)
-{
- unsigned char *ptr = get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL);
-
- return (int) (ptr != NULL);
-}
-
/* function prototypes */
/* rpaphp_pci.c */
diff -Nru a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
--- a/drivers/pci/hotplug/rpaphp_core.c 2005-02-03 09:28:39 -08:00
+++ b/drivers/pci/hotplug/rpaphp_core.c 2005-02-03 09:28:39 -08:00
@@ -287,26 +287,43 @@
return 1;
}
-static int is_php_dn(struct device_node *dn, int **indexes, int **names, int **types,
- int **power_domains)
+static int is_php_type(char *drc_type)
{
+ unsigned long value;
+ char *endptr;
+
+ /* PCI Hotplug nodes have an integer for drc_type */
+ value = simple_strtoul(drc_type, &endptr, 10);
+ if (endptr == drc_type)
+ return 0;
+
+ return 1;
+}
+
+static int is_php_dn(struct device_node *dn, int **indexes, int **names,
+ int **types, int **power_domains)
+{
+ int *drc_types;
int rc;
- if (!is_hotplug_capable(dn))
- return (0);
- rc = get_children_props(dn, indexes, names, types, power_domains);
- if (rc)
- return (0);
- return (1);
+ rc = get_children_props(dn, indexes, names, &drc_types, power_domains);
+ if (rc) {
+ if (is_php_type((char *) &drc_types[1])) {
+ *types = drc_types;
+ return 1;
+ }
+ }
+
+ return 0;
}
-static int is_dr_dn(struct device_node *dn, int **indexes, int **names, int **types,
- int **power_domains, int **my_drc_index)
+static int is_dr_dn(struct device_node *dn, int **indexes, int **names,
+ int **types, int **power_domains, int **my_drc_index)
{
int rc;
*my_drc_index = (int *) get_property(dn, "ibm,my-drc-index", NULL);
- if(!*my_drc_index)
+ if(!*my_drc_index)
return (0);
if (!dn->parent)
next prev parent reply other threads:[~2005-02-03 17:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-03 17:32 [BK PATCH] PCI fixes for 2.6.11-rc3 Greg KH
2005-02-03 17:40 ` [PATCH] PCI: typo in pci_scan_bus_parented Greg KH
2005-02-03 17:40 ` [PATCH] pci: Add Citrine quirk Greg KH
2005-02-03 17:40 ` [PATCH] PCI: memset rom attribute before using it Greg KH
2005-02-03 17:40 ` Greg KH [this message]
2005-02-03 17:40 ` [PATCH] PCI: add linux-pci mailing list to PCI maintainers entry Greg KH
2005-02-03 17:40 ` [PATCH] PCI: change sysfs representation of PCI-E devices Greg KH
[not found] <200502031908.j13J8ggb031915@hera.kernel.org>
2005-02-07 17:00 ` [PATCH] PCI Hotplug: remove incorrect rpaphp firmware dependency David Woodhouse
2005-02-07 17:41 ` John Rose
2005-02-07 17:45 ` John Rose
2005-02-07 19:13 ` Andrew Morton
2005-02-07 19:28 ` David Woodhouse
2005-02-08 0:21 ` John Rose
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=1107452421934@kroah.com \
--to=greg@kroah.com \
--cc=johnrose@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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.