From patchwork Wed Jun 12 08:56:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13694673 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90649C27C75 for ; Wed, 12 Jun 2024 08:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YDJBaR0MvxpWJM7RpvQfxxKhV9VilI1oTkBVJ55Kzj8=; b=QcG1DlBcaiq8K0dXsjoYNYKoJg WxzvUTaEARj2hOzshQCRqnihUAcqtj95XUGb9DnQhrDnWLU430dLCoMwwE6u15ZZhPugxTR/ybe5z EXvM/4KJYL/5wZ3o1cS2n0TV0biMg+I0eaKO1gFFXWUhDqsIy3AxoEfWlCYZYbiBXxzPDXasSnsjp HXaJrF84E7/zmMWmkgCn1H5JX1+QvC91Q59i/wxZ+ZmLTvRYup43WV/HwlfpiE/1Tmi2u/66DJkpF gt69HBFUe1pCTkuWtfEUKhDCglP8MGR0Y1nL1aBfEAPthoyQJVgrtCRgaiuhMfmF0zxQAChpm2vgQ hFs38aWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHJmf-0000000BpRA-45jW; Wed, 12 Jun 2024 08:56:46 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHJmd-0000000BpPD-0kBT for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2024 08:56:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718182604; x=1749718604; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=D3tQW505oweH4lJvd1rZezj/RbPf9yk74H/waktxya8=; b=NGJx8yQR2KizjExKAh+FXEjUv04JF7lc/meAolQRvksjfmJrhRF3y0Bw Ig7sC7KDv8OSkINC/WP64wbPol7w/07H5qrIWQd8J6n1jlp8k3xhbfzKP GI9DCWU/BbkgYRKnXbfxUcnzZG5YwPX4YgkcFmhgdkxs+WggeZx7oOKT2 6IoqzfZ2bHpvw8KFI/fj79rYKjBfwCI9jFQEmM1KGV407Ollc8UfZ+sfe PHBal1xK1j218KIQqnsKoScRTM3DW3wb+9DOl2yP7ZobkHCaY7y0twFjI gQyCUv7XrsQIqobQZRc6AY/HNxVxh4H+A6eMNnBW420gH2phsJRqlyc07 A==; X-CSE-ConnectionGUID: 5SeBfD+qSHygM5oEwQmaDA== X-CSE-MsgGUID: Lb2HsVhCTqywAU8Y03Csog== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="26050963" X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="26050963" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 01:56:41 -0700 X-CSE-ConnectionGUID: 1CKszvE4T1+JKuRRDRMoEQ== X-CSE-MsgGUID: NK+UoWlnT+qqIWPx6Ewk3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="62894100" Received: from unknown (HELO localhost) ([10.245.247.204]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 01:56:35 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: Jonathan Hunter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Robert Richter , Thierry Reding , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 0/3] PCI: Resource helper improvements Date: Wed, 12 Jun 2024 11:56:26 +0300 Message-Id: <20240612085629.5015-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_015643_329525_D637411A X-CRM114-Status: UNSURE ( 8.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series introduces resource_set_{range,size}() helpers to replace often repeated code fragments to set resource start and end addresses. The last patch cleans up nearby code to use pre-existing helpers & defines. For now, this series only converts PCI subsystem. There are plenty of resource start/end setting code elsewhere in the kernel but those can be converted once the helpers reach Linus' tree. Ilpo Järvinen (3): resource: Add resource set range and size helpers PCI: Use resource_set_{range,size}() helpers PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M() drivers/pci/controller/pci-tegra.c | 2 +- drivers/pci/controller/pci-thunder-pem.c | 4 +-- drivers/pci/ecam.c | 2 +- drivers/pci/iov.c | 6 ++-- drivers/pci/pci.c | 3 +- drivers/pci/quirks.c | 23 +++++++--------- drivers/pci/setup-bus.c | 35 ++++++++++-------------- drivers/pci/setup-res.c | 7 ++--- include/linux/ioport.h | 32 ++++++++++++++++++++++ 9 files changed, 68 insertions(+), 46 deletions(-)