Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp162517ybg; Mon, 27 Jul 2020 19:06:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzqFQFdkbbV+aqCJtJ4XJXKQPRsjW2TdlsSBHFAXKi+AQwsmPoacg5G3zNaHzVXck5K2CU X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr24182736edp.216.1595901962798; Mon, 27 Jul 2020 19:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595901962; cv=none; d=google.com; s=arc-20160816; b=i7CwZCaA2H3Brv4nS2VsnLH8uhYx8vEN3dBBfKI9VH48ORJlXrn1u/6LK3J2KT0dgR hWP0XYtaN5ZGFMaN+eeAteM06KNUBPfURNucdiJXxwEzCDxpmgDo1K4bMXEkF5zTWYBy l50+oy8Lw1xODsMk8co/mfxGv+4mZuHa16WGzp4FWHNFSSm1pk7QC3EkOLBtyBmbGRPH Q1JxuuX06iU+GNrx6mziD+QBgFE7Bsevu99fklHqbJZSz9ugcFwrrMy7NbL1DgWMI+zu tgJhalUxm2i9GRG/WKxCfw8zXmW4R6lPr0ica4gSDYCwwjQZ6Qo0lRHA1XYe8lU8InaK SUug== 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=SZvyJK9UXjeuoSN0Pm0JcXIdZ0sIsf6hMhbxQMLw8Z/NzIK+ySLQibeXg2QB49CmG+ F/ApwBIdd1SHwr479gKGwDreSDokGCBX7ktzgZA1D38NrgPVWv8ZhG7oBEeIBBW5mmYd k7I8annPmcOFl609W39dEgpgmbeM1CjkiOKW9q8IXOmd8+aTKco5a0niAUsEmPGxS2SM /VTLwmmVlBe6xyqpgXT4N65T+BVeO717fbhvPMydMT98courb5ARQW469KF1RBq98IDl I4vONhzDJdJTLZ6peSUN8584FThuZqntB0UM/CfaMZDXw/85gVx/pHg99QjbLZH5eC4Y s18Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=DKdYGkAJ; 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 t19si6935282ejj.568.2020.07.27.19.05.40; Mon, 27 Jul 2020 19:06:02 -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=DKdYGkAJ; 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 S1727101AbgG1CC5 (ORCPT + 99 others); Mon, 27 Jul 2020 22:02:57 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:44580 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbgG1CCf (ORCPT ); Mon, 27 Jul 2020 22:02:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595901755; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=1GwQrNQCSG7I+ITNe/q8t3Qe1WXR3VW3IkHkTvo6IBg=; b=DKdYGkAJf5zK6/8XOJu6U+M/P7kXmR6be/cK5e63sWrQIpHRFxIKeZFRSjWztutz+6td7QfO J4uSxd0qXRQWL1ptFqcSHSN1nJL+re0jrE17L+SpNC2agput696Sk2XffSFEkmRW0qIY/pqM zmm5PiGR9KeD+wBG8aQ/HMd+/IU= 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-n06.prod.us-east-1.postgun.com with SMTP id 5f1f87397186ea1ee1763745 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 28 Jul 2020 02:02:33 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B987DC433B6; Tue, 28 Jul 2020 02:02:32 +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, URIBL_BLOCKED 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 1D03DC433AF; Tue, 28 Jul 2020 02:02:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1D03DC433AF 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 v6 04/11] bus: mhi: core: Trigger host resume if suspended during mhi_device_get() Date: Mon, 27 Jul 2020 19:02:13 -0700 Message-Id: <1595901740-27379-5-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595901740-27379-1-git-send-email-bbhatt@codeaurora.org> References: <1595901740-27379-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