Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2499791rdb; Wed, 21 Feb 2024 09:22:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNL08jFr6SHHdPEA1sP/fRy26twwKX74UIrduibRR1wR7LQkOaAbwE/vePw/SJIRWHCaSutoUcyvaJPizcpD44/kXoQb6Q+7idSlRx3A== X-Google-Smtp-Source: AGHT+IEWNFnFMrJv0tIuBC12z5dyXKLdKr7AeCJpg5PSMvEho4oy98O8s1UE8t+/izTnrhyVvD9c X-Received: by 2002:a05:6870:d8d2:b0:21e:80ee:523b with SMTP id of18-20020a056870d8d200b0021e80ee523bmr13695039oac.34.1708536161166; Wed, 21 Feb 2024 09:22:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708536161; cv=pass; d=google.com; s=arc-20160816; b=H/uRkNZUGW8RbdivTk7Vb4Bz9J1bdTO0jq+FYMPLeTWTzewQEbEX8JNu0KKP0zhpD2 62IF1cXuOFy2/puOsmWO9Hijvk7RNYObB9FEUrsCOKLQJs4YIlkeZmJO0DPk1nBPYbka e70vKIjh7BB1OJgN8G3DL2zjMKOKCbXij2EjvMq2FRAc8f2jzeCsx5iABs/GuG5vasAW JuhRP6ydiqYexpKeF5JiTw40Ces/0+fShcgSwlxUFFFa9t2kNSf9DY7AccYiAPXM41mw M+IS2zf5x7UUJ030tR93Obm9cVMjQ2xBEW0/QgMlQOyOmqkmIM4KCyEHAYVpDS9028Du +9Qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BxK9QSTmoRrLlulObARwPvXOu7dmPoYPffk1xFoAODY=; fh=uyFlBTN0gt8MLUF8gbOt1yONzFe48Xsfcxb2omI+GpQ=; b=XU6LXnqEo+SLw9ReXohEbOMG0EZy58oYokGDJ+XYRBDj4SbLN59Rw+jHrjC9bxNumm j/zwsjQfYSH11PNNzynCMTdf6LanMw9d5GGrXUtV57IaKintrxR50HLJc49kPh7NREVi lvX8LDgZCS5kJF1xcwM4jjCrTpfe+NQGP0NEv/72DFSqvoVrF5LcKmk6eakiyWwLcQ1O 4fgSoDkPeNOdPkw9M1u26vZoD+7Z0wUGbGclqx0/B4qhB0WCVAyh726QOjjhOBme9I2i l4WBxJt23D/4FYp9ryC/J2sw/RC9hKpuFv0sJLzvohieRdykGX55AS42xC67l+fxaGs/ gYyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lRXYkRq0; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s2-20020a656902000000b005dc42ad5d65si8565929pgq.622.2024.02.21.09.22.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:22:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lRXYkRq0; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0A4FEB21146 for ; Wed, 21 Feb 2024 17:22:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4901183A10; Wed, 21 Feb 2024 17:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="lRXYkRq0" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A4B7FBDC; Wed, 21 Feb 2024 17:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708536155; cv=none; b=tl82jz/kZ9xh/2iZz80h0oBsa3egNSUDn0N/1r/ukePJMsYOPLqZvBRLzNa3k95QtgZ9IlDA9vWP5NiJBWtzLIG1rj6XrQWOaJvNemB+dQFeXAOX+03uhma43bGi0ZM/hRIa1Q4/rXBVJbWOKg3DFxrttwBEwZ8b5ioLpPnDF90= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708536155; c=relaxed/simple; bh=IyBKPSwtGfLjQXX0GNBOrKL3WAkHUPwsIKtl305joU8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=SJd0wZSoKF2axoTtjV+/rnCF5tQYHObir7NUi/N9GdbQhywRT25kfT8BoMfWCZ8YNDDkSyC2Sv91CCX0TUqwIjmBFIEzGQdC6xr6uKwYYs3IKQDV0luuMbkz7bRF+6SB7B1exr7TUginnswrQ3MwBhFOO+JDe1VdfWKpgkujk6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=lRXYkRq0; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41LBg667027993; Wed, 21 Feb 2024 17:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=BxK9QSTmoRrLlulObARwPvXOu7dmPoYPffk1xFoAODY=; b=lR XYkRq0cpysKF767sTnZ8rplwyTOoBTMobixY08Lo0l3sAIkQ88gCS83tB308/URf Xny+kb8/0HEEorF4TruOW5rg7+EYjQoXmSXfSnSgSP+sxztBU1NbuiMDlG9SFO+K 2tqwGsBbaD9arVGb47P27CwyH4xheAHtJxqsFHPxjQkK8gdvJP3K/gSQaIp0HMG5 sZJ+lyHprNEjsm6WH1p7WybTKyj6YknNF1hQZPmQ+3tf7tCSMI1xWDsUpNCF1TR5 M4qof1Yqepq28BxcUvEfkIJvY8mUp8gHbu6otod/hy2nwvLCadBa5GI4DCvBj9OP HnkLty1xiWHZ3RYbXt+A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wdgge0u9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 17:22:26 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41LHMPCC005697 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 17:22:25 GMT Received: from [10.110.34.22] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 21 Feb 2024 09:22:25 -0800 Message-ID: <8fa5a254-7c9c-4f71-ae84-a7dc7c7aab03@quicinc.com> Date: Wed, 21 Feb 2024 09:22:24 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] bus: mhi: host: add mhi_power_down_no_destroy() Content-Language: en-US To: Baochen Qiang , , CC: , References: <20240221030026.10553-1-quic_bqiang@quicinc.com> <20240221030026.10553-2-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240221030026.10553-2-quic_bqiang@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: p720gyruh47yBjuK3CApn8LPqUJQMutT X-Proofpoint-ORIG-GUID: p720gyruh47yBjuK3CApn8LPqUJQMutT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-21_04,2024-02-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402210135 On 2/20/2024 7:00 PM, Baochen Qiang wrote: > ath11k fails to resume: > > ath11k_pci 0000:06:00.0: timeout while waiting for restart complete > > This happens because when calling mhi_sync_power_up() the MHI subsystem > eventually calls device_add() from mhi_create_devices() but the device > creation is deferred: > > mhi mhi0_IPCR: Driver qcom_mhi_qrtr force probe deferral > > The reason for deferring device creation is explained in dpm_prepare(): > > /* > * It is unsafe if probing of devices will happen during suspend or > * hibernation and system behavior will be unpredictable in this case. > * So, let's prohibit device's probing here and defer their probes > * instead. The normal behavior will be restored in dpm_complete(). > */ > > Because the device probe is deferred, the qcom_mhi_qrtr_probe() is not > called and thus MHI channels are not prepared: > > So what this means that QRTR is not delivering messages and the QMI connection > is not working between ath11k and the firmware, resulting a failure in firmware > initialization. > > To fix this add new function mhi_power_down_no_destroy() which doesn't destroy > the devices for channels during power down. This way we avoid probe defer issue > and finally can get ath11k hibernation working with the following patches. > > Actually there is an RFC version of this change and it gets positive results > from multiple users. Firstly Mani doesn't like this idea and insists that an > MHI device should be destroyed when going to suspend/hibernation, see > > https://lore.kernel.org/mhi/20231127162022.518834-1-kvalo@kernel.org/ > > Then Mani changed his mind after a further discussion with kernel PM guys, > see > > https://lore.kernel.org/all/21cd2098-97e1-4947-a5bb-a97582902ead@quicinc.com/ > > So we come up with the regular version and it is almost identical with that RFC > version. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 > > Signed-off-by: Kalle Valo > Signed-off-by: Baochen Qiang Reviewed-by: Jeff Johnson