From patchwork Thu Apr 20 02:40:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 13217751 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 D978AC77B73 for ; Thu, 20 Apr 2023 02:41:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233370AbjDTClf (ORCPT ); Wed, 19 Apr 2023 22:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbjDTCl0 (ORCPT ); Wed, 19 Apr 2023 22:41:26 -0400 Received: from BN6PR00CU002.outbound.protection.outlook.com (mail-eastus2azon11021022.outbound.protection.outlook.com [52.101.57.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D20F9; Wed, 19 Apr 2023 19:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UHiHC33NZ8SCDytbIc2iOt1SPbdXOVV/raxFFfCGxFmaEG08MNV9T56BaQFpcIsMJIFfQkWy3gpHFGfagb4B+nMOROzT8EiENJ2+jxbuISi52F2elc4xrYBZLhQad2OIy/Ap0008JkFpy89v63x5Xv/p6KesdCw8hducj3RRbVbceohRlOG0Q2ZL2lWV8lbdSyVKDWVLUPOY0mNNWyjD1XgBtuJOySDJqjME8zQ5wHWIC3kLUL+UZo9gACI71Avke+lAeZg3A/gm8M4IL2a2SRNJ5J8FOIzCwULXzU/UjRF/Yw+Mk8F9NA7W3Shp80nzkysm8vF4vuHvtMBgRmRHjQ== 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=YOtyolTiZvROuvCdIoKLhmvPeieVpPdw+Netk63t3oY=; b=m3Ey96bCfnb7AuauFZYG9pBnKwrFXNik8lxBlY9t6oJdpY6W3iDhSMaQA7cMOZEPdJsuJ33VV6h3lPkdFy/+b3ObEzpU88Tb/FLosulftsjEjJeN5DxK9UesRsBai99z5/mehnbg5UFT0TZucWf6ywPtkNTlL7hKJEQLIqNNosQcmgGSsb9Qz82t3qYjpUufNyq5/ti7MinkB42xq18u82xt4u55gaOt5aRcXtXcnrz5aqV2xo1ySXVoZ1Yyr7TcVGdzz1Yx2ePAM8WHp2LTCLRKs4fz7vMnxn7blfUjBrleBSyxdFh5HVkuqBWsZL+szA8M7MLvLYqyN5MFzga4MQ== 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=YOtyolTiZvROuvCdIoKLhmvPeieVpPdw+Netk63t3oY=; b=I3KjXOVh/IvRg+D2UOAtaFT9zMoW1l6IM9mnDmNUMyTn/nEe81YVaOCldz7/g8uzeYbk1n1Crg0P29cU4/+99ZgNAN3Adl0dqmNbtVCHnxxXbyc5NNS1aJv7yic2XEP6zfyvA86sbUMqKYZ/dWjj2tcl5jXDmHQ5+/qHX8tvkF8= 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 SJ1PR21MB3411.namprd21.prod.outlook.com (2603:10b6:a03:451::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.7; Thu, 20 Apr 2023 02:41:18 +0000 Received: from BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::932e:24fe:fc1b:5d30]) by BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::932e:24fe:fc1b:5d30%5]) with mapi id 15.20.6340.009; Thu, 20 Apr 2023 02:41:18 +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, stable@vger.kernel.org Subject: [PATCH v3 3/6] PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev Date: Wed, 19 Apr 2023 19:40:34 -0700 Message-Id: <20230420024037.5921-4-decui@microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230420024037.5921-1-decui@microsoft.com> References: <20230420024037.5921-1-decui@microsoft.com> X-ClientProxiedBy: MW4P221CA0023.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::28) 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_|SJ1PR21MB3411:EE_ X-MS-Office365-Filtering-Correlation-Id: 91b09d1b-1ac5-463e-11dd-08db4148b7ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Eyr6mY8JQYRf5mx1rADNVbeoyggPjkDBhx5s9qTNkgiCjODNTCrgwEJA8fXt9jew8A5whM+zH2wrZhaVl0KtI0/smoq57msT2I5A/odx7vRsLOwKkDGAz/oGyXCMBRtu4vhsgsMP0qbl8W6+CZ0hAQO1bK0HQmnv7IngcjS5LzqP3aHCr0zLg/XZMiUBxSvuw27Ykycq9Pm46S41V05ajEXt9X1CH6D5RHC8lj3KcxvNjaOjeDhkbTGR+Use7lORdoRQ+a65Fao/ZLLkNGobfnBf6WFIhhWn6e9vG+ikPL6ZFNkDGXTok1CDmcxYd3t/FAxILpd3TKnsVLPXmlzNuk/r5y5yUp6CuT450ewMqvDjf74mMubvVqzmbUjOpFxD/cidvsayaYG6SsYbum+TKwBB5gOYAf1WDXtSVrYYQeddkHIIv3IrA3AWWcgWOWnuOtiDY3GcTqDIunkKReJNZlwTR/+Ew2P3bWgf0WI2oa3o6oLT+pbA9tAbjHU6yQzpLfwozX0fj816lSIYpMp7QsuHcEClki1jW4Osvr30Bg5GU8wW0pQxtxPHPKJ0GtA46vvOFM/XhsI9qKFMA2mHso/eqjGil7R0BQF+4AcB90JYi/X1GxEgikBPdj2kr//giP+KjdiDgRmmFr3UNzq3+w== 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)(376002)(366004)(39860400002)(346002)(396003)(136003)(451199021)(2616005)(83380400001)(36756003)(186003)(6486002)(6512007)(1076003)(6506007)(6666004)(52116002)(66946007)(66556008)(10290500003)(66476007)(478600001)(4326008)(316002)(41300700001)(82950400001)(82960400001)(921005)(786003)(8676002)(8936002)(38100700002)(5660300002)(7416002)(86362001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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Ty/013tCD/sJ/m2WMYnVgHwVPu856bI3/KBAC8m3m7SODUFnbElWCe94MsgnuADHLwBzcbyQ7OBJniOc2AikqKkM67K198+nRiN/j27A3ViQMEnsAwb8bYXA5baB0GjH3fMabIHrkXkEXuy03avl4HjzNgQG3EIUcADSqLkEVcMdRogYoLcuisOioViLSJiLQN+GejvNXw9vBvn1qTZplHzcOuqx5PYPswm/xhYYU64uR96xhCX8PMMN/0QILMkY947UfLKfKWIOak3XTrVdAxOVsFLjYpoya/LuWa47VOv3tOS0Bwef/imVKLGbrVbBkJamw+sAyVlyvF1nDRoHmVB6hIfBWrbbX7YOP/VY+aZRXCGb5M1JthRobIxUypjNIsgmMhzd2RPXdo/TsV+MHUNrom4VHWVxAACV3ce7nqoH5iVMIjZTh7QxqrWVsuChNn9TN/wJb5pqvDEFhlXChcyv+pvxnRLxxTZXGA0+15O4iIxCxTlGQQLKRJiV/bRsUula+/uyGxWz5xzUgnmN1F+0aRv8RMft0FVK9gX2w7d40DM+5w95aLh9HbvD1hRSIOSQlBgJK41A1+cMNEm8mC8BuwnRGidB X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91b09d1b-1ac5-463e-11dd-08db4148b7ab X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1092.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 02:41:17.9618 (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: SaNPadS+rcD5r+A7+LD3xJFeF5ThoGGWoNv7TE2tebY4WjJWqjNlZ4c5ybitKeFpgIar4L/wtAg7DvMiginEhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR21MB3411 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 Cc: stable@vger.kernel.org Acked-by: Lorenzo Pieralisi --- v2: No change to the patch body. Added Cc:stable v3: Added Michael's Reviewed-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 1b11cf7391933..46df6d093d683 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -553,19 +553,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; @@ -2750,8 +2741,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 @@ -2808,7 +2797,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);