Received: by 10.213.65.68 with SMTP id h4csp3616316imn; Tue, 10 Apr 2018 01:43:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jPWVK/ot4LwpCSEmReVoX92MDT82+KNs9tU9mZic8HeSyfchN4UM3ePS3JwgoXNJUE0RK X-Received: by 10.99.185.74 with SMTP id v10mr27406013pgo.372.1523349800622; Tue, 10 Apr 2018 01:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523349800; cv=none; d=google.com; s=arc-20160816; b=w4IktNjFJbxqO2uOgeHQfA5+EEG1FlYi8+9O8pRP5lhTvRkg4hSsFuJcrD6P63TZWu 7/L4wCRWtTBRrYH8dverNdSowAaKZK/bcy/r0UQ7nonjEYEgQuoTyfwnZgq0uQt0PJJm 3t/FmfiPuq2PoQyqxrC+ZVFo7zmQFnGBxIQKvDWnJFNCI9LUPF0Du9Xes7Z+5g/Cvt4d YPccBAqlEbKDD+qCl/9BWWDx4k0c8bo6kzK9QxF6Re7s+i5/dx2aLN/GZbNCkMgRYZ+u VMipecE40MrxVZfwG0jzoUq9RTuyaDPvSJ5IFBU7tVP7Jc4CUW7lIPwd9hcQa3U8eRi1 p77g== 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=MFJiVTezqlCgoVY08hEzNY+++SoDHki+3fdlwdAMppM=; b=hin4t9popaJTKyGtZ9uWkyJVaZ0UzMPlTTfEHCwCzP78l+5ZSnOMcB16yWqjX49QAK 9Dmn+/Y29brGKjLhImdwxsivUNh5sFMUASoq1SLJLy8rO/PYJ+MAs6ZtYO/5OVenP/qJ iYO+m+U1mvBlXkOl8i+TLE/pfKc9KFWha2tuY+/3AX/UMUTZwvtIm74F5e/j/KFzSYke fNBOru6eMHool7+mheW9qcgIoY1fio42b7nsXdKLUPUmNGnnkgZa8kukU12nKsAg/ZoT hBcyriFWhLEhKZNaR4tRt5SRiGmHOdDrHPZRJ937qGC1R9ENw4d1Uo99Y4ENFRknyvG1 Xemw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r5WhLMvg; 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 h69si717169pgc.794.2018.04.10.01.42.43; Tue, 10 Apr 2018 01:43:20 -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=r5WhLMvg; 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 S1752881AbeDJIid (ORCPT + 99 others); Tue, 10 Apr 2018 04:38:33 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:53897 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbeDJIib (ORCPT ); Tue, 10 Apr 2018 04:38:31 -0400 Received: by mail-it0-f51.google.com with SMTP id m134-v6so14777211itb.3; Tue, 10 Apr 2018 01:38:30 -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=MFJiVTezqlCgoVY08hEzNY+++SoDHki+3fdlwdAMppM=; b=r5WhLMvgZpR8j0QezB+OP+zppc+/h5zKW3yCRGa7H6Ds4lMHnlQq4Y6a3fTxuWs/5b mCNG+WkAhNDcunwn/FmzXQKhxvSxGJ0y1uTW99CEaYRENdxQJ0uG/XD3gqEbs8rd7Qvv NyDuAjstseBjBb2iGZnHKs/j2FGFhOWVMkxFX7sdCrTGgMY0jLQabqqST6m3IoqDnSyf 0LfrX0Tw5h3DfMBzLT5xfO5CQCkVQL6OMqEcbWH4nJYEbwYqFsB0YBbQxORltC+4lAsp eBjlFHiNOjFExu6/P/pGHxGsCeaEyhe7h1GGhGFSfME6kaKna8jUzzsWtFvQzjkvSXih wAVA== 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=MFJiVTezqlCgoVY08hEzNY+++SoDHki+3fdlwdAMppM=; b=C0Ttr5RoC23PIUjdM2tlnmyi5szEt8phKBaWBvWxynS73cuaZfvTagawkHD+SkBJ2z eUUREARWqbzfvA3hvIVfghYhiABEEyDPSqpfGAwL6nI6OYvsN56X8QLCaXLRxMx4+9mn x5linWo85GW73sxgmOXl1qs/Livu5eF6oguyCJ48Ta+2guPY5/QXSjIjhdG+EruZyZBn LIm1hNEQjx6gkRMCkyzz4j64/hrw5ccmy2sszMEwI7uTujwU5qFEO+ZHpK64WNMUL53S Jg+CfDnp5ytbNAiz82oZtpHQtbQNqOfsI+FWBqDKYuG6EBGLwxLq2O9ZyrfbeZ0FCvAz u5XQ== X-Gm-Message-State: ALQs6tDKA2oZdoXjxqDauPcNTxXutkiFl27tPKh+Te7JcsbMCF4Hf66/ vFuVwEcKWvH6tJ7Lwdb1QMx5JeElp0NgWU7Gfv6kx+mp X-Received: by 2002:a24:e00f:: with SMTP id c15-v6mr1342464ith.9.1523349510153; Tue, 10 Apr 2018 01:38:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.179.8 with HTTP; Tue, 10 Apr 2018 01:38:29 -0700 (PDT) In-Reply-To: References: <1523210867-3806-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> From: Tomasz Figa Date: Tue, 10 Apr 2018 17:38:29 +0900 Message-ID: Subject: Re: [PATCH] pinctrl/samsung: Correct EINTG banks order To: Krzysztof Kozlowski , =?UTF-8?Q?Pawe=C5=82_Chmiel?= Cc: Sylwester Nawrocki , "linus.walleij@linaro.org" , Kukjin Kim , linux-arm-kernel , "moderated list:SAMSUNG SOC CLOCK DRIVERS" , linux-gpio@vger.kernel.org, linux-kernel , Marek Szyprowski 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 2018-04-10 16:06 GMT+09:00 Krzysztof Kozlowski : > On Sun, Apr 8, 2018 at 8:07 PM, Pawe=C5=82 Chmiel > wrote: >> 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. The issue looks real although one thing was > missed - there is a gap in SVC group between GPK2 and GPL0 (pointed by > Marek Szyprowski): > > 0x0 - EINT_23 - gpk0 > 0x1 - EINT_24 - gpk1 > 0x2 - EINT_25 - gpk2 > 0x4 - EINT_27 - gpl0 > 0x7 - EINT_8 - gpm0 > > Maybe this should be done differently - to remove such hidden > requirement entirely in favor of another parameter of > EXYNOS_PIN_BANK_EINTG argument? Perhaps let's limit this patch to s5pv210 and Exynos5410 alone, where a simple swap of bank order in the arrays should be okay. We might also need to have some fixes on 4x12, because I noticed that in exynos4x12_pin_banks0[] there is a hole in eint_offsets between gpd1 and gpf0 and exynos4x12_pin_banks1[] starts with gpk0 that has eint_offset equal to 0x08 (not 0). > Anyway if such hidden requirement > stays, then please document it in the source code (it maybe next to > PIN order... or next macro... or also in exynos_eint_gpio_irq()). > > Beside that please add cc-stable and appropriate fixes tag, Agreed. Probably the only safe way of documenting this is to put it inside each bank array, so that when someone creates a copy/paste for new SoC, the comment is clearly visible... Perhaps something like: /* Must start with EINTG banks, ordered by EINT group number. */ Best regards, Tomasz