Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4367606rwd; Tue, 30 May 2023 04:37:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5R8e7PxxVYtv93heIILUoCKS+0kim2Flhp8ltImhLOUj+04ISnXUD8BtSkF8u15fyQfDA0 X-Received: by 2002:a17:902:c948:b0:1ac:750e:33f4 with SMTP id i8-20020a170902c94800b001ac750e33f4mr2586838pla.32.1685446647441; Tue, 30 May 2023 04:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685446647; cv=none; d=google.com; s=arc-20160816; b=Zi7DjyCcsnUUxxdAlGmjFv64La3+ZBYwaGsSsSQOMss0Zbo1kSjw6oqgYSIZdJ2hw1 ga1oBBjuHmClU+V+B+LhTetEj2RGh4p5gT4RX2/cgdWHXrVqewbu/MLtOH8wF08dZn0s GGOo+O5+Zviz31rtAc63Tmak3cURd4+4IVbOQu17pOcXWekWpAO7pD/hzNLIexBkXFnJ KP2U/HlgYGyZyyPgF+xFcLTid1mVLRZlZJzt0iocuk/BBD2Enr42c9cp3DqryrPXE0iz F+ZVn00tZSlnfR0CKyBhhdUYMCIGrHdF0TeY7Mes6c8TaH00Ip/8PRoPps93u68jEWS5 jmlA== 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=6j5SHV70pDSwZPcamtX6U6AWKV8jCzVkEubgQXFukKU=; b=U3fIYcHXOSlwTk5lAPMF2kM9zvwXRCP0uCd8Zk01+zEVM6pLbCGl283KzAO/H6+b1H t/X7IqLU/hlO6lkfQu8BaALMG/dSyjwgdksNmNkPyOFV2vg3lQsX+Z98vwx2lTlwBkBb kIAGXmArLEitoRn82HJigVPUVa6C3EnPltqU0mR/57HsnfkkAdR9oNjvPFuENHmMtKQe llCBF4duJw5Sra8K45zlqrzhFcTBsUfN4LdJZ1C3Mh1NL3fl7R4sV+3fwKTCAou2EtKW JhMj51M39XojjQ5CMXUwyT5OB+rvYya4LCHvmsEEeKNQxGQVq2cGQfJz4Ju5nfKkGO0O WFaw== 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 jg17-20020a17090326d100b001ae4f2b8cfdsi96504plb.633.2023.05.30.04.37.12; Tue, 30 May 2023 04:37:27 -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 S231244AbjE3LKZ (ORCPT + 99 others); Tue, 30 May 2023 07:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231342AbjE3LKX (ORCPT ); Tue, 30 May 2023 07:10:23 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F95E8 for ; Tue, 30 May 2023 04:10:22 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 90076a58-feda-11ed-b972-005056bdfda7; Tue, 30 May 2023 14:10:19 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Tue, 30 May 2023 14:10:19 +0300 To: andy.shevchenko@gmail.com Cc: "xingtong.wu" , 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: 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 01:53:47PM +0300, andy.shevchenko@gmail.com kirjoitti: > 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 Oh, It seems I misread this as the cause of the patch, please ignore my previous reply. > > 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