Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2446277lqt; Mon, 22 Apr 2024 10:52:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTxpizRqUABcRlCz4ihuf0H6PqUZ/M5FM/FNDWcopEa9ab90gtA9SFY9BaLGJw+WVzcfVh3AlSaqEb5kW02+aQIwAdqgCj7oK7QGj90A== X-Google-Smtp-Source: AGHT+IH6IGEhjTIsR+AdHZ1yDw3amXREYnWQmlv03f6ZfanGZePMZkrGGUPVfwGXmWUDH4Aychsc X-Received: by 2002:a17:90b:88f:b0:2ac:40c8:1ed3 with SMTP id bj15-20020a17090b088f00b002ac40c81ed3mr8689443pjb.5.1713808363669; Mon, 22 Apr 2024 10:52:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713808363; cv=pass; d=google.com; s=arc-20160816; b=nizn/djXI1fdLEBz21zJFO3sU8ms3LBHjf2J1qHZlORcFfMT7vZApQR4s8f/D2tcQ9 XJKA2br6OSRU06giA3uvlwsGCM6jONsyAyD6t/NIxxmVXqHDMVQSPGCTjSGaeTIQ1u15 ro8wCq1j6cNLoDCxRhDJbTbsaiHsvXYy5r3mjkVCOtQ52cIhaNXcOOyjoyD5+GTxPevl Mn9XZdoFVWMZ+7tYCIWz2vdepgVQTdGhJ+iv7EAHXgN3iHcDMWNTfWbnylXFp5CJOWV0 8ktlWO9ymmtz7qYX0ni8Gz6BIPNFORl8EgUQKT8gyMzlqCZZteE1Zjvr8lQ6V74PJ5Sk vPdQ== 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=EEn0V02AuhXE7r52CmjjMCc8dfhh8auUxTS0XqiCtNU=; fh=b2YQfG9PfQSUw5xMVFyESXjrM9bXk1jv/UlzGGNeVIg=; b=TgZvhIc5ZWyaZL/XZAv5wcy9QYBCqs2b1YEYPxsnR+CujFFPaLdFgQJ7DsAtp4fMQp 0+jjSsVufw6QvT4D8Vv23pQbi0e3/53G2cQNrvdEH1wGaQ7+Vejg+UFO4ggsQALRmwjX 2PDIZbNMCQutvnLLFZIVNwZ+eVseD4fzqcjN/uVNICrjgQBbf0xA8Yrs6+zolB7XtF1+ g2kgVKQfrGBlLccULMCKoDeDITqVi7HVyXIWFRAE632C1DaAqYZaVwIbvH01c5TH/k7G PngjIv6aTm0n0LpSeIq5mkAEm6azdgcdu7AKL4icU3oMlW5HcJknZoRwzvQcIL6qAszJ FF5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mysh+ody; 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-6689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t11-20020a17090aba8b00b002a63dcc38d7si8306451pjr.30.2024.04.22.10.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 10:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mysh+ody; 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-6689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6689-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 51207283D8B for ; Mon, 22 Apr 2024 17:52:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33EA6152197; Mon, 22 Apr 2024 17:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="mysh+ody" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 B790D15443B for ; Mon, 22 Apr 2024 17:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713808336; cv=none; b=Kx+epkhwNwW0lhAPmDVlZCW5Thcf2rQaEoMcu9tiAEpe7rkXx7GNpRFMQhwl6oVCoSgTN26wxHNF8uqjqQ+8HcoQcesMe+50uZI3NHfoioPZTwkZgMb4vxYkv5i6reyWmiCqFBwrhZxhEWdi4Psn2mDx41frUPOQAcBfrb2Hslo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713808336; c=relaxed/simple; bh=WW+03q863luKQo5O86QzFWfZIlYJ6GqzzHzTEghVAss=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Qy1YsaNiZkgko93pwyYeIAPzoaySWbjKoB8f9HELmUXtS8mlRnTnuvzzLoJMWdXjApT5Vd2UUfwpniqgwodAl64lm0JD1s5TD7PGcRUgGKP8JeVLh1qQgX7ub8DAZGCuJFCO/W7rpTftta0hJImttOuBPoGUfXUq42X9t5Zu92k= 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=mysh+ody; arc=none smtp.client-ip=205.220.180.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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43M870vU009346; Mon, 22 Apr 2024 17:52:11 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=EEn0V02AuhXE7r52CmjjMCc8dfhh8auUxTS0XqiCtNU=; b=my sh+ody7wywdNhYfzmNuGpxf5r3EhpdZ5mMo3ejSmlhTfTgvvgUMcvnKi3FQVxkP4 iPTR39+2PDNvFEvEoS1qbZD7Nw3CqNY0nn/taal5HTC32dpW3dhuC6ARIYoZMTLZ D365XWp8oCU+qj16k3lCn+kNwcgzgtazEWkwTj4WwEKZIrZW0elfI4L+DFHoGrYN y7833oYPaFVRd2/XfT5SnT8eIEnXaOJNX+A9AmunTcOKK/ZiXuQCHBPfOhUINDzy m+pBKUmr3mctjM2/fy088noonjc6jZ6PPHG7LXqj/bOKqargpCHoJu5OdkGdgOfy gcGF4M/9zFHvEYaxKH1Q== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xm4qddag1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 17:52:11 +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 43MHqAWk001149 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 17:52:10 GMT Received: from [10.227.110.203] (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.1544.9; Mon, 22 Apr 2024 10:52:09 -0700 Message-ID: Date: Mon, 22 Apr 2024 10:52:09 -0700 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 09/10] wifi: ath12k: support suspend/resume Content-Language: en-US To: Baochen Qiang , CC: References: <20240412060620.27519-1-quic_bqiang@quicinc.com> <20240412060620.27519-10-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240412060620.27519-10-quic_bqiang@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: gc3aOPEnO1s2__yG3lsOm8by43XcJGPl X-Proofpoint-ORIG-GUID: gc3aOPEnO1s2__yG3lsOm8by43XcJGPl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-22_09,2024-04-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404220075 On 4/11/2024 11:06 PM, Baochen Qiang wrote: > Now that all infrastructure is in place and ath12k is fixed to handle all the > corner cases, power down the ath12k firmware during suspend and power it back > up during resume. > > For suspend, two conditions needs to be satisfied: > > 1. since MHI channel unprepare would be done in late suspend stage, > ath12k needs to get all QMI-dependent things done before that stage. > 2. and because unprepare MHI channels requires a working MHI stack, > ath12k is not allowed to call mhi_power_down() until that finishes. > > So the original suspend callback is separated into two parts: the first part > handles all QMI-dependent things in suspend callback; while the second part > powers down MHI in suspend_late callback. This is valid because kernel calls > ath12k's suspend callback before calling all suspend_late callbacks, making > the first condition satisfied. And because MHI devices are children of ath12k > device (ab->dev), kernel guarantees that ath12k's suspend_late callback is > called after QRTR's suspend_late callback, this satisfies the second condition. > > Above analysis also applies to resume process. so the original resume > callback is separated into two parts: the first part powers up MHI stack > in resume_early callback, this guarantees MHI stack is working when > QRTR tries to prepare MHI channels (kernel calls QRTR's resume_early callback > after ath12k's resume_early callback, due to the child-father relationship); > the second part waits for the completion of restart, which would succeed > since MHI channels are ready for use by QMI. > > Another notable change is in power down path, we tell mhi_power_down() to not > to destroy MHI devices, making it possible for QRTR to help unprepare/prepare > MHI channels, and finally get us rid of the potential probe-defer issue when > resume. > > Also change related code due to interface changes. > > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > > Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson