From patchwork Thu Oct 3 09:15:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2981671 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94AD3BFF0B for ; Thu, 3 Oct 2013 09:16:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0118200F4 for ; Thu, 3 Oct 2013 09:16:03 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAB88200F3 for ; Thu, 3 Oct 2013 09:16:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VRf0q-0000Jv-T9; Thu, 03 Oct 2013 09:16:01 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VRf0q-0000JY-15 for spi-devel-general@lists.sourceforge.net; Thu, 03 Oct 2013 09:16:00 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.160.48 as permitted sender) client-ip=209.85.160.48; envelope-from=kuninori.morimoto.gx@gmail.com; helo=mail-pb0-f48.google.com; Received: from mail-pb0-f48.google.com ([209.85.160.48]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1VRf0o-0008Cf-Rs for spi-devel-general@lists.sourceforge.net; Thu, 03 Oct 2013 09:16:00 +0000 Received: by mail-pb0-f48.google.com with SMTP id ma3so2171864pbc.35 for ; Thu, 03 Oct 2013 02:15:53 -0700 (PDT) X-Received: by 10.66.227.194 with SMTP id sc2mr8243236pac.41.1380791751744; Thu, 03 Oct 2013 02:15:51 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id xn12sm9182922pac.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:15:50 -0700 (PDT) Date: Thu, 03 Oct 2013 02:15:50 -0700 (PDT) Message-ID: <874n8yogu4.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Mark Brown , broonie@linaro.org, Grant Likely Subject: [PATCH] spi/hspi: fixup Runtime PM enable timing MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-Spam-Score: -1.5 (-) X-Headers-End: 1VRf0o-0008Cf-Rs Cc: spi-devel-general@lists.sourceforge.net, Simon , Kuninori Morimoto X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 3e00a09d2fbd64f0ad98e7c8c29dbf9e038fc746 (spi/hspi: Convert to core runtime PM) enabled master->auto_runtime_pm. Then, pm_runtime_enable() is required *before* spi_register_master() calling. This patch fixed it up. Kernel will hang up with "spi_master spi0: Failed to power device: -13" message without this patch. Signed-off-by: Kuninori Morimoto --- This patch is needed on current linus/master branch drivers/spi/spi-sh-hspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index 0b68cb5..e488a90 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c @@ -296,6 +296,8 @@ static int hspi_probe(struct platform_device *pdev) goto error1; } + pm_runtime_enable(&pdev->dev); + master->num_chipselect = 1; master->bus_num = pdev->id; master->setup = hspi_setup; @@ -309,8 +311,6 @@ static int hspi_probe(struct platform_device *pdev) goto error1; } - pm_runtime_enable(&pdev->dev); - return 0; error1: