Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2539070rdb; Wed, 21 Feb 2024 10:38:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVOQdtsQUGS7x/dTtWlaP6dcTsH9uUgrtHJ4HK4jz8suxR/oglJkjURShtHDmSzVAqC1HRxmKXR4/JjcCDOu0xMNPGvI62Ti1trCL1aPQ== X-Google-Smtp-Source: AGHT+IEsvsELhXS8oPzeGnzSB+4PXaZ1okKTlv11MvueAMxo6K/sNddwSOW/tXUCLu0i01+fadMn X-Received: by 2002:a05:6358:6386:b0:17b:6171:adac with SMTP id k6-20020a056358638600b0017b6171adacmr2095763rwh.17.1708540739360; Wed, 21 Feb 2024 10:38:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708540739; cv=pass; d=google.com; s=arc-20160816; b=b86W8d1oNhHB6fiMKZXu1JSBHa9Ylqh4eoOZ99wuTbPtiLl3Bsj7LDBvBBO1mtEfZe R+A4usLh6K18IZRy7B+37930cK4NqvPLy5+i0kMJBwFI/xB0h0kX9BGHHSHlVFMnIk98 ahv//ntRkqSc2OdLDlGl9JDkIGxnZECv1wdyjff+WiA6D2dhMmUnYA4da1Yv3Sch0y1r 7RgXRkGfUBA2Qtl6ter+sH6VCrbepDasBiI/nm8VYUisTpQZdN+/NbXMFMbCE5CtHoJR 1W9C31ALgk3ZSXVLzWl78x6ffHaPd6SVg31ZDJmXoCTUPaTBCcEsXl57JvKxUdPR8Zug E7dA== 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=j9l9WM1qKo7UMdTBEdEi1ZcMt204djLcampA01wtfYM=; fh=uyFlBTN0gt8MLUF8gbOt1yONzFe48Xsfcxb2omI+GpQ=; b=Dj8DRJjZgOTJmTIFBjjqPxiS9MyDE1JDCiCHNmauogD5PVaUvVJL+TRit903N0ZDJO 5LRYWduDhN7Qk4y1OjfvgAh+TTda/slyryLkpSSXH36mp/zHLZZJL6MJ+ThB6RVJ3Xes /M+sN8QdFrrC6Q97pkUzJxfjRuvoA7jSAn++KdpAumq8693pbb6Ob5QL3Jnl6A4V/vIr pTi6qC6gjFSY3SWhFOUeP8Wtsll72/cjQdBmPv2enPnZw00cUrIR36SMW2MK7tbdw02Y S+ZFO9vsixWGmN4kg9jaqC8JAOt+M7v6IXhC6AxUfpK7WSZFHFyf/EIKFCfTv8jDO2RF PTWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Kf2VAcjT; 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-3876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3876-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. [139.178.88.99]) by mx.google.com with ESMTPS id k191-20020a6384c8000000b005e17c9e194fsi6999334pgd.247.2024.02.21.10.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 10:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Kf2VAcjT; 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-3876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3876-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 864FF2880F5 for ; Wed, 21 Feb 2024 18:38:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0C6512B14D; Wed, 21 Feb 2024 18:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Kf2VAcjT" 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 9341712C523; Wed, 21 Feb 2024 18:35:23 +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=1708540525; cv=none; b=P12QOuVTs8W401yHhKLd6oaddINTdIg/3d5JOSA+sNQlfxGBwtaVRlSumofs/mjwxRbRayCFZTfKq1yJdEuwNfitHa6NDCqUJ1mP9ORN4vBF/0khTAb/yFCeZLrxwtuvjv5WbKfPYwF8D0X9W4Q2dKKuPw5zcz5HceC391PHdw0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708540525; c=relaxed/simple; bh=zoB6y4KDSC/eJZ3hp9NUirAnhFBYy0/kfcY3DpuOI9w=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=BVJ9wLrmF5r6ri2FZQoabG717fIwNvr7z2fN549Lwn6dXA5o/10rWnv3PeYSsSsyA5pGIYXg3Q16MpKa8KvUQpT2UGhVZBzSMONJVncq65Di6ICT8aCKh5rr+TbejJz7ZDafcxgFtsUNMJBHnyfJJqChSCQqI+1XofB3GZi39Qo= 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=Kf2VAcjT; 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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41LAPkSC031361; Wed, 21 Feb 2024 18:35:14 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=j9l9WM1qKo7UMdTBEdEi1ZcMt204djLcampA01wtfYM=; b=Kf 2VAcjTKImtM2ODEnhjCUm3nZqd0o8PCl3blq6meVSo9ouDeqbR0ADCH/ARG+iono SLua+2z6q609F4LSArdR83z7hOeFgwsDPxAu+FitoV4lfNc8SvnnAyc2+wga8hag 0/vp73wjL4/YXqNSdQTc1Dn/CtRUwoxtoUEKVFKWx1T/q9pHUZ4xOgcQqC7KCbdL 7vhxtiG8lk8D8bfml5vWV3fXdG5MaFn1v7Ob9lbIlNx0kHFVBEfhCcdhl83RFzd4 UjJNtCa3OE62PbnepDGqEJNlQfpbKtadAbwLn0XreqOzmy+9cWjmUq6M3p/nlr5e znguyBdWu2Q2DVZY3fnw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wdckv9jdh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 18:35:14 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41LIZDXA009405 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 18:35:13 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 10:35:13 -0800 Message-ID: <93397cef-e088-419e-be5b-e7394e088ad0@quicinc.com> Date: Wed, 21 Feb 2024 10:35:12 -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 3/3] wifi: ath11k: support hibernation Content-Language: en-US To: Baochen Qiang , , CC: , References: <20240221030026.10553-1-quic_bqiang@quicinc.com> <20240221030026.10553-4-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240221030026.10553-4-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: ABNJpMUmCDuXYEFoVC_wK083Gm9hgXr9 X-Proofpoint-ORIG-GUID: ABNJpMUmCDuXYEFoVC_wK083Gm9hgXr9 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_06,2024-02-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 malwarescore=0 mlxlogscore=934 impostorscore=0 mlxscore=0 bulkscore=0 phishscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402210145 On 2/20/2024 7:00 PM, Baochen Qiang wrote: > Now that all infrastructure is in place and ath11k is fixed to handle all the > corner cases, power down the ath11k firmware during suspend and power it back > up during resume. This fixes the problem when using hibernation with ath11k PCI > devices. > > For suspend, two conditions needs to be satisfied: > 1. since MHI channel unprepare would be done in late suspend stage, > ath11k needs to get all QMI-dependent things done before that stage. > 2. and because unprepare MHI channels requires a working MHI stack, > ath11k 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 > ath11k's suspend callback before all suspend_late callbacks, making the first > condition happy. And because MHI devices are children of ath11k device > (ab->dev), kernel guarantees that ath11k'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 ath11k's resume_early callback, due to the child-father relationship); > the second part waits for the completion of restart, which won't fail now > 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 probe-defer issue when resume. > > Also change related code due to interface changes. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 > > Tested-by: Takashi Iwai > Signed-off-by: Kalle Valo > Signed-off-by: Baochen Qiang Reviewed-by: Jeff Johnson