From patchwork Fri Jun 14 10:06:05 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: 13698622 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 AD261C27C6E for ; Fri, 14 Jun 2024 11:19:16 +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=00mwssbD/P34++93PWIsbvOlunMjR8dDyJ+15QWy5kE=; b=xkMNBKnXi7XiT7X1fnK9vBB9wM Nn9CLpzD+X63jO33QJ1l9nSdzdgXKWS4Kc1Z2UIdWFpTTu8LKP5n15aaBZ5PaGn7b63gRHCTQ6T9D XTjaxphI1wK9INRFFp5rAF+auiYfINKnveq3C3Z04JoGGzLpwyO0WUCFVj9hgsxBXfCeGXcqHvHIM Ic4i2P4mA0QfpiCxw/sqg/4f1VxBn4bX0b6wdfF6eVga4tYLpfDD4m/OlHhMDh7dqfGmiVgA+bSas 6apTMo0gVCApo7hTVJqcBw9jh4AIsF/fwjj5BtHMtOln+a3Fv0B/GqcmJ6a8D59jq+/BX/XqvvLYU XjmcYvCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sI4xV-00000002Zf2-1qKV; Fri, 14 Jun 2024 11:19:05 +0000 Received: from mgamail.intel.com ([198.175.65.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sI3pd-00000002LTf-1K3R for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2024 10:06:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718359614; x=1749895614; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2ybDsU0ZTyNiNs9381IROwZv24wezPthu0zRlBzvDnE=; b=aV95hTbTGCttYEqRC/piSXi1Lzgga5I1KOZV59pfy9dZeq0RMnxTlLOm fj1lf2qLXkqGsDYWz+CDTAhfb8iZerZltnFaVL9vDtTJwkJ7tQtB1bGYz QkptSK3ZUHLXwp7nv2nwwIQf9SxNzqsK5anVPJAhcqpSrpTomxD/BwQ77 wDvnMW4f7CHZ1lQ4tA/EaYhc3nz7B3ILEJVNA4O0JPC4ajZ64j+FCaLrK McoG5TDJYqlSHTpZYoCxHQYKo3IdzT7TV54ycIiRMEWI6wrq9RJCfXtGT S69tfHc0X2xx9nVSP/8oBbCl44xoUQU8fKqZP/eDiOWyvmSWdtoXcqbYa g==; X-CSE-ConnectionGUID: OWL/d+mcQ4KCpB+5piTpBw== X-CSE-MsgGUID: LZ6KCUE1S0udfkJlwHqnAA== X-IronPort-AV: E=McAfee;i="6700,10204,11102"; a="15388982" X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="15388982" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 03:06:53 -0700 X-CSE-ConnectionGUID: B6kYxiMFR7yEN15B3j9W5A== X-CSE-MsgGUID: 7LZkjDPCTWqeBrOOEejDcg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="77933746" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.222]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 03:06:48 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Jonathan Cameron , Philipp Stanner , 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 v2 3/4] PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M() Date: Fri, 14 Jun 2024 13:06:05 +0300 Message-Id: <20240614100606.15830-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240614100606.15830-1-ilpo.jarvinen@linux.intel.com> References: <20240614100606.15830-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-20240614_030653_442933_F3CF5835 X-CRM114-Status: GOOD ( 10.94 ) 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); }