From patchwork Mon Apr 16 15:52:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Chmiel?= X-Patchwork-Id: 10343367 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 ED547601D7 for ; Mon, 16 Apr 2018 16:00:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDC24287BA for ; Mon, 16 Apr 2018 16:00:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D24DF287E1; Mon, 16 Apr 2018 16:00:27 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 7FD07287BA for ; Mon, 16 Apr 2018 16:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750972AbeDPQAM (ORCPT ); Mon, 16 Apr 2018 12:00:12 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41207 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793AbeDPQAE (ORCPT ); Mon, 16 Apr 2018 12:00:04 -0400 Received: by mail-lf0-f67.google.com with SMTP id m202-v6so5618867lfe.8; Mon, 16 Apr 2018 09:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/T9HU9SZVOqOMlY/8NU7XSlN8ZWeBNURpifQCIs75+M=; b=UHPBLjHZN9QoFTag6crRfLc/GiHkqLcFHkkOwkSKM40J0jK6KFY/cto9K2r66oiLIW LYzUGFvtfxRtCrlnWwsr77QPJYuu0vXamwqOT94aLUMJZ8Ssmo1JKqMGbKtjRJgOTqSg gLubnp3O+sF0BZZv8RFVrtMBYBfTEEBcIZjdnQu1ws7iGwDA7B/XySO3c/pKLkuueVIX doz/afnyJ1tJHDFvRLy6oNUjf+NvY2XbCGSnBSU0aOU9KxGyZdiIV3eUw7/dcDoRAjGi zq7PI58nKVqafXVKrTSJRo2fVW0KCVd47WZcaCe2ris+0rb5EB+S3WPsq2/615rgbYTJ dHpA== 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:mime-version:content-transfer-encoding; bh=/T9HU9SZVOqOMlY/8NU7XSlN8ZWeBNURpifQCIs75+M=; b=EojLRt84CfDr+6zITgIcPiM7lhNySyQvhSTcNrqjQzPvS5AaJa1HGSKXx84ltQjJt2 a8mJmAxcUPvkRX5D76BRyyuRymp7kjnCdn/0KlTolJAznC1q5GvfjGPnYM9mBu/6zVsO s/3wzcBNoqBg8NJ+QcYBXRQ3M+80eop3ylDSjx1DV6R+NIXDrJ6H7EiE8j3idUswnH+X PBP72GgeD9XsIKbD6YnGCxWNpX+wdtRqNFhRiYOmrr9n6N26+fUbhOCe1LEnCRZdOTVF GGdqxub4FXf29M4wSrBw2UeCvqNmn6pOv5xP+1l88VEWSafN7bc6t9hjHARrbMeyor+i Aqew== X-Gm-Message-State: ALQs6tCKx4nsyJUuRAYSUupF2mlFoFssEKiDQLv0kYRkicUSKyCSOfcU FEIYsijHSeHgTiCcYX6NsiI= X-Google-Smtp-Source: AIpwx4/tsKCVco9/KTtKsla0SEvNZ264Yv0kymXzGHYV7USqt6u2YKUZY6qDOjKEmZTt56Zf5x/txA== X-Received: by 10.46.128.139 with SMTP id i11mr9673441ljg.97.1523894401840; Mon, 16 Apr 2018 09:00:01 -0700 (PDT) Received: from localhost.localdomain (user-94-254-174-4.play-internet.pl. [94.254.174.4]) by smtp.googlemail.com with ESMTPSA id s68-v6sm2172036lfs.22.2018.04.16.09.00.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Apr 2018 09:00:01 -0700 (PDT) From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= To: tomasz.figa@gmail.com, krzk@kernel.org, s.nawrocki@samsung.com Cc: linus.walleij@linaro.org, kgene@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pawe=C5=82=20Chmiel?= , stable@vger.kernel.org Subject: [PATCH v2 1/2] pinctrl/samsung: Correct EINTG banks order Date: Mon, 16 Apr 2018 17:52:45 +0200 Message-Id: <1523893966-8884-2-git-send-email-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523893966-8884-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> References: <1523893966-8884-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All banks with GPIO interrupts should be at beginning of bank array and without any other types of banks between them. This order is expected by exynos_eint_gpio_irq, when doing interrupt group to bank translation. Otherwise, kernel NULL pointer dereference would happen when trying to handle interrupt, due to wrong bank being looked up. Observed on s5pv210, when trying to handle gpj0 interrupt, where kernel was mapping it to gpi bank. Cc: stable@vger.kernel.org Fixes: 023e06dfa6882f500b9c86fd61f0b1913aa07f36 ("pinctrl: exynos: add exynos5410 SoC specific data") Fixes: 608a26a7bc04a39cfd7041f31ca2b2100113d14e ("pinctrl: Add s5pv210 support to pinctrl-exynos) Signed-off-by: Paweł Chmiel Reviewed-by: Tomasz Figa --- Changes from v1: - Limit changes to s5pv210 and Exynos5410. Exynos3250 will be handled later. - Added cc stable - Added fixes tag --- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index 90c2744..4f4ae66 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c @@ -105,12 +105,12 @@ static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = { EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38), EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c), EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40), - EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"), EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44), EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48), EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c), EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50), EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54), + EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"), EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"), EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"), EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"), @@ -630,7 +630,6 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20), EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24), EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28), - EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"), EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c), EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30), EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34), @@ -641,6 +640,7 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48), EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c), EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50), + EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"), EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"), EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"), EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"),