Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4018127pxb; Tue, 25 Jan 2022 01:30:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv2RNUKjH0MP5YhJoQ5fBRDKrApI7tdHJpSwjufdYu/nSlHf9bOYNflANsJpalQIhf0mbt X-Received: by 2002:a63:8241:: with SMTP id w62mr3521850pgd.612.1643103040696; Tue, 25 Jan 2022 01:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643103040; cv=none; d=google.com; s=arc-20160816; b=sqnJwgkiY/OTAAHTb4dVQphIo6otBB/YZ9GebRSfCd53i605BL1vPY9jLP7s5PtJ93 /fo4fZL1TadbQdbvKc1zTq3O8xiHy6OO04KjtnjJFlbKuI28SxRnHjDZoHm3igeV5DRz +Wit9j58xKXP5jlKDy8a1CHDY/wjiTVzuJVx8FfUCuh9hSkBcPrr1sWWFKsHmBppPECj WofWVzCrLT3C4QtW1DFFRZXpv2diT/07MZtWvCQmVMIJgAFXOsWRr9FiRVyHlYBgEG8S WtUtCBktrs7K2NEQN3dy3V7Ne0u1uiPpclzS61W3sGGMufUyhtB5bW4E0/Cj73Lg+0iz qSMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=0nj3tQtaS2Jftix8pFrL2+Rvw9SRm0Q+IWJ3wAkzl0s=; b=FMKHloVZxp2BIvixTSaPx37BVDpfMRC+3HGYL5K9SiNMlGbAgjMYtn0Oi+MpWX5BgH RB0NfqGLX+4YygukCbq4lZTCdt2n5rKpGTY5UNiv8ayUJCHuFlhh9x5m5U9gDaF72Iit ecBrn3eURGmFqssML5DTCuSJDgae5mV8xwivo2PPJleblO0UG70uYcFsIp7QqiXJxlg1 r38f6z6QRbIQFWT8i4khuY/LZ+NkI2GnxBPByOihpAXSzKElqyBHdaKHuiOAWA5dGT5u qcI3oBzjLsME2/Hib2edGpr1Jrim+2zlfm2IKfbCPBXHaOR3KxfGFW5rxkFAcTSh5yJp Re6g== 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 e12si5016972plh.484.2022.01.25.01.30.29; Tue, 25 Jan 2022 01:30:40 -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 S1450897AbiAYIgl (ORCPT + 99 others); Tue, 25 Jan 2022 03:36:41 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:38608 "EHLO mail-qv1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378752AbiAYIb3 (ORCPT ); Tue, 25 Jan 2022 03:31:29 -0500 Received: by mail-qv1-f51.google.com with SMTP id b12so4529982qvz.5; Tue, 25 Jan 2022 00:31:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0nj3tQtaS2Jftix8pFrL2+Rvw9SRm0Q+IWJ3wAkzl0s=; b=WB9h79SHkFBh8zEGcIeB7E5HjafQdfpc08WU2JJUiiPYqy9M9KJ/1Obbo3AoYDuZM1 L1ZQ35GjmvhlgLfu/XAavya6XuAAD+5NoospC4UKkm5iDbh8x7/5myPjkvSpHJx+1S1t MJoJYqGdK7EVegPvSwcyshqEkzm5FfysYVYEy17n9KIBsqKUHA751y1SqRy7fxRZTJIJ XwSLmmOSBQVCaiCt5Lp+1+6RoKze+67Ygj9GhfzsJEBTjeJWUcv/cptoSXjrRnyPWrD9 Bp/hDQh9OiCwjzfUPD47V6Yg/M2Hs5SNbYhyiB9BDtvD2gf0W0vSHVNHDpyLrrFV4q7J DrAg== X-Gm-Message-State: AOAM533jz79E3Mb70YzDiCSOaQNE/eMwJqeM8QoYVLs1gyCdu9MFvtXH rBe1oSOzAy87kimGpLjSGZsXQpf32NMPiu/s X-Received: by 2002:a05:6214:3006:: with SMTP id ke6mr15873363qvb.59.1643099481113; Tue, 25 Jan 2022 00:31:21 -0800 (PST) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com. [209.85.219.50]) by smtp.gmail.com with ESMTPSA id d8sm8722166qtd.70.2022.01.25.00.31.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 00:31:21 -0800 (PST) Received: by mail-qv1-f50.google.com with SMTP id k4so24225123qvt.6; Tue, 25 Jan 2022 00:31:20 -0800 (PST) X-Received: by 2002:a05:6102:a04:: with SMTP id t4mr1874173vsa.77.1643099137125; Tue, 25 Jan 2022 00:25:37 -0800 (PST) MIME-Version: 1.0 References: <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <20220113110831.wvwbm75hbfysbn2d@pengutronix.de> <20220113194358.xnnbhsoyetihterb@pengutronix.de> <20220115154539.j3tsz5ioqexq2yuu@pengutronix.de> <20220120075718.5qtrpc543kkykaow@pengutronix.de> <15796e57-f7d4-9c66-3b53-0b026eaf31d8@omp.ru> In-Reply-To: <15796e57-f7d4-9c66-3b53-0b026eaf31d8@omp.ru> From: Geert Uytterhoeven Date: Tue, 25 Jan 2022 09:25:25 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] driver core: platform: Rename platform_get_irq_optional() to platform_get_irq_silent() To: Sergey Shtylyov Cc: Andy Shevchenko , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , Miquel Raynal , linux-phy@lists.infradead.org, Jiri Slaby , openipmi-developer@lists.sourceforge.net, Khuong Dinh , Florian Fainelli , Matthias Schiffer , Joakim Zhang , Kamal Dasu , Greg Kroah-Hartman , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , "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 , platform-driver-x86@vger.kernel.org, Benson Leung , Linux ARM , linux-edac@vger.kernel.org, Tony Luck , Mun Yew Tham , Hans de Goede , netdev@vger.kernel.org, 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?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sergey, On Mon, Jan 24, 2022 at 10:02 PM Sergey Shtylyov wrote: > 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? So far no one reported seeing the big fat warning ;-) > > 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... So far no one reported seeing the big fat warning? > >>> 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... It might one day, leading to very hard to track bugs. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds