Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4342207rwd; Tue, 30 May 2023 04:13:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7y8LkSfv/VHYNxQ9uu/gbndyglhjDb7jl+kMeUyV/poYY9GMNpTrzlvqk3D6DiKQbQ9+gN X-Received: by 2002:a17:902:f68c:b0:1ad:df75:45e0 with SMTP id l12-20020a170902f68c00b001addf7545e0mr2335480plg.39.1685445208413; Tue, 30 May 2023 04:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685445208; cv=none; d=google.com; s=arc-20160816; b=e6NKgaOXO4+SxPwKLLH3YVJtDwJ9zDD3XAeZj9aKjr65DIhndrmoSKgkDSWII4+kXH dZ8Um1VaHkEQ82wSgtFElIqMCfJm3UOiWVFXoNMhXzgqfj5Yv7JLWBYMEc/cDnZfXiPK lwJYTMR7llQ+S3WpYjg3SLobJM4DRwHceB+hH3prTfLRxNnGZhNwEpmNDqGA0l1HFy9z qcnBo1cmAra+N5hAdcid1KbJ8hExbwqEOwpil3Iwb/ColTcHQj/hn5jE2Mwe5PDwb4Ut Jv5CkOQON4YegiIsd5PBqpvFI44actZHtoxki4TcTlcfjzGJRW8LUyyGalW/zp9hSUxV loYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from; bh=cjc7clg2enAilpg6tWm5m24w3XbgJugwKKjxUkrDra8=; b=gx8nUhAYMEIIhzEGMNKsPiwUVTG7nzz4lYMwzB01guAWXpRhy12rEmefLpk+CYkSWF wKFHCX9ZJiCnmfH1TGlLT6hY0P6Hcb2Y9qdN/TOZMnWIQL2DZYPC1Brw5ZeWxQy6h3AK Lw/vDiwuOkTyOzBH6HD6aiwTOExqw2ul/oI2V/4Cahj+0QuEMRBt3msLc9Fo/2pFtSbz kSV6cQpoRBgtdaSxBeVi4ob7W6hjzl51m9h/9yyNUyh3KFD5k0xd2GIiU1CEAo8zx+VU 9oo0Z43WIz1MJISveUnA4HXFsxIfREO7bH2zCgl84mc8ElQoPGPNUp4GLRf89pKtxyqB 73Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a170902bb9300b001ae5e755a12si5903447pls.186.2023.05.30.04.13.16; Tue, 30 May 2023 04:13:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229752AbjE3Kxx (ORCPT + 99 others); Tue, 30 May 2023 06:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjE3Kxv (ORCPT ); Tue, 30 May 2023 06:53:51 -0400 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DEFC93 for ; Tue, 30 May 2023 03:53:50 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 412208c1-fed8-11ed-a9de-005056bdf889; Tue, 30 May 2023 13:53:48 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Tue, 30 May 2023 13:53:47 +0300 To: "xingtong.wu" Cc: andy.shevchenko@gmail.com, simon.guinot@sequanux.org, Linus Walleij , brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, henning.schild@siemens.com, xingtong.wu@siemens.com Subject: Re: [PATCH v2 1/1] gpio-f7188x: fix base values conflicts with other gpio pins Message-ID: References: <20230529025011.2806-1-xingtong_wu@163.com> <20230529025011.2806-2-xingtong_wu@163.com> <5428dcc3-bcaf-2fff-59db-62d3b3b45d17@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5428dcc3-bcaf-2fff-59db-62d3b3b45d17@163.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tue, May 30, 2023 at 02:27:09PM +0800, xingtong.wu kirjoitti: > On 2023/5/30 06:24, andy.shevchenko@gmail.com wrote: > > Mon, May 29, 2023 at 03:54:36PM +0200, simon.guinot@sequanux.org kirjoitti: > >> On Mon, May 29, 2023 at 03:03:28PM +0200, Linus Walleij wrote: > >>> On Mon, May 29, 2023 at 2:27 PM wrote: > >>> > >>>> It would be nice if a pin number found in the device datasheet could > >>>> still be converted into a Linux GPIO number by adding the base of the > >>>> first bank. > >>> > >>> We actively discourage this kind of mapping because of reasons stated > >>> in drivers/gpio/TODO: we want dynamic number allocation to be the > >>> norm. > >> > >> Sure but it would be nice to have a dynamic base applied to a controller > >> (and not to each chip of this controller), and to respect the interval > >> between the chips (as stated in the controllers datasheets). > > > > What you want is against the architecture. To fix this, you might change > > the architecture of the driver to have one chip for the controller, but > > it's quite questionable change. Also how can you guarantee ordering of > > the enumeration? You probably need to *disable* SMP on the boot time. > > This will still be fragile as long as GPIO chip can be unbound at run > > time. Order can be changed. > > > > So, the patch is good and the correct way to go. > > > > P.S. The root cause is that hardware engineers and documentation writers > > do not consider their hardware in the multi-tasking, multi-user general > > purpose operating system, such as Linux. I believe the ideal fix is to fix the > > documentation (datasheet). > > Thanks for your review. > > The direct reason of this patch is that when "modprobe gpio-f7188x", > it conflicts with INT34C6. I met this issue on an older kernel, but > could not remember which version exactly. This is interesting. But what I have noticed the v6.3.2 missing this https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpio/gpiolib.c?id=7dd3d9bd873f138675cb727eaa51a498d99f0e89 change. Can you apply and retest? If this does not help, please share more details, exact steps of reproducing the issue, including respective `dmesg` output, etc. (maybe via creating a kernel bugzilla report). > The error message is as the link below: > https://elixir.bootlin.com/linux/v6.3.2/source/drivers/gpio/gpiolib.c#L798 -- With Best Regards, Andy Shevchenko