From patchwork Sun Apr 8 18:07:47 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: 10328479 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 3A1CB60385 for ; Sun, 8 Apr 2018 18:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2925628AC0 for ; Sun, 8 Apr 2018 18:12:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D45028AC5; Sun, 8 Apr 2018 18:12:25 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 82E5B28AC0 for ; Sun, 8 Apr 2018 18:12:24 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=hgSuEFa7tNet4IzSzXXbFAVlXa0p3JFdA2G1QQXBWvg=; b=NYEHWv2/NpY6a4 eGVzTaR9tZANX8UeFZ02gC/cOQEs3Epn9cBBvUGxGFfcRmW8DvdBxZ5VzeJdVxKL0k4CY+CJtnR2j fzSLrUwZ8YkH5FdDxNMdaL89ZXGlkHRD6VaMzvaSpKPtjLxLQqMlx7OAOOpcBWfxTdJdQFmXSqBAo qowrmvmSmqAlQ/BWLxw6popVxwQ3Cw/3oOUdDADIZRxT2PyQz4YguJ9KbFUV9S6eXHt5J5R3iG9Nj DjYFnVUnu4KxOwUwKy3DMcjUABnDzxtwYN8CMVTMy5cBdaXiPYMzEaBGusgvDgSzvckC74Y6Px4IL uCH4NpcFNffQZBaZaJOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5EnT-0002P1-VX; Sun, 08 Apr 2018 18:12:11 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5EnR-0002MP-5S for linux-arm-kernel@lists.infradead.org; Sun, 08 Apr 2018 18:12:11 +0000 Received: by mail-wr0-x244.google.com with SMTP id y55so6403716wry.3 for ; Sun, 08 Apr 2018 11:11:55 -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:mime-version :content-transfer-encoding; bh=9uc1BFf2UnAPjiumEgsJL8/x50GDCurlHuHyT/bn9A4=; b=W4ydkzZYb89uW+EZwrpBMy0C0uu0vc3VOi2sLhmRDu1hgea4vLEB70AJNJkgqi9JU+ dc4Z5vwl8BNf1pw5AoNSSRFBZV37BHbY54DQy69y9GNfOgWzMoq9fAKhEvxRnKGLXgPy hEZAkxylOjjItcBGbjnpJF7H/pWxy5OW54hGpZW8BfHzqrgXw8a0aAQ1dawuJmVGwIwh UehqKptF7476CxmwdBRY6DUbI9YRMCXMGFwBOjY6MMWCBoyxTj8crUD8dbjHEjBqxQ/A b8Bbd7/5OBwz0CoYprjWyLdRKMsrYGR5cK5jVNNfKvbOB95ho+UGjL2afCqJs4SY/f4u eV1A== 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:mime-version :content-transfer-encoding; bh=9uc1BFf2UnAPjiumEgsJL8/x50GDCurlHuHyT/bn9A4=; b=FjCcb5eD5Y+3rwGhNG0KvFHVcjUIQui3MdImHD32a6LMZmvDCCQkf2AJNBKMwRO0yt nlHsgEMH7UfEWIP9kQewlhR91ZPGaPsETpswPTO1UbU/f9sCRur2ivum5jwKjRLlkwPf 0Uc0KfZGHUN46SDOd+2kLgIybyaqFdZ5flQ+o/8K4ls8jTLhhs1ER/o0bqUA7WSAXaGX Eyuf/S6U2LbuvGqOjZrmdV1ByqLhakMobBxMkq0j6eeh1amKffA0JFr0LTIpyG7RWc5k SXwUSwV4iYRYLNEfKJO2NM+ILq256wWtTlAVP7FeGm6Sf6B3syMNsbymaJUCls8whKrn flQA== X-Gm-Message-State: ALQs6tAJyWoDQ/xSfDSHXPfvp9QmY3iBlMKmHs8XnH0PAYqHFfV+5TK0 ffHeGKkAnJrpuYge3C2EYhw= X-Google-Smtp-Source: AIpwx49U0kAvZD8cEuqe9z01w7XpR4wPDJtNi2PviEJhNtY4vLj1GAlM91048KXS6LehXvD1A81h4w== X-Received: by 2002:a19:5317:: with SMTP id h23-v6mr19087184lfb.6.1523211114448; Sun, 08 Apr 2018 11:11:54 -0700 (PDT) Received: from localhost.localdomain (user-94-254-171-85.play-internet.pl. [94.254.171.85]) by smtp.googlemail.com with ESMTPSA id l1sm1674621ljj.30.2018.04.08.11.11.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Apr 2018 11:11:53 -0700 (PDT) From: =?UTF-8?q?Pawe=C5=82=20Chmiel?= To: tomasz.figa@gmail.com, krzk@kernel.org, s.nawrocki@samsung.com Subject: [PATCH] pinctrl/samsung: Correct EINTG banks order Date: Sun, 8 Apr 2018 20:07:47 +0200 Message-Id: <1523210867-3806-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180408_111209_211336_E57D583B X-CRM114-Status: GOOD ( 12.27 ) 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: linux-samsung-soc@vger.kernel.org, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, kgene@kernel.org, linux-arm-kernel@lists.infradead.org, pawel.mikolaj.chmiel@gmail.com 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 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. Signed-off-by: Paweł Chmiel --- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index 90c2744..de4ab07 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"), @@ -158,9 +158,6 @@ static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = /* pin banks of exynos3250 pin-controller 1 */ static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = { - EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"), - EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"), - EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"), EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08), EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c), EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10), @@ -170,6 +167,9 @@ static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = EXYNOS_PIN_BANK_EINTG(5, 0x2a0, "gpm2", 0x2c), EXYNOS_PIN_BANK_EINTG(8, 0x2c0, "gpm3", 0x30), EXYNOS_PIN_BANK_EINTG(8, 0x2e0, "gpm4", 0x34), + EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"), + EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"), + EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"), EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00), EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04), EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08), @@ -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"),