Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5964993rwd; Mon, 5 Jun 2023 10:54:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mL5+Cw35I4xrGfn7K1qpn2LmCR5s2oMyRWt9Tm4jWljvJ14CwpeAd6aGtmGFBy9tvqJq3 X-Received: by 2002:a17:90a:be10:b0:256:c324:7ae4 with SMTP id a16-20020a17090abe1000b00256c3247ae4mr3286938pjs.16.1685987685271; Mon, 05 Jun 2023 10:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685987685; cv=none; d=google.com; s=arc-20160816; b=JkZTD+rYvU//Fuo+EDaGZOg7LwsmZUb709b9WDaqauWctPM0bZZ4e+YHSP22W02ud+ aKpfokvh/thQKstoDH6moO0FLiwm8zUEi9HZwS1R3QU6e/HdjhsR9PrOlRhFat6D3Y/a 7+l+RI04LKRdl/scpTSSNRx+eLobUsaQx6fNZQXYV/VL4T65NSsGdOsjYy28sNWn333j 7IaVpbb6nC8cLAmVA9pF1yXQuINvVvxsB+OZknfciKTqc9owLLNdhThx5ftD5JcO0qHa 0c2ICou4z8kJ1TRsxKbYOalY1CzD7H0kyg4P2POA043oPsEu9fiI1zAsuKlVOSe2Hxa0 PX5A== 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=oZqfyldacC0XDQdlgcybeOtmpOKByOPh6WjeVTF62fI=; b=FD6xCXl8YqGdfYmX17v1Sk5Ff1x18qWa7/9zljrUAMklu78vXfpXddGfC2kWvIdKVS EFSj9ZpAGxme8rFim8JX6vW27xVCqAayFUJH0zN1bfkzaVO2MLzqcvZSwToKdr9pmLrk Pzcvb6Kg459Vn5xFcRXeNjwY0skHLnD/cvGXXVHmEyiDgAeSIuLp7uc3bvJEfQjWpiK6 qArjqiExQn+z23ofdw1sERFhmuqykwhofsxIqpbVTeNIOka1stxECN0wN+Y3ubFKDKaO f9B+sOlVAK+xnYpMJFRtEEvoioZiNvRxwevumeIDQvGeTLOPJDRxxJZ5qe6Dd8s70Msi 3uTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zHj/glth"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a17090ac20700b00232f57260c1si4875908pjt.1.2023.06.05.10.54.30; Mon, 05 Jun 2023 10:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zHj/glth"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233417AbjFER0o (ORCPT + 99 others); Mon, 5 Jun 2023 13:26:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbjFER0k (ORCPT ); Mon, 5 Jun 2023 13:26:40 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13EC799 for ; Mon, 5 Jun 2023 10:26:39 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b01d912a76so23528485ad.2 for ; Mon, 05 Jun 2023 10:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685985998; x=1688577998; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oZqfyldacC0XDQdlgcybeOtmpOKByOPh6WjeVTF62fI=; b=zHj/glthhqgShaVchA3kSlzmwRY1tu52DszjiLxHcQu4qoc/Guv3EPCzIvWg2KPeNb rCXdG49EbGfe+X72cuW9RHxS3QRqLfxGcCZq8RYA2EYEVatWZp3BRIBqZQDGn9CxC0SJ 1HgYv876+yPQzJGFGojPFisVcd481SL8Lt3Zma1YkYooSEa4Q5VISP0Qt6L3pv8Eg73m Ps1PFvKHxIWN+lU+k2XX0cWIhrZomTguaZo76gC/R5JJF+K5do82HWBsPc3r22qXMsv5 zZAPXxY60v8/pqBiIyMqGSWS12DaYmG0Q3LNmofbCsfK+8IWu+Un/XFnBO0bcm6SaQ6/ bKrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685985998; x=1688577998; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oZqfyldacC0XDQdlgcybeOtmpOKByOPh6WjeVTF62fI=; b=U+5RWPJzv2SEMjt/MyPoKjLT5tWjao8KBQQPecZXCIo3S+43Xk1uVaDkyjqZ6ndKzl IyAy0FfjRx3tqePEqxyXUS6Ohhycy3CST8sLdBmpzVRyF6KEMOVzma4txh0wUwf6GsV3 pqwDK2wbEPyoKWuAFu2/MsXjo28fP9vK/xrDjZw/eV4lKjswB/zMIfBB3YJAruoIIQDa GwWSA8DtMmXv0QDSqOIAt5Hv8tPej0T3NGMrKvjDzVzFauh7OetT1MYJsvGWNG0E2bKz p3XDpaR2HcRnV9UDlMJxBVhNl/gAEZ4qiOYxk7gTjD3n7CNWlH4hktWQAQWTefYcq1mr r/7A== X-Gm-Message-State: AC+VfDyghJDMEjnLWmetcYH67BpRhOSPys4XnKgrjyWn+ksds7tcPXln l1xQtHw3pKE2Jgn4DjBb1V/9RA== X-Received: by 2002:a17:902:b183:b0:1b2:1a4f:5825 with SMTP id s3-20020a170902b18300b001b21a4f5825mr1249848plr.19.1685985998519; Mon, 05 Jun 2023 10:26:38 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:e5f9:abc2:7e8d:5257]) by smtp.gmail.com with ESMTPSA id 11-20020a170902c20b00b001b061dcdb6bsm6872663pll.28.2023.06.05.10.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 10:26:38 -0700 (PDT) Date: Mon, 5 Jun 2023 11:26:35 -0600 From: Mathieu Poirier To: MD Danish Anwar Cc: Bjorn Andersson , rogerq@kernel.org, vigneshr@ti.org, nm@ti.com, srk@ti.com, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] remoteproc: pru: add support for configuring GPMUX based on client setup Message-ID: References: <20230601105904.3204260-1-danishanwar@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230601105904.3204260-1-danishanwar@ti.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi MD, On Thu, Jun 01, 2023 at 04:29:04PM +0530, MD Danish Anwar wrote: > From: Tero Kristo > > Client device node property ti,pruss-gp-mux-sel can now be used to > configure the GPMUX config value for PRU. > > Signed-off-by: Tero Kristo > Signed-off-by: Suman Anna > Signed-off-by: MD Danish Anwar > --- > drivers/remoteproc/pru_rproc.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c > index 2874c8d324f7..29d3a5a930c1 100644 > --- a/drivers/remoteproc/pru_rproc.c > +++ b/drivers/remoteproc/pru_rproc.c > @@ -109,6 +109,7 @@ struct pru_private_data { > * @dbg_single_step: debug state variable to set PRU into single step mode > * @dbg_continuous: debug state variable to restore PRU execution mode > * @evt_count: number of mapped events > + * @gpmux_save: saved value for gpmux config > */ > struct pru_rproc { > int id; > @@ -127,6 +128,7 @@ struct pru_rproc { > u32 dbg_single_step; > u32 dbg_continuous; > u8 evt_count; > + u8 gpmux_save; > }; > > static inline u32 pru_control_read_reg(struct pru_rproc *pru, unsigned int reg) > @@ -228,6 +230,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, > struct device *dev; > const char *fw_name; > int ret; > + u32 mux; > > rproc = __pru_rproc_get(np, index); > if (IS_ERR(rproc)) > @@ -252,6 +255,22 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, > if (pru_id) > *pru_id = pru->id; > > + ret = pruss_cfg_get_gpmux(pru->pruss, pru->id, &pru->gpmux_save); > + if (ret) { > + dev_err(dev, "failed to get cfg gpmux: %d\n", ret); > + goto err; > + } > + > + ret = of_property_read_u32_index(np, "ti,pruss-gp-mux-sel", index, > + &mux); > + if (!ret) { > + ret = pruss_cfg_set_gpmux(pru->pruss, pru->id, mux); > + if (ret) { > + dev_err(dev, "failed to set cfg gpmux: %d\n", ret); > + goto err; > + } > + } > + It would have been nice to be told in a cover letter that pruss_cfg_get_gpmux() is in linux-next so that I don't have to go fish for it... I am fine with the code in this patch, though the changelog is cryptic and could be enhanced to say "why" this is needed. The above could use some comments to make sure people looking at this code understand that an error from of_property_read_u32_index() is acceptable for backward compatibility. Here I have to suppose pruss_cfg_get_gpmux() has been added to Nishanth's tree. As such the only way for me to apply your patch is if Nishanth sends me a pull request for the patchset that introduced pruss_cfg_get_gpmux(). You can also resend this in the next cycle. Thanks, Mathieu > ret = of_property_read_string_index(np, "firmware-name", index, > &fw_name); > if (!ret) { > @@ -290,6 +309,8 @@ void pru_rproc_put(struct rproc *rproc) > > pru = rproc->priv; > > + pruss_cfg_set_gpmux(pru->pruss, pru->id, pru->gpmux_save); > + > pru_rproc_set_firmware(rproc, NULL); > > mutex_lock(&pru->lock); > -- > 2.34.1 >