Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2583567pxv; Sun, 27 Jun 2021 02:35:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb8RCCUUi1DTzp2G4bS82WgDBg3ScdrM4NtDoRB5x8UJ6GuL0jALTEi0aJop7ypdXf+nrV X-Received: by 2002:a92:6902:: with SMTP id e2mr5618548ilc.275.1624786501841; Sun, 27 Jun 2021 02:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624786501; cv=none; d=google.com; s=arc-20160816; b=09JKa0P0O51Ywolp/j8C19+xM77kEGFVfhsIVBBI/pEWO6KoKSyYclVH94OXl2R/kX /9KcoT6DsX91vIuVtkD5TReW3ed6mefZUz4nkfSwedg5gRmHtBrmsTUgduWFc0aCXLGE 2YaLgCtLt5oGgR320UpAxClbzDg5z6FtilIawDjEnwW5s3xhcqZmVSos5pva9V1K8QvE 7wxVUGrTdUf6Rr1uFr9RLp9dwhRtNJVjaK4i0u3njTksqBpJeaJ5w+DmTnyQYwwh++S4 W3MU+sl0r+yR9jlcXuoPGASnOmJp9eluWBRZFeXMo5yh7XmjNmRScxBqkBRumhi1I1VS tQBg== 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:dkim-signature; bh=5EhXthsWfwEs0xNrl9REBAzPg/Pr0Fd/pP88+OTbnhY=; b=ALUDsq/rWhwOX/AgORT7pMDfkM3lSz7+wTYCrPiykjocNZcBXGdBSzF5orEm1nO8TA pQxEKp7MWCsIoi5LlfLKNGv6la2djS9yMeLHkOPQAGigG7QwRdDPH/zC4a5p1307k5v1 rsQhuntiysnWtf1AQwmkQWEEqdFC5wjGYWDtk2WVCLCATJFxog3wP7CQOSplxMgEh0Gv vYtqCFGLj2r4T0jPwrThnEbq5pAWR+exptblFqo4TJ9pIpu3D7Pp7L4Fs9PdpHxKKYAd b3fJJK+y6FACFotZWzNTSkYMd1KLfTHipOPwkgxgk48p5K20dYiR8NlcuLI38DEZvcQD 7n7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dR3BCf8G; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si5422391jad.43.2021.06.27.02.34.49; Sun, 27 Jun 2021 02:35:01 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dR3BCf8G; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbhF0J0g (ORCPT + 99 others); Sun, 27 Jun 2021 05:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbhF0J0c (ORCPT ); Sun, 27 Jun 2021 05:26:32 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3E0C061574; Sun, 27 Jun 2021 02:24:09 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id n11so2930121pjo.1; Sun, 27 Jun 2021 02:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5EhXthsWfwEs0xNrl9REBAzPg/Pr0Fd/pP88+OTbnhY=; b=dR3BCf8GlgDv63a2yPBk9InUJqLy3eN66Z3Efz4nGNr1sXgKcsTX1da//xiSMcFx0X qu9zR9sMoFzGaBKCykIUroGmlCH03ytTWiCSbAu53yEJcgZv+NHAkxU6b9avY7pONbQE zqPaUiw+QOMvYcKnmwrwFGuvE/7KmwbK2SZr4bwFBTCJxiEn24UBfNQW7X3tqi6VGJaz Gb5vjKrO6Lfj2m7OfWNq8spb1yj5Lns1ErUH/RuxYZOjSSSiAp2OYEZD8gfAFeFxAMNx R14q6PpnQxbb31fWWtaoqsz9+XCkeMU1GwHqsr/z23XUGexX2FnoVBKMkLFolJUlfSDC OY4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5EhXthsWfwEs0xNrl9REBAzPg/Pr0Fd/pP88+OTbnhY=; b=SqGoolFa5Xb2mPejk/XObk210CcsCBHJoaGwEVrsekkdyjCEA1vs9NeIvP4xLrk4Xn 9IIIK4aFY+NMMg1pNv/bbqCWNAk7RzNOEk7mvWajmakdX2ws8gfuYuaVd/YMJVlzqKsW VzUQpOqFysK9wm0T1e6Ys52pczgTWdJAyJJEDwVL0fTr0jD9yi++06wUXqH8WhTbcy4N pLgYxWY56HcrhIJwp9Rj1FK/v/eNxSyX7xUr5OmsVMP5tp6NISM1BeaGq4AgayKtbtVD uS4xoxKhdIgVI9IkHja+xPexlh8jGzZh+5Khpk4TCKl/quK2VZjsSfbEKmeblSy/mWyD J9YA== X-Gm-Message-State: AOAM5322+RFdHOu/3fjyfz0VgzfImFAnpDvCuB+dzQ79vnhC4WtyEfDC 8CmYLkSH6kIcOAADUDszPDVe4DN2sdrSnF1xLB8= X-Received: by 2002:a17:902:fe0a:b029:11d:81c9:3adf with SMTP id g10-20020a170902fe0ab029011d81c93adfmr17159686plj.0.1624785848687; Sun, 27 Jun 2021 02:24:08 -0700 (PDT) MIME-Version: 1.0 References: <11a8323c249ae6ea7584402ab0fb74551b6a4b7d.1617189926.git.matthias.schiffer@ew.tq-group.com> <4c143c8ee65fe52840ccbb4e1b422b6e473563d9.camel@ew.tq-group.com> <38b1191ce594d9fefe9e0e98b3fa8ca0a23ee3ea.camel@ew.tq-group.com> <53e222fdbb3d488a99bb24d0205b064d3fe662b0.camel@ew.tq-group.com> In-Reply-To: <53e222fdbb3d488a99bb24d0205b064d3fe662b0.camel@ew.tq-group.com> From: Andy Shevchenko Date: Sun, 27 Jun 2021 12:23:32 +0300 Message-ID: Subject: Re: [PATCH 1/3] gpio: tqmx86: really make IRQ optional To: Matthias Schiffer Cc: Linus Walleij , Bartosz Golaszewski , Lee Jones , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 4:44 PM Matthias Schiffer wrote: > On Wed, 2021-03-31 at 17:03 +0300, Andy Shevchenko wrote: > > On Wed, Mar 31, 2021 at 4:36 PM Matthias Schiffer > > wrote: > > > On Wed, 2021-03-31 at 15:39 +0300, Andy Shevchenko wrote: > > > > On Wed, Mar 31, 2021 at 3:37 PM Matthias Schiffer > > > > wrote: > > > > > On Wed, 2021-03-31 at 15:29 +0300, Andy Shevchenko wrote: ... > > > > > I don't understand which part of the code is dead now. I assume the > > > > > `return irq` case is still useful for unexpected errors, or things like > > > > > EPROBE_DEFER? I'm not sure if EPROBE_DEFER is relevant for this driver, > > > > > but just ignoring the error code completely doesn't seem right to me. > > > > > > > > platform_get_irq() AFAIK won't ever return such a code. > > > > So, basically your conditional is always false. > > > > > > > > I would like to see the code path which makes my comment wrong. > > > > > > EPROBE_DEFER appears a few times in platform_get_irq_optional() > > > (drivers/base/platform.c), but it's possible that this is only relevant > > > for OF-based platforms and not x86. > > > > Ah, okay, that's something I haven't paid attention to. > > > > So the root cause of the your case is platform_get_irq_optional|() > > return code. I'm wondering why it can't return 0 instead of absent > > IRQ? Perhaps you need to fix it instead of lurking into each caller. > > what's the plan here? "driver core: platform: Make > platform_get_irq_optional() optional" had to be reverted because it > broke existing users of platform_get_irq_optional(). I'm not convinced > that a slightly more convenient API is worth going through the trouble > of fixing them all - I know we don't care much about out-of-tree > modules, but subtly changing the behaviour of such a function doesn't > seem like a good idea to me even if we review all in-tree users. Why? The problem with this function is either naming or semantics. It should be fixed and that will require revisiting all current users anyway. > Should I just rebase my patches with the existing ENXIO handing (and > fix up the other issues that were noted), or do you intend to give the > platform_get_irq_optional() revamp another try? I do intend to give another try, but if you want to be independent of that, just make sure that in any new / revisited user of platform_get_irq_optional() the 0 is taken into consideration as an optional case. -- With Best Regards, Andy Shevchenko