From patchwork Wed Dec 15 14:16:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 12678407 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 E15B2C433F5 for ; Wed, 15 Dec 2021 14:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243274AbhLOORJ (ORCPT ); Wed, 15 Dec 2021 09:17:09 -0500 Received: from mga01.intel.com ([192.55.52.88]:61506 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243270AbhLOORD (ORCPT ); Wed, 15 Dec 2021 09:17:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639577823; x=1671113823; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=WbKGQwzNFtHUjDhP3/EZTCvTtjBwzUn8wYIkln3iTjs=; b=OUwUCRGRokEaQqc2D3Mj3M6QOseSGiKc1ZlIL9EZY5IJ64j4Uu9POBjc 2Ky2AmG0iPvYFJWhEIFUInUQstVp2nFwgfcMK0oCuOFB/K8bCB0mgn9ji UaTc2tp7jPAhsQ2H+hOmBcBy1RgYwUHNCPEFjcAlGjchgtqGz2nlSEXCU s9fLlusoGeZEjWK1DP2U74TM9ThEca2QGTKK5415HdIxImmVf1LCA76Vl /ROLL430QJMXnlBVNprK55WHtwjKjf/nnwXP34LAZ72ntuEJ8ISXu+Ccz FGfRyQYqhx/HgyJcaMh37jK/5BzCg0fsouqmAuS2Agr3pqGsfmX6UPRuu w==; X-IronPort-AV: E=McAfee;i="6200,9189,10198"; a="263385685" X-IronPort-AV: E=Sophos;i="5.88,207,1635231600"; d="scan'208";a="263385685" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 06:17:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,207,1635231600"; d="scan'208";a="755378755" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga005.fm.intel.com with ESMTP; 15 Dec 2021 06:17:03 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 15 Dec 2021 06:17:03 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 15 Dec 2021 06:17:03 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 15 Dec 2021 06:17:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dw9nf5f0hUYKGcLW1hagJJdJX2jZAJ/LLJZfjvE0w0et5cxIAczvbTP2wVdJ8B//LkJbJubpEBgtT4EJWkQhO8qwgERKvPCYXnZjoVg0n+7LTE1G2NrLiAzKevlwiPOPUdp71nexlv6XIHjGX9GYi1fK6gXP0mN72ZMG0hbmePgF6P4HHn0YRaarb231gNwNPMKRLyY9ulq5yGUg55GNGaM80utzZn8citFVjAivReivzeP0psVq3jmWCRqE9Zmt8onBKdgptRn4tLsqFZC9KLC6Jz/m3qzAh002Gnuy506tY0yyH0yvrZUED6Y2tj3XhdvGvpeAt6pA5I55pSPDgw== 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=QVlrTDWM4h97SXpRYcoAm1AWlO/yIzV1Qu2W4wzILsk=; b=TSym8PcqPiNLvfLFNsKHlQLrvwYuDgrmYmgusXxf+Sj7fxFmcPv7MnwZzM4YhBmc5DZy69+GK2+2iRhQ3jEQsFiioZS3g3qDtuYklaJty6kb08EAzXH2ohtq6oWs8DTPhqNaTOceFOodwO6XfTtiMxTYDApxnlrBiAfKygWHRxUQVutFcyltEUYTFE5vMSwk2L7daK0ZDOPat2LUQoqSB0NrwKrG8zifJdIa4G8/VKtOO6wG4JMLvd9suT/QHNbh3Mo5dxqdJhzghRM6eGLm0VM5WUA4WHsygqiKFSIQp/UGLs8Zk0MhyU87h3kGLqgPx4f7c5+H5ll+UOMiJpNIsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by DM6PR11MB4740.namprd11.prod.outlook.com (2603:10b6:5:2ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.15; Wed, 15 Dec 2021 14:17:01 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::54fb:8c9f:670:3658]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::54fb:8c9f:670:3658%4]) with mapi id 15.20.4801.014; Wed, 15 Dec 2021 14:17:01 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Bjorn Helgaas CC: =?utf-8?q?Christian_K=C3=B6nig?= , "Ard Biesheuvel" , "Michael J . Ruhl" , Rodrigo Vivi , =?utf-8?q?Micha=C5=82_Winiarski?= Subject: [PATCH 2/2] PCI: Don't fail BAR resize if nothing is reassigned Date: Wed, 15 Dec 2021 15:16:26 +0100 Message-ID: <20211215141626.3090807-3-michal.winiarski@intel.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211215141626.3090807-1-michal.winiarski@intel.com> References: <20211215141626.3090807-1-michal.winiarski@intel.com> X-ClientProxiedBy: AS9PR06CA0257.eurprd06.prod.outlook.com (2603:10a6:20b:45f::11) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec133b13-6eea-4dbe-0a76-08d9bfd58fda X-MS-TrafficTypeDiagnostic: DM6PR11MB4740:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wgPRr5FZ+J8fmdUhUzeRW6Q88jm33nFpw4gDBbwpPwQlO4TSETwme4xUJOnhLxT1SC6ATdzIHHi95OV39LUePM8G48ySLaRUU1ilkJIeh6CnyubI14HgfZi/kUSzgMA1pT5gaXrzHUzm6hIMzLAdsZw+dnZ4gQDgkaW6SWsz/stzkG4OTozxmTnhFVfbEdEQDhKP0nyZF7GqX00D+aq10lr1BTHNNem0FFCQL9oQFIa3+21trBCP48aT17AcoeGMi4Gmyf8TRfDnuGi8+usd3GsbF0H/0p5ty8pGPralm08JD7Px2aHY2Z6jj4SjLH6vYy2XYX8yetBjJSun+maD1xJKseiKx7bKOq8+I6aV1Fx5Ok60WHm1S95elxVuVg68SSPK0GfRFoI9YhUnoul/pEWNuR6Xs0BTIIFlVnlpY9MjLhBFrLQSzXGrhfeQ1f4q/m3lUdOjnysmmBApAh/ykvGZPlRV1dU/jcYRqo5rOkqMO8oHfz8fCx80iVTnyiqxpazCwOekiAh3bhr8isXmOBLt7sVLJYcaMfdXjUT+t+sOT9qhIx8PalOMOlJ8MZRCXf2FJtGDSlX/huII/s+lkxloTv5quKgE8Dvcx57h2dStfvm9UVibYV26ClqssLNhXunFtwA/DqVGSETve92l6A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5373.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(38100700002)(508600001)(6666004)(83380400001)(107886003)(54906003)(2906002)(8936002)(4326008)(5660300002)(6512007)(26005)(66476007)(82960400001)(6506007)(316002)(6486002)(6916009)(36756003)(66556008)(86362001)(66946007)(4744005)(8676002)(1076003)(186003)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?dfh6a4TeCMzHV/YJ+mN3bLs6s45Q?= =?utf-8?q?f2Nv0GB8L2WJrduSX+VWrvy9EcaJ0DmbIW05GC8HHI4OAsAOMpimH6ds45srMkjHz?= =?utf-8?q?RavATL+6XJ4audy4SgGqv8q8/0iPbH+4FttSHov8lyYhpSnLtCHGO9y0CMpL8kAaE?= =?utf-8?q?ryqer27ng/k2UylapvEKDI7ChMyb6h92SUT5eihLZ/0ETiGiW021cufLjP5Vl0kkL?= =?utf-8?q?Xua3KGLkU8wGcEMbLcIjNKA5jd2oFqRPJpLektyL1wW6wRkrxUXirwJ14so86mjgk?= =?utf-8?q?0yXQvrh7s1v7vpckAC12q/lmoUVpI9yH2gup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OVQWaCdCOdbe6FkRnpWKcQv?= =?utf-8?q?cyXZAdJ3cs/S7iXZmDZnX1RHw8oSEbRy8yD/NdAXlwAfn6c1lJ8r1UcclO/0J0Gqd?= =?utf-8?q?5avRAN/0qY5SkAPy6QNTwpVbdyDiFoTpElzI2cGlsTwHtuIwk81clcihUqBxoCMR6?= =?utf-8?q?yvzRAGIdlFhRSYD8pRfwDdjemEi6NUj8FEINPpT3Fsp6mojtsVbHHJJYsLAv4Y+jT?= =?utf-8?q?r0IOXtbN1goT1rlllvoBMSDPiwlS8chY/H82xOFvCSkDkSk2Du6g0OxtaUuBKBVFU?= =?utf-8?q?mlxjsLAkwimx1mH9mUBisF8LgGl/e2EnngzcOFEHqCuDvTKhjcKU2Bq0gDrsduUoU?= =?utf-8?q?hFP2frBM2elrdMBingVZLKAmG0jz8Ly/9Z6vgoJMahP0yh09toPOINjq+ausCt7/e?= =?utf-8?q?LKF2n2EmvbVl/PQUW9ORe+svB6twICP+w=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ec133b13-6eea-4dbe-0a76-08d9bfd58fda X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 14:17:01.2787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: InFRK2bTR8lGCkfDtZFX9YzgFnI/v/CfyqzmAtqDmGvqKlGKairqK9I2+p8rqfOcgW1dbFONQrfSkG7Pv7VFNRDoM8nWUy8HAwhAd7dy0sw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4740 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When pci_reassign_bridge_resources returns -ENOENT, it means that no resources needed to be "moved". This can happen when the resource was resized to be smaller, and it's completely fine - there's no need to treat this as an error and go back to the original BAR size. Signed-off-by: MichaƂ Winiarski --- drivers/pci/setup-res.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1946e52e7678a..5de5129055e0a 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -484,7 +484,7 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size) /* Check if the new config works by trying to assign everything. */ if (dev->bus->self) { ret = pci_reassign_bridge_resources(dev->bus->self, res->flags); - if (ret) + if (ret && ret != -ENOENT) goto error_resize; } return 0;