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: 9938035 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 45835600CB for ; Tue, 5 Sep 2017 07:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A3528420 for ; Tue, 5 Sep 2017 07:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D7BC288B6; Tue, 5 Sep 2017 07:21:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF14C28420 for ; Tue, 5 Sep 2017 07:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbdIEHVE (ORCPT ); Tue, 5 Sep 2017 03:21:04 -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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }