Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp887824rwd; Wed, 7 Jun 2023 08:09:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OOr+HoNxbK2JX0Zk1MWT8OiWKDqWIBoYyZy94tzoKHueKUWRSWCs/Ism0IO8WxJj2stch X-Received: by 2002:a17:902:f68a:b0:1ad:b5b4:e424 with SMTP id l10-20020a170902f68a00b001adb5b4e424mr2864917plg.38.1686150595833; Wed, 07 Jun 2023 08:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686150595; cv=none; d=google.com; s=arc-20160816; b=H2shjeO9sqG4pPU7/1vY5bZ+0m6seTVLpPbm//mKH09H75p5wTM75EQkMnzniPLcsq +XngNBm8gcsOI54dn20gLPs3i9dfqTfGAT0IuiVEGvcyV7kd7xiDhRiCDkMGh+I7TRDt S2zi9eqvt/J5O42HTysekucG2PIESgcNxFttQwl45CaWm4Knpv+8nU4DhdKkb73YpqpJ SW5vCm9XgXXeiXgt6odJaEB4I7cJUKKVicOKznOpSMOWo+AyFjvG9VYTlVobfj9SK77t 0BJfOEM3dKoOjUHEimYxEpLFWlm1RrHg+5ihV7L7opBpyhTJIf77ZlTXMwglp9u7NZmV LS9A== 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-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=iAIHwcazueeF4v54/CcXn7K5UvskKxjjIRmq1XIcdGM=; b=NUCD3svDzJDhcIY9oQPnCDsRaviQPBUlSdpO7DOeb7t1byBgfc3V4tdwYSMIEB/iyX NigwjP/hGwvXU7tSrUiLd4cprbeSuAFwdmGaZfzm0+Hmv46gvm7y9Dxizw141QZLzkoD i1lpfa2d1IjIEN7LeK4YhB9YGpI6CybV8jcCIPab/cMFQwClIxQ7LXsRRGz+9A/kSSTF 6vRywcN3+hZLWqhwe84p0r2oWLkJcw3gTqyfkt6AcOj5A37YC3fit21ngj9vwyWr6GeF 2J1e/gE7H/NsWI2wHNG2tZVOeanTuJt4KnpG9noo4HA/0XyvEtRuCotO5vBaER4dzUHv 6fXA== 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 d18-20020a170903231200b001aaed82c2afsi9408062plh.171.2023.06.07.08.09.41; Wed, 07 Jun 2023 08:09:55 -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 S240804AbjFGOtM (ORCPT + 99 others); Wed, 7 Jun 2023 10:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234794AbjFGOtK (ORCPT ); Wed, 7 Jun 2023 10:49:10 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2383392 for ; Wed, 7 Jun 2023 07:49:09 -0700 (PDT) Received: from localhost (88-113-24-87.elisa-laajakaista.fi [88.113.24.87]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 7314a8b2-0542-11ee-b3cf-005056bd6ce9; Wed, 07 Jun 2023 17:49:05 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Wed, 7 Jun 2023 17:49:05 +0300 To: Jiasheng Jiang Cc: andy.shevchenko@gmail.com, oe-kbuild-all@lists.linux.dev, linus.walleij@linaro.org, brgl@bgdev.pl, palmer@dabbelt.com, paul.walmsley@sifive.com, linux-gpio@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] gpio: ath79: Add missing check for platform_get_irq Message-ID: References: <20230607070819.48553-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607070819.48553-1-jiasheng@iscas.ac.cn> 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,RCVD_IN_MSPIKE_H2, 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 Wed, Jun 07, 2023 at 03:08:19PM +0800, Jiasheng Jiang kirjoitti: > On Tue, 6 Jun 2023 17:46:36 +0800 Andy Shevchenko wrote: > > Tue, Jun 06, 2023 at 12:28:17PM +0300, andy.shevchenko@gmail.com kirjoitti: > >> Tue, Jun 06, 2023 at 11:18:41AM +0800, Jiasheng Jiang kirjoitti: ... > >> > Add the missing check for platform_get_irq() and return error > >> > if it fails. > >> > The returned error code will be dealed with in > >> > module_platform_driver(ath79_gpio_driver) and the driver will not > >> > be registered. > >> > >> No, this functional change and has not to be for the fixes unless _this_ is the > >> regression you are fixing. Did the driver work before at some point as after > >> this change? > > I will remove the fixes tag in v4. > > > To be more clear, answer to the following questions: > > 1) does driver work with wrong DT configuration? > > 2a) if yes, does it make sense, i.e. the hardware functioning usefully? > > 2b) if yes, can we guarantee there are no broken configurations in the wild? > > > > Depending on the answers correct your code and/or commit message. The above is a list of the questions you need to investigate. (Note, it takes several minutes on elixir.bootlin.com to check some of this, but I'm not the author of the code) > >> Otherwise you have to _justify_ that this functional change won't break > >> existing setups (with broked IRQ in Device Tree, for example). > > Sorry, I do not quite understand what you mean. > I have no idea how these questions are related to my patch. The IRQ is usually provided by Device Tree or ACPI (here is DT only case). Then the platform code converts that to resource which this driver consumes. That resource is used when instantiating GPIO (IRQ) chip. > Do you mean I should not fail the ->probe() if there is wrong IRQ numbering in the DT? I don't know. The commit message of your change should elaborate this. > Please tell me the relationship between these questions and my patch. The tight relationship. The patch changes the flow. Either you shouldn't do that, or be aware and explain why it's not a problem. Or get it done differently. -- With Best Regards, Andy Shevchenko