From patchwork Fri Jun 29 10:27:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hari Vyas X-Patchwork-Id: 10496115 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A83CD60325 for ; Fri, 29 Jun 2018 10:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D24B297C0 for ; Fri, 29 Jun 2018 10:27:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 817CC297C4; Fri, 29 Jun 2018 10:27:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB75297C0 for ; Fri, 29 Jun 2018 10:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935356AbeF2K16 (ORCPT ); Fri, 29 Jun 2018 06:27:58 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33578 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935366AbeF2K15 (ORCPT ); Fri, 29 Jun 2018 06:27:57 -0400 Received: by mail-qk0-f194.google.com with SMTP id c131-v6so4626877qkb.0 for ; Fri, 29 Jun 2018 03:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1n0pMQR9w+VvZgccx2Glo1E0o0Y9+3x5GDDVsIPvpQY=; b=A56pQ2hIfeXWrEJRqEHhudxNelNwfYtWpqWYx1LB5L9PKnu9Yuz/W27Cjq3lawHmeK zBmI0PxnY1V2quwYy8Kh1XSXHWNZYaWKynK27vm+4Zbkmi48jZhZCQSpRLHoUaqgCgEg 0pgWujqFhGkfsfo2Yb9EjDcgegeheTZFObTxM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1n0pMQR9w+VvZgccx2Glo1E0o0Y9+3x5GDDVsIPvpQY=; b=hWzFl6y4njXSNwuB0+BgoIwz3lrPVEXkzVpBXuc0owqpQ2bhLkX5s9uWtP7lu1dc9p fGIVNXuSoirZanWhLqHxBwZW1xxclmuUgIk0eqZ2nWVkUnPYNj6gTWfvCR2LSCtkIvFh 8HzKD0Kod1K1tbmCty0hXbYMzIZlXIOfHXK1B1HgigOTPU5LJwSnNHSumd6MTPTio3UG 9ZM06NDyZfo2Z0RQhui8r3/KC0oXK00j8bE/s3B+bzLOuYerbwUM05QisAgo/d1ovjEj jgm7X5mX8uarMP9QqGKhTwG0AT/78jGfFkzQRyxH2WXihx5r92qRcXlvmW2rXyhfgTpz DS7w== X-Gm-Message-State: APt69E2ZbSlk2YgdSOysn44nSQJBwLoTQfwoh/yBK6rPAcHdpCbNmrrq AjXvS6ZvQ49HX2yQxEcG0Vg5Jw== X-Google-Smtp-Source: AAOMgpewy3Nh8aI5dqmgiQQMM/iRXfAFUsDVYH8QuUBRSzJFemaawMOLhLdxk9+nqapDwx7u2Ng/JA== X-Received: by 2002:a37:3609:: with SMTP id d9-v6mr11787492qka.419.1530268077120; Fri, 29 Jun 2018 03:27:57 -0700 (PDT) Received: from hariv-server.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id v88-v6sm2188365qkv.63.2018.06.29.03.27.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jun 2018 03:27:56 -0700 (PDT) From: Hari Vyas To: bhelgaas@google.com, benh@kernel.crashing.org Cc: linux-pci@vger.kernel.org, ray.jui@broadcom.com, Hari Vyas 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 Message-Id: <1530268061-17324-4-git-send-email-hari.vyas@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530268061-17324-1-git-send-email-hari.vyas@broadcom.com> References: <1530268061-17324-1-git-send-email-hari.vyas@broadcom.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }