From patchwork Thu Jun 15 04:44:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 13280698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07A59EB64DB for ; Thu, 15 Jun 2023 04:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243160AbjFOEqN (ORCPT ); Thu, 15 Jun 2023 00:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243116AbjFOEqA (ORCPT ); Thu, 15 Jun 2023 00:46:00 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2126.outbound.protection.outlook.com [40.107.101.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D44AE2684; Wed, 14 Jun 2023 21:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5ekCV6HJ6iJpq17Iu64gq5hMA+iAej3fFDdqXyC5jXwLy0fFAijGSxk27o2tfRtYZMfNSX87N4D1jrEirWPB1ElmJkNOKPtJUPaFgb6SJ7NYD+53dAMFhDMfirF0CkoneAcnM7kaAwuf+9Cv/0mjOCdqpAOvJp3c/Bbpca5ti5dNvtyfKaACYl9T+QDZirYMeR2G3n1N3OglxtUei1KVKRctjfeCi1zcjmrfyBgxaV27hGWLDjmbA1GEKCSxOgh8atiT+Xcv74TVGLHP0Pftzpgv4I3uqaatVMPGEzBG+qsQcFAz2n1XkGN++uhH5ZZFkc46SoVXMFq7v2WBYs/Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OJ+hFj+wB2UrTRLkTBYFcRNUhFnHauukaAsov7l2qwU=; b=AZpcBatpnTVjYjB4SoSawINz2IqS8+VXBg9dWgZayjRw2UwEBzOowRtgB5c9dAe30ZBxuSXF/bSlJk9T/nz6gEUvaREBYjI9EZTxcNkpy+0ClG+dXzcqi0MPvA1+yi8aWpA84GcUJS2XOiLTtPymjiB2gu5BAF5DujaKJTWKWji0qWhQRyjjU8uj2TTvJEqZhpGsIw+gntNe2OoM4mTSxk3yvXgiWblksE9vw58VE0CIKC5g70D6w6boCWTp04pwfplI5yIBThWmBtVJ5h0N5A8KsCcDSZDRRsNNPYYo3ZIsDJr9NySPkl7GqeAQz7TINTwWxqgA4KmPYcL+clX73A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OJ+hFj+wB2UrTRLkTBYFcRNUhFnHauukaAsov7l2qwU=; b=Q/oRgxGCtWExhTY3uq8NBCHnUrlsVNFrkbEKBUxUD7GYpVE4hWnTm0h6dy922F4lW/m7gHRKdfeXqWzMDxBGHKlaI7AgpKgKMQFV0l85GgiKlGIyexAOonxZClAJXe9m6FPSLvE3eSk5CRSqLVlSgWYzTZHB3vHQPh4TJqvmLzw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) by PH7PR21MB3382.namprd21.prod.outlook.com (2603:10b6:510:1de::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.10; Thu, 15 Jun 2023 04:45:42 +0000 Received: from BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::e673:bfeb:d3c1:7682]) by BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::e673:bfeb:d3c1:7682%3]) with mapi id 15.20.6521.009; Thu, 15 Jun 2023 04:45:42 +0000 From: Dexuan Cui To: bhelgaas@google.com, davem@davemloft.net, decui@microsoft.com, edumazet@google.com, haiyangz@microsoft.com, jakeo@microsoft.com, kuba@kernel.org, kw@linux.com, kys@microsoft.com, leon@kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, mikelley@microsoft.com, pabeni@redhat.com, robh@kernel.org, saeedm@nvidia.com, wei.liu@kernel.org, longli@microsoft.com, boqun.feng@gmail.com, ssengar@microsoft.com, helgaas@kernel.org Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, josete@microsoft.com, simon.horman@corigine.com, stable@vger.kernel.org Subject: [PATCH v4 3/5] PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev Date: Wed, 14 Jun 2023 21:44:49 -0700 Message-Id: <20230615044451.5580-4-decui@microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230615044451.5580-1-decui@microsoft.com> References: <20230615044451.5580-1-decui@microsoft.com> X-ClientProxiedBy: CYZPR17CA0016.namprd17.prod.outlook.com (2603:10b6:930:8c::25) To BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR2101MB1092:EE_|PH7PR21MB3382:EE_ X-MS-Office365-Filtering-Correlation-Id: 34955f6d-e823-4685-a080-08db6d5b600b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m8pyY0EewRj8e3wtyiDfrbJhR770R7vkMOo8IPJ/DFgVoIflx8PWF/z6SqD5BsZhlxbRG/uPY7asTDtLIZdJA4ghDZydEM8Woq2lxTL5lk6mlXvXVeUQlgoZsKKcyjVhyAHPp4uXTvZ7LW65ATDrvuSRMW9bqFGiTlcru626bONd1CjE4MwgtYq4NlmfTVOVrD310iVJUK1eBN1CnCxpQ+XdvDCzBXIo/iIqsD4oPm676ZmDNAiyloSjZTXQEWyZ1l2OSQIIKhAESjZ7438xGehQYviPSjJsXBgA5nf6tgNpZOvZMxo9pnOJ1pDxsTqYu8JHYN13K3Y+upq4dFZJKSbMOcuGs5rmiXd98jherCmvBQsbWhdV4Y/m8qWWMrv8TsV3wVmNC1PCSSjugsk0oL84B/mfwkWKcPMwipfOe30jbiiYOZcOHM0UJX2GkGJJa1Xq7MMXwg5KyS2KDnnJege5RfAANxdW/czk0xd9PdhVax0o1OllQdg2x9UPjrXcdBv9nHJ1emCfnYYlZ+rNjFa0ibDVYqBAm8g8DksTvWsW6K/gl4WOjVtZktaSU9SwI6F2NrXPU1BqLsKc9Q7lnDQVj0G0GiMMetq1xlI4cvPByxqBOo/czgYqawL+t/hzJlaYXiawaN2VOUxdmzgYRw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR2101MB1092.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(366004)(136003)(396003)(451199021)(82950400001)(921005)(478600001)(82960400001)(8676002)(41300700001)(8936002)(10290500003)(66946007)(4326008)(66476007)(316002)(38100700002)(2616005)(66556008)(83380400001)(186003)(6486002)(52116002)(6506007)(5660300002)(6512007)(1076003)(86362001)(7416002)(2906002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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g25evdPuVMW8sh9AgIbbsS1i0bPy3mi/FR4bj9+mkC8NLSk6r9LtHtENxzG9w+PxvznV4+z3EdaLErZygVWKNl/91miTcGLub9Y1U2gnwNHyeWQzP03Dcp8lVqhRMZQen1cCkLe3k7WMUB3EzWH6OsxTHFh/myVQ58TwZCqwgnVPFubVHmhdR7c2MNQ+M04qt6RCrdtlMsrBFzXaU81SkFweUN2trgykGXEP4GBV7zCJLmvJWkLqDxe6fQPcO0qtBvqDfAjxfgtdl5NBuPMEMoeYkV6LhszmBruCO87q8OJWr7Ckb0PdqAol9NtIX2qN82Lrgm5gBcKEUoUw/efx7o93MACoXtmqsx05zCRlXd8GyFud1LbvRcnkE05WqDnzErf6cPTzoALtOWzpR0dO2a4DVT9KDyKT3KfrhcTb3dPymK/ANG08s6s0vQ8doiA6YwwaljCeOvpNsfkr1aZkKJPJY2t3S1VMNYVIOsAj1J6WH+tCq9aOEiCLsNByPL9Jr2caF3rmSF2v2Lq3762fm4pelxVF/WFjJ/iLM21VUMsDWZR0PCFi38azbvmxTGZHwHT3QF3PUy6E/mJV4ezazUa4dX5uBlBGGhR+g X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34955f6d-e823-4685-a080-08db6d5b600b X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1092.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2023 04:45:42.5075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CTRX6MXnBV/p1FtTD3T83mqkZYxmTo7xdXWVvYOEwESr6tMj8jSdysTl9hX/g99KtkEEczAKSB/G2yCH3JW+5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR21MB3382 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The hpdev->state is never really useful. The only use in hv_pci_eject_device() and hv_eject_device_work() is not really necessary. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley Acked-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org --- v2: No change to the patch body. Added Cc:stable v3: Added Michael's Reviewed-by. v3: Added Lorenzo's Acked-by. drivers/pci/controller/pci-hyperv.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 733637d967654..a826b41c949a1 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -545,19 +545,10 @@ struct hv_dr_state { struct hv_pcidev_description func[]; }; -enum hv_pcichild_state { - hv_pcichild_init = 0, - hv_pcichild_requirements, - hv_pcichild_resourced, - hv_pcichild_ejecting, - hv_pcichild_maximum -}; - struct hv_pci_dev { /* List protected by pci_rescan_remove_lock */ struct list_head list_entry; refcount_t refs; - enum hv_pcichild_state state; struct pci_slot *pci_slot; struct hv_pcidev_description desc; bool reported_missing; @@ -2843,8 +2834,6 @@ static void hv_eject_device_work(struct work_struct *work) hpdev = container_of(work, struct hv_pci_dev, wrk); hbus = hpdev->hbus; - WARN_ON(hpdev->state != hv_pcichild_ejecting); - /* * Ejection can come before or after the PCI bus has been set up, so * attempt to find it and tear down the bus state, if it exists. This @@ -2901,7 +2890,6 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev) return; } - hpdev->state = hv_pcichild_ejecting; get_pcichild(hpdev); INIT_WORK(&hpdev->wrk, hv_eject_device_work); queue_work(hbus->wq, &hpdev->wrk);