Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp138847lqs; Mon, 4 Mar 2024 18:46:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoUJOKKbTKsGzVkXFcT4pFFD0XQGbIfV5nmioD9Ta4s0g40SckWgBPGdd3ej59aQc7lhCx220gcj8r4POFFdPac+HYP2ITNXfVZ8qI+Q== X-Google-Smtp-Source: AGHT+IHfve8wpA+ssEp1vdv+bW+uuh1oZY9ZQI6rL22eQytf7LPN3MU7DBXaIqB/2FIM8pmk+91+ X-Received: by 2002:a05:620a:a53:b0:788:2a6c:e86 with SMTP id j19-20020a05620a0a5300b007882a6c0e86mr653228qka.3.1709606816465; Mon, 04 Mar 2024 18:46:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709606816; cv=pass; d=google.com; s=arc-20160816; b=trWotesW4uU1bc3Z+KMcIGeLvZT2fEEsxEF0mnFFRzZq9s/D9qL8aAoc+25f5wkrb7 qzc9nbUyuFuhvhgUV8cTZNJjGhBlI9+Gzh0spBamjtNrK8iRoVxztJmi2G5oAcj5dUZN AiHjS0cvHlyYmU0VQ6AawJ2xhsULrTWk93ZlZV359Y7F31jNsk1dIeWOHtk8sBWiCMTe a6q+kSI8cI2sWnTfdY5J161K5vZ2SsyRAg6M6JH8VrxeeHJyRv3iV9Q2ia5NzWIzIKop 8NhDYY3sFAGy4aWmQ9OVhVBOVYKn/5ok2nP7aWxJnep2Anv07XjaKBB1gmH0OwRh3jXS Ixeg== 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=SPseMgNHICrE3PG4zZrb4tfldUcXoYVBpbVb9JBbf0A=; fh=YnEy5PrjHYeUDfIdlIr6Ue2YFmgnglwJGSsnfqsN+Is=; b=nxUrT8X/4lO0ybhGoVA4yZBW593yoOQgioIHI9cs+7VHxftX5jY/fWGlOCSnU/P8/b 2qvvXXwJYY/arlq5uYs2fu0o2RzIFPW8bo3DgCLbk4Rf3n84b1+WC3CGDFMxO8L/zGPq RAu43QsVjeEtdBxC8raCL+qP9Fx/qE0V9gzPkp+sIVY2WtPCrJhBEY2Zix6+LhTUSgJ2 Yai4UGZ0T7cCGGA1bHzE76XWKEeiYpC/WZYaPDJwcGKOW3/6O2VgnW0V/lBJqXUI9/nT fohyGnuBVrf07AKczO2bk/efk6c17Ic+v/wVhLTibgBh12WPnBHUNUnG32D+4Am52oua cRCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QmLPtcIt; 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-4365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b9-20020a05620a126900b007881e2392cdsi5830924qkl.773.2024.03.04.18.46.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 18:46:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QmLPtcIt; 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-4365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4365-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0ECBD1C20A48 for ; Tue, 5 Mar 2024 02:46:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 303ED286B3; Tue, 5 Mar 2024 02:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="QmLPtcIt" 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 92BABFC09; Tue, 5 Mar 2024 02:46:51 +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=1709606813; cv=none; b=Mc2ODbfHAnfhjW5cAVezju2gkVjIYUplsYAqIlA6tNXtAvaDxZ0uT2biIVxrwh5PHbhx8M2zUhjII8jMCew4cZwprktaA2jkh/Djii8h5bI0BanmMhFt5gBZ5JQljXwINIeJUmIU5c+Y82omhxNBlEOOgfsjHd64yYWl0PWS/wo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709606813; c=relaxed/simple; bh=wi1O6vhp6yalvefyIniYQ56KvD98lh/d88XSIE2cHYM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=B7kzdiv6FxszdPnHnMcRLIDfZeRC04hSBd05Wy83BzdX9zF4kkMtYsJiQt824UVWKKA8gn4UNw2DZM6wCXXa5cFaxXohUug2AH9GyCfj1p9Z1+KYiK9rb4L5zh90zynxHHTUW1OIsoeTBlsvQdaj0TLnhMJUWEjB0shtBkiz+PU= 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=QmLPtcIt; 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 4251P9oS020905; Tue, 5 Mar 2024 02:46:38 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=SPseMgNHICrE3PG4zZrb4tfldUcXoYVBpbVb9JBbf0A=; b=Qm LPtcItY0+pli8PXxm6Ob0vNL5aOTGSe62SNnAo+d20x5cu3RqTj50xAkvm7Bvu1B NYlRoHeRefwP8a9GXiU82+grWF3K3oTgE8BPG3YDLthhG7xJof9V8zfcA/XNrJQe R7oniHUAmkOG0lokCZawIINVqOi8ncYCl/zR8ejE9NDnwNQxK4XaXbOocUUIGusk kq4Jkq/e2Fs1IJNFJoDinljcW0IQyU+a2su73O8z5zaVUY2PS1lhR0r+1vsqvf1U e68atX43MeKgefzXQ85VqaMLJKtIAH7JchdnJ0EiPaOzjTrGC9mOIoeWUwe1n8jr MqC53YI4uRpL87lTpw8Q== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wnarj24xb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Mar 2024 02:46:37 +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 4252kadZ018363 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Mar 2024 02:46:37 GMT Received: from [10.110.86.150] (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; Mon, 4 Mar 2024 18:46:36 -0800 Message-ID: <2cfaec27-7b7d-4727-b625-2df5b6879da6@quicinc.com> Date: Mon, 4 Mar 2024 18:46:35 -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 v7 3/3] wifi: ath11k: support hibernation Content-Language: en-US To: Baochen Qiang , , CC: , , , , , , , References: <20240305021320.3367-1-quic_bqiang@quicinc.com> <20240305021320.3367-4-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240305021320.3367-4-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-ORIG-GUID: As1TGrEn59R--rOTg5BDEyvIMXJUl623 X-Proofpoint-GUID: As1TGrEn59R--rOTg5BDEyvIMXJUl623 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-03-04_20,2024-03-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=856 adultscore=0 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403050019 On 3/4/2024 6:13 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: Baochen Qiang Acked-by: Jeff Johnson