Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3033497pxj; Mon, 17 May 2021 16:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3M+ZPPEU/g5LUyZixjPUiNtwIi7IzzgtEJBRJ3vTrI0NNODdw4EXy7aQyauNV47S3/UrW X-Received: by 2002:a05:6402:1046:: with SMTP id e6mr3000478edu.218.1621292689936; Mon, 17 May 2021 16:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621292689; cv=none; d=google.com; s=arc-20160816; b=U1slactg6/PblERb0lpmjRfOWt418ogNX16Wi3UStbEJEKUr7gJ0poKgbuTO5xLCQ6 YPIFf/v1PuZ9xFGD5+I3FYfNawhIflN/VDHbWfYZbVoBcmmnIQAMEsqCD1W5qvszD4w5 vJUPFq4uAsMvX+YBVT2RVF5O7Hiat5lrN6f7EoiTIqU3aE2TA62n7KkKOPonu4/EqQpd E7ZQLomuVJGphAR1i1n5QzRaKepyN2kdS6u3ag5unWnJZEoflGmxSgZAgupQBv3VsmX0 aeXJnkRS1qSzuGdL4J+AJWlk6XA7n/whT6Ru5AzPS9K/n+F9IqgpHDcKb6mJcn+21Y9p xWdw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LcQKNW0USfCfOIlAlxPvs+YcfZLTh4vzZM01zuVigng=; b=BDqrut35poDKx/4LF/EjDVd7PLjh5ipiXRVG14VrFbsgaIq/frIwJuNGK3nfMZsf2p f7agN9aEiZ3aCQKenhI4wok7M4bUlQ6b5OSL1m3PkXDo+5YJixcEiu1w8XWfG/s/Vjnc boegi8WIgqDwQAlkVNXZlNzyAOf/NY/HlvFgVlHbI3qEGlojyinwz16zV+9SW/+Q0NQH CEAqKwJlMzEHGDfVfU3cbmkgMbTW7hA3escef1rqJ3FmsPa5KIG2nx9TcpOs44L07DxR U1pCYejshR+O8jvsQN+PWL5y2g0t0LbrIqpgIajEBODGNeaurCLoqp+OcRqowjofqWbF gD5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fXwy/EoT"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si16249078edy.134.2021.05.17.16.04.26; Mon, 17 May 2021 16:04:49 -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=@linuxfoundation.org header.s=korg header.b="fXwy/EoT"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239256AbhEQOTT (ORCPT + 99 others); Mon, 17 May 2021 10:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:47270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238893AbhEQOQs (ORCPT ); Mon, 17 May 2021 10:16:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 900A061241; Mon, 17 May 2021 14:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260601; bh=DGejjeRC7+aoqLuuEhvVuE+mag9lvvv+H+3HISvqTwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fXwy/EoTPr6xRWpiydDgT5oql0Idw1Wfzwhs75cBQMt3LsF5b9pbNq7IYABQRrVFJ bGA9IqDP/C1oO5FP/Q8Os+orBP+ogNjHpDrOGcu0CVUZoxkSiCeQQk2qQFMHAXnEyg A/XOg0bvY+hsnJGrkTx39CfyA0+T7M5VmEzW52AI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suman Anna , Mathieu Poirier , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.12 156/363] remoteproc: pru: Fix wrong success return value for fw events Date: Mon, 17 May 2021 16:00:22 +0200 Message-Id: <20210517140307.886147815@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suman Anna [ Upstream commit 1fe72bcfac087dba5ab52778e0646ed9e145cd32 ] 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 Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20210407155641.5501-3-s-anna@ti.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- 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 9226b8f3fe14..dcd5ea0d1f37 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.2