From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796217594; b=WNG91qWx9OmdLJsGVOf6CvPUT2tvNAHE/f2mSDM4S+QRVH73jyok/66CqAZ/2voUC1RB 4n+eCNcQgVFEQw0P7pzst2V+2YQeMSJ7ss7ReF0u7GF5ai65IyTCgfsi+4GCUyTTtl5ZN 9tNzCidxwM3sKXDbql8AKqBgZjmMBk/+dgo4tj6h8Qs0Tl2vPpl6jO+udHRyuHBJgstM7 dh972A3XQMjA0iC1uqHvG3Ksh7/mrgtBB1q6kLKJMyKSJohoZVg+mAh58tp0yN5rsOOfM GCWmoxCm8ONJuieGH6hic0ihKgivH+iRWXQ055B1THMbUYGlT4AmSToH3A73/LVanPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796217594; h=Received:DKIM-Signature:MIME-Version:Content-Type: Content-Transfer-Encoding:Subject:From:To:Cc:In-Reply-To:References: Date:Message-Id:X-Mailer:X-Developer-Signature:X-Developer-Key; bh=xY7c0XE5kZG9IGAlM6BPqBG8zOCR/MTak8EC6oMrC4U=; b=shfAh1IRMOSYemGzD6dvWzx9j0RGJ594IeLVO4tbprrZDeNLpuTmOI5xeeuEOvQDVPlv SmnqiIcB6VANLotBmeXxRExIOzex8EuQj781Q6B3Njxgp1VbRFXhONz0lrVf4fumdcvRg xp6jMkaqmlZ2f9V8Wr5CrpxCS2uKaW80QcbH0LTnXe50kwV/tkAJhUdOAjr4SxVua3zY2 4BM5cXIWMo4Ek6wJgLFYsoprSkI/Qub+e8xC080UiMc1+lhSH+AR45Tz1BlZ4WXJpNHjA x46OxDl/5AEz9mZLOgFm7abKFyEPZebTW8DiB75BSafo3CHXMG3viEXvYRo1HYActlA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GarB4f2Y; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C6A6606A329; Wed, 2 Dec 2026 13:19:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GarB4f2Y Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98AA01F00893; Wed, 2 Dec 2026 13:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796217593; bh=xY7c0XE5kZG9IGAlM6BPqBG8zOCR/MTak8EC6oMrC4U=; h=Subject:From:To:Cc:In-Reply-To:References:Date; b=GarB4f2YOHQyx0tSkIjk1/UfBKeaSrDFupjnD5k+buF2yHPot6fm4nmh5XNlT4xSd OildKvgjfrIA+fcZWldl0QZ2fPZqe0/X+6oILI4M9MM3nicTxNya68ZIUjbkxhUoei E2WBzeMKN69K+s8xEd4W6hOveP66GTPuvoH95OIeo530l/Ep7i3ZtT7a+UUTmlHIIy XRQg5yv6JAU8V0w+54WL9lvhRGVDOB9NXFi3/d/ujxTWVt/OROXW4h+SiXG53paDIH XXgUUw6L6FATW+N/zVIKBAJjrgjuMFMSAMTAZQg8j3OsRfugjLuFv9iwYDHZ69TKmJ jf+iystjO8pBA== X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [PATCH 1/2] bus: mhi: host: Add mhi_pm_suspend_force() API From: Manivannan Sadhasivam To: Loic Poulain Cc: manivannan.sadhasivam@oss.qualcomm.com, Manivannan Sadhasivam , Jeff Hugo , mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa , Len Brown , stable@vger.kernel.org In-Reply-To: References: <20261202-mhi-suspend-fix-v1-0-451bdce5733c@oss.qualcomm.com> <20261202-mhi-suspend-fix-v1-1-451bdce5733c@oss.qualcomm.com> Date: Wed, 02 Dec 2026 18:49:46 +0530 Message-Id: <179621758635.121678.9242560214471179720.b4-reply@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1743; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=Y1Fm/ns8KhhyKsXPMxEe1peeRsyddCejO9/IzWXLUZM=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBrEBr1npDG8Q96ho0qsJ3kOj0Ut4oEcESAaTM90 DGWmSBd4waJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaxAa9QAKCRBVnxHm/pHO 9fY0CACM8ecbNEs0e34PBOe3H0xMWjbrE5pdy3tetCr2sQb2XGdswJnEJ/MWAKLgXGfajF+ZkUp HFaJvMpZ8rr1zHeU8PvXEWw/LxeNfecHC+Z8RCNZZc2FB4y850uRgHakEeRKkTLjywzWhcPewNg PeUKX0DI67qUpPINevDBQF2DSX0D1+xb8zfu/2wtW6iR75nxf/Zq4CKajdJFlTEKPD199qBrhjb Ygb3j5106gGoXmRCanaNtV7B54UNSF+28HMjz+PHDqZic+lkVkiS5Z9Srg+ro3cJsY2ErC92kCQ AokIL3NWJ3gU0mvUnr98D0fJutLVnl7Ihp7pxyjWZLfxbxKY X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 On 2026-12-02 11:15 +0100, Loic Poulain wrote: > On Wed, Dec 2, 2026 at 9:44 AM Manivannan Sadhasivam via B4 Relay > wrote: > > > > From: Manivannan Sadhasivam > > > > Currently, mhi_pm_suspend() returns -EBUSY when suspend is not completed > > due to device asserting WAKE or packets pending to be transferred to the > > device. While this suspend abort works fine for runtime suspend, it is a > > disaster for system suspend, because a single driver aborting suspend > > aborts the entire suspend process. > > > > So to fix this issue, introduce a new API mhi_pm_suspend_force(), which > > forces the MHI stack to trigger suspend instead of bailing out. It does so > > by waiting 100ms for the pending packets to be drained and ignoring device > > WAKE. Even if the device is wakeup capable, suspend can proceed and the > > device can wakeup the system later. > > Why ignoring device wake? can we have more info on this. > My wording was slightly off in the above paragraph. I wrote it in such a way to sound like the API deals with device's wakeup capability, but it is just the wakeup count of the device enforced by the MHI host. To your question, we should not see any driver holding dev_wake during system suspend as all of them just do mhi_device_get_sync() to access the device and make sure it stays in M0 and call mhi_device_put() to allow it to enter M3. But userspace can hold the device_wake through debugfs. So if device_wake is set during system suspend, most likely it would come from userspace vote and the MHI stack can do nothing about it, other than forcing system suspend. - Mani