From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C461C433ED for ; Fri, 9 Apr 2021 11:40:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC05B61108 for ; Fri, 9 Apr 2021 11:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233351AbhDILkm (ORCPT ); Fri, 9 Apr 2021 07:40:42 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:41522 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233293AbhDILkj (ORCPT ); Fri, 9 Apr 2021 07:40:39 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id AC1D6FB05; Fri, 9 Apr 2021 13:40:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XARy5O7q8hdf; Fri, 9 Apr 2021 13:40:22 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 9FD56404BF; Fri, 9 Apr 2021 13:40:21 +0200 (CEST) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Kishon Vijay Abraham I , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Robert Chiras , Sam Ravnborg , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Liu Ying Subject: [PATCH v5 1/2] phy: core: Use runtime pm during configure too Date: Fri, 9 Apr 2021 13:40:20 +0200 Message-Id: <2de2ee26bbf443491dfff1c802f2fa9efaf58d52.1617968250.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The phy's configure phase usually needs register access so taking the device out of pm_runtime suspend looks useful. There's currently two in tree drivers using runtime pm and .configure (qualcomm/phy-qcom-qmp.c, rockchip/phy-rockchip-inno-dsidphy.c) but both don't use the phy layers 'transparent' runtime phy_pm_runtime handling but manage it manually so this will for now only affect the phy-fsl-imx8-mipi-dphy driver. Signed-off-by: Guido Günther --- drivers/phy/phy-core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index ccb575b13777..256a964d52d3 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -470,10 +470,16 @@ int phy_configure(struct phy *phy, union phy_configure_opts *opts) if (!phy->ops->configure) return -EOPNOTSUPP; + ret = phy_pm_runtime_get_sync(phy); + if (ret < 0 && ret != -ENOTSUPP) + return ret; + ret = 0; /* Override possible ret == -ENOTSUPP */ + mutex_lock(&phy->mutex); ret = phy->ops->configure(phy, opts); mutex_unlock(&phy->mutex); + phy_pm_runtime_put(phy); return ret; } EXPORT_SYMBOL_GPL(phy_configure); -- 2.30.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CFDFC433ED for ; Fri, 9 Apr 2021 11:48:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C0B8610CC for ; Fri, 9 Apr 2021 11:48:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C0B8610CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DwP5mfoMQ8RdAWINGbBIIvIkzNqrxSxMTNtiYWnY/NU=; b=NT7Xic0JxYXzaKQaYnv3wSc6U E14Z3Bt6bTHz9WHpkV3P5k9vn3UzWEO68VcyU6thvNkkyUcgdMQ5Rs49+pIH3KJJQYeNw3edEgcR/ cifFayAFf7Uc1kxzNUPMMdNGeTD+J3zrRabekoLPz51jAcigEoA7XF+6DlkzX91nyHInoliwscps3 jvrWo5MZMe7bkmssa8g8OJ1VUNAJ7ZhZVooqphnQf/B/nvAaDTaKUvXZyVDtbZkJbYKaCvskIfFzY UL1gTcRC36ng4h/RKK6FmOt60346KnKd8P2SMs2f570due/OUjOX76evv1WGPC7AeT+5K/b/IODmN UIYJKM0JA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbT-000fA0-TS; Fri, 09 Apr 2021 11:47:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbH-000f8z-ND for linux-arm-kernel@desiato.infradead.org; Fri, 09 Apr 2021 11:46:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:Content-ID:Content-Description; bh=I6L9YsiX93p8pzhieyx0KEQ5LgpPKRoxWW7MvGRunOQ=; b=PGlp//C5B+FVchGsOn3oVgHzNi xCgoocYpgLuhaBTxYvI6RcRBfl88ey74SXTvhErMUqRIIAxxy2SwZ0sAk9iwQjtw3y5Jyn3NzyXT5 e+2/oggh6hupp1TjUCUX5Oh29nlGy1uIM4o7Po6LIRtoKtFqPS4F0lTr83LMWGImr4qcF1dEnUwYw xmZkDXNwMLjY83VOpicSBbmf9fL37BCkBQmqQQ0XhFqOuBI6SkOY3iU8zq4AUAyKS3BkLW/6wWRjZ 0OknUpiCcZiqx75GpiQKd1L8PAiu94oDZOJ0IQdw2ebnBYX5xGsyTpkhvnUNgMaKSHHBnOKDM7VB4 ArpD0NaQ==; Received: from honk.sigxcpu.org ([24.134.29.49]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbE-004ToR-NY for linux-arm-kernel@lists.infradead.org; Fri, 09 Apr 2021 11:46:58 +0000 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id AC1D6FB05; Fri, 9 Apr 2021 13:40:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XARy5O7q8hdf; Fri, 9 Apr 2021 13:40:22 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 9FD56404BF; Fri, 9 Apr 2021 13:40:21 +0200 (CEST) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Kishon Vijay Abraham I , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Robert Chiras , Sam Ravnborg , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Liu Ying Subject: [PATCH v5 1/2] phy: core: Use runtime pm during configure too Date: Fri, 9 Apr 2021 13:40:20 +0200 Message-Id: <2de2ee26bbf443491dfff1c802f2fa9efaf58d52.1617968250.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_044656_967571_E1F7A3E1 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org VGhlIHBoeSdzIGNvbmZpZ3VyZSBwaGFzZSB1c3VhbGx5IG5lZWRzIHJlZ2lzdGVyIGFjY2VzcyBz byB0YWtpbmcgdGhlCmRldmljZSBvdXQgb2YgcG1fcnVud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