Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3177588pxj; Mon, 24 May 2021 00:03:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3piLanwkzxJr/xv23hdcLwpqqMBze0tsoHyI9Bpw8fCepmNde+xJFoUwuuRkdiaVdB5Lp X-Received: by 2002:a05:6402:845:: with SMTP id b5mr23436875edz.9.1621839808586; Mon, 24 May 2021 00:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621839808; cv=none; d=google.com; s=arc-20160816; b=oeoqZKQqvSsbFXnFfA+WHjnV4Y80XLYnR3koSv91Je+uUJoMMuW2ehKc1X9UNnXGvq XjTvRiCPGa/d+mdFkPQPdcxDaLlXgTq6sVjEH0lpi+2EC8G4VLh5+NmADEBg7foIYZgU mVM+h3lk6e8x/3MTaM0hYwi+9o0EwLYkx/0seN9lq1X+u36Ont0RMIhuBM0V5mxw7F1c tNI59ubWH4Xta+E+PGUcnKt41Dx1f5+89sVTxxrAzKMFCAGv320i0cnFhKvGeuoQHeJ2 1Ztjyic0mXbwcQmF3pCPnylCGY6EXmhCwz+GjdXQUUUoaKGqxNeWpCLzdiKng87uOYdN AAmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B5/Knft73Gn3au8zWl2Y6O7dohU2k4MikaJeOBs+YWs=; b=MrY+S72aSL4TmyCD8Ut8Xn4oZNpCF6gCfpnJS5zI+Yagx8jQzlXQyiNUbsZj6vRSnK 7nUZ0h1f0gER+x3IasJCILuxQT/R/QZQvc+gELswgdLffVLCTMmpPDcjcGfIuanxYFIr NR0pJOXB2ITEFUNz2bFmZXMJVPCK/xKNN2htW6PvyFa4wz6FdtZVhqOLsK7ENVpVatsc PV/B6BHEEubjobde8Snlveoid3iWopQmMvuyIrasVkKGEjKlze8GFMrBO2M7cekShTET zkFbCjwEBviVtKRPPn6+OsWWNWfeibOYuym1Vzh5QAzogKb/bBHbYjZjepT2PrOCioxT 2IIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="onN/sezX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id da5si12606996edb.393.2021.05.24.00.03.05; Mon, 24 May 2021 00:03:28 -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=pass header.i=@linuxfoundation.org header.s=korg header.b="onN/sezX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232317AbhEXHDU (ORCPT + 99 others); Mon, 24 May 2021 03:03:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbhEXHDU (ORCPT ); Mon, 24 May 2021 03:03:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A49BC60FEF; Mon, 24 May 2021 07:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621839711; bh=wae65KOcaAEsmwm5b4JIWjciQ5lLGB76byDWItyOH48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=onN/sezX1sshCB0mmiddosdsLbGt4B1DkCIccD2p67O+zB5zG/SovvP30Nnq/FAV5 IKmn6cw0aUb8PVl8AUXmDWSJwgT2sLEeY3Th7bfUjNPc5S13gYQgecadGH04/WsoCM +lbTia6B1epI5dz9xhdKceX2Y4kkM+PvXcrqi7yk= Date: Mon, 24 May 2021 09:01:49 +0200 From: Greg KH To: Baochen Qiang Cc: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH v2] bus: mhi: Wait for M2 state during system resume Message-ID: References: <20210524040312.14409-1-bqiang@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210524040312.14409-1-bqiang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 12:03:12PM +0800, Baochen Qiang wrote: > During system resume, MHI host triggers M3->M0 transition and then waits > for target device to enter M0 state. Once done, the device queues a state > change event into ctrl event ring and notifies MHI host by raising an > interrupt, where a tasklet is scheduled to process this event. In most cases, > the tasklet is served timely and wait operation succeeds. > > However, there are cases where CPU is busy and cannot serve this tasklet > for some time. Once delay goes long enough, the device moves itself to M1 > state and also interrupts MHI host after inserting a new state change > event to ctrl ring. Later CPU finally has time to process the ring, however > there are two events in it now: > 1. for M3->M0 event, which is processed first as queued first, > tasklet handler updates device state to M0 and wakes up the task, > i.e., the MHI host. > 2. for M0->M1 event, which is processed later, tasklet handler > triggers M1->M2 transition and updates device state to M2 directly, > then wakes up the MHI host(if still sleeping on this wait queue). > Note that although MHI host has been woken up while processing the first > event, it may still has no chance to run before the second event is processed. > In other words, MHI host has to keep waiting till timeout cause the M0 state > has been missed. > > kernel log here: > ... > Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.911251] mhi 0000:06:00.0: Entered with PM state: M3, MHI state: M3 > Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.917762] mhi 0000:06:00.0: State change event to state: M0 > Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.917767] mhi 0000:06:00.0: State change event to state: M1 > Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4338.788231] mhi 0000:06:00.0: Did not enter M0 state, MHI state: M2, PM state: M2 > ... > > Fix this issue by simply adding M2 as a valid state for resume. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 > > Fixes: 0c6b20a1d720 ("bus: mhi: core: Add support for MHI suspend and resume") > Signed-off-by: Baochen Qiang > Reviewed-by: Hemant Kumar > --- > drivers/bus/mhi/core/pm.c | 1 + > 1 file changed, 1 insertion(+) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.