From patchwork Fri Oct 13 10:01:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 10004019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 00A5D60360 for ; Fri, 13 Oct 2017 10:02:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E582429005 for ; Fri, 13 Oct 2017 10:02:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA32D29010; Fri, 13 Oct 2017 10:02:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 75E0029005 for ; Fri, 13 Oct 2017 10:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=N3eiyeViRhHk4NSy3GltlsQD0iGvRqKlacY5w9XWyIA=; b=HHR OVar2vTZbWb96woVGW7SDL8eIoB/ywCRGF6D5BSRWLLG7KwCE2+HZjPGiISW8qg39ep6i205tYlEl +M9XsR/b1pjkpzjPc/q7b1L72J99CiutwMzwku4CN1qU19nYgtFRxtgjR1J+Es0YKXNH8m2a1wn7d Uu12PZcDmutPCLxs3JPEFvVkrbpjZaL1Q1eOjDoUUhbvO4Knnfg7rrSATRsmDKPTntnSHXk/0wg8S my2iFE0TGjOndgH0Pr2p/5QdJF1DJFWSJdyGTLpLniSmxLHuq/Nv6X3OlcVxzQEJvajoDUdOlpYTi xZEPmdF06UVLo2kcSnwinAqqIj0sv9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2wnV-0006vO-LD; Fri, 13 Oct 2017 10:02:29 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2wnC-0006e6-AL; Fri, 13 Oct 2017 10:02:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PM/njbH7zltvhJwn+F8a+J9uEZU5an8dQfQrx80j/ao=; b=kU+Ni5kaO+PELawONoQSZJcLP n88RF2EcdT1PQxOBl8YCxdwwgWsZFbTmpE1UByIjbcF2jtBa5VtvquA3GtMZorGgiVfn3SdzKbJfN W3WF38ketP5nuLmnq1chDPetfZY2GUuSP+V3h/vQNPIrcv24fX87B+hZV+PZgfd2su/KW84YgBEVn DCKyn60NlnHKgk5qqF1HxObmFD971oAX4SFf8ZEQJrne/uXWez/MUi/+LkfUZgw5C2ZXISASZjTIk o0fp+J79t8AuB3Ic4wlsnH4Kby1v9tmAmUMjpgBVCVGnmJcjq5kcFqPRmjedxvt0Ndk0pRYbTFmjS QI8B9/hhQ==; Received: from regular1.263xmail.com ([211.150.99.131]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2wn7-0000f0-Fp; Fri, 13 Oct 2017 10:02:08 +0000 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.131]) by regular1.263xmail.com (Postfix) with ESMTP id 2D7276259; Fri, 13 Oct 2017 18:01:29 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id C141D3AC; Fri, 13 Oct 2017 18:01:23 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 20445X70SVK; Fri, 13 Oct 2017 18:01:29 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] spi: rockchip: Convert to late and early system PM callbacks Date: Fri, 13 Oct 2017 18:01:15 +0800 Message-Id: <20171013100116.8271-1-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: briannorris@chromium.org, Heiko Stuebner , Jeffy Chen , dianders@chromium.org, linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org, Mark Brown , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we are suspending the spi master in it's ->suspend callback, which is racy as some other drivers may still want to transmit messages on the bus(e.g. spi based pwm backlight). Convert to late and early system PM callbacks to avoid the race. Signed-off-by: Jeffy Chen --- drivers/spi/spi-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index fdcf3076681b..ae539c735ea6 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -914,7 +914,7 @@ static int rockchip_spi_runtime_resume(struct device *dev) #endif /* CONFIG_PM */ static const struct dev_pm_ops rockchip_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) + SET_LATE_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) SET_RUNTIME_PM_OPS(rockchip_spi_runtime_suspend, rockchip_spi_runtime_resume, NULL) };