Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2613034yba; Mon, 22 Apr 2019 09:49:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCDz2bZ166MFJ5CQ+RPUYbzA3L0QiKibxAOMxwyZBeZeJX5hwoZNyNQIacXK8Hr97zPjKL X-Received: by 2002:a62:4ec8:: with SMTP id c191mr21948845pfb.138.1555951784823; Mon, 22 Apr 2019 09:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951784; cv=none; d=google.com; s=arc-20160816; b=y2LzSBaeb8SGZwp8jAipvkPkPDLA4YihxD45LiAV+rmFCKnFgiWKP4Jyg1E0bmym2c kMheSkSAWMLJ4rU5hU2IL4IFHbkFkuwJwj27c//A4JLeg0DGT6ee0mK3tnvzIQETV4p+ LmPN9QUlIUxI/J8kAgZOQKgky8ki81jvNWEFMx3Uq6SDfCiiuqdRwG9c85sZyyM8j8s7 FnpAtplNoRjkr/RQVzud6/tvCwHXd4JkldL19SkGGh5r/ROCYQU3/QrEEufidW7klDVJ pr6BwIu8ny10eMKOKIyz1xnUBcgoPC2FnZkTX64kR4vgu1vglV7qGYQlJJW+B4oicUIS aRww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=ms0rfvZRl0q7nQ2JjG0gB/4aq7m4g4BAWeD/32kGdqg=; b=uLSSqkEeZuxocYVokBzU8WFqmUbotu0VjG2WEoRl78cRHy5HUwwDBUqgx4gAdcc8FN 99PJ3I5SR/4iKgdYHwCIzoksNf+71DQBTJyuC82E/JDfXoolmtWFDBHIv9DZBzE/Ydf2 A73qxEO196LyuswS7EzrZ+kGdV2AlX2RcR7jn9PMmVzjOsV8hg57d0Obh7cKeL4LBDn6 1Vf5WCQT2gCD+MV858MdrQXh04ZdlTdn8AigCshQ2s31akyA3TflCYXtgU1pOApG+Edu VwZtfvbzbRDU6l8SnEH8E6/sdwqhOrCqMEJjNmA1vzrx5BGZVVtlMMO185GoS6RRjZGd 92mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=Qlb6Ka8j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si13156222pgz.9.2019.04.22.09.49.29; Mon, 22 Apr 2019 09:49:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=Qlb6Ka8j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728358AbfDVQoL (ORCPT + 99 others); Mon, 22 Apr 2019 12:44:11 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43504 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728345AbfDVQoL (ORCPT ); Mon, 22 Apr 2019 12:44:11 -0400 Received: by mail-lf1-f67.google.com with SMTP id i68so9429368lfi.10 for ; Mon, 22 Apr 2019 09:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ms0rfvZRl0q7nQ2JjG0gB/4aq7m4g4BAWeD/32kGdqg=; b=Qlb6Ka8jzhKp6KmakCpuNsNkyLWhHvTiov1ihZVaaVdKamd9IQ/m2y6LwsFhEdoQnJ mYSzr+1ZCRJmbijqp//eJkFy249IY+dBMp+4pBOhKcmWyNmbGZWJX1L4Z2QHSTXBQGBR esMa2AtIiOjVa/5N02637M9NulFgKACiBIK17ft2CT4ROMvlGKvAVHfHYgHajDeqWEze 2k7qpR0ufA0giD4UPfmnj5QY3v+SpGNS0efAiyNEm1VjwIRNOvxRn0ZrqyYIwJcehEr0 XvCYC8X1sYH2c4eZCNJEC/RHDPuRswFEIa+72lAFdXiCsxDAR3mUpvXj8edSgBV1nfGa L+xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ms0rfvZRl0q7nQ2JjG0gB/4aq7m4g4BAWeD/32kGdqg=; b=cgsQ/N77WJBIjc2Lqsw5u3U7wToriFoNmjT6S/bJyxHP2qOyl4h512RVM0EkBxMgye duPXMNUHq8/qTk4G0z9gBgOZxOIBqCPGD0V0R6rYfEe+o0ALK5Oo58MXPKnEsXudE+ym zzo6p67k1homA9VZcB2IGp4bDy3790+0LLwwFaWJ+Zi7e4G8zAnfWx5jS/8qyYYRRVX9 wxkkJdmnL/fqFJ0OLtatuhe+Rz80fgc8mm6+GSW7ze0Q3GvVo26ZqAK/+tY2ACm+XIcM MMP8vzHwRak9UE7WJgyYrrrlbuhl0Z0wxSuNFr4F+Znl/4mYtpKYKzOQ5gaGl6KJemdi Oocw== X-Gm-Message-State: APjAAAW9k5KgtMIU7PFiWg6z4B1oO3q7vrkTh+JBGbA5IvDgPDKQiwhs 0tLtVSOia2n0ifb8L4T97P4tQafWvaI= X-Received: by 2002:ac2:5609:: with SMTP id v9mr10489369lfd.159.1555951448427; Mon, 22 Apr 2019 09:44:08 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.82.98]) by smtp.gmail.com with ESMTPSA id n10sm3425619ljh.36.2019.04.22.09.44.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 09:44:06 -0700 (PDT) Subject: Re: [PATCH v9 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver To: masonccyang@mxic.com.tw Cc: bbrezillon@kernel.org, broonie@kernel.org, devicetree@vger.kernel.org, Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, lee.jones@linaro.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-spi@vger.kernel.org, marek.vasut@gmail.com, mark.rutland@arm.com, robh+dt@kernel.org, zhengxunli@mxic.com.tw References: <1553847606-18122-1-git-send-email-masonccyang@mxic.com.tw> <1553847606-18122-3-git-send-email-masonccyang@mxic.com.tw> <1e2bf23d-db39-0d1d-0bcc-6d9cd2935a82@cogentembedded.com> <3d334751-8fd4-7db1-9deb-e6c94936df13@cogentembedded.com> <3971c669-9095-9d18-d029-37f9663a54b2@cogentembedded.com> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <529fe004-63e2-43c3-0382-9aaa86d0c3a9@cogentembedded.com> Date: Mon, 22 Apr 2019 19:44:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19/2019 12:31 PM, masonccyang@mxic.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@mxic.com.tw wrote: >> > >> > >> >> >> Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller. >> > >> >> >> >> > >> >> >> Signed-off-by: Mason Yang >> > >> >> >> Signed-off-by: Sergei Shtylyov >> > >> >> > [...] >> > >> >> >> 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@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# That's not *runtime* PM, it's the *plain* PM you're testing here... > thanks & best regards, > Mason MBR, Sergei