Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp341609pxk; Thu, 3 Sep 2020 00:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxqteEl3aOwn0RpYuiwULjFmYngVLHG3p79szikG/JQO4PgxUn2nI+cDcN7QOsxknTHM5O X-Received: by 2002:a17:906:2b57:: with SMTP id b23mr805382ejg.26.1599118977041; Thu, 03 Sep 2020 00:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599118977; cv=none; d=google.com; s=arc-20160816; b=g+3rAm2WDt4P+fUIwfl8dcFTvTaeqTxkOSmKPA7FGofInUJAkOr9Saxx118kvR1WWv dyf8+vT8JkqaxcoEp65sMZ4abZR0JJQC1iw1sShFGxSy4I7PNi2gWFpBz8Be8S8YQcpC Yh9aajUMAgdpK0GfDwROXGmaanzx5sGcv6T+QP8FVYMLBum/0Lgzek4JNTXaN+XwSXnr DojTSBBktNbwS/qyzAz7wqONT/CgEiC8UoPqRIQHtNQIN4vB0ao7F21VkKVECaJp6/Cq Nvgm6e1Bdp+Gck68zZKGvIkFjLIQob0k+WAR8sfFZTDapkjNINKyHPWCQw8ZRef38wb3 /tiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CIADU2SGu37VuCHKz6d1E1PsPEKQc7xCc3sLi9A42/E=; b=LPwZm6gVSWqsqudZBictt8Mdq0u1vTCaSYrBOU6isJmo7EGYEa613++QkvY99cPs1P kJJhFJmfn5ZZVRTsfxEplPQcZ53wT8s29RVjtusVBP+k0BOMXkpbq/AdkBKbYRAZX4wy kocNkSuP+JS7F9pEN1LMZl/z1gvhtnUVdBd11RSBmpGLNPaZEpp3mOGaO2YK7cWTxged cm4zEH+XKuTi2CpuJN1J2nEiPWLZBoanjp4syzp6sf5lOG4dePXGK84pZfQdnYQzVVPz ccZ6taL6paVdbCPvYUsUH6D2WllQSfKh00EOIIkwuxBspN3eAsiNt5PDpnucE3mAMAUL RrmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FngE6bFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d3si1245988ejm.474.2020.09.03.00.42.32; Thu, 03 Sep 2020 00:42:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FngE6bFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728134AbgICHlt (ORCPT + 99 others); Thu, 3 Sep 2020 03:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbgICHlr (ORCPT ); Thu, 3 Sep 2020 03:41:47 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05A88C061244; Thu, 3 Sep 2020 00:41:45 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id t4so1671763iln.1; Thu, 03 Sep 2020 00:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CIADU2SGu37VuCHKz6d1E1PsPEKQc7xCc3sLi9A42/E=; b=FngE6bFBUKDj9tP3egcx0spkVyOqlh4ENFgUCTfcVwGmiZgwu0q02sceL1B9EZtaUC jU51K4eP32s5BB/1UAtGT7bOUyPSa+yLLVsdb49GXmy1mkPzDURHqZo1I7/uXXnfLVrA yE+xsj2n5T/AtWYlw1s/+kvHWPvv4gKVNn3MLtxMx1/OCvecEGuMk3hvygYA/C+2JhPq x5naMed3dEoPLDS5rrNsguWlo6Z6ssi/KFwR8njpVY74sZfmiZdNhgz590AQ2Q0NxvwQ tw2IpIwutYRrg7wYCDAMe+soTf1EDiMjMwM71fjQIi+eng/zJQWD4zDYmGpsfcADsu1D f5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CIADU2SGu37VuCHKz6d1E1PsPEKQc7xCc3sLi9A42/E=; b=UaVS+b8W8SWotq/RkdesRSnEdnZeCzvdSNJMILgLXYARXpaml/hE4o2ptUx6+vcV79 WlHPcNNh06VLeJjyXTiMTB0nivaLvi07x6BA1v7gDlED6orkBcKP5rWWZisiiRWXVMIY PXd1WkFBjVXT28f0ZI7II1bTdf/reQprahh1RuiZYJ7ZOsVlQbAqB6Qss56G0p05S9jX rScg2WoOBYDYNik+cbJIpttM4zcHqWrkaJHQxDyUBRb4yAGAqVJM59rFUctaLrfRq23U wx3itKoY1DtCS66nrp7RX+z6NZa9oDH6t5oTqAE4iMOZjXnr5jYdc8TgUsvcxsTx6f+I ZWLg== X-Gm-Message-State: AOAM530Uirj6/ZheEOLJqAnSD5akTgHwqpqZ0K6elIirh+EepoX8Meya ROufvrG2dIl5Xv+bEt0zzGTahYfUmpNr/u/dVm0= X-Received: by 2002:a92:dd8c:: with SMTP id g12mr1980528iln.184.1599118905190; Thu, 03 Sep 2020 00:41:45 -0700 (PDT) MIME-Version: 1.0 References: <1598858073-5285-1-git-send-email-dillon.minfei@gmail.com> <1598858073-5285-2-git-send-email-dillon.minfei@gmail.com> In-Reply-To: From: dillon min Date: Thu, 3 Sep 2020 15:41:07 +0800 Message-ID: Subject: Re: [PATCH: 1/2] gpio: tc35894: fix up tc35894 interrupt configuration To: Bartosz Golaszewski Cc: Linus Walleij , Lee Jones , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bartosz, Thanks for reviewing. On Tue, Sep 1, 2020 at 11:46 PM Bartosz Golaszewski wrote: > > On Mon, Aug 31, 2020 at 9:14 AM wrote: > > > > From: dillon min > > > > The offset of regmap is incorrect, j * 8 is move to the > > wrong register. > > > > for example: > > > > asume i = 0, j = 1. we want to set KPY5 as interrupt > > falling edge mode, regmap[0][1] should be TC3589x_GPIOIBE1 0xcd > > but, regmap[i] + j * 8 = TC3589x_GPIOIBE0 + 8 ,point to 0xd4, > > this is TC3589x_GPIOIE2 not TC3589x_GPIOIBE1. > > > > Fixes: c103de240439 ("gpio: reorganize drivers") > > Signed-off-by: dillon min > > --- > > drivers/gpio/gpio-tc3589x.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c > > index 58b0da9eb76f..ea3f68a28fea 100644 > > --- a/drivers/gpio/gpio-tc3589x.c > > +++ b/drivers/gpio/gpio-tc3589x.c > > @@ -212,7 +212,7 @@ static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d) > > continue; > > > > tc3589x_gpio->oldregs[i][j] = new; > > - tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new); > > + tc3589x_reg_write(tc3589x, regmap[i] + j, new); > > } > > } > > > > -- > > 2.7.4 > > > > I suppose this patch may be correct but I don't see how commit > c103de240439 ("gpio: reorganize drivers") could be the culprit. It's > been like this since the original driver implementation from commit > d88b25be3584 ("gpio: Add TC35892 GPIO driver"). Sorry, i didn't check the original code file, yes, I should use this fixes tag. > > It's been over a decade since this driver was merged and nobody ever > reported this. Either nobody ever used the GPIO module with interrupts > (unless the bug's impact is not significant) for this chip or this is > a quirk of some specific model you're using. Could you double-check > this? I used tc35894xbg, and searched https://toshiba.semicon-storage.com/ , but no tc35892 found, it seems was replaced by tc35894x series. from the git history Linus Walleij has some submittes about the interrupt part. maybe he can give us some feedback. post tc35894 datasheet here for you https://toshiba.semicon-storage.com/info/docget.jsp?did=30200&prodName=TC35894XBG > > Bartosz