From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: kernel.crashing.org@shangw, shangw@linux.vnet.ibm.com
Subject: [PATCH 15/21] Replace pci_dn with eeh_dev for EEH sysfs
Date: Fri, 24 Feb 2012 17:38:12 +0800 [thread overview]
Message-ID: <1330076298-7006-16-git-send-email-shangw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1330076298-7006-1-git-send-email-shangw@linux.vnet.ibm.com>
With original EEH implementation, all EEH related statistics have
been put into struct pci_dn. We've introduced struct eeh_dev to
replace struct pci_dn in EEH core components, including EEH sysfs
component.
The patch shows EEH statistics from struct eeh_dev instead of struct
pci_dn in EEH sysfs component. Besides, it also fixed the EEH device
retrieval from PCI device, which was introduced by the previous patch
in the series of patch.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/eeh_sysfs.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/eeh_sysfs.c b/arch/powerpc/platforms/pseries/eeh_sysfs.c
index 5e4eab1..01a62fc 100644
--- a/arch/powerpc/platforms/pseries/eeh_sysfs.c
+++ b/arch/powerpc/platforms/pseries/eeh_sysfs.c
@@ -41,24 +41,21 @@ static ssize_t eeh_show_##_name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct pci_dev *pdev = to_pci_dev(dev); \
- struct device_node *dn = pci_device_to_OF_node(pdev); \
- struct pci_dn *pdn; \
+ struct eeh_dev *edev = PCI_DEV_TO_EEH_DEV(pdev); \
\
- if (!dn || PCI_DN(dn) == NULL) \
- return 0; \
+ if (!edev) \
+ return 0; \
\
- pdn = PCI_DN(dn); \
- return sprintf(buf, _format "\n", pdn->_memb); \
+ return sprintf(buf, _format "\n", edev->_memb); \
} \
static DEVICE_ATTR(_name, S_IRUGO, eeh_show_##_name, NULL);
-
-EEH_SHOW_ATTR(eeh_mode, eeh_mode, "0x%x");
-EEH_SHOW_ATTR(eeh_config_addr, eeh_config_addr, "0x%x");
-EEH_SHOW_ATTR(eeh_pe_config_addr, eeh_pe_config_addr, "0x%x");
-EEH_SHOW_ATTR(eeh_check_count, eeh_check_count, "%d");
-EEH_SHOW_ATTR(eeh_freeze_count, eeh_freeze_count, "%d");
-EEH_SHOW_ATTR(eeh_false_positives, eeh_false_positives, "%d");
+EEH_SHOW_ATTR(eeh_mode, mode, "0x%x");
+EEH_SHOW_ATTR(eeh_config_addr, config_addr, "0x%x");
+EEH_SHOW_ATTR(eeh_pe_config_addr, pe_config_addr, "0x%x");
+EEH_SHOW_ATTR(eeh_check_count, check_count, "%d" );
+EEH_SHOW_ATTR(eeh_freeze_count, freeze_count, "%d" );
+EEH_SHOW_ATTR(eeh_false_positives, false_positives, "%d" );
void eeh_sysfs_add_device(struct pci_dev *pdev)
{
--
1.7.5.4
next prev parent reply other threads:[~2012-02-24 9:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 9:37 [PATCH v4 00/21] EEH reorganization Gavin Shan
2012-02-24 9:37 ` [PATCH 01/21] Cleanup on comments of EEH core Gavin Shan
2012-02-24 9:37 ` [PATCH 02/21] Cleanup on function names " Gavin Shan
2012-02-24 9:38 ` [PATCH 03/21] Platform dependent EEH operations Gavin Shan
2012-02-24 9:38 ` [PATCH 04/21] pSeries platform EEH initialization Gavin Shan
2012-02-24 9:38 ` [PATCH 05/21] pSeries platform EEH operation Gavin Shan
2012-02-24 9:38 ` [PATCH 06/21] pSeries platform EEH PE address retrieval Gavin Shan
2012-02-24 9:38 ` [PATCH 07/21] pSeries platform PE state retrieval Gavin Shan
2012-02-24 9:38 ` [PATCH 08/21] pSeries platform EEH wait PE state Gavin Shan
2012-02-24 9:38 ` [PATCH 09/21] pSeries platform EEH reset PE Gavin Shan
2012-02-24 9:38 ` [PATCH 10/21] pSeries platform EEH error log retrieval Gavin Shan
2012-02-24 9:38 ` [PATCH 11/21] pSeries platform EEH configure bridge Gavin Shan
2012-02-24 9:38 ` [PATCH 12/21] Cleanup on comments of EEH aux components Gavin Shan
2012-02-24 9:38 ` [PATCH 13/21] Cleanup on function names " Gavin Shan
2012-02-24 9:38 ` [PATCH 14/21] Introduce EEH device Gavin Shan
2012-02-24 12:46 ` Stephen Rothwell
2012-02-28 1:13 ` Gavin Shan
2012-02-24 12:50 ` Stephen Rothwell
2012-02-28 1:26 ` Gavin Shan
2012-02-24 9:38 ` Gavin Shan [this message]
2012-02-24 9:38 ` [PATCH 16/21] Replace pci_dn with eeh_dev for EEH address cache Gavin Shan
2012-02-24 9:38 ` [PATCH 17/21] Replace pci_dn with eeh_dev for EEH core Gavin Shan
2012-02-24 9:38 ` [PATCH 18/21] Replace pci_dn with eeh_dev for EEH aux components Gavin Shan
2012-02-24 9:38 ` [PATCH 19/21] Replace pci_dn with eeh_dev for EEH on pSeries Gavin Shan
2012-02-24 9:38 ` [PATCH 20/21] Introduce struct eeh_stats for EEH Gavin Shan
2012-02-24 13:01 ` Stephen Rothwell
2012-02-28 1:19 ` Gavin Shan
2012-02-24 13:51 ` David Laight
2012-02-28 1:22 ` Gavin Shan
2012-02-24 9:38 ` [PATCH 21/21] pSeries platform config space access in EEH Gavin Shan
2012-02-28 6:03 [PATCH v5 00/21] EEH reorganization Gavin Shan
2012-02-28 6:04 ` [PATCH 15/21] Replace pci_dn with eeh_dev for EEH sysfs Gavin Shan
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=1330076298-7006-16-git-send-email-shangw@linux.vnet.ibm.com \
--to=shangw@linux.vnet.ibm.com \
--cc=kernel.crashing.org@shangw \
--cc=linuxppc-dev@ozlabs.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).