Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp556714pxf; Wed, 7 Apr 2021 06:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuL7RWrdA4Q6tf+0lWtazxXjG86jrLDEAqVLpx4OsjNV/0/hESU3ecW6tkj9b8MMPMoEOq X-Received: by 2002:a50:ec8c:: with SMTP id e12mr4426829edr.249.1617801742426; Wed, 07 Apr 2021 06:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617801742; cv=none; d=google.com; s=arc-20160816; b=qbx1qIYa0bNZpCsg/nCgKITSgGzpZj8qCxcYgBpKuyOCSVC6HB41JmB2uo4nSBS5aO FdX1/3k3DYLeOX5NaMnuNmEGXnKIxfpGPDrvrUmeH98Li8zT5XTNS1A6rphqyYzW/Oru FdbKHzz+BSTHCs9Fe8vy68uI5tkI2YLlgNyhHlsGXW8YGTbAmqMgWDoMdM/fB1mN6t30 ocN6hbKYtTx+ygwtDWU9S7gsI8MTUduXtBHyig/TqYCqOHn6RQ2HHtSfpFaGpwFF3qaU TSNwdxNAB/FcuqDLazz3penXdpqyvDxaf7uPPVYEDSoFAvrMEibZ61qwqksEJd9Gkwia b7Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LRgGDa7UAPYiNMpF39Lh56jOssvyorq9ppnVgi31J/o=; b=CpGSDtCBQ38MnlsCpqgHOsyfitfEYybP5zuPUDLuYmRCMfk24IeMPjqkX2NluNd7Y0 UbIxHtP1fzQ3Lx4FkoY2iawWXkmvR2Z/hdL0vfKfwvkRVgbmCVc7+RqEEZ1x0CeuuoKV eP0NxuWcs1kVxYzYOpY9OqD7CS8QZpJcX+V1+UTuO0Js1vhlj+swWL+VcPBviQhXaRLM CxZOVx+jfIXXpTNvp1lepKGEoxyaYr6oxWDqyQitnxObjxEo/KdTE1OF9hZ7NWXdRull 8zhRehUExJjUVeIrxK0Q7bvxgl7u6QEBgGTQ46CjdI/+1X8AUHgjLWKVW1yZGMjrnRrT GjVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dol2GVi+; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si2226652edq.101.2021.04.07.06.21.58; Wed, 07 Apr 2021 06:22:22 -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=@linaro.org header.s=google header.b=dol2GVi+; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232362AbhDFXdX (ORCPT + 99 others); Tue, 6 Apr 2021 19:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232844AbhDFXdW (ORCPT ); Tue, 6 Apr 2021 19:33:22 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F55C06175F for ; Tue, 6 Apr 2021 16:33:14 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id l76so11583629pga.6 for ; Tue, 06 Apr 2021 16:33:14 -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=LRgGDa7UAPYiNMpF39Lh56jOssvyorq9ppnVgi31J/o=; b=dol2GVi+MHXAlQjLNZRDGWiqiSTsM30xf7XFveOIDRMzyunh6Jdu+U5JHQcGZuJpFT 1Nt6iDXj+VGjUXmzEpBOly2AcwI29wifSBNVAaPnsZM3dBKPWK3Jr388aqNYDVw+FmZP N8XsQQuVaPQf2rjP9vqafbggki2gcIVroQ6vLd0+bSmdL38sYop/zcaQIqgxy72tLy6S mnj2jbtr9HeKqe6ym8YnbmfZ2+b93HoPmG6lCSVT8TG4y4c2wdYlUIWyjLOefUnhFpRo 0HmzNOW90h4nNv8WNiQy/IcGujauCci6RgEGtB9+LMc/vaV6Y7B+1IoE4sPtZrrsuMh4 cv2g== 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=LRgGDa7UAPYiNMpF39Lh56jOssvyorq9ppnVgi31J/o=; b=MXiWAQIBaBpxtCz1+jqaY5PYQufJxrbI/Q7MLFyoiR3/Gf2paSLwmRcW3bkED5AjEJ FHweytCqlg91fjYlqwW2cwbxLLmTLSazPgvYCfM7AhMjBGglZ6YerwC8vvWuTOlqdQgN W9VwakqaBP6ftMEYKtNZ/BCEZbQw9QjgWRDL/wfsqKdLdtspLFOZcD+B1DGuv3Mzn8Rc IMejk3EC+nprexNK44Odg1pOedZups0qO55S0pimq3t2/X8NpzALGCmlrsTo0VS5oY1Z Xl8+f8sRUktj31MjbMz9GID+5lNRmOOzKzLExZs1Nqmv7EDhuDmDfiAOD5VbN09N0ic8 PEUw== X-Gm-Message-State: AOAM530s1VmFheN2zEOtATyZ2kB9xNIYo7189yGJuG9wb5vYyy/Z6gVU 5agltHqKUYtLjVl9+F6OAdr8aA== X-Received: by 2002:a63:fb12:: with SMTP id o18mr539600pgh.438.1617751993641; Tue, 06 Apr 2021 16:33:13 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z3sm19557575pff.40.2021.04.06.16.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 16:33:12 -0700 (PDT) Date: Tue, 6 Apr 2021 17:33:10 -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 2/3] remoteproc: pru: Fix wrong success return value for fw events Message-ID: <20210406233310.GB330882@xps15> References: <20210323223839.17464-1-s-anna@ti.com> <20210323223839.17464-3-s-anna@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323223839.17464-3-s-anna@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 05:38:38PM -0500, Suman Anna wrote: > 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. > Very subtle... I had to look twice to make sure. Reviewed-by: Mathieu Poirier > 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 >