From patchwork Tue Mar 7 14:20:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shanker Donthineni X-Patchwork-Id: 9608995 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 AAEFC602B4 for ; Tue, 7 Mar 2017 14:21:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52FC284ED for ; Tue, 7 Mar 2017 14:21:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9B9E28515; Tue, 7 Mar 2017 14:21:51 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 495B3284ED for ; Tue, 7 Mar 2017 14:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=ZdYpYCQxmP5YxVgVDL5yOyuAyd/qnbJZtVCC+GdCCf4=; b=YwG Mz+BLxEhjn9KSuMk3dGeZnbf6NaRXy/mH4rqiDUbht2Kzmz8quRsaJ2kU3a4jpllJBMbTKfZ4yU63 xHeRBqnmGdRs+AXVkChjjPWVTvjdc5oVRV/BnD+ib06P/Ulevm58NZRxJpuekqXVxTQKdWrN76pZ4 tVbls2Z6owGXflw2NX+AGphk6SVjhYNgkE20Ih7Lnqfw9RAjRaXR/UCT8OQIbFu0se7TOx5h9gn4b zRmKDSHO1wrDCBGjom4YMAUrvPGayqgVo8Ls7Vq/iSQuodj1ESMQRTTVW2t7rnJV4sHDLWUlvdlZX xEgAqMxgt+9Hv6fFYzYAP7vVnkQ917w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1clFzl-0005Ai-7L; Tue, 07 Mar 2017 14:21:45 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clFzh-00051u-H9 for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2017 14:21:43 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 009346079B; Tue, 7 Mar 2017 14:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1488896481; bh=0kUZs2GCQMSxpvZzP0+Hin4xPzRlsW6Rf253yvFMBjI=; h=From:To:Cc:Subject:Date:From; b=Stg7VNqLqDFIfO17kUmnOAqULKNAYpHC+Z9XKQqREJ9nxCvF06V2hxlbfe3RchTO5 qHk2EZeEU57VI770Yje80ZsjtXOTOmeHjWpghMJVTQEO4ph1FjKUo6DgsCIJPxDdVc kup8SycjGYWwqt73rcpDGpmhYZY04wCpQDC1D4GE= Received: from shankerd-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: shankerd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4298E60269; Tue, 7 Mar 2017 14:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1488896480; bh=0kUZs2GCQMSxpvZzP0+Hin4xPzRlsW6Rf253yvFMBjI=; h=From:To:Cc:Subject:Date:From; b=MzQ3PoFL8WMGjtJL6WEnlMwlZRFTTLxFhFrPF6mOit452mvp3JIwVLvGw28wdCPHm Hg4COKL7P5F3eROPbBsgMvOrOyu/DMepLHZD+GPXHo5gZUGqIF4vU+4QVi3UfOPjBX G2qbebcsN1F01rGMVK5gYjAHbJTSqYU4FhohVoZ4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4298E60269 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=shankerd@codeaurora.org From: Shanker Donthineni To: Marc Zyngier Subject: [PATCH v2] irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065 Date: Tue, 7 Mar 2017 08:20:38 -0600 Message-Id: <1488896438-6116-1-git-send-email-shankerd@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170307_062141_611941_472DCDEF X-CRM114-Status: GOOD ( 14.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , Vikram Sethi , Jonathan Corbet , Catalin Marinas , linux-doc , Will Deacon , linux-kernel , Shanker Donthineni , Thomas Gleixner , linux-arm-kernel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Qualcomm Datacenter Technologies QDF2400 SoCs, the ITS hardware implementation uses 16Bytes for Interrupt Translation Entry (ITE), but reports an incorrect value of 8Bytes in GITS_TYPER.ITTE_size. It might cause kernel memory corruption depending on the number of MSI(x) that are configured and the amount of memory that has been allocated for ITEs in its_create_device(). This patch fixes the potential memory corruption by setting the correct ITE size to 16Bytes. Signed-off-by: Shanker Donthineni --- v2: changed from ITTE to ITE. Documentation/arm64/silicon-errata.txt | 1 + arch/arm64/Kconfig | 10 ++++++++++ drivers/irqchip/irq-gic-v3-its.c | 16 ++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt index a71b809..2f66683 100644 --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt @@ -68,3 +68,4 @@ stable kernels. | | | | | | Qualcomm Tech. | Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 | | Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 | +| Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 | diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 896eba6..6bd51fb 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -509,6 +509,16 @@ config QCOM_FALKOR_ERRATUM_1009 If unsure, say Y. +config QCOM_QDF2400_ERRATUM_0065 + bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size" + default y + help + On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports + ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have + been indicated as 16Bytes (0xf), not 8Bytes (0x7). + + If unsure, say Y. + endmenu diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 2320100..86bd428 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1601,6 +1601,14 @@ static void __maybe_unused its_enable_quirk_cavium_23144(void *data) its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_23144; } +static void __maybe_unused its_enable_quirk_qdf2400_e0065(void *data) +{ + struct its_node *its = data; + + /* On QDF2400, the size of the ITE is 16Bytes */ + its->ite_size = 16; +} + static const struct gic_quirk its_quirks[] = { #ifdef CONFIG_CAVIUM_ERRATUM_22375 { @@ -1618,6 +1626,14 @@ static void __maybe_unused its_enable_quirk_cavium_23144(void *data) .init = its_enable_quirk_cavium_23144, }, #endif +#ifdef CONFIG_QCOM_QDF2400_ERRATUM_0065 + { + .desc = "ITS: QDF2400 erratum 0065", + .iidr = 0x00001070, /* QDF2400 ITS rev 1.x */ + .mask = 0xffffffff, + .init = its_enable_quirk_qdf2400_e0065, + }, +#endif { } };