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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E9FBC77B73 for ; Mon, 5 Jun 2023 18:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UPEaqpd21a+3K8lu09ppjnaX8GuFIz83T6o52zpOADE=; b=VhRxTc8nMlGB0A sKpYh1Q8BU7UmBOxxDJAauh6SYJ++jM+8AA34IA1AV8rXMdpawt7f05aL6ays+noHVTl1pXA/rLza WcCmJr35FR0TXUUn0DD8EpMVgdzuwz5kPN9fcF8mATDhNJuoUw+El6YJg0bYXJtIA+NH5KXy/+Imc eh68DTJs5knrGslZA40ZWSk80GbX16qFCTQ/LexX4rOwtFFE0vP1lECBvs4X6Z6BLTtq6Pdd5Pyuy 3iMKIC47PiLMk/kJLZ7C/+a7XcAEY/TfBJHvRNaZ5WUA+JX83pBVRnKBzszC246V6DRcn0+BSecI9 r2U9MPB8dCUutBm6vvuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6EyD-00GPuI-0A; Mon, 05 Jun 2023 18:30:21 +0000 Received: from mail-pl1-f171.google.com ([209.85.214.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6Dyb-00GGmd-2m for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 17:26:43 +0000 Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1b010338d82so23683185ad.0 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=SLCZLFXFKFHgxzUE+iLx/yf7e7c3ta4D/QBG3UhfMIa1SP/7tBNZD6yp2q/KeqH99P E2oDcZY9BZC37qtMEuaaASsKVBz1BhqbeNieUu5s3MgF/AcRCSfeqVZMz7BMEWcwP+ve U2gYyewZK8kT6Kxeujbo0ZWm4P4ky3vLS5C+d8x2BMhaJ8OvbcZMpS9eZGmmGKXndI0b lV/QTUnVa2OYp2pCsQy5EqIE94EXVYy6j0fpkGDCuOOmF0/0FcE3IdA/yM/hMD+Z9VzW lim/p7G9Xj2M+9+RJVu+X5aYs7CplzfGaYQIj1o/DX3H3gQfdds4Sr5OhirqIiqZ9bnh EJaA== X-Gm-Message-State: AC+VfDxDa1FACqIQ0yeSKOv3uf4sQ330uGq5gB6zyZP7GWPc5SVLFVqS QATnseQmT9RHdBm0Iv8PtTvKjg== 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-Disposition: inline In-Reply-To: <20230601105904.3204260-1-danishanwar@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_102641_954488_1E5AF594 X-CRM114-Status: GOOD ( 26.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel