From patchwork Sun Mar 5 15:23:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shanker Donthineni X-Patchwork-Id: 9604665 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 A6098602B4 for ; Sun, 5 Mar 2017 15:25:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C1827B81 for ; Sun, 5 Mar 2017 15:25:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 441C627DA4; Sun, 5 Mar 2017 15:25:45 +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 D46BB27B81 for ; Sun, 5 Mar 2017 15:25:44 +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=UIQgSjn6rgNr/h1J90bmkC9QZx713l6WwnnNXRykbEU=; b=IVf Gtbw3dkveFikZ2SMiFluLWL/RT2SyIXL1YYLltRToVUSQYh3cxOZHk7QwWY0TDjdv1F22N8i7XVUW /Qry4CZEpSgiasuFprKGCKjQXMdATGwz/9RLSRnjPH65B5ZAGIfzpUh1JeGwwRhizfwTygyP4+0Fh EWI37e1PeYz8/wLlWokNpXiwxwwnvDCRkKrlpgE+SuXf7mBrsciqnQxMch5Nd8J4cg0ixRXDAxoWG H19ZhOfPbRSQgY//hoKNuVk/5Q5Lj6HHX27pY4mpeQEz5CYkecOSVb02Vg2zngSquhX+9Ev2twN8u 8TJ7FtmuTULwQpZfSh2YQ4NMtKi3r+A==; 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 1ckY2R-0005Eo-5p; Sun, 05 Mar 2017 15:25:35 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ckY21-00042p-Mz for linux-arm-kernel@lists.infradead.org; Sun, 05 Mar 2017 15:25:11 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 06F406035F; Sun, 5 Mar 2017 15:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1488727489; bh=o20uXKCS8WwAQJHrCSXilH/WWjKQp7FjNEv9euRdd0w=; h=From:To:Cc:Subject:Date:From; b=cOwTW3yo+7G10CJ8n3Wvvipv/f+Fj180GS3uyeAhk+sTAjdwghH+DdZ5gXF/DloxT spfOYb044YBkN0oi65VbDfPJFwpzwQZxkZ+ts0QtaHfMmvXolTEvh0sABaUGXF+PZW lgI7mCYQabDp0psF6G79+XlRsWlOQ4AI7pS8RFpI= 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 505DC60209; Sun, 5 Mar 2017 15:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1488727488; bh=o20uXKCS8WwAQJHrCSXilH/WWjKQp7FjNEv9euRdd0w=; h=From:To:Cc:Subject:Date:From; b=MUpeKfC+XX56iOT2NfN2Mc92pItxYbM9iULqXs/rq4iVTWyie1DJl1Aifzlez0dAh VtOG1q5j0E+iO0qdfEI034J29YNOguoaXmNVuesDCilFI/OAGyOgkot5kWumcx7RR3 +gU+epDU7gJuj+92rD68H+ejGdn5UlYJFpYJixB4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 505DC60209 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] irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065 Date: Sun, 5 Mar 2017 09:23:56 -0600 Message-Id: <1488727436-25085-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-20170305_072509_797439_4C61A381 X-CRM114-Status: GOOD ( 14.00 ) 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 (ITTE), 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 ITTEs in its_create_device(). This patch fixes the potential memory corruption by setting the correct ITTE size to 16Bytes. Signed-off-by: Shanker Donthineni --- 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 + ITTE 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 ITTE 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 { } };