[<prev] [next>] [day] [month] [year] [list]
Message-ID: <529fe004-63e2-43c3-0382-9aaa86d0c3a9@cogentembedded.com>
Date: Mon, 22 Apr 2019 19:44:04 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: masonccyang@...c.com.tw
Cc: bbrezillon@...nel.org, broonie@...nel.org,
devicetree@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>,
Simon Horman <horms@...ge.net.au>, juliensu@...c.com.tw,
lee.jones@...aro.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-spi@...r.kernel.org,
marek.vasut@...il.com, mark.rutland@....com, robh+dt@...nel.org,
zhengxunli@...c.com.tw
Subject: Re: [PATCH v9 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller
driver
On 04/19/2019 12:31 PM, masonccyang@...c.com.tw wrote:
>> > Re: [PATCH v9 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver
>> >
>> > On 04/18/2019 05:51 AM, masonccyang@...c.com.tw wrote:
>> >
>> > >> >> >> Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller.
>> > >> >> >>
>> > >> >> >> Signed-off-by: Mason Yang <masonccyang@...c.com.tw>
>> > >> >> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
>> > >> >> > [...]
>> > >> >> >> diff --git a/drivers/spi/spi-renesas-rpc.c b/drivers/spi/spi-
>> > >> renesas-rpc.c
>> > >> >> >> new file mode 100644
>> > >> >> >> index 0000000..037f273
>> > >> >> >> --- /dev/null
>> > >> >> >> +++ b/drivers/spi/spi-renesas-rpc.c
>> > >> >> > [...]
>> > >> >> >> +static int rpc_spi_probe(struct platform_device *pdev)
>> > >> >> >> +{
>> > >> >> >> + struct spi_controller *ctlr;
>> > >> >> >> + struct rpc_mfd *rpc_mfd = dev_get_drvdata(pdev->dev.parent);
>> > >> >> >> + struct rpc_spi *rpc;
>> > >> >> >> + int ret;
>> > >> >> >> +
>> > >> >> >> + ctlr = spi_alloc_master(&pdev->dev, sizeof(*rpc));
>> > >> >> >> + if (!ctlr)
>> > >> >> >> + return -ENOMEM;
>> > >> >> >> +
>> > >> >> >> + platform_set_drvdata(pdev, ctlr);
>> > >> >> >> +
>> > >> >> >> + rpc = spi_controller_get_devdata(ctlr);
>> > >> >> >> +
>> > >> >> >> + ctlr->dev.of_node = pdev->dev.of_node;
>> > >> >> > [...]
>> > >> >> >> +
>> > >> >> >> + pm_runtime_enable(&pdev->dev);
>> > >> >> >> + ctlr->auto_runtime_pm = true;
>> > >> >> >
>> > >> >> > I think this line no longer works as expected with the new
>> > >> >> probing scheme.
>> > >>
>> > >> That's because we added another (SPI) device under our MFD.
>> > >
>> > > Do you mean just to remove one line
>> > > ctlr->auto_runtime_pm = true;
>> > > ?
>
>> how did you test it ?
>> what is your testing flow ?
I think I've patched drivers/spi/spi-mem.c to get spi_mem_access_{start|end}()
to be called with ctlr->dev.parent->parent as an arg...
>> > No, you should explicitly call RPM for the MFD (not the SPI device).
>>
>> okay, patch RPM to RPC MFD and will remove SPI RPM enable part.
>
> wait! I test it ok.
>
> Don't need to patch RPM to RPC MFD, just keep RPM in SPI.
>
> root@...ak:/sys/power# echo mem > state
> [ 135.848711] PM: suspend entry (s2idle)
> [ 135.852777] PM: Syncing filesystems ... done.
> [ 135.869468] Freezing user space processes ... (elapsed 0.002 seconds) done.
> [ 135.879962] OOM killer disabled.
> [ 135.883257] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
> [ 135.893474] Suspending console(s) (use no_console_suspend to debug)
> [ 135.910946] [Mason] rpc_spi_suspend
> [ 135.986022] PM: suspend devices took 0.084 seconds
> [ 135.986047] PM: suspend debug: Waiting for 5 second(s).
> [ 141.142024] [Mason] rpc_spi_resume
> [ 141.220859] PM: resume devices took 0.116 seconds
> [ 141.243179] OOM killer enabled.
> [ 141.246417] Restarting tasks ... done.
> [ 141.266579] PM: suspend exit
> root@...ak:/sys/power#
That's not *runtime* PM, it's the *plain* PM you're testing here...
> thanks & best regards,
> Mason
MBR, Sergei
Powered by blists - more mailing lists