From patchwork Mon Dec 15 14:01:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 5492991 Return-Path: X-Original-To: patchwork-linux-spi@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 A3B4FBEEA8 for ; Mon, 15 Dec 2014 14:03:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCCB5209F9 for ; Mon, 15 Dec 2014 14:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4C6820A0A for ; Mon, 15 Dec 2014 14:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751246AbaLOOC5 (ORCPT ); Mon, 15 Dec 2014 09:02:57 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:49679 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbaLOOC4 (ORCPT ); Mon, 15 Dec 2014 09:02:56 -0500 Received: by mail-pa0-f53.google.com with SMTP id kq14so11867835pab.12 for ; Mon, 15 Dec 2014 06:02:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RsQVLIUx1BlA+r43XS2/LiKymOeaY192xTE4+x2wkEs=; b=lGc08O6mVyHne0G6IhF1A/Jx2C87nf6+P/uHxCUAr2BelZ+jSxXxqClgZC2vXOFQr+ xHpzTrmDZbzmtTPipzLPYgiFYxNRXrEp3QCb0B4XnC8vmoGWr9dvPTfc+R/GPAWg/JSO q7eqKBhGjjyCH4fPpwV13zKE7vkRglStNBinFbJNsaEplbXvNFJQ0QdUOtWPs6eRa02a LXk4njtMqw7BFKKmgSYGfnT7YKwbkIRBC1hsZ1m64hlQ36l/E2Ld8UKgM+Qd66gFXQX6 lO6NapMnykXNbLow6+s9kWvwWUwjLtnrNPR3MIH30Mbu2KSGkpibCaBwHMLH2fmIiOnY 1+Ig== X-Received: by 10.69.26.98 with SMTP id ix2mr50826291pbd.161.1418652176168; Mon, 15 Dec 2014 06:02:56 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id oi5sm6754801pbb.7.2014.12.15.06.02.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 06:02:55 -0800 (PST) From: Yoshihiro Kaneko To: linux-spi@vger.kernel.org Cc: Mark Brown , Simon Horman , Magnus Damm , Geert Uytterhoeven , linux-sh@vger.kernel.org Subject: [PATCH/RFC] spi: sh-msiof: Add runtime PM lock in initializing Date: Mon, 15 Dec 2014 23:01:11 +0900 Message-Id: <1418652071-6396-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Hisashi Nakamura SH-MSIOF driver is enabled autosuspend API of spi framework. But autosuspend framework doesn't work during initializing. So runtime PM lock is added in SH-MSIOF driver initializing. Signed-off-by: Hisashi Nakamura Signed-off-by: Yoshihiro Kaneko --- This patch is based on the for-next branch of Mark Brown's spi tree. drivers/spi/spi-sh-msiof.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 3f36540..1405293 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -480,6 +480,8 @@ static int sh_msiof_spi_setup(struct spi_device *spi) struct device_node *np = spi->master->dev.of_node; struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master); + pm_runtime_get_sync(&p->pdev->dev); + if (!np) { /* * Use spi->controller_data for CS (same strategy as spi_gpio), @@ -498,6 +500,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi) if (spi->cs_gpio >= 0) gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); + + pm_runtime_put_sync(&p->pdev->dev); + return 0; }