Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1692374ybh; Thu, 23 Jul 2020 15:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSFn9wepTXFbLEszHw+tK78CWJ6vGOT//yK63Cd1PjMPwcQ17ZNv8UATCNvulKGefhB+Za X-Received: by 2002:a17:906:4dd4:: with SMTP id f20mr6891772ejw.170.1595543880513; Thu, 23 Jul 2020 15:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595543880; cv=none; d=google.com; s=arc-20160816; b=nSgPnuRRrCotWpxbbl+j0WcmzR8YpgG+egK03JB7xxQDm4tSzKgouYhQ/pf6LuZKDR MshLi9Ax/fHtKGMQ0J08eeq0LhlMHcHFwbj/y3oqW/TsvkR9/Ea7AuCaqEfwMR+Kb04I 2bs+237OsTEwo3pzDO+xxBwXHiUWheSsEzzITgTqMm3t7WEiwsCytL67vFNdZqfwcFGk b+I2liyRfyEd6WwQIpqJ3I52Vl3qWY2H2UQESGtO9Xx0HHA56Xod3Y8KwBwLD8pf9NAL R1xacHwaAFWKY09lS6JIWUVYHkZSyId9MllMgQM6LuSni+nlxymjJRBapwjnGSG8KyW2 1ceg== 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=Uex+4DW9o44df+A15v6DQnpYiOZbaIHOXreTfblB0i91vDhOW1vDEVcfs/u1Q0Jpca iO0sXlJME+WTCE4+Sz/OxNEtxfae9gFmXcKozDZTm0HdxOVEXhDtps/jddY6LakECuOj 7MFVPILUrvWd2iiGFI1jgY2zLdo8RsEXllsF/T9lJR9DP0cdziZZ/nVuOVmB66OsA6a/ uQMi79+0F5lOoMmNSGYjFE4e/oh+1mOzFmSPjBbhzkHYvr1sCF9J9JUmTDZnuqqD6nRf X2AQEji1IzNBltLh7HGTUAomQG5vs3QpJfVQD9kIfSb9mX/DQTrMViaH7vo3G8Gc6/IF 0tTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=q6ucoIJV; 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 18si2931207edw.87.2020.07.23.15.37.38; Thu, 23 Jul 2020 15:38:00 -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=q6ucoIJV; 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 S1728254AbgGWWhN (ORCPT + 99 others); Thu, 23 Jul 2020 18:37:13 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:12126 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728232AbgGWWhM (ORCPT ); Thu, 23 Jul 2020 18:37:12 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595543832; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=1GwQrNQCSG7I+ITNe/q8t3Qe1WXR3VW3IkHkTvo6IBg=; b=q6ucoIJVFl9wcN2l340IyhVCW6hH+DV5Qb33/4Fp4SLQF6eza5f62tO1VzxyVpA80+Ytk6WA VZVLdLyIMHxXslgXNzkrw3tTXe5oaTQRDJ5o9Z2OzDnB3I4modoUIZSdb1P8/Vyyhs9q0T0t xDedURrzCfOYS5JK5+Ckxn9EXIk= X-Mailgun-Sending-Ip: 69.72.43.7 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-n14.prod.us-east-1.postgun.com with SMTP id 5f1a11058423214e13237d9d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 23 Jul 2020 22:36:53 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 44571C433C6; Thu, 23 Jul 2020 22:36:53 +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=ham 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 A86D5C433A1; Thu, 23 Jul 2020 22:36:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A86D5C433A1 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 v5 04/10] bus: mhi: core: Trigger host resume if suspended during mhi_device_get() Date: Thu, 23 Jul 2020 15:36:36 -0700 Message-Id: <1595543802-17859-5-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595543802-17859-1-git-send-email-bbhatt@codeaurora.org> References: <1595543802-17859-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