Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3081790pxu; Tue, 8 Dec 2020 03:07:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPv7fUW5WPi1sem96znFJ9RG+mNvr4Hg3836+GLdHu9ZcLH85Pnut4ih5M5bdrScPJrWwo X-Received: by 2002:a17:907:417f:: with SMTP id oe23mr21831082ejb.259.1607425645006; Tue, 08 Dec 2020 03:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607425644; cv=none; d=google.com; s=arc-20160816; b=B2gVy7LuUcpILXbRBPtC9i/0ecBV9W8TNssGtGxK6/ue2sZZyvN8MfPMn+8UlOPFRB 9szuheasuUU/mjASIzsY+IXR6X2xfjohlC58bmNcXeT5hFcjHbG+KPMw2OY0XzMnIJh6 dQ4BqRIk0mSJ3XhotmA3TOiNIcCiBJAXyHL/x3/2NR5+jGOyja9ynCmXJRxkZth3lM3P YwDPUeBnf4LRH6n7c9cuuymcrsnNygTyE6nJzqfkt+Psm5nh5lIU6MjdZspNcWqdWy4y wNDit7MhEw78x7A/tMo1g4kMZVHfk4pUKND6ywHC26mJYC54FO+U6r+cZAqfZ5B3/tsI n6iw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oVdto4l/iQFOE/jcGLfjaxzoGzq2Ps5a3Ie3KVUxu1I=; b=x0b6NLct3X3FBbHs3trDZ28XP36WUv2dB9LWQV846jw/OogkTYf7UnP6b36xm6MWl2 TXCk3SCLKTEMZt34UCIOA7LXbUAjEz2+POLpgC4z1DCI6iz6xmGofixMZQOYK7KOY4ME /AcuH5JAJUCmB6hQ6vmuBuwUpT2x761LZyiGFe6UcIwZ8zNfOPHWiGq6dPNxWdI7mGBx Krp1Tsx0iWj2OgV6ZNzl1/gOz2zSwnTj5GO3+fg/dbq4Ho30iJZmretO7DdpbksmENgj QkFt/29d1Tuz8Q/v45BiPXLepIptbwfHyjctohr6J9rQN7tfpFg4IlCUe+uEVhKBRD4B Eedg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qb024noJ; 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 l9si10062203edf.357.2020.12.08.03.07.02; Tue, 08 Dec 2020 03:07:24 -0800 (PST) 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=qb024noJ; 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 S1729146AbgLHLFP (ORCPT + 99 others); Tue, 8 Dec 2020 06:05:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728752AbgLHLFO (ORCPT ); Tue, 8 Dec 2020 06:05:14 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEA0C061749 for ; Tue, 8 Dec 2020 03:04:34 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id c1so3843332wrq.6 for ; Tue, 08 Dec 2020 03:04:34 -0800 (PST) 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:content-transfer-encoding:in-reply-to; bh=oVdto4l/iQFOE/jcGLfjaxzoGzq2Ps5a3Ie3KVUxu1I=; b=qb024noJnAcaD4FrKPkd4Ne8IhxPQM8AlFz92r4A6tTwucH6MQXOpPuRiJdwTukbJK J+1ZPm8YX5jCZaEvyjJ6vpn4lAMa7UFXjLoCTOLFc501Hrx1cNiVd+Z8WluLCJc96MuN lG3zsMPbMQ7hm6N6VfWocnn+bbRnLm+Gti9iZ1XUFKkrwPa52L+7FuO98JnyIATsKAvJ zhHBZaGpGCQf8SOU7RWmdoMsg25XwH8LXk3+VNnowPQbs0YR6Fbl8kFUTCijvApbHnRT x/2pY4XAtfUyMd/mC2HSFBNTO0FPeKDCdLVM3JnPGjoXBVpvqs5FD3afdifAdwB7tAmT gSLg== 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:content-transfer-encoding :in-reply-to; bh=oVdto4l/iQFOE/jcGLfjaxzoGzq2Ps5a3Ie3KVUxu1I=; b=glg/dyLMMofCYsZnkiw30PUk7YklgV7Ehw2FkS6s9ukgy3ZtEQi8mRfNHparBCE7NK Zt1P+bNvudoynKIpb6dlC9QQ8ysXk/TvMhO6b5imvZbzBTIc7dxBSrSO/50WuHSbCQqF K/OGOsC27eZQA7X6Fc4oLmbiS6kEXoX8zPESeh3vtWmsKL9jWU8F90mVQaOw7ENdbet7 HbrdGxDdHWcFqq2OoBxOi1hlyt0gV7WHCeavXVxlPeNGaD5irnkv1Br5T21FN89z66sS Itl0xuT/kDq8QE8D9zy98HXoN+8bbMUwW1CsbfpzRJYjW9YMLr11cwTmDKVIXSzG37i/ 9OyQ== X-Gm-Message-State: AOAM531qDX5C3QDgJeVVGCFdlfwMRB4RXqh8N8PISzCmOrobrKssjytt +cH7vf+bQCmf3iRsaMg1uY+6Jg== X-Received: by 2002:adf:f7c2:: with SMTP id a2mr24125501wrq.11.1607425473108; Tue, 08 Dec 2020 03:04:33 -0800 (PST) Received: from dell ([91.110.221.209]) by smtp.gmail.com with ESMTPSA id h20sm2925583wmb.29.2020.12.08.03.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 03:04:32 -0800 (PST) Date: Tue, 8 Dec 2020 11:04:30 +0000 From: Lee Jones To: Mathieu Poirier Cc: Grzegorz Jaszczyk , ohad@wizery.com, bjorn.andersson@linaro.org, s-anna@ti.com, linux-remoteproc@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, praneeth@ti.com, rogerq@ti.com Subject: Re: [PATCH v3 3/6] remoteproc: pru: Add support for PRU specific interrupt configuration Message-ID: <20201208110430.GS4801@dell> References: <20201204201807.14716-1-grzegorz.jaszczyk@linaro.org> <20201204201807.14716-4-grzegorz.jaszczyk@linaro.org> <20201207173731.GA1509079@xps15> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201207173731.GA1509079@xps15> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 07 Dec 2020, Mathieu Poirier wrote: > On Fri, Dec 04, 2020 at 09:18:04PM +0100, Grzegorz Jaszczyk wrote: > > The firmware blob can contain optional ELF sections: .resource_table > > section and .pru_irq_map one. The second one contains the PRUSS > > interrupt mapping description, which needs to be setup before powering > > on the PRU core. To avoid RAM wastage this ELF section is not mapped to > > any ELF segment (by the firmware linker) and therefore is not loaded to > > PRU memory. > > > > The PRU interrupt configuration is handled within the PRUSS INTC irqchip > > driver and leverages the system events to interrupt channels and host > > interrupts mapping configuration. Relevant irq routing information is > > passed through a special .pru_irq_map ELF section (for interrupts routed > > to and used by PRU cores) or via the PRU application's device tree node > > (for interrupts routed to and used by the main CPU). The mappings are > > currently programmed during the booting/shutdown of the PRU. > > > > The interrupt configuration passed through .pru_irq_map ELF section is > > optional. It varies on specific firmware functionality and therefore > > have to be unwinded during PRU stop and performed again during > > PRU start. > > > > Co-developed-by: Suman Anna > > Signed-off-by: Suman Anna > > Signed-off-by: Grzegorz Jaszczyk > > --- [...] > > drivers/remoteproc/pru_rproc.c | 180 +++++++++++++++++++++++++++++++++ > > drivers/remoteproc/pru_rproc.h | 46 +++++++++ > > 2 files changed, 226 insertions(+) > > create mode 100644 drivers/remoteproc/pru_rproc.h > > > > diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c > > index d33392bbd8af..4ef59d15d888 100644 > > --- a/drivers/remoteproc/pru_rproc.c > > +++ b/drivers/remoteproc/pru_rproc.c > > @@ -11,13 +11,16 @@ > > */ [...] > > +static int pru_handle_intrmap(struct rproc *rproc) > > +{ > > + struct device *dev = rproc->dev.parent; > > + struct pru_rproc *pru = rproc->priv; > > + struct pru_irq_rsc *rsc = pru->pru_interrupt_map; > > + struct irq_fwspec fwspec; > > + struct device_node *irq_parent; > > + int i, ret = 0; > > + > > + /* not having pru_interrupt_map is not an error */ > > + if (!rsc) > > + return 0; > > + > > + /* currently supporting only type 0 */ > > + if (rsc->type != 0) { > > + dev_err(dev, "unsupported rsc type: %d\n", rsc->type); > > + return -EINVAL; > > + } > > + > > + if (rsc->num_evts > MAX_PRU_SYS_EVENTS) > > + return -EINVAL; > > + > > + if (sizeof(*rsc) + rsc->num_evts * sizeof(struct pruss_int_map) != > > + pru->pru_interrupt_map_sz) > > + return -EINVAL; > > + > > + pru->evt_count = rsc->num_evts; > > + pru->mapped_irq = kcalloc(pru->evt_count, sizeof(int), GFP_KERNEL); > > sizeof(unsigned int) Would you mind trimming your replies please? Brain grepping through 200+ lines of quote for a one line review comment is a little frustrating. TIA. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog