Received: by 10.213.65.68 with SMTP id h4csp2127191imn; Sun, 8 Apr 2018 20:24:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49KaCYHVL1cs2YCxOuRhA/d4dPZHdHwzw8etvPK4KL6ju+70/+EbwttXArLQuxaH/sQ0a8+ X-Received: by 10.98.171.7 with SMTP id p7mr27890019pff.215.1523244247918; Sun, 08 Apr 2018 20:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244247; cv=none; d=google.com; s=arc-20160816; b=F99uMmG5GVWlxWeA6NGY7rFIsNK97C5x5bHNxfGP0qDFRj2C1uF+gU4ag9aN39ZNKu +pP43qJP+OvsyJISn11qsP4f/Z0I+zApeW6ezd2mqrHwvEXPy2BRvkWgpdFSAFa2Dfti 3T/lDUuJK3LvUk7ItjNGk9i34msLo3tC8fulvZMk2c26VGZkco5wQM97BhKoy2u4ageU HtJR01HyM7xY475kwCBvPlSXJGmUC2M84PBb48A6ByzVefF8DJEpLkJ12U313rVVgEpt y3gMTcpIBDMEbWX1z7K4/8R7qP2kp0JPE28pgGz2yMfxS0nsYYz9+o/C52xpDOettwr0 rZ7A== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=LXL0D2SoJIdbdQlj/p/dP3kGpDKIXP7so0eVg6RqkX8=; b=lhv1ylVyY9sRuAtO9r4/Mgc+ny/vC0kJsGzkgRi6P3alDe436gco7xWEXFFfOStzRr Yqxwg2qckN2Kk/EvhV7ExW2cNhO0TCWeF4XIfFisqwV2PuUhY0O6W9npSzLGQQfgNrxt eh644H6+/i3LWFWNb855jiD0RVIGfcZSDHcR7t1jj52WdnzAJ1ah6+Szt3L3yE2a282H inidbe4HMRa2i4ijSKHwhkONb/Jo7ji+vnzZlODiVISK+0ToR2j1jnbb2pB4KMmXVjqx 3nXkKItWBg7cvyIwInoo4Jc5mkMtNhW91+1HtChVXmey6+z3c0Kdc0JJqtw3RdfYWDZN Tkig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S3J+/BSz; 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 b13si9890034pfi.53.2018.04.08.20.23.31; Sun, 08 Apr 2018 20:24:07 -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=S3J+/BSz; 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 S1753175AbeDIDUx (ORCPT + 99 others); Sun, 8 Apr 2018 23:20:53 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:39857 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbeDIDUu (ORCPT ); Sun, 8 Apr 2018 23:20:50 -0400 Received: by mail-io0-f196.google.com with SMTP id v13so7887020iob.6; Sun, 08 Apr 2018 20:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LXL0D2SoJIdbdQlj/p/dP3kGpDKIXP7so0eVg6RqkX8=; b=S3J+/BSzCAztn/4GAXOYhDmjv9G6cawBIxss83ViCOeVyI0b2LAKYwRdbUmkc2CFD+ dgqbYov+kcUPZcgiwM5Y9ggibBas+02HXWojVRcaYwJRQLh/mqwhNGtC4d5b9g97bhCy HV2DAHq8c+4YDYlt9WJQvx6LNw59rdBJmT/km75bIFuCfjbLqDDOVQBs5yMU5NnacX0d xYIw25XkIrbmMWxDZRjnlkSyzEIA+cX7yKuiaJyxM/cbM9GAk/m2kAPRTYz56q6NqlUQ zWncWYjNDJtDKvhei2zimoCIP24ZS9iWL9TrG8zop1MDjiREZmm3poNzRtRyH+IctQoy /xQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LXL0D2SoJIdbdQlj/p/dP3kGpDKIXP7so0eVg6RqkX8=; b=m7BLt1VNl6C6WAfm3ScUUFnJQoM5uClhreIWfx2UMETFswFkU4zXm9Bo9PGdIZzM0z k+V3EpYizLiNjKFSNOtV2BtDdomkCd2XxLy/klvbkvxxxh+7k7k4BWOcnk6S/tiTcKXY RxZenRiAL/YyS7sn5bAAWo2ZMHEz2IdrGyXCKJ7zuJfZmhj90RZNkRyr9gUr/Naemhiw 11hKp7UCI28p2GlKyoGhpTFbmBCGPbmfh82BQwLX08j4MlgsMNRklESJEFVwPnWQrFJw vdfWBWF/XVrHXJKfXnrCrjkCZv19RXJMIpY/Nmt5bfOUtrZ9o8bIX+SDxm1cs8+bq3R5 iY9w== X-Gm-Message-State: ALQs6tBfP+gHdlkJuJ/PXNFKPq0Q9UYW7jEU+C47WW8MJh+bdDiGohZd WV9oKA8L4LGBOdbZUcBmGmMZCYMUu5Zvm4IaO9c= X-Received: by 10.107.180.143 with SMTP id d137mr33875550iof.77.1523244049547; Sun, 08 Apr 2018 20:20:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.179.8 with HTTP; Sun, 8 Apr 2018 20:20:49 -0700 (PDT) In-Reply-To: <1523210867-3806-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> References: <1523210867-3806-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> From: Tomasz Figa Date: Mon, 9 Apr 2018 12:20:49 +0900 Message-ID: Subject: Re: [PATCH] pinctrl/samsung: Correct EINTG banks order To: =?UTF-8?Q?Pawe=C5=82_Chmiel?= , Sylwester Nawrocki Cc: "linus.walleij@linaro.org" , linux-arm-kernel , "moderated list:SAMSUNG SOC CLOCK DRIVERS" , linux-gpio@vger.kernel.org, linux-kernel , Krzysztof Kozlowski , Kukjin Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pawel, 2018-04-09 3:07 GMT+09:00 Pawe=C5=82 Chmiel : > 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. Thanks for the patch! Looks like it might be fixing quite an ugly bug indee= d. Just one comment for exynos3250 change below. > > Signed-off-by: Pawe=C5=82 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/pinct= rl/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_p= in_bank[] __initconst =3D { > 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 =3D > > /* pin banks of exynos3250 pin-controller 1 */ > static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __init= const =3D { > - 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), It looks like gpk0 starts with eint_offset =3D 0x08. Depending on what the SVC register returns on this SoC, it might be group 0, which would be fine, but also group 2, which would require this bank to be at exynos3250_pin_banks1[2]... (or changing the way group is translated to bank pointer, e.g. by subtracting (eint_offset / 4) from the group number. Sylwester, would you be able to check which group number is returned for GPK0 bank in SVC register on Exynos 3250? Best regards, Tomasz