Hello,
> > Re: [PATCH v9 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller
driver
> >
> > On 04/18/2019 05:51 AM, masonccyang@mxic.com.tw wrote:
> >
> > >> >> >> Add a driver for Renesas R-Car Gen3
RPC-IF SPI controller.
> > >> >> >>
> > >> >> >> Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
> > >> >> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.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 ?
>
> > 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@draak:/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@draak:/sys/power#
thanks & best regards,
Mason
CONFIDENTIALITY NOTE:
This e-mail and any attachments may contain confidential information and/or
personal data, which is protected by applicable laws. Please be reminded
that duplication, disclosure, distribution, or use of this e-mail (and/or
its attachments) or any part thereof is prohibited. If you receive this
e-mail in error, please notify us immediately and delete this mail as well
as its attachment(s) from your system. In addition, please be informed
that collection, processing, and/or use of personal data is prohibited
unless expressly permitted by personal data protection laws. Thank you
for your attention and cooperation.
Macronix International Co., Ltd.
=====================================================================