Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp705982ybh; Wed, 11 Mar 2020 09:10:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvqnr1iGRp2rp9aO+Df41OX24XZJ3Btd8DRtloEZK+YK9LJlRXGMaW303CmY7AB0pVjAfW5 X-Received: by 2002:a05:6830:1f54:: with SMTP id u20mr2992478oth.322.1583943052968; Wed, 11 Mar 2020 09:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583943052; cv=none; d=google.com; s=arc-20160816; b=pP32feTx//7nPRprA2zudT8nd4eYKHmZnTI47asbAEMEvPv38X6gYR7u6JWSEA8XMK Omdq+/0l64hgtOr7c3xpu+4HvKq26zqf1Etmb/Ar5sCxU6PnlKYHd4SpA5/sQ3/d9cVn /s+lAa4pfjSZYLwy/GmiGaheihUTA7OxcqrQYnNf+xgvnKaNLtYfKh8HAkD8zSXxGjCc uVy/6+LnP008aWFdVcVJpwsWfZS+KzkJTDBI2CEdTzwYNOv0Xrgqi980pqKcYl2NeMmK AUSCXv0sxfq7Ji60floqL/J4eour8CWAb1/u4NEwh6j37H6o1/gonW5mD7hxMqiYeIy7 MeBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qHCMeKPDxYeB8oLBoOVgW7eRt3m++jTxFNAqk0lBahg=; b=u7n2erLIvOI9fU22MdQP2mxo3U0x89aSKo4A1mspjYdpktfQouvwCoDewbMHBZiHVM RNvEhi9Twp87VsR6cociaESa8DjVoVj4UX0E7OyxkGQJorVaIBUVR5a3+sSn/aBK7isJ x/i0sUq0Iv0CfguVyH3ISogeovvR1l1eD7+RdW7Rp0Ya1j4g+p6B0GR5pvd8p7baAw4Q q2CQ8ximoZbl8wRDIk6rAyn4CEOJrHNTWbhhbaTwX3bi92Si8uYzjIE3rFI9TkYQD6Fi o396K2IfCYoFUiWSurdV/XxDe47hNnnv3EBHUTL8jKvomevm0E6kziIAE2eEIfDyfuxE KwJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=T+2qbotF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s200si127264oie.188.2020.03.11.09.10.39; Wed, 11 Mar 2020 09:10:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=T+2qbotF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730026AbgCKQJ7 (ORCPT + 99 others); Wed, 11 Mar 2020 12:09:59 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:45429 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729989AbgCKQJ7 (ORCPT ); Wed, 11 Mar 2020 12:09:59 -0400 Received: by mail-ot1-f65.google.com with SMTP id f21so2530316otp.12 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=ZePsvie8S8me4Zdq229hRmfiSs3NKBdZmbirpOpITKJZJ6jJizeItrhwkCrZd8kOcD FvfvunU9QcRpaJXWSdwfXviLX+86WDDRsT3blXQjMsMQVssuUZ48ItBEZNv40pQ5Fs3O 9mubmahxquMPlKz1rqR41U1HmyQEPlDYJ0IZmySTMvTcmnNGhm+DzdbeLMu5wNpr6Krx DYVplR0jIqGaLV8Rcq+Hm+DTsHYGiHcoLuA3hNn0JmeDolxarRwfyNXMO1QlSfjXoYr3 4Un4T0B6D/TuQEijChvwqSlJdt/EiG4N+tC6T98pwtYP0LZE6wBWJVjrKYoUWJXa8lPe ygrQ== X-Gm-Message-State: ANhLgQ2kLFhoOTqpT7vfWOEzj1cH8tQZm5AOb68MQIwpY7c3NIkD9wSA y+AqwSpfycWXs5sffLIwuiG0Dydki0EXruV7vK/vBw== 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 Cc: Marc Zyngier , Santosh Shilimkar , Rob Herring , Nishanth Menon , Jason Cooper , Linux ARM Mailing List , open list , Tero Kristo , Sekhar Nori , Tony Lindgren , Linus Walleij , Peter Ujfalusi , Grygorii Strashko , Device Tree Mailing List , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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