From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935460AbcHJUOV (ORCPT ); Wed, 10 Aug 2016 16:14:21 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:50675 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934095AbcHJS1r (ORCPT ); Wed, 10 Aug 2016 14:27:47 -0400 Subject: Re: [PATCH 2/2] remoteproc: core: Rework obtaining a rproc from a DT phandle To: Bjorn Andersson , ssantosh@kernel.org References: <20160719154905.23344-1-lee.jones@linaro.org> <20160719154905.23344-2-lee.jones@linaro.org> <20160810171546.GN26240@tuxbot> Cc: Lee Jones , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, ohad@wizery.com, linux-remoteproc@vger.kernel.org, ludovic.barre@st.com, s-anna@ti.com From: Santosh Shilimkar Organization: Oracle Corporation Message-ID: <06677af9-e994-6bb4-98b0-c0434340b092@oracle.com> Date: Wed, 10 Aug 2016 11:27:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160810171546.GN26240@tuxbot> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Suman, On 8/10/2016 10:15 AM, Bjorn Andersson wrote: > On Tue 19 Jul 08:49 PDT 2016, Lee Jones wrote: > >> In this patch we; >> - Use a subsystem generic phandle to obtain an rproc >> - We have to support TI's bespoke version for the time being >> - Convert wkup_m3_ipc driver to new API >> - Rename the call to be more like other, similar OF calls >> - Move feature-not-enabled inline stub to the headers >> - Strip out duplicate code by calling into of_get_rproc_by_index() >> >> Signed-off-by: Lee Jones >> --- >> drivers/remoteproc/remoteproc_core.c | 41 ++++++++---------------------------- >> drivers/soc/ti/wkup_m3_ipc.c | 14 +++--------- >> include/linux/remoteproc.h | 4 ++-- >> 3 files changed, 14 insertions(+), 45 deletions(-) >> > [..] >> diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c >> index 8823cc8..15481f3 100644 >> --- a/drivers/soc/ti/wkup_m3_ipc.c >> +++ b/drivers/soc/ti/wkup_m3_ipc.c >> @@ -385,7 +385,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) >> { >> struct device *dev = &pdev->dev; >> int irq, ret; >> - phandle rproc_phandle; >> struct rproc *m3_rproc; >> struct resource *res; >> struct task_struct *task; >> @@ -430,16 +429,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) >> return PTR_ERR(m3_ipc->mbox); >> } >> >> - if (of_property_read_u32(dev->of_node, "ti,rproc", &rproc_phandle)) { >> - dev_err(&pdev->dev, "could not get rproc phandle\n"); >> - ret = -ENODEV; >> - goto err_free_mbox; >> - } >> - >> - m3_rproc = rproc_get_by_phandle(rproc_phandle); >> - if (!m3_rproc) { >> - dev_err(&pdev->dev, "could not get rproc handle\n"); >> - ret = -EPROBE_DEFER; >> + m3_rproc = of_get_rproc_by_phandle(dev->of_node); >> + if (IS_ERR(m3_rproc)) { >> + ret = PTR_ERR(m3_rproc); >> goto err_free_mbox; >> } >> > > Santosh, do you have any objections to me merging this? > This looks ok to me but I have not been merdging the remote proc code. Looping Suman who IIRC, was looking at it along with Ohad. > of_get_rproc_by_phandle() will fall back and attempt to acquire the > handle from ti,rproc if the generic "rprocs" property doesn't exist. > Suman, Can you please check this series and see if you can line this up ? Am not sure if Ohad still maintaining it. Regards, Santosh