Received: by 10.213.65.68 with SMTP id h4csp1800543imn; Sun, 8 Apr 2018 11:44:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/DwBIka44/Srh9Yz8HfGNBsne/NcFg7asst7W0eAemsyOXuWHkHI4QwMAyymMNUbAGBHxX X-Received: by 10.98.202.24 with SMTP id n24mr11877586pfg.45.1523213092373; Sun, 08 Apr 2018 11:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523213092; cv=none; d=google.com; s=arc-20160816; b=pRYLHXW7PTi5o6hE+Rt+pwt8jst0iWrW/ZPGTCVC+ojXeaLw6/JSEDDcx+SRvyoq4d 9WVoTbWMlHwXxkzuAwTyqmei4EoVKY75MWAswjGTkLdWe7DYqx6X4tR+ph4Ug6Ghl1LZ 6XAlOakM8J3Kxa73hXJz8co4c1SLEX+9Qv8Q9a/EVKu1tcod5iNF4Mw/8Lzh0BJuxOzP Eh4JWzk7vfM6THO/NE+dHQ2EuCWJ6beiEdu5wctxJIPjEXCwTkOBzBoCNq5EC+be1s6j 2bpmd5WSHo4LqXKQB34QAm1KB2wmmKUzFAEabnbr3Ed4wTNhnAgedbVg9FMtTcEyrE9q UkoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9uc1BFf2UnAPjiumEgsJL8/x50GDCurlHuHyT/bn9A4=; b=MWJL7YOcvVCzsGBv6iRGm6zNVZh2gq0vs63cPDDKVdt9E/Eftp4s0NGm7Dyx1gzHvB dT5EZrovzjI2WEZg54x7IFRZ5xrT2FP4UsAQ6GyZ727bRhmeEpkQUea/+xR6Hm5hOwL8 BQ9pSmAropYMW7+IbT5Avx+gJAQQYTgW/JdnIBOzpjaHrndPyHncr13uq83w5Q64AKnU 9vzdXen6LkFNiOLFOhK2l3jU04lViXGVbHhUMsnwy0k644B+fBtQrc5Ia2Ut6YyBRliO ndrSjAgi/qE4usJt10gE+VRcUjAAbcerIkcYEYvjdJJGbtLH2aW9JNzHKbLt0zDoawkM WGGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W4ydkzZY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si11355979pfj.212.2018.04.08.11.44.15; Sun, 08 Apr 2018 11:44:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=W4ydkzZY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbeDHSL6 (ORCPT + 99 others); Sun, 8 Apr 2018 14:11:58 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:39073 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbeDHSL4 (ORCPT ); Sun, 8 Apr 2018 14:11:56 -0400 Received: by mail-wr0-f193.google.com with SMTP id c24so6385065wrc.6; 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=XPV9eufGxcSrDsbO9asOM1HPsWron5xfqnU+ZWVmBP/nvdbLt0UTrnNRSwq9ah1CGD xN9X2WdonpmCgNn7pXvWnyhcqWEbZJYBFI57FxhJEc8qba47u9eniev4kF832OH7onfc 4At9y6EAz1qTTp3CBs2WCiqw410VJqbwWNXMDH7Nx57cjvBDqJiiehGTCSrvi3iVSKKP vQAaM/+D2ltUs1fNUsd6GjO0MdraYyVi/lt5jIkC9AuUErsrwfQS3vYrQSRi0D+CjseH rqcTy8mA8ZBrhf2HrSTpC3ZzetIXBhcwQW2/2/94nPNknhl5E5pUZ8CsyL/o7JxmBxaw 8NIQ== X-Gm-Message-State: ALQs6tDDA6/rSYKt/lKn+BLLQJ5sM84B6GDG3y8GEy3jsgaKVtAOceRM OEHCqNpP+mDj+JRuVEHLdxo= 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 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, pawel.mikolaj.chmiel@gmail.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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"), -- 2.7.4