From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CF46C7EE2D for ; Mon, 5 Jun 2023 17:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbjFER0m (ORCPT ); Mon, 5 Jun 2023 13:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbjFER0k (ORCPT ); Mon, 5 Jun 2023 13:26:40 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16EDE9E for ; Mon, 5 Jun 2023 10:26:39 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1b011cffe7fso23568845ad.1 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=d/PvzKhUvf9XlsdKJ9F9McE0EBN1V5sPFmW/PoLoFRDuAGbJm1t3GBZdA9IEsyGJNp qaPoLmUCbJHHVAON4n3ZcTU5gEQ8GbZmSrQIuMkUMWsp4X0L3B4a5nkaqoeTQwoDDOS8 uLAKYHE8I/M7u2bqee8+t/ms9bXKVdd4eB8zTtv2u3ATpI3lam5IlTK7uflYASOcrMYW YXiUYHAdn/33GvC07YC9oEEu2jqK8GOJO4oAHavhK9JaT1NzoyBcM09aYK1q3E4V17JQ gdXWWypQpYubwYjnw0NlghA9LqnlXIjefKOg2EqJlvX2yOTkg+xXa6D4CQZqF9PNPUbp cAjg== X-Gm-Message-State: AC+VfDyN+4Z7EpoQLKOhciY9XIcbT90Vsrg7b+7Ih67GCc31knTNoA8F vr+js6e9oweaQX289OfDokknIA== X-Google-Smtp-Source: ACHHUZ5JvrGlGppWeBFVmmK+Ax40IK7f9ZR/h7+HCqrLeKIfBaX7AWDP6dUJVCsCnHCuJREMmCBrMQ== 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> Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 >