From patchwork Tue Sep 5 07:19:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 111628 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp5120386ybm; Tue, 5 Sep 2017 00:21:10 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4sV1LR0gFA8n007PY4fTOeaIbyTow1dH4yCRI8htfIdNBxN/mYDcWlDxIGu6vF945WXyef X-Received: by 10.98.196.206 with SMTP id h75mr2815783pfk.55.1504596070758; Tue, 05 Sep 2017 00:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504596070; cv=none; d=google.com; s=arc-20160816; b=fAZl1qJdD5RDGawc0zHBKrE2frSZbkkm103v22vlwgt5sMWfbJezDUQP91cHjoUHNK 1Fj349FFLnB5rUBkI/+233MWEbWb50uwJ7siE4KLpVUv8P+mmaC5Q5W9XQdu88AKPgkp v/Wy79y/f4X9i8Q2d9zXOy7jloAwyEq07AOPkKEqCMQSFAmYdvSqxUqZI9Y5g+VNdGU0 aO/SJXweV4bPvLO3czZhtdlOT0u7ZT6w2D0hHcsL9xjeUVZe+4zyitLw8Mj2ooor5/LR a0n8lStvw5AutJAjz+nhGHJDH+VZnzF17MzKbdomk+vJL13EJGWOznxLWaJRzYkPdV4X cvoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1uVXPlgsRY2nJJhtOBPVoYOnbQ/MEXuRLUdksWUPHl0=; b=VWJWdcgZPR/Fzqx6sVASfRKynJvm8iDbsCTfhfIe2dofUb8PLTPL2QIjX4W31qSrPb e9fmJH3M0yIAXm35FF8FZINd6ervgCIAoJ43hAETYRelQ1mXrkLFdHMh6fwbz8r7g6cr FabXAychwo/q4z2V43aDXnc6OsqvyvCHM6HXuXpxHP3xOHVQJOMF98wCfDP/uhZ+xtIO XpEG3UFiNuejF2lB+1QsmCGb+aduParUKFpHfzGVhAmvTk/0w8ZyOu54DiBAZkg1Dus6 4oZ78DR10GO/iXy3HLCgtSNh4RvV3SzgmzNglKqUuMprPyaPyQN0wiBo2pjsLVy8TeCU QsKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si46936pgc.128.2017.09.05.00.21.10; Tue, 05 Sep 2017 00:21:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752233AbdIEHVF (ORCPT + 26 others); Tue, 5 Sep 2017 03:21:05 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:49793 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbdIEHU7 (ORCPT ); Tue, 5 Sep 2017 03:20:59 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MMnK3-1dpxEU3eIx-008XyS; Tue, 05 Sep 2017 09:20:26 +0200 From: Arnd Bergmann To: Bjorn Helgaas Cc: Arnd Bergmann , Ray Jui , Scott Branden , Jon Mason , bcm-kernel-feedback-list@broadcom.com, Oza Pawandeep , Lorenzo Pieralisi , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] PCI: iproc: fix Stingray CRS defect handling Date: Tue, 5 Sep 2017 09:19:45 +0200 Message-Id: <20170905072004.3959082-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170905072004.3959082-1-arnd@arndb.de> References: <20170905072004.3959082-1-arnd@arndb.de> X-Provags-ID: V03:K0:zGuc58DaM0+i44U9+dkIo41sMp9w09Ky0WMpJqy3ODz+4vJjdQf 1XbTOFQfk5TMSmqGpHetO9v3qJJobyKPnHq9HbXQFNJ62AP8R8jCdaqZ5SCrv9V0MGp7FQ8 PCmr6ZWtRb/HgM61EOxszlIRLdI/6u2a+b+CetD9MPfSq70EA281Acpw4qPU4h35CGmXeXn qWEbBmA/vrFuJuja4ohGw== X-UI-Out-Filterresults: notjunk:1; V01:K0:6OJuOIHgeAU=:xC3VRt+GdAopps/52wjtF2 c5MEUOjeWg7OOxWZF7dI4ol4TuSM/ZcraG4E0ucqOP2+0OahiqbEsgm6lYU45VPTqxfya9X3K SdYbPRZ2dxRujoFI2MSEqwuXf6azCOcWW/H0yWJJjvd+B+BJIpyKfLbKN2hMjp9JfQjxEe8HQ VRtGzF3btyJxkeIzNcDKTVPdh+Ei7mnIAMQk0O3unTKHiPadPcSIAs0HKB8Kd921Y2W2m+fh/ r+YM7joz6fdcfb79n1jSKvefzbX4v1pO+bYgLlIiN6z0/7+BC3Ngei9JSX5mXiM4zwPaI83DC rwXlZ8pnDD9M9HvJT2JX93XaBh5eKyGYyQ+Yhb9eUcVnj8o8USOSSKpl3KdgVJHLyU3M0XM8i bTYKmo/lY7w5kcOATScrPmKISEkIc072uIVBVVvLtgJdV3QKtliZp9KunJZ05AU8JfQwF5JX9 FaMZtt9CEnL4yDF2H9IZVJNInakP74MMdqYwt7V+86+nN0YvC6bfMagoZq31ah39M2Mgscl3B VK8bscWLb9AULjkgU2ep3XRnvYnNlwEtqTwjBtrLzjH8tCBbWChNqqP9ZYgJHeboIppOw7cLv pJu/DCRM6dNgey/MDU3lslzrbjV+/qb2QG0KnMzBrLoeXfSyHStkKRDJgUJYc3+mD/ZxUowp6 LoaSH6OiEL+5UuOPBBr/vXEPnZziAs2Q8dXJLScd2MaYOruZ0qxu49POZp9r5S7iPUxU8f7TH x7Fd32o42ZP8LF9jqG5tNibMfkdjF6L8sLEwzA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The condition that was used to detect the PCI_EXP_RTCAP flag access is wrong, as pointed out by gcc-8: drivers/pci/host/pcie-iproc.c: In function 'iproc_pcie_config_read': drivers/pci/host/pcie-iproc.c:531:22: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((where & ~0x3) == PCI_EXP_CAP + PCI_EXP_RTCAP) This adds the same bit mask to the other end as well, so the condition is evaluated correctly for any access. Fixes: ac8d3e852f75 ("PCI: iproc: Work around Stingray CRS defects") Signed-off-by: Arnd Bergmann --- drivers/pci/host/pcie-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index d7f4c29aed96..f2df9c2266b9 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -528,7 +528,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn, return ret; /* Don't advertise CRS SV support */ - if ((where & ~0x3) == PCI_EXP_CAP + PCI_EXP_RTCAP) + if ((where & ~0x3) == ((PCI_EXP_CAP + PCI_EXP_RTCAP) & ~0x03)) *val &= ~(PCI_EXP_RTCAP_CRSVIS << 16); return PCIBIOS_SUCCESSFUL; }