From patchwork Fri Mar 5 14:09:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 393521 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp450525jai; Fri, 5 Mar 2021 06:01:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz76l9Duv1IuCTyEKaqbE6LGM0c2GUm8opvf1h17ovo0rvuct2RrM0pPKn0UH3vDqzzn1Qs X-Received: by 2002:a05:6402:1d19:: with SMTP id dg25mr9209157edb.218.1614952901866; Fri, 05 Mar 2021 06:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614952901; cv=none; d=google.com; s=arc-20160816; b=jlIDbmgG+n9VonnOTZtXuHCuBjZ49BfK4IcueOcLBn5hWbaSmM+lnynhJfyMakMkzT Ymm9q4j/QUiYnrf/rzK0cWO3PWbpXy3REUDRP0bADypzWEELAY1b7VlXnjuLq91RO8Vx 9DywjGMmoh0iQ/HY37ApJ58/mHsO4rzZqs2wgwekT/g8SQ68hcTN+jazlu2DW31zbbnr wcV6UX8bnA7t+fmQAP72AelgBDJrfi4dHcQsGCtkMmEBVVoCVYWs/dQ9AypTp4ajxcO/ ma+wmGfg4Wc52MYhB1X+SAWj1aWfC09aEOC6CYgS+jhoKOvWyHMy4DyWzCWBc73nWQBF 8juQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=MtOIud4TCy9Y7BduyBbPYACEUWKGNNxpzstIW4INW1Q=; b=UIcTM6hv4k/4BNMa1TcCPdJQ40n0EA2lnZ16tmlrII07e6LT1crdab/rSgswXC/Pl3 G7PNnDXhPtogKBPKLU+CSsESajxe+rX3C5tgCHhctiN87Gt0Hmo4JjMXNjVw0NBFrhlL vjqMkhOOJh1Gn3tupbB1rl1O9vzNhDt26/w8/rLQbRfPB4JUWpfrSC7anqjjouSFcxDA KcStgQRuid5eE1jUwdkg8hg0N35hODq543dAobG6AKydQMssHdYgQ8FMSjBjtM7h7rdK O6hmVd2xMFoAK1o6xGeU5DQVt6qBUqPWOIyHqHGS4pSjp8bIFcpTXzuto3U5Y0Gmht/K hD1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G9r+DXby; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si1664143edd.486.2021.03.05.06.01.41; Fri, 05 Mar 2021 06:01:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G9r+DXby; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhCEOBI (ORCPT + 16 others); Fri, 5 Mar 2021 09:01:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhCEOAk (ORCPT ); Fri, 5 Mar 2021 09:00:40 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3D9C061574 for ; Fri, 5 Mar 2021 06:00:39 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id n22so1538386wmc.2 for ; Fri, 05 Mar 2021 06:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=MtOIud4TCy9Y7BduyBbPYACEUWKGNNxpzstIW4INW1Q=; b=G9r+DXbyrpSuHCsKN8dOe/k2LEVZAeqz2grzrwF7z/aToUa/KqY/vQ2gAdrVztR2K2 KIg011NC4c74l33zUAzvqV/Pp2dw6vlumt2pC/4szyHVxwkgJbHISmrNbwTUfkeaJCTd 9Lg9HmxWF41vtunTg42qMwksBhyCKF2C4w0m/ThP/s6dsCMzltcPzQwJ+a82oE/6s9hS IrZA1boWt7XaR22yG5iTsagUjvxzHlEzwhLv+CC7tI4/ywOFz7021xpEv6U5v7w0ZWZI qgfb2YkV1ub7FwN97kLjaLBedPLnnIG0hkvs0CgGL2gg6kbTuf+C00zMU9o6WBZ83bXE 1DkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MtOIud4TCy9Y7BduyBbPYACEUWKGNNxpzstIW4INW1Q=; b=dLbLml2v63A1cTbHvEK11mkf0mdOPIEfJQrFeO13iowNggy7mc8N9O+k0t2VlQMVoB zyt3Zx4lZfkIK6DZkIMcl7DDoHSZsjH+N25P/2sXi2Crsbs5yXWwOAwc97t7v36AU69l wDA59SbjADiPNjRcLZWQ7X8lXzwlFo/IXuFpbJdjot0H171mX0ns+tXfz15rD9BYFHse ymuenL8sTY7O9TFzWVRc1+21HmS+3FHk1FeH9I/e5phN2c4p9z08yvpaDqLozg2Kty2Y Yk7ytZg4tvf+H7Y8YqTrBIzmnZfDySCClQE7hhu8Bo3ppdLzHhpJ1nMPy8qhGCb09iok YsYw== X-Gm-Message-State: AOAM532DpzmfipMUQvDprf9xaT10xKArP7dG93V6ZVuEyvvF48DLhBZk DfGtugePyygeoeAXoWd5V+sSBw== X-Received: by 2002:a1c:a5cb:: with SMTP id o194mr8900716wme.129.1614952838517; Fri, 05 Mar 2021 06:00:38 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:55da:a740:2edb:1c7e]) by smtp.gmail.com with ESMTPSA id v9sm4740635wrn.86.2021.03.05.06.00.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Mar 2021 06:00:37 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH] bus: mhi: pm: Change mhi_pm_resume timeout value Date: Fri, 5 Mar 2021 15:09:07 +0100 Message-Id: <1614953347-10192-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org mhi_cntrl->timeout_ms is set by the controller and indicates the maximum amount of time the controller device will take to be ready. In case of PCI modems, this value is quite high given modems can take up to 15 seconds from cold boot to be ready. Reusing this value in mhi_pm_resume can cause huge resuming latency and delay the whole system resume (in case of system wide suspend/ resume), leading to bad use experience. This change adjusts the resume timeout to a fixed 2s value, which is more than enough for any MHI device for exiting M3. Signed-off-by: Loic Poulain --- drivers/bus/mhi/core/pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 0cd6445..e2d83a9 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -17,6 +17,8 @@ #include #include "internal.h" +#define MHI_PM_RESUME_TIMEOUT_MS 2000 + /* * Not all MHI state transitions are synchronous. Transitions like Linkdown, * SYS_ERR, and shutdown can happen anytime asynchronously. This function will @@ -942,7 +944,7 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl) ret = wait_event_timeout(mhi_cntrl->state_event, mhi_cntrl->dev_state == MHI_STATE_M0 || MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state), - msecs_to_jiffies(mhi_cntrl->timeout_ms)); + msecs_to_jiffies(MHI_PM_RESUME_TIMEOUT_MS)); if (!ret || MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state)) { dev_err(dev,