linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hari Vyas <hari.vyas@broadcom.com>
To: bhelgaas@google.com, benh@kernel.crashing.org
Cc: linux-pci@vger.kernel.org, ray.jui@broadcom.com,
	Hari Vyas <hari.vyas@broadcom.com>
Subject: [PATCH v2 3/3] PCI: Hotplug: use new pci function to get device addition state
Date: Fri, 29 Jun 2018 15:57:41 +0530	[thread overview]
Message-ID: <1530268061-17324-4-git-send-email-hari.vyas@broadcom.com> (raw)
In-Reply-To: <1530268061-17324-1-git-send-email-hari.vyas@broadcom.com>

Due to one race condition happening while updating pci
device addition and master status bits in a particular
scenario, device addition state is moved to a independent
private flag variable.

This change uses newly proposed pci_dev_is_added() function
to retrieve device addition state.

Signed-off-by: Hari Vyas <hari.vyas@broadcom.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 3a17b29..ef0b1b6 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -509,7 +509,7 @@ static void enable_slot(struct acpiphp_slot *slot)
 
 	list_for_each_entry(dev, &bus->devices, bus_list) {
 		/* Assume that newly added devices are powered on already. */
-		if (!dev->is_added)
+		if (!pci_dev_is_added(dev))
 			dev->current_state = PCI_D0;
 	}
 
-- 
1.9.1

      parent reply	other threads:[~2018-06-29 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 10:27 [PATCH v2 0/3] PCI: Data corruption happening due to race condition Hari Vyas
2018-06-29 10:27 ` [PATCH v2 1/3] " Hari Vyas
2018-06-29 14:38   ` kbuild test robot
2018-06-29 18:22   ` kbuild test robot
2018-07-01 14:06   ` Lukas Wunner
2018-07-02 14:20     ` Hari Vyas
2018-06-29 10:27 ` [PATCH v2 2/3] PCI: use new pci function to get device addition state Hari Vyas
2018-06-29 10:27 ` Hari Vyas [this message]

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=1530268061-17324-4-git-send-email-hari.vyas@broadcom.com \
    --to=hari.vyas@broadcom.com \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=ray.jui@broadcom.com \
    /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).