Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6706662yba; Tue, 14 May 2019 12:08:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqypGMkxl5nwJl6e1Mc7TVodGmYdQqwHHI2US7J3yj5ViZ1oGiWWBxASr4+mTvHocSahDHRZ X-Received: by 2002:a17:902:56d:: with SMTP id 100mr39220354plf.246.1557860897953; Tue, 14 May 2019 12:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557860897; cv=none; d=google.com; s=arc-20160816; b=izIKSLoXRrqA8ftz1oKfXjkPAsZbZBbq3CDGOqcqep7+nTXMlq62KCgpLPdjuwXrVj WJ2d/4EjsP7MH3+CudGyyV+RAJ/k3EWycoeVpnB/AlLaaflBtzaY9YXA4HtsKrk3ZGDe 4/6pwP1kENOH5FJC9jKj1v1gBqdTlEJCcKGJltCrhUrkTDKk14RExC/TD3XmzOhyJdZd tCVY95skDouK9PUNfm1no7l8PnAZv/rLvBc2bAq5rCX4OzP0Z/rXZb6QYHiLoedqnEHS MJHLIKQKqEPFUuqQGbS26b5WwdGcY+VkBTSgFtkVHMoWnjOo5IW1egzoYeFu3HYLte3X ADug== 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=SPWmKpq6VDGUfyOzmQTA3tI7BJu0RPpA6WUx4ql1p0M=; b=Oa1VnSbIOSjQkdtBRfy2pNiqljW//be8wajPjt9fi2UWmFYI4/WLTS+NH6our3TdZt 6sbu7yALuzmQtQqw4G2uiiwauKk0mBjt8NpOAoOYw9tcx6GuYD9Bm1iS6nHxa+/WzDEa ZGuBYOo2EkwEPsHOlYVM1uvZYTjbaCD9SLG7z9UO8aX9eDZWRIgGmmBWPjl8j3x6LOJo BkW5erd/fCDfFv/jTgRV6P6/WEWuHPjcYhCerun9nZNKwCB/QBPvAn5JYBpjdvZcU9RS ulfr7QScLYfj2+eAytRO+C+x5pgPHubqLqvNBq2Lrin/8/Usi12jK//HOwF6DUKgdZH2 CZzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=MeFq+tmD; 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 f13si22929840pga.385.2019.05.14.12.08.03; Tue, 14 May 2019 12:08:17 -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=MeFq+tmD; 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 S1727671AbfENTGo (ORCPT + 99 others); Tue, 14 May 2019 15:06:44 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:39716 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbfENTGn (ORCPT ); Tue, 14 May 2019 15:06:43 -0400 Received: by mail-lf1-f66.google.com with SMTP id f1so44215lfl.6 for ; Tue, 14 May 2019 12:06:41 -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=SPWmKpq6VDGUfyOzmQTA3tI7BJu0RPpA6WUx4ql1p0M=; b=MeFq+tmDozlVwHUa/pirnaQUyzHzhiC922oLEAd3VZSh7SQs/8lTjYBKazPc8OI/3f aD8IoPZ8mJx5iLrL+MCV/S9RnL1ffUq9tgdO6ubADK0wQj3lx2tIb2T9eO5FVg9jcnEV l48gJnNLj8cFsXg356nvAolyYevr0DwKfyW0dhSkz3vR3T0wCBP7RPDLfxZt50xi69l5 u5zLWcDHJcPmasR54xK+MBfniS3Mh21UfWPTl7N6KLj8pwkK/rhJg8/W7QjH7+ex66Dm OamrI2TSVd9HUuywpc6pkUClP5OK0UHg6vlo0K4S2IF+L5a4DN5OMKLT2ucSF52OXx9s Sxkg== 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=SPWmKpq6VDGUfyOzmQTA3tI7BJu0RPpA6WUx4ql1p0M=; b=SuZNL8l2YioOlLb+xO48V4boGOJROkmJQy9Ku6QkgIfE07jdNeZQnYtn2rggycSt6m dRV69pk/cZ0H/+ORlOMstLQ6pEvOvuhFVVuqHfMKw93YQECJriclG5+o1rv919rIFl/u JmA8v4WvSfBpEQ0S/40IS3hBWET2KXDQaBlOqCNdXFrbll+KCKWQMvCGyA4HdW1tE6yS OAc/iDlbdzgATLrNgmzfb63lFEyQFL7v20/UjfYrucs05MLTxL0VSr22bop3b39/vmiE LSIPIgRCa75qrkUU0RiwMUfNQSIRAkas7fCwPnnWltnhXHvX7xoP/AvpY+romcYoc1Ps yuNA== X-Gm-Message-State: APjAAAVfDy5GRhVXdpBJUIRhIL5QCOd8oyvD4AJrSWHIy2VBNJQUmFQC qbOliYsBYzJYnn9CXCHXP8ngeg== X-Received: by 2002:a19:1dc3:: with SMTP id d186mr17340891lfd.101.1557860800826; Tue, 14 May 2019 12:06:40 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.86.127]) by smtp.gmail.com with ESMTPSA id j19sm3969610lfj.52.2019.05.14.12.06.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 12:06:40 -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: <9014077e-2648-adad-72c1-baf834f5a511@cogentembedded.com> Date: Tue, 14 May 2019 22:06:37 +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 Hello! On 04/19/2019 08:38 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 ? > >> 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. > >> >> >> >> > Have you tested reading? v8 patch still works while v9 patches >> >> >> > hang on doing: >> >> >> > >> >> >> > $ cat /dev/mtd... >> >> >> >> >> >> Sorry, 'od -x', not 'cat'. >> >> > >> >> > root@draak:/# cat /proc/mtd >> >> > dev: size erasesize name >> >> > mtd0: 00040000 00001000 "Bank 1 - Boot parameter" >> >> > mtd1: 00140000 00001000 "Bank 1 - Loader-BL2" >> >> > mtd2: 00040000 00001000 "Bank 1 - Certification" >> >> > mtd3: 00080000 00001000 "Bank 1 - ARM Trusted FW" >> >> > mtd4: 00400000 00001000 "Bank 1 - Reserved-1" >> >> > mtd5: 00300000 00001000 "Bank 1 - U-Boot" >> >> > mtd6: 00200000 00001000 "Bank 1 - Reserved-2" >> >> > mtd7: 00480000 00001000 "Bank 1 - Splash" >> >> > mtd8: 00040000 00001000 "Bank 1 - Device Tree" >> >> > root@draak:/# od -x /dev/mtd1 >> >> > 0000000 0000 d280 0001 d280 0002 d280 0003 d280 >> >> > 0000020 0004 d280 0005 d280 0006 d280 0007 d280 >> >> > 0000040 0008 d280 0009 d280 000a d280 000b d280 >> >> > 0000060 000c d280 000d d280 000e d280 000f d280 >> >> > 0000100 0010 d280 0011 d280 0012 d280 0013 d280 >> >> > 0000120 0014 d280 0015 d280 0016 d280 0017 d280 >> >> > 0000140 0018 d280 0019 d280 001a d280 001b d280 >> >> > 0000160 001c d280 001d d280 001e d280 1000 d53e >> >> > 0000200 f800 9266 1000 d51e 3fdf d503 3ba0 1005 >> >> >> >> Still hangs for me. After I patches spi-mem.c and the driver to >> >> call RPM for the MFD, it started working again. Perhaps, that clock>> >> is still enabled on your target. What does the following print (for Even with these issues worked around, I still see strange behavior on writes, e.g. after I mount JFFS2 partition, remove 1 file, unmount, re-mount, and mount again, the removed file is back! :-/ [...] > thanks & best regards, > Mason MBR, Sergei