From patchwork Fri Jul 6 17:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 940649 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="P7CaXPW4"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41MhXZ4Zvgz9s4b for ; Sat, 7 Jul 2018 03:28:46 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 61AEA3E6F95 for ; Fri, 6 Jul 2018 19:28:42 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) by picard.linux.it (Postfix) with ESMTP id B80EF3E6DD7 for ; Fri, 6 Jul 2018 19:28:40 +0200 (CEST) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id C1A25200CFE for ; Fri, 6 Jul 2018 19:28:39 +0200 (CEST) Received: by mail-qt0-x242.google.com with SMTP id b15-v6so10567468qtp.11 for ; Fri, 06 Jul 2018 10:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6Fkve6Q13jFjpxemJYxQElXnD4OKMhoNo62lFkcseoc=; b=P7CaXPW4fwmN0Pi2zAPVNnZYADQBzkqo8/z13VqFi6wRTmplzt6AZRu54WLJxoISO8 zTpPA7lc7csA+5V7XKnwdEwtYJu1Pz6pZvMFvTkYkCm9EmgxnJYr7/P39sMRxzpkY9zH xwj2SDY9ZTVS1C+80fdVBfJE/VF6ga6seIaDU= 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; bh=6Fkve6Q13jFjpxemJYxQElXnD4OKMhoNo62lFkcseoc=; b=UtU04imukvNYiPg7O6c6/bYJ4E9TwLC0N3NJmg23IPBHw/Yr1spUfZAkpLwfWzwl2P c81JlmAvih/1R6uIYBbFs3Fau15K2QyfxvK5z8xcU3b+0PnwEaoHlMt7kqt+YlxlGEvv mh8whN7xYykimXteFR//nFywTqi6gZjHyrUHqkGVoyDD3mE6mlo+q2NiJ2K2f+XGpRIb radVV5Gpdo0rIGBQjxb1YsZ2Ro8vK5BVkcUt3bKTkjHlbdxI7cz/duD0VA4JPJoVrkak w2PVpW7VovBphak+EZP7Xzu9zKFePrQb6i1ALt+n6HdNxVk+2lSQ2+N7v951a8cKjgki Knyw== X-Gm-Message-State: APt69E2GnmaLSdCaQ1B5vJnKUW5ZsG8u+Bg6Qq2Ka83FcIa8gFU6CoRO jqrCbZH7cKa3Die2n2MNqyexHQ== X-Google-Smtp-Source: AAOMgpdpXyqCrU8mlz5EOGnzvPpzyuK8EafeTePn8YP2CZhUsiWLxg+whkLTK9pJRxXE+PVmRZq8jg== X-Received: by 2002:ac8:37b4:: with SMTP id d49-v6mr10225788qtc.369.1530898118348; Fri, 06 Jul 2018 10:28:38 -0700 (PDT) Received: from workstation.celeiro.br ([138.204.25.70]) by smtp.gmail.com with ESMTPSA id g84-v6sm5709500qkb.91.2018.07.06.10.28.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 10:28:37 -0700 (PDT) From: Rafael David Tinoco To: linux-kernel@vger.kernel.org Date: Fri, 6 Jul 2018 14:28:33 -0300 Message-Id: <20180706172833.533-1-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.18.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: puck.chen@hisilicon.com, stable@vger.kernel.org, john.stultz@linaro.org, lkft-triage@lists.linaro.org, lee.jones@linaro.org, ltp@lists.linux.it Subject: [LTP] [PATCH] mfd: hi655x: Fix regmap area declared size for hi655x X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Fixes: https://bugs.linaro.org/show_bug.cgi?id=3903 LTP Functional tests have caused a bad paging request when triggering the regmap_read_debugfs() logic of the device PMIC Hi6553 (reading regmap/f8000000.pmic/registers file during read_all test): Unable to handle kernel paging request at virtual address ffff0 [ffff00000984e000] pgd=0000000077ffe803, pud=0000000077ffd803,0 Internal error: Oops: 96000007 [#1] SMP ... Hardware name: HiKey Development Board (DT) ... Call trace: regmap_mmio_read8+0x24/0x40 regmap_mmio_read+0x48/0x70 _regmap_bus_reg_read+0x38/0x48 _regmap_read+0x68/0x170 regmap_read+0x50/0x78 regmap_read_debugfs+0x1a0/0x308 regmap_map_read_file+0x48/0x58 full_proxy_read+0x68/0x98 __vfs_read+0x48/0x80 vfs_read+0x94/0x150 SyS_read+0x6c/0xd8 el0_svc_naked+0x30/0x34 Code: aa1e03e0 d503201f f9400280 8b334000 (39400000) Investigations have showed that, when triggered by debugfs read() handler, the mmio regmap logic was reading a bigger (16k) register area than the one mapped by devm_ioremap_resource() during hi655x-pmic probe time (4k). This commit changes hi655x's max register, according to HW specs, to be the same as the one declared in the pmic device in hi6220's dts, fixing the issue. Signed-off-by: Rafael David Tinoco Cc: #v4.9 #v4.14 #v4.16 #v4.17 --- drivers/mfd/hi655x-pmic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/hi655x-pmic.c b/drivers/mfd/hi655x-pmic.c index c37ccbfd52f2..96c07fa1802a 100644 --- a/drivers/mfd/hi655x-pmic.c +++ b/drivers/mfd/hi655x-pmic.c @@ -49,7 +49,7 @@ static struct regmap_config hi655x_regmap_config = { .reg_bits = 32, .reg_stride = HI655X_STRIDE, .val_bits = 8, - .max_register = HI655X_BUS_ADDR(0xFFF), + .max_register = HI655X_BUS_ADDR(0x400) - HI655X_STRIDE, }; static struct resource pwrkey_resources[] = {