From patchwork Tue Mar 6 18:21:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 10262387 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 417E46055D for ; Tue, 6 Mar 2018 18:23:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 334DB290AA for ; Tue, 6 Mar 2018 18:23:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 280D1290CC; Tue, 6 Mar 2018 18:23:45 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 D0AE4290AA for ; Tue, 6 Mar 2018 18:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055AbeCFSXd (ORCPT ); Tue, 6 Mar 2018 13:23:33 -0500 Received: from mail-sg2apc01on0120.outbound.protection.outlook.com ([104.47.125.120]:45036 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753837AbeCFSV6 (ORCPT ); Tue, 6 Mar 2018 13:21:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+Hhm9N3q2CK6Hm61XPJ+Ffw7pjJ9voBSDqTWohRxk+M=; b=We5s/Ae+y8BJI578EyPbKkIo/+PQEBj+D4gaZF3cFGlnRroo6Ewm7jC5zGSEN7YsnJw7SXzmpjgeCtey2tE+ZNdOZTo35tH1l5x4v0ZAo6yhktxgqR7/s/+6psuKh2i8CM54e3Uc5QGCeIh99AU7CpdLiZ/tBO+NTFPDKnsDxHU= Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0021.APCP153.PROD.OUTLOOK.COM (10.170.167.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.7; Tue, 6 Mar 2018 18:21:50 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0588.001; Tue, 6 Mar 2018 18:21:49 +0000 From: Dexuan Cui To: "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , KY Srinivasan , Stephen Hemminger , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" CC: "linux-kernel@vger.kernel.org" , "driverdev-devel@linuxdriverproject.org" , Haiyang Zhang , "vkuznets@redhat.com" , "marcelo.cerri@canonical.com" , "Michael Kelley (EOSG)" , Dexuan Cui , Jack Morgenstein , "stable@vger.kernel.org" Subject: [PATCH v3 2/6] PCI: hv: hv_eject_device_work(): remove the bogus test Thread-Topic: [PATCH v3 2/6] PCI: hv: hv_eject_device_work(): remove the bogus test Thread-Index: AQHTtXf+ZtRiOS3OX0GDg2oNP2dLfQ== Date: Tue, 6 Mar 2018 18:21:49 +0000 Message-ID: <20180306182128.23281-3-decui@microsoft.com> References: <20180306182128.23281-1-decui@microsoft.com> In-Reply-To: <20180306182128.23281-1-decui@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.15.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; KL1P15301MB0021; 7:5F5KyCw0LVnNMvnTDw4ii7VK3iFfa57r8dOe80azc9338BXTpqKehMrdTA55o22WcybMf1e4vSSSM7yZVUzUrcub+Kc1DV5f4PnNjJDWoltCMTKOSfrokErGENTDNIQWXDP+dh5Cx7EBEzh8xixW39sbwFQUtaUNLakwSAt9yGmp2jBPDWZErl6noYR3Y0AzBoMl1BHFEOMZPxcKo4qaCXP3ad5c71T7yYJOi68LdgG7YE9L51EzZUqFSF+606m/; 20:WNhKS2JJ/41e8QbtH/SBQkmU0HUwXKXCSZDexqdM/276xZgGaHdq9C68sIo/v0ZjXmfkEUhVBapjzM+OO0LUxqfS43rXKWHeQzo+V0n6zC1ib8G/xM9xAVUKhU5UrVQy3aQlUjJMZP9dzdt3EEEx+H23QrCzcHFTlOBtkDVt6aI= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e527aa9d-4807-4675-480b-08d5838f20fd x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:KL1P15301MB0021; x-ms-traffictypediagnostic: KL1P15301MB0021: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:KL1P15301MB0021; BCL:0; PCL:0; RULEID:; SRVR:KL1P15301MB0021; x-forefront-prvs: 06036BD506 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(39380400002)(346002)(376002)(366004)(199004)(189003)(5660300001)(36756003)(22452003)(1511001)(10090500001)(2501003)(66066001)(316002)(7736002)(14454004)(10290500003)(2201001)(99286004)(305945005)(7416002)(478600001)(76176011)(25786009)(4326008)(86362001)(102836004)(106356001)(6506007)(105586002)(186003)(77096007)(26005)(3660700001)(110136005)(2900100001)(54906003)(68736007)(50226002)(97736004)(8676002)(81156014)(81166006)(8936002)(53936002)(3280700002)(6116002)(86612001)(6436002)(6512007)(2906002)(1076002)(6486002)(2950100002)(3846002)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1P15301MB0021; H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: uP+i4INQGxnqR55IglNFA0YyUS1YkUw+aUOVOVkqt45lkBbQ8gliln+Iyrf6vKOWk9125Z+Vxvm/rOtRjo05+94mV/pkUaG2++f8AyAI3vX1Z3rIw/tzB/x4yohwK1GzalkCSm7a2lVLmdQVyUZW/ASNuGr2u/32el5pL0UMcqrMsIgBb0B4PTqobXnMADyEZUL2BUw806UmFa4jtjUrBZvU/D5vNkNDdsZ9dIT2cMPr3AaURG6mJFk6k1rOhFXFVE+k1q2jOydzCy7vk0OLQ5JjD3qUPXaA+lw4Q4JF6csQsknlZaB/HHleYwbSibEy+g/88cClyoxosYo9W2/gEg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e527aa9d-4807-4675-480b-08d5838f20fd X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2018 18:21:49.4981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0021 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 When we're in the function, hpdev->state must be hv_pcichild_ejecting: see hv_pci_eject_device(). Signed-off-by: Dexuan Cui Cc: Vitaly Kuznetsov Cc: Jack Morgenstein Cc: stable@vger.kernel.org Cc: Stephen Hemminger Cc: K. Y. Srinivasan Cc: Michael Kelley (EOSG) Reviewed-by: Michael Kelley Acked-by: Haiyang Zhang --- drivers/pci/host/pci-hyperv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 1233300f41c6..04edb24c92ee 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -1796,10 +1796,7 @@ static void hv_eject_device_work(struct work_struct *work) hpdev = container_of(work, struct hv_pci_dev, wrk); - if (hpdev->state != hv_pcichild_ejecting) { - put_pcichild(hpdev, hv_pcidev_ref_pnp); - return; - } + WARN_ON(hpdev->state != hv_pcichild_ejecting); /* * Ejection can come before or after the PCI bus has been set up, so