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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AAD9C433B4 for ; Tue, 6 Apr 2021 23:31:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB90961205 for ; Tue, 6 Apr 2021 23:31:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB90961205 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LCLWVJpdN4n7pKA0LHeIV6mWRf1DRpnD29KeiKTXcSs=; b=Qc5NlMUS8XKby/7VKLbT/3PBP GhHSWzc/hQUNMpjNbWSq5Djb2GluCdVMwLcubYlxve2mC8TNh/6+kULG+uIFIuBNuEg2xcNhXJIZq LoMC7Kcyo/adfOmVlf2yApf4zd+ojCmZVzRKDnZjzVjo4JtFHZ8D54xBGkwRCzcOmoH4YBoRwL8jw aFt/Zc1yUDLWqemwfzL6ZUJ1qTzFHEd2F5t15M9vnneNNUxjKzG/JrQfR7MJ0VftJDhgM8cv6wp88 gVoG7nRPVJvBTUWNBQz8gue8FQ6a+7zOWAWOIzls0nA5d2kfUuxRRVGdqHznB0l2SINrBp3DedfsJ EVUfoE1OA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTv7v-003cWh-H0; Tue, 06 Apr 2021 23:28:56 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTv7p-003cUL-QG for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 23:28:52 +0000 Received: by mail-pg1-x534.google.com with SMTP id h25so11613483pgm.3 for ; Tue, 06 Apr 2021 16:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RGNhW1SeCdXrMq4z6mrbdFRDIylhAsC1seorfL6HTAM=; b=rpNRun9/6wtnfL2CPb/ElToTlTr/MBgUJSi1HaaTdIjFLJ7NW6EesGp29IN/KMoscW m+uRBzeLMM5hqXsUG3zTVi0PyJgeraCxz6BaOPjV8pxQeAZG1xGRWNB3aJbCRYnV7czB ZyhF02592EHIhj3tSaET9sXEyyi/ChMhraptbYj57PuyV9gV/ZRRmALEl8ocMuhzf4P4 +WJl23P2ObKObCZDRg1lKGYrwZ+dF0q3RhXWA+xwTcRJsuy9IzAi2sujuMr0jPxA9AtP 16TYdP4orK+eF9R/pTH9+ST9Vd6RV3oGdCxfBTEa/UBITVVLSiaHInF9X4BQxgMxqtNs pWXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RGNhW1SeCdXrMq4z6mrbdFRDIylhAsC1seorfL6HTAM=; b=FZPITGc9uPOUIgRCncexaf8sTS5ZKQKCdkYTg+D6Kq4XX9oXLLkpRtcH2aoiPIxXf2 M2m/bu8xDGmsOiIKqj2R4LsO3D0ktWA1oyUsry77EAErdLAuo2wU/WcfkXW58bdscaMZ mGAnLtYSeL/8KPkc5Rp7/bYvK7eEmk/fAtv918Hd/zGOA5+gB/D3p2RP/7yi59foncKs Dj6jIwQoXTrBmpGywwOryH0NgQcESSBZzR4pAebnI3DP6ZGxj4UeXSqTIgKbBAY0bc/R Kk9CJ4VDh+bC/93gV9WzJ6JMrW4uvjVpz+ieLxIbGzhrkaD0riZq0rZnSSaF2GyJp5ig sPJA== X-Gm-Message-State: AOAM5329x7ljFOWNz49dvUrCje+rtoBhcXeoRZLtJzituN92xxPdZ2+h SG0E4eyt0jfZAZYpcezonSZu0w== X-Google-Smtp-Source: ABdhPJwBU6hVyjyLMzyH1bXdT1/Ghkt/24x5WKhTlDwW92zY37reeKFNWQzZR6scrzDv0JVqW74bSw== X-Received: by 2002:a65:68d3:: with SMTP id k19mr580276pgt.44.1617751721163; Tue, 06 Apr 2021 16:28:41 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id j16sm19188529pfa.213.2021.04.06.16.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 16:28:40 -0700 (PDT) Date: Tue, 6 Apr 2021 17:28:37 -0600 From: Mathieu Poirier To: Suman Anna Cc: Bjorn Andersson , Grzegorz Jaszczyk , Jan Kiszka , Vignesh Raghavendra , Lokesh Vutla , linux-remoteproc@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] remoteproc: pru: Fixup interrupt-parent logic for fw events Message-ID: <20210406232837.GA330882@xps15> References: <20210323223839.17464-1-s-anna@ti.com> <20210323223839.17464-2-s-anna@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210323223839.17464-2-s-anna@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210407_002850_524309_06C10F5D X-CRM114-Status: GOOD ( 25.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 23, 2021 at 05:38:37PM -0500, Suman Anna wrote: > The PRU firmware interrupt mapping logic in pru_handle_intrmap() uses > of_irq_find_parent() with PRU device node to get a handle to the PRUSS > Interrupt Controller at present. This logic however requires that the > PRU nodes always define a interrupt-parent property. This property is > neither a required/defined property as per the PRU remoteproc binding, > nor is relevant from a DT node point of view without any associated > interrupts. The curret logic finds a wrong interrupt controller and > fails to perform proper mapping without any interrupt-parent property > in the PRU nodes. > > Fix this logic to always find and use the sibling interrupt controller. > Also, while at this, fix the acquired interrupt controller device node > reference properly. > > Fixes: c75c9fdac66e ("remoteproc: pru: Add support for PRU specific interrupt configuration") > Signed-off-by: Suman Anna > --- > drivers/remoteproc/pru_rproc.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c > index 16979c1cd2f4..a9d07c0751be 100644 > --- a/drivers/remoteproc/pru_rproc.c > +++ b/drivers/remoteproc/pru_rproc.c > @@ -284,7 +284,7 @@ static int pru_handle_intrmap(struct rproc *rproc) > struct pru_rproc *pru = rproc->priv; > struct pru_irq_rsc *rsc = pru->pru_interrupt_map; > struct irq_fwspec fwspec; > - struct device_node *irq_parent; > + struct device_node *parent, *irq_parent; > int i, ret = 0; > > /* not having pru_interrupt_map is not an error */ > @@ -312,9 +312,16 @@ static int pru_handle_intrmap(struct rproc *rproc) > > /* > * parse and fill in system event to interrupt channel and > - * channel-to-host mapping > + * channel-to-host mapping. The interrupt controller to be used > + * for these mappings for a given PRU remoteproc is always its > + * corresponding sibling PRUSS INTC node. > */ > - irq_parent = of_irq_find_parent(pru->dev->of_node); If I understand correctly when an interrupt controller node wasn't speficied in the parent this was unwinding until it found one... > + parent = of_get_parent(dev_of_node(pru->dev)); > + if (!parent) > + return -ENODEV; > + > + irq_parent = of_get_child_by_name(parent, "interrupt-controller"); > + of_node_put(parent); > if (!irq_parent) { > kfree(pru->mapped_irq); > return -ENODEV; > @@ -337,11 +344,13 @@ static int pru_handle_intrmap(struct rproc *rproc) > goto map_fail; > } > } > + of_node_put(irq_parent); > > return ret; > > map_fail: > pru_dispose_irq_mapping(pru); > + of_node_put(irq_parent); Reviewed-by: Mathieu Poirier > > return ret; > } > -- > 2.30.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel