From: Sam Bobroff <sbobroff@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 08/14] powerpc/eeh: Cleanup field names in eeh_rmv_data
Date: Wed, 12 Sep 2018 11:23:27 +1000 [thread overview]
Message-ID: <fd3beb5a120b1de7b639a23e343bb9f5995a82b7.1536715396.git.sbobroff@linux.ibm.com> (raw)
In-Reply-To: <cover.1536715396.git.sbobroff@linux.ibm.com>
Change the name of the fields in eeh_rmv_data to clarify their usage.
Change "edev_list" to "removed_vf_list" because it does not contain
generic edevs, but rather only edevs that contain virtual functions
(which need to be removed during recovery).
Similarly, change "removed" to "removed_dev_count" because it is a
count of any removed devices, not just those in the above list.
Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
---
arch/powerpc/kernel/eeh_driver.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 7859af897058..ffe8293d1f06 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -35,8 +35,8 @@
#include <asm/rtas.h>
struct eeh_rmv_data {
- struct list_head edev_list;
- int removed;
+ struct list_head removed_vf_list;
+ int removed_dev_count;
};
static int eeh_result_priority(enum pci_ers_result result)
@@ -502,7 +502,6 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
struct pci_driver *driver;
struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
struct eeh_rmv_data *rmv_data = (struct eeh_rmv_data *)userdata;
- int *removed = rmv_data ? &rmv_data->removed : NULL;
/*
* Actually, we should remove the PCI bridges as well.
@@ -524,7 +523,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
if (eeh_dev_removed(edev))
return NULL;
- if (removed) {
+ if (rmv_data) {
if (eeh_pe_passed(edev->pe))
return NULL;
driver = eeh_pcid_get(dev);
@@ -543,8 +542,8 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
pr_debug("EEH: Removing %s without EEH sensitive driver\n",
pci_name(dev));
edev->mode |= EEH_DEV_DISCONNECTED;
- if (removed)
- (*removed)++;
+ if (rmv_data)
+ rmv_data->removed_dev_count++;
if (edev->physfn) {
#ifdef CONFIG_PCI_IOV
@@ -560,7 +559,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
pdn->pe_number = IODA_INVALID_PE;
#endif
if (rmv_data)
- list_add(&edev->rmv_entry, &rmv_data->edev_list);
+ list_add(&edev->rmv_entry, &rmv_data->removed_vf_list);
} else {
pci_lock_rescan_remove();
pci_stop_and_remove_bus_device(dev);
@@ -729,7 +728,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,
* the device up before the scripts have taken it down,
* potentially weird things happen.
*/
- if (!driver_eeh_aware || rmv_data->removed) {
+ if (!driver_eeh_aware || rmv_data->removed_dev_count) {
pr_info("EEH: Sleep 5s ahead of %s hotplug\n",
(driver_eeh_aware ? "partial" : "complete"));
ssleep(5);
@@ -791,7 +790,8 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
struct eeh_pe *tmp_pe;
int rc = 0;
enum pci_ers_result result = PCI_ERS_RESULT_NONE;
- struct eeh_rmv_data rmv_data = {LIST_HEAD_INIT(rmv_data.edev_list), 0};
+ struct eeh_rmv_data rmv_data =
+ {LIST_HEAD_INIT(rmv_data.removed_vf_list), 0};
bus = eeh_pe_bus_get(pe);
if (!bus) {
@@ -934,7 +934,8 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
* For those hot removed VFs, we should add back them after PF get
* recovered properly.
*/
- list_for_each_entry_safe(edev, tmp, &rmv_data.edev_list, rmv_entry) {
+ list_for_each_entry_safe(edev, tmp, &rmv_data.removed_vf_list,
+ rmv_entry) {
eeh_add_virt_device(edev);
list_del(&edev->rmv_entry);
}
--
2.19.0.2.gcad72f5712
next prev parent reply other threads:[~2018-09-12 1:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 1:23 [PATCH 00/14] EEH refactoring 3 Sam Bobroff
2018-09-12 1:23 ` [PATCH 01/14] powerpc/eeh: Fix possible null deref in eeh_dump_dev_log() Sam Bobroff
2018-10-15 4:00 ` [01/14] " Michael Ellerman
2018-09-12 1:23 ` [PATCH 02/14] powerpc/eeh: Fix null deref for devices removed during EEH Sam Bobroff
2018-09-12 1:23 ` [PATCH 03/14] powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field Sam Bobroff
2018-09-12 1:23 ` [PATCH 04/14] powerpc/eeh: Cleanup EEH_POSTPONED_PROBE Sam Bobroff
2018-09-12 1:23 ` [PATCH 05/14] powerpc/eeh: Cleanup unused field in eeh_dev Sam Bobroff
2018-09-12 1:23 ` [PATCH 06/14] powerpc/eeh: Cleanup eeh_add_virt_device() Sam Bobroff
2018-09-12 1:23 ` [PATCH 07/14] powerpc/eeh: Cleanup list_head field names Sam Bobroff
2018-09-12 1:23 ` Sam Bobroff [this message]
2018-09-12 1:23 ` [PATCH 09/14] powerpc/eeh: Cleanup logic in eeh_rmv_from_parent_pe() Sam Bobroff
2018-09-12 1:23 ` [PATCH 10/14] powerpc/eeh: Cleanup eeh_enabled() Sam Bobroff
2018-09-12 1:23 ` [PATCH 11/14] powerpc/eeh: Cleanup unnecessary eeh_pe_state_mark_with_cfg() Sam Bobroff
2018-09-12 1:23 ` [PATCH 12/14] powerpc/eeh: Cleanup eeh_pe_state_mark() Sam Bobroff
2018-09-12 1:23 ` [PATCH 13/14] powerpc/eeh: Cleanup eeh_ops.wait_state() Sam Bobroff
2018-09-12 1:23 ` [PATCH 14/14] powerpc/eeh: Cleanup control flow in eeh_handle_normal_event() Sam Bobroff
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=fd3beb5a120b1de7b639a23e343bb9f5995a82b7.1536715396.git.sbobroff@linux.ibm.com \
--to=sbobroff@linux.ibm.com \
--cc=linuxppc-dev@lists.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).