From patchwork Wed Nov 23 06:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Chen X-Patchwork-Id: 13053135 X-Patchwork-Delegate: bhelgaas@google.com 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 4A4DFC433FE for ; Wed, 23 Nov 2022 06:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236087AbiKWGpb (ORCPT ); Wed, 23 Nov 2022 01:45:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236103AbiKWGpa (ORCPT ); Wed, 23 Nov 2022 01:45:30 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2080.outbound.protection.outlook.com [40.107.255.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D75EBF60B5; Tue, 22 Nov 2022 22:45:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZnfWLjX0abhW4yetRWTXtXktUrASVkbYKpm0igmobUD/hofD/dLjp6uogsGpPGCcF6MXxk6L2CXzBI3CnzK6qwkokdHvXXnJuLwe3MvXOQxKteI/z3rosuqWB21EVCofxR+DwT5qaLGO0lspLiJB0ZPbSvyZsrbXmgN8dnEI6BqYQKNhi6Tz0XZ0HBvF6cMKlhE/FPKmbKDsFGoISHAuKELnkDWYbK4Etlz9kBNbOxOvHV404OKu1ksDJXhqOW+4QXhT/rHVnmBvAZMdMOC1OSVXBgROmJokGYJgPbzHfTLvIQlSpI6FAU24AkrmQuV80QqCXTjgLPIu+hcA1BbTkg== 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=P2arYZU2ZHRES2ZqQw8TmGnHItgfYQYqrc6T/YUHHkY=; b=JOYxy5YuxAK5WjFs1C5nFFhLZozeZq/DY1YDf5hhxY5sgNGATKWbzk7vGy2uBKDvxPZ4ivGtQD41VeoFMlP/tEOU/lCrPZUuichKkPiG0dDcLsgkKON3EYN3dqfKx4Y2L8efAtRUJRtOICc0Yz23FTz34Vn81F9TF7JacXJ7t5SQPg0OQ0e6BjknMTLgwSxguqah2W5qO/FTd65Db3J3913ZH5CiA2KUNumdEDsUmvU87Z0sdLVYjsxco4OYm5DTYfclec9TjU+q7+KNILnOXKko4/LFijDpzWPWnPb8AnTFcwoggJ2McRg9XMpE1+a1QGYPWm/jsAgnps0ByhzKUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P2arYZU2ZHRES2ZqQw8TmGnHItgfYQYqrc6T/YUHHkY=; b=P/U79OnhrTC3uNbeI9Wp3z3pvNumxKtvsII7c4szu5k8x+zsRXJI9jYDtUeHZJs4sSAo1yO/tOk8+UYbKIQhnZQiZTZ3XzMp4n6HEYIpCjAnyUFM9lwvyhXDdThjT73/cNnsrXRDtTr4ck9jlbxLrcQuHCCM2sIIVfIrvZBLVpfN/UAML3ETH4XEVdFI0AW1d/Ek41pyzzq6D6my/q5yC4J2eIVx6n61WAC37O1HplN8URwqat9+iFieTexXfvSHXN0nLbLwOQup66pf1ApUHIgDEOrIgtFB4fet4DquOxTO2k2Dcyv6G9gf9LFj15T7jt+bu2WNSY1iCHwIQGE90g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from TY2PR06MB3424.apcprd06.prod.outlook.com (2603:1096:404:104::19) by PSAPR06MB3942.apcprd06.prod.outlook.com (2603:1096:301:2b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Wed, 23 Nov 2022 06:45:23 +0000 Received: from TY2PR06MB3424.apcprd06.prod.outlook.com ([fe80::3fde:75ae:e50a:7b24]) by TY2PR06MB3424.apcprd06.prod.outlook.com ([fe80::3fde:75ae:e50a:7b24%7]) with mapi id 15.20.5834.015; Wed, 23 Nov 2022 06:45:23 +0000 From: Angus Chen To: bhelgaas@google.com, sr@denx.de, pali@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Angus Chen Subject: [PATCH] PCI/portdrv: Use ENOSPC instead of EIO Date: Wed, 23 Nov 2022 14:45:02 +0800 Message-Id: <20221123064502.2061-1-angus.chen@jaguarmicro.com> X-Mailer: git-send-email 2.33.0.windows.1 X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To TY2PR06MB3424.apcprd06.prod.outlook.com (2603:1096:404:104::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR06MB3424:EE_|PSAPR06MB3942:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b10cc71-74d8-4aee-c31a-08dacd1e4c11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9TdWoH5TqBJhBc1QoflIe69HrZdykh1XMFyBp7w5N2GITfR+hq0Gqt4cnpUDTb0qHL/YfbHMSeFntEV6pWclYTthI5qo2yJ9R2akQeSoHld23VHV+6Dt3fF5+oeSa5nEgo2ZQ74ObeLRZ/ZwWdUsvWf4cLirz/yfmjeVB1ZUDcrFxv35ddNkk00mBQ0uipCL7B5o1xEgRW7Fii+gKS3GQy4J7gOIpPMJY/ZNSPCg6tphC7zxZ7m4qTZ+FY4cnIBT30X8LWIHc/UDCK5+720vXyxuMXmqt1HMfK+Sp3mF4tv6NWAYSecpiEqhSiQLR5tirdgArxngCh2DdFBQ3YkNljiN14cEgHIXpwOi+KQn0DoirCoJyBTpGd84T+fRWyCmsSDaMaFEjZRb09XN60JX6znBIYZXanhFn2BrmgUGH4oP7nvZZgZV4r8yM4Sy4+WcjeX+9vQUPuyZIwg+bermWFgwGahpqxk0X38EzRIqa7iNBbH1lNDF+FWNucpGIQ8IiugqkC2urrhyNmlfUKB1QUuyvCg/gSaKkzc6Fah8qcC3KSxkFkQhqoqCjbd3zcTw/1gmkoR9nVtwrczRtDm1J+9fXMFWd+ZJZF2LnFwmwDsHI38w/96v/ycyEcCmf84fu9ZYT/VafWgdEX6rNcNMZalsuWNw0lKrzfuimcDYhhlyfZT1iWTdEaXF3Hxnppx/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY2PR06MB3424.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(346002)(366004)(39830400003)(396003)(136003)(451199015)(36756003)(86362001)(52116002)(4744005)(44832011)(26005)(5660300002)(2906002)(186003)(83380400001)(2616005)(6512007)(1076003)(38350700002)(38100700002)(6486002)(66556008)(66476007)(6506007)(107886003)(4326008)(478600001)(41300700001)(8936002)(8676002)(66946007)(6666004)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AfrlefG34CPsdEVAcD6S+Lh44LsXUP+9Uz42T93gax1bsSEgnN98rXIcm/0Jey1i8lXmB5MOrijojQbLssCRbzAeP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8foBPWpa/t003QtbmCmVkxoQgszfYWvmrYh9xXmaL9AF0bj9pdXMLEP+YAaF8LoYG7YIX/yZqJ2x0+6boboMKyCVIp4UzDzms8K0ORaUr+3Ixrwjk0cao8J32ccbHHDCLGFNelDftpVm0D9bIWMCUjItcId+BzeJFmQuTkbQe6dd49y5nwdkboVBibv0kS6MQOe9TiWDkLMBZQXavvmoYdcCmahpUuKs48a4nOBB7iRoI3s1WlxhTcubPRF//0YD6t4I8SWjJ1BbnOdOOpV71+ZCX5kZGtRi++NqXTJdRjYnBkxJn2BRsKM3EWFKhj4t4uWSxqOYBQLwp8PlQNXvY44Kh+ccWiTXUXtQQfx7JCoZVewg10IZbxNaCgKVCmI3Qm8WRbpuuBhmg8l8MFPVxDx1UMFFOKbxxOqTdQt1e4sncLbRQCCE7Fes/AKxrmkIU13Vt5XkJ9Og== X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b10cc71-74d8-4aee-c31a-08dacd1e4c11 X-MS-Exchange-CrossTenant-AuthSource: TY2PR06MB3424.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2022 06:45:23.7635 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XkqU4DP2e+bEiV067qppRaZGDr+lgIuNmMi/NyEQtFnbGNCdFpa9VABlogHevLxocuiNc3zXT3U7zxJQDCrKyaUxwbJBHiGTzXX52p11Xfs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB3942 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org If pcie_message_numbers can't provide the vector cap which pme&aer&dpc requested,it should be return ENOSPC for better. No functional change intended. Signed-off-by: Angus Chen --- drivers/pci/pcie/portdrv_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 1ac7fec47d6f..473a70210313 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -113,7 +113,7 @@ static int pcie_port_enable_irq_vec(struct pci_dev *dev, int *irqs, int mask) nvec = pcie_message_numbers(dev, mask, &pme, &aer, &dpc); if (nvec > nr_entries) { pci_free_irq_vectors(dev); - return -EIO; + return -ENOSPC; } /*