Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3628438pxb; Mon, 24 Jan 2022 13:54:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQMZpkeALVKeTKg2dLjMnGTiMyB3HPAqBPwrsT8gRHEHUjhnqxvmOmCO+8uWpCoU2jJPua X-Received: by 2002:a63:86c8:: with SMTP id x191mr13143815pgd.218.1643061257140; Mon, 24 Jan 2022 13:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061257; cv=none; d=google.com; s=arc-20160816; b=J+ANeq/9kq1HWQcrhew+66QeCSJfB3xeaXFgTuWtWBeaSmHHfIhIEug+Rhlo0UPMSX l+Uq5p+HT+7ghIcqlY23qFFnKhhSNywABP2LJz4V+2Q+fJppoB+LeaBfpNzORzi0B1pU FlQIZtSpTZqbRB5XEyz8a/LPODoyAJQMvEvyDNVNNVwKnkD451GclsuGbIzQM52PAikX eqwkXPZcNZZZJoA+dt66QmJXOr7ci3pTRCA7BkzHDaF7AIqWoWc/8pKADc1n+3CPDLUh DoT+J/r1NwfcDifHFNX3zVzp0XpHUtyde54FXVCsNNPJx5J0DXy/AMzeOEuYjHV6yLxG tlsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-filter; bh=NIUc8QBKX/h12rKVs5+VoNpJ4D+KnvjVQrH2k92KlqQ=; b=W662CHOI9LXrOdIDhFeifr7eEtO8LZewtkpZcs9l1ouVnewjuLmuEDoe1iKYUH2AMF eLtc7tz7iLeevsdE83io502OnzFVIx1uyrbv+ciCFQMiUII4g+L1H5ekdb22/32+5VWi fl2fSE9SPqpmaSiARI6VLMy+wPJsJSMN/Jif4dS/qYeRcjuDbo4yWHjudfZENpJ9pIV8 MTmEpLB4azFK3FhrjDqXv9t4xZNIntdxm+4+5+nyub4LTqvPQmyayoR/TWZhDAz/KmA/ 60HIrsxCZ+I9mIaWQdxo9E+jrDlh5smNJZMZ/8fA8nJo4+4svJ3E85ZkQi9wxenVv08+ 5Zig== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si8218491plh.493.2022.01.24.13.54.04; Mon, 24 Jan 2022 13:54:17 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1456952AbiAXVke (ORCPT + 99 others); Mon, 24 Jan 2022 16:40:34 -0500 Received: from mxout02.lancloud.ru ([45.84.86.82]:57190 "EHLO mxout02.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1445138AbiAXVCV (ORCPT ); Mon, 24 Jan 2022 16:02:21 -0500 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 817A9209B103 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH] driver core: platform: Rename platform_get_irq_optional() to platform_get_irq_silent() To: Andy Shevchenko , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= CC: Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , , "Linus Walleij" , Amit Kucheria , "ALSA Development Mailing List" , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , Miquel Raynal , , Jiri Slaby , , "Khuong Dinh" , Florian Fainelli , Matthias Schiffer , Joakim Zhang , Kamal Dasu , Greg Kroah-Hartman , Lee Jones , "Bartosz Golaszewski" , Daniel Lezcano , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Linux Kernel Mailing List , Mauro Carvalho Chehab , John Garry , Peter Korsgaard , William Breathitt Gray , Mark Gross , "open list:GPIO SUBSYSTEM" , Alex Williamson , Mark Brown , Borislav Petkov , "Sebastian Reichel" , Eric Auger , Jakub Kicinski , Matthias Brugger , Takashi Iwai , , Benson Leung , Linux ARM , , Tony Luck , Mun Yew Tham , Hans de Goede , , Yoshihiro Shimoda , Cornelia Huck , "Linux MMC List" , Liam Girdwood , linux-spi , Linux-Renesas , Vinod Koul , "James Morse" , Zha Qipeng , "Pengutronix Kernel Team" , Richard Weinberger , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , , Brian Norris , "David S. Miller" References: <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <20220113110831.wvwbm75hbfysbn2d@pengutronix.de> <20220113194358.xnnbhsoyetihterb@pengutronix.de> <20220115154539.j3tsz5ioqexq2yuu@pengutronix.de> <20220120075718.5qtrpc543kkykaow@pengutronix.de> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <15796e57-f7d4-9c66-3b53-0b026eaf31d8@omp.ru> Date: Tue, 25 Jan 2022 00:02:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 1/24/22 6:01 PM, Andy Shevchenko wrote: >>>>>>> It'd certainly be good to name anything that doesn't correspond to one >>>>>>> of the existing semantics for the API (!) something different rather >>>>>>> than adding yet another potentially overloaded meaning. >>>>>> >>>>>> It seems we're (at least) three who agree about this. Here is a patch >>>>>> fixing the name. >>>>> >>>>> And similar number of people are on the other side. >>>> >>>> If someone already opposed to the renaming (and not only the name) I >>>> must have missed that. >>>> >>>> So you think it's a good idea to keep the name >>>> platform_get_irq_optional() despite the "not found" value returned by it >>>> isn't usable as if it were a normal irq number? >>> >>> I meant that on the other side people who are in favour of Sergey's patch. >>> Since that I commented already that I opposed the renaming being a standalone >>> change. >>> >>> Do you agree that we have several issues with platform_get_irq*() APIs? [...] >>> 2. The vIRQ0 handling: a) WARN() followed by b) returned value 0 >> >> I'm happy with the vIRQ0 handling. Today platform_get_irq() and it's >> silent variant returns either a valid and usuable irq number or a >> negative error value. That's totally fine. > > It might return 0. > Actually it seems that the WARN() can only be issued in two cases: > - SPARC with vIRQ0 in one of the array member > - fallback to ACPI for GPIO IRQ resource with index 0 You have probably missed the recent discovery that arch/sh/boards/board-aps4*.c causes IRQ0 to be passed as a direct IRQ resource? > But the latter is bogus, because it would mean a bug in the ACPI code. Worth changing >= 0 to > 0 there, maybe? > The bottom line here is the SPARC case. Anybody familiar with the platform > can shed a light on this. If there is no such case, we may remove warning > along with ret = 0 case from platfrom_get_irq(). I'm afraid you're too fast here... :-) We'll have a really hard time if we continue to allow IRQ0 to be returned by platform_get_irq() -- we'll have oto fileter it out in the callers then... >>> 3. The specific cookie for "IRQ not found, while no error happened" case >> >> Not sure what you mean here. I have no problem that a situation I can >> cope with is called an error for the query function. I just do error >> handling and continue happily. So the part "while no error happened" is >> irrelevant to me. > > I meant that instead of using special error code, 0 is very much good for > the cases when IRQ is not found. It allows to distinguish -ENXIO from the > low layer from -ENXIO with this magic meaning. I don't see how -ENXIO can trickle from the lower layers, frankly... [...] MBR, Sergey