Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp161642ybh; Tue, 10 Mar 2020 21:58:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+lhIfVrtgZMR2rLQ/NmYklmFNypFlHjFk0efAD40W/AJpx3IrT2se5FLxi8qnclzYgfTF X-Received: by 2002:aca:3196:: with SMTP id x144mr732367oix.77.1583902739431; Tue, 10 Mar 2020 21:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583902739; cv=none; d=google.com; s=arc-20160816; b=rCx6Nues7qxgv2sI35zIwUj7OZSjyDUMz0pgZxCTUg55myS1FrJxLto6Wbtl6jgaWH nlFEWgF5RA2E2Sjl9jcsYgzbpFHLSpEeYHxxxpmE/pNLYkk/JtXNkbr1bEw4jFXQciWx gmsAyJoCIv+SZYSbNCyY7JlHZes8NZ0nAo3/hcSoHf8Gh+iNUntenh8yvLNM8eiiAR9P c8ZTXR2NhuEBn1AMr2u5qUprOElvruOO9j4B84Tuznue0EGZ2H9x/zfGYeB1KEWXW8vg hwoxmODMo4KHYz1n7fK/JW4zliqVd6+ovQSY1UdrXVF1OwflfQWbPqGM8IflJdSy0zcG BhNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=MFTqGdrDyTmeaJQ1bZpBzfDtbpnP3ovZ3eA6y3Etkpg=; b=Osq0DIfqeTc4onNNCpbwE01ozlEN1+yxWnaIAskcku6h1Wlq7NZDY8L2qZWFhoU/Ke 4RFAMAD+53sAm1dnAvslvxE+pwIoCkDJfKEIZYdZQL3HaABlrtfOGVAEtLGKWrqhGEXn W3nwgW5cQczvheRGKW52IP6piUa5pcfBwpiTyPxWNw2gf5DRNckw6UbYlwwdUFbm5Tdj eLAsCLNwHcnevN8rrKn1FRtP3PJ0rBLssGS+LibadtNlXs88+rs6gRtMANzg+GI1E68L ewSSbhL6j1xuBVyb1uLuuZmEJs5hvmno2+dUg0bYX9ytJCEWVDaKEIPm/oC24Ge3gTlt G46g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LxyfcpIh; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k200si478719oih.6.2020.03.10.21.58.47; Tue, 10 Mar 2020 21:58:59 -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=@ti.com header.s=ti-com-17Q1 header.b=LxyfcpIh; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726362AbgCKE6U (ORCPT + 99 others); Wed, 11 Mar 2020 00:58:20 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:59540 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbgCKE6U (ORCPT ); Wed, 11 Mar 2020 00:58:20 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 02B4vliK085472; Tue, 10 Mar 2020 23:57:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1583902667; bh=MFTqGdrDyTmeaJQ1bZpBzfDtbpnP3ovZ3eA6y3Etkpg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=LxyfcpIh2W+Bsk5crUUjzOQjTkD+k2r8DTKINGYZI4hjjSWMWyIekWRblL9BFyK0r 2CMSJJG9jE6OdD55+B0kykLUyHNFd98Vp+AmDZQeCmo21uMDzycgsEKRFEkd4fOB8i o6DR36lvZrdupylA+QzkBojFkE/TCocpBSkg1tFs= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 02B4vlbe057182 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 Mar 2020 23:57:47 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 10 Mar 2020 23:57:47 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Tue, 10 Mar 2020 23:57:47 -0500 Received: from [10.24.69.20] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 02B4vgLT066746; Tue, 10 Mar 2020 23:57:42 -0500 Subject: Re: [PATCH v8 07/14] gpio: thunderx: Use the default parent apis for {request,release}_resources To: Tim Harvey CC: Marc Zyngier , Santosh Shilimkar , Rob Herring , Nishanth Menon , Thomas Gleixner , 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" References: <20190430101230.21794-1-lokeshvutla@ti.com> <20190430101230.21794-8-lokeshvutla@ti.com> From: Lokesh Vutla Message-ID: Date: Wed, 11 Mar 2020 10:26:47 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tim, On 11/03/20 4:57 AM, Tim Harvey wrote: > On Tue, Apr 30, 2019 at 3:14 AM Lokesh Vutla wrote: >> >> thunderx_gpio_irq_{request,release}_resources apis are trying to >> {request,release} resources on parent interrupt. There are default >> apis doing the same. Use the default parent apis instead of writing >> the same code snippet. >> >> Cc: linux-gpio@vger.kernel.org >> Cc: Linus Walleij >> Acked-by: Linus Walleij >> Signed-off-by: Lokesh Vutla >> --- >> Changes since v7: >> - None >> >> drivers/gpio/gpio-thunderx.c | 16 ++++------------ >> 1 file changed, 4 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c >> index 1306722faa5a..715371b5102a 100644 >> --- a/drivers/gpio/gpio-thunderx.c >> +++ b/drivers/gpio/gpio-thunderx.c >> @@ -363,22 +363,16 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data) >> { >> struct thunderx_line *txline = irq_data_get_irq_chip_data(data); >> struct thunderx_gpio *txgpio = txline->txgpio; >> - struct irq_data *parent_data = data->parent_data; >> int r; >> >> r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); >> if (r) >> return r; >> >> - 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); > > Lokesh, > > 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. Returning -ENOSYS is the right behaviour. If the parent doesn't have the resources, child driver should not hook it at all. > > 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? If there are no parent resources why should thunderx-gpio request parent resources at all? Thanks and regards, Lokesh