Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp151428pxf; Wed, 24 Mar 2021 01:25:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcdwpehCGHneBeFwn1R9fXnXwnl/ghRjjkvoI0Yah6/O7rKU3LY7St4DWMuRN1li6Wk8tG X-Received: by 2002:a17:906:b4c:: with SMTP id v12mr2394205ejg.330.1616574327432; Wed, 24 Mar 2021 01:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616574327; cv=none; d=google.com; s=arc-20160816; b=DgjDROrlPEguOPBHPtszZ4NRk9c8YKN4T6u3KuszpdfXNt/ZGbPqWcaHCoMKiTnyFe licJAWD4ydJJrozi3njj+ueH/YsV1lIXcpAQIxjPLv6ma+DW4yhMNXmb23H+PlSEFH2w t48/VTEnHYhqMGUoAmkxGwgTmFpgRIsMRl+21qnBYrrmt++RnhT+FgG6hwfiB7Xvkfs9 eV058BZ3Cph41+ZIUFyI0nhQdw77ecGXV58RuoK7TzU0eg6NuJrcblEGmg+AdZHOn15k mzJWbyckIlqa3zeObmCWTWtsvCs7FBnEvFdHWiQVorXKPn4bfhhaTagoappg7gOLjRmE 9VqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v0jTGCZ1oBPMU7LTD68AxfiI5GGeI84RrTgbBNlTmxE=; b=NP+cPDJH5IkfpO51qRyaWfKwDAnEhO/u77Yg48TQz1c7//0Hi8HxCg/jVEPBQdRMPE BxTd3aF8Xtd/0uspN4ZYEO7MmmOyqMDavQCq3+Z2fuP6ghMEeyPpT3+/LfiapxNe3BHi 2y89um5vxJdxZpRGfTUOJS+5I2ht5JIaWt3AyFQ0/U/hZqLsMoJLeVv2SyQQyWaWzpHw DOLFr2qwIrV04Z67lFu2PiDQmrJzaaeSq8/Iv5VkSKTwpyf1WWnx7rpoyhMbztp4mPec ldZkaM/nOezAOJOBDT3Fezxnt8+mOUXOEHN4lG4hYcHqxzfbFPr/IeUrddi7wuQVW89H p/hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Q3bZjckC; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si1194222ejz.383.2021.03.24.01.25.04; Wed, 24 Mar 2021 01:25:27 -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=@ti.com header.s=ti-com-17Q1 header.b=Q3bZjckC; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234009AbhCWWj2 (ORCPT + 99 others); Tue, 23 Mar 2021 18:39:28 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44572 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbhCWWix (ORCPT ); Tue, 23 Mar 2021 18:38:53 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12NMcg09129795; Tue, 23 Mar 2021 17:38:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1616539123; bh=v0jTGCZ1oBPMU7LTD68AxfiI5GGeI84RrTgbBNlTmxE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Q3bZjckCHvWhjgwTVwo1bHC5CQteCOi9sCFEgZQScqZ+/bRjcvZhWsh+DLIZsHIDV fHCQj21H1BUKvvkX2Ex2mXoqLNemcB1ASYehl3un9ESTD8pwoM1un1+RNQ8xXUeaA4 y8QIkbKI4uTC9JBsTLSocK02KIcfeNL/lxliEbyI= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12NMcgnV020633 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Mar 2021 17:38:42 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 23 Mar 2021 17:38:42 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Tue, 23 Mar 2021 17:38:42 -0500 Received: from lelv0597.itg.ti.com (lelv0597.itg.ti.com [10.181.64.32]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12NMcgcg117647; Tue, 23 Mar 2021 17:38:42 -0500 Received: from localhost ([10.250.221.195]) by lelv0597.itg.ti.com (8.14.7/8.14.7) with ESMTP id 12NMcgnm102217; Tue, 23 Mar 2021 17:38:42 -0500 From: Suman Anna To: Bjorn Andersson , Mathieu Poirier CC: Grzegorz Jaszczyk , Jan Kiszka , Vignesh Raghavendra , Lokesh Vutla , , , , Subject: [PATCH 2/3] remoteproc: pru: Fix wrong success return value for fw events Date: Tue, 23 Mar 2021 17:38:38 -0500 Message-ID: <20210323223839.17464-3-s-anna@ti.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323223839.17464-1-s-anna@ti.com> References: <20210323223839.17464-1-s-anna@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The irq_create_fwspec_mapping() returns a proper virq value on success and 0 upon any failure. The pru_handle_intrmap() treats this as an error and disposes all firmware event mappings correctly, but is returning this incorrect value as is, letting the pru_rproc_start() interpret it as a success and boot the PRU. Fix this by returning an error value back upon any such failure. While at this, revise the error trace to print some meaningful info about the failed event. Fixes: c75c9fdac66e ("remoteproc: pru: Add support for PRU specific interrupt configuration") Signed-off-by: Suman Anna --- drivers/remoteproc/pru_rproc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index a9d07c0751be..87b43976c51b 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -339,8 +339,10 @@ static int pru_handle_intrmap(struct rproc *rproc) pru->mapped_irq[i] = irq_create_fwspec_mapping(&fwspec); if (!pru->mapped_irq[i]) { - dev_err(dev, "failed to get virq\n"); - ret = pru->mapped_irq[i]; + dev_err(dev, "failed to get virq for fw mapping %d: event %d chnl %d host %d\n", + i, fwspec.param[0], fwspec.param[1], + fwspec.param[2]); + ret = -EINVAL; goto map_fail; } } -- 2.30.1