From patchwork Wed Jun 12 08:56:29 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: 13694676 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 C04F5C27C53 for ; Wed, 12 Jun 2024 08:57:39 +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:References:In-Reply-To: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:List-Owner; bh=dYUoaOkxIPha81vU/WikAMTAQLmcfOeWAAG6fo5oQ0I=; b=xOojDRptYV+P4a+YeJxNMLzcn5 VX15d3xQMjJKggKE20+Sx2dQYFlhDOOkQi0ZXBRvLGw5lsqB/QaX9QKb/q3jB1sGUczKNB8bUWrAW UiblKWoJEWNCSZKXjASX3QQKL49qTA9DzJHdppIQrNbKW/wOgPB98qkkQNBfPYLjiIUCz5QLZLKPd +QFtb7KzGHCYbl5Yj2RPheQyvoe8qb2NVNn1KpzrO2linDS3J6fHeVvNaBzYF9R6eLF7Mal/oGgQq aENJXJMH2Qy8MLcbzkm/a/pJVYVuu/UAn/QFV1hxmkg83FDAFX4oEVRib//W4Wo4Ej/VcaERu+1yL T7Kqia3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHJnO-0000000Bpmr-1q0z; Wed, 12 Jun 2024 08:57:30 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHJnM-0000000Bpja-1Ek2 for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2024 08:57:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718182648; x=1749718648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rSWAv76CS9DrIAWgkBXjqcWjEwCJ0bzwSYtZQcOfclA=; b=RGvDZY9Q91QtwHhbe7JYK7AIl4J/EoQlswJZ0/gx3W0hWgi5qlUrl/V/ JhDbMVfrhiDwPv5KuGWyABi6Z4qAa7Pcn2SCDpp2D4RWO3yCIbuJxBc8o 77kx+7yzfe981kO0yIY0KVWnzqO8Mk6NQmZcgb288MhHalJypMAXvdrWS uCgccEMMh0SwPCNHejRf4KtDqCznTwEjM4WsnZvJiJiCAIkX3QxyfQLl4 6G2w4moQ39EyFrLiStYrJzaQm3K4fv9Fkw0sNKYicrW4UF6HFM6qSQBwD dyBCC9jt58R3SHTRvMOoAdFCR5Yd0KgkJ3zTWlyQJABk8nHMAiZpqZ3h7 w==; X-CSE-ConnectionGUID: ZOWe7MITTBCyDIeB0wij7w== X-CSE-MsgGUID: 0heFnEt8Sl6q2NdFdoNo0g== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="18792156" X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="18792156" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 01:57:28 -0700 X-CSE-ConnectionGUID: 4zlu8W8fQYeg647hM6IZDw== X-CSE-MsgGUID: hUjTRGRTQfiyGkT8Z6hV4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,232,1712646000"; d="scan'208";a="39582944" Received: from unknown (HELO localhost) ([10.245.247.204]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 01:57:23 -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?= , linux-kernel@vger.kernel.org Cc: Jonathan Hunter , linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Robert Richter , Thierry Reding , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 3/3] PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M() Date: Wed, 12 Jun 2024 11:56:29 +0300 Message-Id: <20240612085629.5015-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240612085629.5015-1-ilpo.jarvinen@linux.intel.com> References: <20240612085629.5015-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_015728_378465_68BB125B X-CRM114-Status: GOOD ( 11.08 ) 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 Use IS_ALIGNED(), resource_size(), and SZ_* defines in quirk_s3_64M(). Signed-off-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron --- drivers/pci/quirks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index bde0f5388d06..125fc1cbad95 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -12,6 +12,7 @@ * file, where their drivers can use them. */ +#include #include #include #include @@ -591,7 +592,7 @@ static void quirk_s3_64M(struct pci_dev *dev) { struct resource *r = &dev->resource[0]; - if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) { + if (!IS_ALIGNED(r->start, SZ_64M) || resource_size(r) != SZ_64M) { r->flags |= IORESOURCE_UNSET; resource_set_range(r, 0, SZ_64M); }