From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by archive.lwn.net (Postfix) with ESMTPS id 21AE47D910 for ; Wed, 11 Mar 2020 16:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rvUFwl8rUBng1m6TXIXzQ+oZ3damNW+QdLZEKCHYjTQ=; b=tCjsU1fVjjZdkO SIotohfneVWtB6gfV8CUe2n5bncOpG6wfMhQegpRPqh1fj+W1iVd79enr3d4xpHpGvd6xCUCCStpj 1Vc5tJj5SqEaDLYmL4Ik6fiqeAVA0dnJrQ/2TPA8BT5D3yHAWLkng8loVgbNKRgAEjdO7eQu/43Rx 4B4yVHRqaNlU4PNHgjcwcdBOlljyUGRX0DK4T9QeC+HbuFoi1kuHgTZMI4VVGW3J55G2up1+/OTSD WsT4rv7xGtfdQ3o9EhnGPizZs4DGUbJE+GSVLDaRq8wcDms3o5QWuhnNDdm0/CRcinpbOWoeqYYI1 IcI6Nm6ry5BYeRhLcIgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jC3vl-0007en-7R; Wed, 11 Mar 2020 16:10:01 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jC3vh-0007eA-OK for linux-arm-kernel@lists.infradead.org; Wed, 11 Mar 2020 16:09:59 +0000 Received: by mail-ot1-x343.google.com with SMTP id h17so2544797otn.7 for ; Wed, 11 Mar 2020 09:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qHCMeKPDxYeB8oLBoOVgW7eRt3m++jTxFNAqk0lBahg=; b=T+2qbotF8YuwXHpWLAJaVZ3hVF/dquYCSRS05M1A7mvQV5LzfewtWVTsHWdk8Go9F/ 2g/4Ym2nx7n5QV/sER4Txqu5rPTxqet8VHyUWGxCmwWAJt3qUQiSWGPET2xfNz9JfedF 5xwHqKoGb41geEImN2fUmeSQQF7St0SbGtqHlmlfn6i/7S3/hSGDeYa08lyFqq83sM5I UZp8EKZAV1mUiq5TMGDkiQlDPoljkg8PtpjL06pqruUn0UYWL7pIycT6vZrXwQHxfMFV S60j0XBqb/FAOJfDMpT+2LXN3h4M5o4PLyfEnFL6nPDVvmcVHwvYhv+3zKS43eS04L3G EiGw== 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=qHCMeKPDxYeB8oLBoOVgW7eRt3m++jTxFNAqk0lBahg=; b=Tc/l+5+kzEXbRlBATryUWYwZEHcxUAi7ZWDK0FTVC9VX12QQnc+KbhApHnxtZeF7FD 4uoOwTHCe4RroTqIRGCnzh3wk5/G6AULA7N5UaqJzRUg+lh3XJ31USmJP++FS/HPhNbb vYcm0qX4Br7FC3BD5NH6AFYLZcmufpcngLAAWm19rypjDOqWJnV1auwF4akI05UeGpGI mfaa5DnoCE2ObGcIl/QCiYH+Yr4cCYZN1VRzRtDrLSScur5Yz27kkKVOhxZjqwRQTAJr eah8UhkTj8BN2urnxPQmOJZgWrXCyluANuD4vkKNKnF59TkqjHcl8Fv+HFSEjh5xo/sz bu+w== X-Gm-Message-State: ANhLgQ0YQBk6gxch5rwsxwY2fyOe2u0xyF5pRAlJmeQVqLTtnagK3Fqg X6lpixlyETqwSNAfs0masknmbx/EhGltG9H2Gl64pw== X-Google-Smtp-Source: ADFU+vsF0mYOWDUY9jeerFS7C1YHWPcdcvJokSfwKoYIwMy0iUuNQO8orU7ziwk2fzKINRWEir3a59IQXixeW7y6JDo= X-Received: by 2002:a4a:2a47:: with SMTP id x7mr790140oox.23.1583942995604; Wed, 11 Mar 2020 09:09:55 -0700 (PDT) MIME-Version: 1.0 References: <20190430101230.21794-1-lokeshvutla@ti.com> <20190430101230.21794-8-lokeshvutla@ti.com> <87zhcmkicp.fsf@nanos.tec.linutronix.de> In-Reply-To: <87zhcmkicp.fsf@nanos.tec.linutronix.de> From: Tim Harvey Date: Wed, 11 Mar 2020 09:09:43 -0700 Message-ID: Subject: Re: [PATCH v8 07/14] gpio: thunderx: Use the default parent apis for {request, release}_resources To: Thomas Gleixner , Lokesh Vutla X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200311_090957_934062_04A76E1A X-CRM114-Status: GOOD ( 19.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Peter Ujfalusi , Grygorii Strashko , Jason Cooper , Device Tree Mailing List , Marc Zyngier , Linus Walleij , Sekhar Nori , open list , Tero Kristo , Tony Lindgren , Rob Herring , "open list:GPIO SUBSYSTEM" , Santosh Shilimkar , Linux ARM Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+lwn-linux-arm-kernel=archive.lwn.net@lists.infradead.org Archived-At: List-Archive: On Wed, Mar 11, 2020 at 8:43 AM Thomas Gleixner wrote: > > Tim, > > Tim Harvey writes: > > On Tue, Apr 30, 2019 at 3:14 AM Lokesh Vutla wrote: > >> - if (parent_data && parent_data->chip->irq_request_resources) { > >> - r = parent_data->chip->irq_request_resources(parent_data); > >> - if (r) > >> - goto error; > >> - } > >> + r = irq_chip_request_resources_parent(data); > >> + if (r) > >> + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); > > > > This patch breaks irq resources for thunderx-gpio as > > parent_data->chip->irq_request_resources is undefined thus your new > > irq_chip_request_resources_parent() returns -ENOSYS causing this > > function to return an error where as before it would happily return 0. > > > > Is the following the correct fix or should we qualify > > data->parent_data->chip->irq_request_resources before calling > > irq_chip_request_resources_parent() in thunderx-gpio? > > You are not supposed to fiddle with parent data at all. Just because C > allows you is no excuse to violate abstractions in the first place. > > irq_chip_request_resources_parent() rightfully returns -ENOSYS when it > can't request a resource from the parent chip because that chip does not > have anything to offer. > > It's up to the caller to do something sensible with the return code. If > your chip is happy with the parent not providing it then handle > -ENOSYS. None of the chip callbacks should return -ENOSYS. If one does > then that wants to be fixed. > Ok, makes sense. Thank you and Lokesh for the feedback. I just submitted a patch to fix the thunderx-gpio breakage. Best Regards, Tim _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel