Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4663001pxa; Mon, 10 Aug 2020 15:02:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww0x2+J01JlXXqoI8NynBSEwsAClvq6C06sMZamgIxh0HNJADq9q1y2C7at7pLLO1a3kLP X-Received: by 2002:a17:906:2c4a:: with SMTP id f10mr23198462ejh.352.1597096968531; Mon, 10 Aug 2020 15:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597096968; cv=none; d=google.com; s=arc-20160816; b=EbfP9gakgNNpFD1KyDoxxYRPuw+GsnGmVmSXh1xCCzBh14gktSMleSyJnM8mIVPT6a wm9cslP+Yc7s3f4OFD0nEqUkaVF4jqyL1+JhJ3VqZ0xBnnHTEf7qlpfVFauxlC6m+kcC s+yDg4B1049qn6FPa8dvi9FuokDCuE9+xEUbkAWpo0kT+Ci7o8qpnG4E1fuLbMo9etEM fF6p2T0Va46wIHqjGd1fvTjmuBc8JsBfhHegnsq6w1/Wa2fQxzw28e8pwU+8A18MSueF NqMO1KjoTn4N1J7D9HjkSTu9dzJp/XWdE+1Xgx6lRAolG8ET6etm1OYOJNrWeaLaAeLM 5zow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=1GwQrNQCSG7I+ITNe/q8t3Qe1WXR3VW3IkHkTvo6IBg=; b=mex0UoqjN/UwEawMn4cCaoBJKtrDTJ7mbMMFBpwZgrlJoNI++VWmM+QL7aiybUdBaJ ZL0tdv4wB2fqtWtX5iXNOldTb3UPfiZNmuBxe/0s+NXocD+74h1ICLgygUPWrGTlr/OI Z0Rqg5l8VSA9aWkbH+WVa0f3HUQQ678FwiC6Oc4QXdx5UoGqXnTI5k9hqOqhhKrZph7E +cmGKCz4GVN/LX1e0iDB0/r8IE8TFTq4woPMC5kQ4FY043NYGxY7XriXU4eP9z51TV+0 9ggOwFAPvktmHJcb+S2wLtkv9+67OF29xYenstt+HRhaNGp/3HXC1YWNbuPdfdlun2on k/lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=azMC4Or+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck8si11196021edb.82.2020.08.10.15.02.25; Mon, 10 Aug 2020 15:02:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=azMC4Or+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgHJWBn (ORCPT + 99 others); Mon, 10 Aug 2020 18:01:43 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:56316 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbgHJWBn (ORCPT ); Mon, 10 Aug 2020 18:01:43 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597096902; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=1GwQrNQCSG7I+ITNe/q8t3Qe1WXR3VW3IkHkTvo6IBg=; b=azMC4Or+ErJJ5/X8j3Ko488WwYLlv32L1gqNKzXF9h4VOVt6MT8z2WbjET8Y7QZa18Xbgp4P xhne6ebDk1u7sGwfnVj4wt4b8sImphhYlQHfNQ2LUXXBqgEaNU54Vuby1ED5cXtzBoVPiW0o qspDuBamcc8yc1uEfyhxSLEnqvw= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n16.prod.us-east-1.postgun.com with SMTP id 5f31c3add48d4625ca1627b8 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 10 Aug 2020 22:01:17 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7EC27C4339C; Mon, 10 Aug 2020 22:01:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0374CC433A1; Mon, 10 Aug 2020 22:01:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0374CC433A1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v7 04/11] bus: mhi: core: Trigger host resume if suspended during mhi_device_get() Date: Mon, 10 Aug 2020 15:00:58 -0700 Message-Id: <1597096865-19636-5-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1597096865-19636-1-git-send-email-bbhatt@codeaurora.org> References: <1597096865-19636-1-git-send-email-bbhatt@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is possible that the host may be suspending or suspended and may not allow an outgoing device wake assert immediately if a client has requested for it. Ensure that the host wakes up and allows for it so the client does not have to wait for an external trigger or an outgoing packet to be queued for the host resume to occur. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/pm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index b227d41..27bb471 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -1112,6 +1112,9 @@ void mhi_device_get(struct mhi_device *mhi_dev) mhi_dev->dev_wake++; read_lock_bh(&mhi_cntrl->pm_lock); + if (MHI_PM_IN_SUSPEND_STATE(mhi_cntrl->pm_state)) + mhi_trigger_resume(mhi_cntrl); + mhi_cntrl->wake_get(mhi_cntrl, true); read_unlock_bh(&mhi_cntrl->pm_lock); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project