From patchwork Mon Sep 17 12:10:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10602631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B277161F for ; Mon, 17 Sep 2018 12:10:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0433B299F9 for ; Mon, 17 Sep 2018 12:10:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC370299FC; Mon, 17 Sep 2018 12:10:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B9DD299F9 for ; Mon, 17 Sep 2018 12:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbeIQRh5 (ORCPT ); Mon, 17 Sep 2018 13:37:57 -0400 Received: from shell.v3.sk ([90.176.6.54]:47304 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbeIQRh5 (ORCPT ); Mon, 17 Sep 2018 13:37:57 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id A8E08AEEAD; Mon, 17 Sep 2018 14:10:52 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Za2rIdfMEKrC; Mon, 17 Sep 2018 14:10:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id D136AAF016; Mon, 17 Sep 2018 14:10:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qLN2yEueWE6t; Mon, 17 Sep 2018 14:10:49 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 34464AEEAD; Mon, 17 Sep 2018 14:10:49 +0200 (CEST) From: Lubomir Rintel To: linux-kernel@vger.kernel.org Cc: linux-spi@vger.kernel.org, Lubomir Rintel , Mark Brown Subject: [PATCH] spi: Gracefully handle power supplies with disabled PM Date: Mon, 17 Sep 2018 14:10:41 +0200 Message-Id: <20180917121041.21084-1-lkundrak@v3.sk> X-Mailer: git-send-email 2.17.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows use of SPI when power management is disables, such as on early boot; See also: commit 31eb74318054 ("PM / runtime: Fix handling of suppliers with disabled runtime PM") Cc: Mark Brown Signed-off-by: Lubomir Rintel --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index ec395a6baf9c..6546564e41d0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1212,7 +1212,7 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread) if (!was_busy && ctlr->auto_runtime_pm) { ret = pm_runtime_get_sync(ctlr->dev.parent); - if (ret < 0) { + if (ret < 0 && ret != -EACCES) { pm_runtime_put_noidle(ctlr->dev.parent); dev_err(&ctlr->dev, "Failed to power device: %d\n", ret);