From patchwork Mon Jan 7 13:45:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 10750587 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-2.web.codeaurora.org (Postfix) with ESMTP id D377513B4 for ; Mon, 7 Jan 2019 13:45:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0EF428A7A for ; Mon, 7 Jan 2019 13:45:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B344728A7E; Mon, 7 Jan 2019 13:45:58 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 F031928A7A for ; Mon, 7 Jan 2019 13:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728378AbfAGNp5 (ORCPT ); Mon, 7 Jan 2019 08:45:57 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:36058 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728364AbfAGNp5 (ORCPT ); Mon, 7 Jan 2019 08:45:57 -0500 Received: by mail-ed1-f67.google.com with SMTP id f23so930850edb.3 for ; Mon, 07 Jan 2019 05:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b2DAOrsaqCpd7/c8SqsFrjOiq3UmHX0O+L9w4u3BsTM=; b=jenRUwhyHvUWELIvIH+8BYorQ0IClHpOHqijBtjNPwjd5zYHPLoxKBuyGMbWIXUuA+ YDH+9xih6RaHmuPbHGYPQDqXvJLbCyo+Jruc8QGAW11FfjEcwfPeC28bhCgKDuQZtDuD lAnQwB1DcB4fs5ts/UB9RXYYQnb3liquKTJj4NTQOXVJChg8T4Cgk5GdUzKxwZmSRz4G 8UzjOQ4exCXjo/bcCvK4rNAetCfLx/xDE1e5ldO69DqU0iJDCm3oj5LQT0DXkeGRcnvB Cc+SVqXwcLgkPq5gJKq2pbF1gcPb5eOwS+TyQScfS12yOuhzgMNSwXRawygQO/Ktq45w o4VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b2DAOrsaqCpd7/c8SqsFrjOiq3UmHX0O+L9w4u3BsTM=; b=fz7CFt2k1pao2z9OvCvSYDx2Tfp+T1amXrTgqEh9+WBl7UT5R9Njs0XKgRMbLamCee ZEZmT28kADQtdkeXnShARPp4R4ZJO7CQXSFP2bRN8oQergMfxfHSIEccJeChUhCbBYnK JsbPqUV/REQj7MhDixpq3MeldX2psAHpCAwWKeENBCvCIevuyRbBgjZ3yyc/a3k12E0W QjC55xQbKhWpp2xTOCgj2a8kfP1GGQTraDrIAvW9Zccoh40KlXVOsAJtdJn0ERK5/K2r l1ibzOD8t81NuGMDarQovM4tUAHQ8zW5fshsVj5GrAgBI97kKm3+RstZMJM6GFpo/INy TtAQ== X-Gm-Message-State: AJcUuke8L4L68cxvBybm9YKnYK1fphUswEVGXXUtsn20RkuLnaGozfKQ bT/7VKfkklKsZkptYTkvMOAlduhaYpU= X-Google-Smtp-Source: ALg8bN6G5eKBh+PZUJ6qp7Q7aqCNOoPkrOuvt4eUW7pAr0qgzvCo5/nNidyT0WQ/OjRF1KxI+fq2fg== X-Received: by 2002:a17:906:938e:: with SMTP id l14-v6mr11121227ejx.246.1546868755214; Mon, 07 Jan 2019 05:45:55 -0800 (PST) Received: from kvdp-BRIX.cmb.citymesh.com ([91.179.126.85]) by smtp.gmail.com with ESMTPSA id n18-v6sm14017427ejy.17.2019.01.07.05.45.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 05:45:54 -0800 (PST) From: Koen Vandeputte To: linux-arm-kernel@lists.infradead.org Cc: linux-pci@vger.kernel.org, Koen Vandeputte , Arnd Bergmann , Krzysztof Halasa , Olof Johansson , Robin Leblon , Rob Herring , Russell King , Tim Harvey , stable@vger.kernel.org Subject: [PATCH v2 2/2] arm: cns3xxx: use actual size reads for PCIe Date: Mon, 7 Jan 2019 14:45:10 +0100 Message-Id: <20190107134510.32494-2-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190107134510.32494-1-koen.vandeputte@ncentric.com> References: <20190107134510.32494-1-koen.vandeputte@ncentric.com> 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 commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") reimplemented cns3xxx_pci_read_config() using pci_generic_config_read32(), which preserved the property of only doing 32-bit reads. It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(), so it changed writes from always being 32 bits to being the actual size, which works just fine. Due to: - The documentation does not mention that only 32 bit access is allowed. - Writes are already executed using the actual size - Extensive testing shows that 8b, 16b and 32b reads work as intended It makes perfectly sense to also swap 32 bit reading in favor of actual size. Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") Suggested-by: Bjorn Helgaas Signed-off-by: Koen Vandeputte CC: Arnd Bergmann CC: Krzysztof Halasa CC: Olof Johansson CC: Robin Leblon CC: Rob Herring CC: Russell King CC: Tim Harvey CC: stable@vger.kernel.org # v4.0+ Acked-by: Krzysztof Halasa Acked-by: Krzysztof Halasa --- arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 5e11ad3164e0..95a11d5b3587 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, u32 mask = (0x1ull << (size * 8)) - 1; int shift = (where % 4) * 8; - ret = pci_generic_config_read32(bus, devfn, where, size, val); + ret = pci_generic_config_read(bus, devfn, where, size, val); if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && (where & 0xffc) == PCI_CLASS_REVISION)