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: 141340 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3361378ljj; Fri, 6 Jul 2018 10:28:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyvXpn/6zsec2NYSPIzj5uz5E1rwmzxLPVxYpQl+tiFmuGQ0gYOojaG24Y9AKBV4f62BeG X-Received: by 2002:a17:902:9a4b:: with SMTP id x11-v6mr10959988plv.342.1530898121274; Fri, 06 Jul 2018 10:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530898121; cv=none; d=google.com; s=arc-20160816; b=J15Tkg7iGIwOMCZh2XcDXWmDP3hKc0QbdiNIPnw7LlamKtI/4TZAWA1Ll/WfsesL38 5QEWvph+6xWmddJ0zmIvbA5SoGenos+dYu8EEG3a4hBD0yu2QDzQeoIHZlSvsOut+vQH iZGbav41PFcg2IFv5frFQjZ6odRCayfkWTSjI1GV0D+yHws0pQA05D9H8rNWXNwLbMJ2 INNwnWceA2mffZK8N6vAYeJFCT5wn1MUpS2hqwKbHePO9sMIHRnHvLMc6zdODZgIIbTG KDKPQDkb07f3KAR+XusQjljwHYUGBL+XXwQRnJjhVRad9IbGxDGcRWbO6a7c5PgcWvn+ Dnrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6Fkve6Q13jFjpxemJYxQElXnD4OKMhoNo62lFkcseoc=; b=PDCCDeSTWv+RoXWoOBtAzVhmEe1wNUceH7PtIjWLsPVEwvqOwAK1YIQd/+1M2g70ru FfrUm8GVO6u1ZJ03xFwQhvyTXmtAfGbot+noH0I6I9fyN31dk65m3WkT65R5NCzUb1DZ R724DiZxAINS15u6YY7YWU873ijJpkO63dwVqjxFAV5jQJIvKTDTSB67Ssv0xURPhubR YM0lfqDPzG+N7tmjDPaQR97RI+LvaxA0/t6MoqQWuB321HEME56jPV1FMul6H4miBSCA 93hQrl8fbT4bFzTsDl5kDj9J5sTU/pqY751lGay5V5ypTXF8Y5VvyYYyp79DS2UtQC3G 9SqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P7CaXPW4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f200-v6si9606126pfa.164.2018.07.06.10.28.41; Fri, 06 Jul 2018 10:28:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P7CaXPW4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932718AbeGFR2k (ORCPT + 13 others); Fri, 6 Jul 2018 13:28:40 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:45109 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932709AbeGFR2j (ORCPT ); Fri, 6 Jul 2018 13:28:39 -0400 Received: by mail-qt0-f196.google.com with SMTP id y5-v6so10571198qti.12 for ; Fri, 06 Jul 2018 10:28:38 -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=GSRTZzLmc5IkhRDKAPmz78xy8LINiiU4XpBdJ9Y3hBkfjd+ECuM8NTHUQyD+NbsOfv SQr+mTfJdUVBgMnoQT0CDwPdTIJEGRqHvnKcvDDXbPuLjXn/z/68IUY9R/xnN5fKpRDl ikQD9aC7uhsAX/Ow9ixksE5VPTtD1XJkZM2qByST/wMRUplSTi4CBObLsSE5NfJ+wZjE cwMbxYLfmltvJSuEhYDgnWzB/mj5IN2227iYp/sFlQFIHPDzFyj4hevHANWbLv5VtUWS yxjHu8AAOQYQRLUJ7f5GyKZLt0hZCY+L49ePU+ZkgggtajsSu0MuQe/I2BhvvdaHTFtr 1eAQ== X-Gm-Message-State: APt69E3XO6w0rZBN2zg4nFjC+2yWrRvoNf87xjH4MXPP8oLESeOOgTz1 opaZrqy17zfOFdI+PJWn7yuklg== 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 Cc: stable@vger.kernel.org, puck.chen@hisilicon.com, lee.jones@linaro.org, john.stultz@linaro.org, ltp@lists.linux.it, lkft-triage@lists.linaro.org Subject: [PATCH] mfd: hi655x: Fix regmap area declared size for hi655x 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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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(-) -- 2.18.0 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[] = {