From mboxrd@z Thu Jan 1 00:00:00 1970 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 D9017366828 for ; Tue, 3 Feb 2026 05:30:59 +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=1770096662; cv=none; b=mScIAmYGQXHm6uVEvkQScLGDs4unNMk0ViYdNsIb7y714CEgmbr0Q9GxRGsURHALeuw3UYTYX+jBS3TW0IEsGPprfzxsdmigo9xlLz0pCcskqcNXyI7ErD7iAwPQ6H3QbYlrWSGxHo/qkJRulSSMZujUVMOfpJbBkDANN5RqRfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770096662; c=relaxed/simple; bh=n13A6SvlSo4cXb375w0SpOGbE+/SRmSY1zlFiEAJZqA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I9mXY/kOh5hTEH/qu+IqL3cwdoXiyaAsFPfXeP0SR/8XY5EdUyeokk1T9t29/NtP51WUAqLhRnw2XuwHeMao8I+66l8L7kY1q0DCHoC5FcDswIURmuvjqBTYrWU782+c/f3WjX+Vmk/DlESM0BJ0/qDE77Pr9Sejur1Ul8G5qQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=gcXOEEuS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gPLTLr0c; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="gcXOEEuS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gPLTLr0c" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 613545rx2106939 for ; Tue, 3 Feb 2026 05:30:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OvIfb3KtMhaK0URlCrLVgD5/o1KlZJAtMpEOkCsCeL8=; b=gcXOEEuSPOsR3bNq cMqdP+eTO8I9yJIFHlLF3sTCWYBfBLB4KEOu1boqT7y7Rt5SoDt5KbpvpKtIOsHX q3NeIEPLlhC9jU1ho3Pd5++rGjBDr4tlZHmjCxrOjxDAFnRW4Bnw9eJbizURFh4W ZOQTOh+VfYETHMDzo62wnQTJyOcdWapvISagRHYdy/zN0xFR4a2AElOtHxqc9tlk 1itFqYzS4wlS7UoYHjWpblxWu8nNrSKRaFtXagxdvTi8kw6fsQ6JoBqH4PZ78d0g NzpPu8biVcRnLSmVXvfI93yiASNpCMr9iXHuvsZIOTiyhPi8qSGD810+A/Fhx+Gg gMD0aw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c2t5eb58u-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 03 Feb 2026 05:30:58 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-81f5381d17dso4222256b3a.1 for ; Mon, 02 Feb 2026 21:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770096658; x=1770701458; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OvIfb3KtMhaK0URlCrLVgD5/o1KlZJAtMpEOkCsCeL8=; b=gPLTLr0c3JxEpK5t7uAYEMQRH9Z1IF57PdCxqEUT82vnoqdRskF9Hf7BgUpaOGhYXG a484vnBCtO3OxTQV/NrdCA5s8rH9GV73nNSgWLTBMT6jDAj9qApdgaH0pOlwA0T2+TNM F3o/PpyPtjCx/xM4YuJ9lvR+iq4lFaCxssUN7Mn9SwD5BR2o7g7Ou5ukUlM8LXx+l3bV 4l73kMV6IUdTbEFjjvOFMftjMbP5Dl61emFuFWmAU+dlEKRv+LLdZ0JeA+jZtaz7+uG0 w88cBsOueIU8cxdiWB8a9gpjAxy3baWefPgklMb8BJRQhUkj06Iaa6vjQ2wobjg2je8Q +fLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770096658; x=1770701458; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OvIfb3KtMhaK0URlCrLVgD5/o1KlZJAtMpEOkCsCeL8=; b=ourG7AkJMBrXfQ/kSY71SRm0EqnXLRyBNHkPQnE/2PWGve5VSt7PA+uh/78+y/xt/y lOMZ+x8SWFgrRLtY/atE7kt2T01lA8gUnd/HWiFPs9si0AvgcXhfzqPkIZHhdEDWVstV Ababt3WIZVQIUu0sk8MHyvOueeBCbukl44V/ajlLTPnVyWeUSGTJlYSh72s/ARqNIUFY DAjv2GbW9QWXznzVGl+X8aY6mnQddFLWORS/kmmrmkQ55Nb75Hz/wnhuDaHNpZzu7gyy wHY2+4eQ0wmJ14tlLP1AwETOwU7ICMwrWXaJ5Dfaj1kI/wI9XEHb60z8OkxvO7KKEGxC UCFQ== X-Forwarded-Encrypted: i=1; AJvYcCX2vsWz9iANoqYeV+s5Ovj2dRa7KaqYXrtTFSubCzgMaQVwGIgwFVQpXBNmZqil/KuMFSTBofZ3xAvJdTQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7+TpX0fkt1/RMNU0/eQfUWLL6sBNop1Rtxo8wV17Kxkqr7XNl HCZ5brylEOyDTZxnNsUiYt/34K25YNyMyHBDzSjZ+J82IWl8HliBhSOs580FPs4DUX0bF/zwRSP BksA8kWfYkLs05lRVa8fQ03qsQrrHnFNQNQgKmjwRcj40HbyVCff9zaUVJa2k49qVA3w= X-Gm-Gg: AZuq6aJ3jVid+KnAj5fyrmyoLyo3xZ36klx2zq50Dch41u3sdREKxc918M9YbyESvHh n8bl2XOi+EK9PYcg5bk9T7HGpDfARYcyeeGkYe09Gd5xOQX29jgowW4eHIQjvMOiK0ZLnJZK8Mj ulCojFXU3NYPuyW90tJGQagx1ybnzZ8Aw5Zo7+R7n4GPTusC3kf63gwOKMB8MoGdmNvdrrWMZuH VgY1haqASkAyKc4x5gF7BZ6GnYWH4WoYpZS4amap+tN4ytZHgvtuMiMNVYIW53a6tYaFQA7V5Rm qeScte/50a4Z1rGZ2KrYVogWznqye8ZyugvqD7xAkCZrqYRTlGNFrDniCNVcQX/Xn6nC3dizJN2 MWeNag1g0PSNANeSEUMysh2+jbIozdAoK9Z1RrEurintnMr58hl3evbb2BgOep6Np8/IEO9ze5K ulXjUc1A== X-Received: by 2002:a05:6a00:3cd4:b0:81f:99cd:faf8 with SMTP id d2e1a72fcca58-823ab643e3emr14879803b3a.8.1770096658163; Mon, 02 Feb 2026 21:30:58 -0800 (PST) X-Received: by 2002:a05:6a00:3cd4:b0:81f:99cd:faf8 with SMTP id d2e1a72fcca58-823ab643e3emr14879784b3a.8.1770096657696; Mon, 02 Feb 2026 21:30:57 -0800 (PST) Received: from [10.133.33.50] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379bff93esm20880164b3a.41.2026.02.02.21.30.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Feb 2026 21:30:57 -0800 (PST) Message-ID: Date: Tue, 3 Feb 2026 13:30:51 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath12k: fix CMA error and MHI state mismatch during resume To: Jayasaikiran Banigallapati , jjohnson@kernel.org, kvalo@kernel.org Cc: quic_bqiang@quicinc.com, linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260202151720.49904-1-bjsaikiran@gmail.com> <125f0ecb-79a5-4806-aa93-aecaf937885e@oss.qualcomm.com> <399d4ea0-5f70-4678-b0d6-9a80c3399ceb@gmail.com> From: Baochen Qiang Content-Language: en-US In-Reply-To: <399d4ea0-5f70-4678-b0d6-9a80c3399ceb@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAzMDA0MiBTYWx0ZWRfX8UrWY/GsTbyN YndA+3FR/S63F1GNwJfgL70oug+9rZ7rlvb4L5WuhnAhkQsk7ug7O4FiMWrkt+EXUP5dXvF8uRH kEZYlZcA2A7UCqx6pH5xCJiMlpJraMHML1RikVek2jPEU9wzUVPT+6pAryQkuhcCCLN6eghCnho CvCdX4ycDJgYsIkR1bXqR0P5EKpMlNZfSyeUhflahou45PlXY2l/ThbPi06gvhicfJgi/nt0vne t0OjGuhz68L8cji9gdCschH+Fd+gOi97kitH5kCL3G8/POvWXoWLj1BHDJgcA3VD4F9P30acftt p57A0nfg9VH8ge9p15taKO80zhJeNWxkml9Y2wFYBuSpiNfAIhccbXhIIL1SCefLL4tgt5dYaU3 eBXa+byDzan6B53YwG62344eKF5Qxrto+cp6KmOYYOon67wT9jEFWTP+Qa6pIo95961q/egJbKK +nwHhD2iXl4VYky+SMw== X-Proofpoint-GUID: Bcgwk7g3quaFhOh0UtLQf6k4m5WkrXov X-Authority-Analysis: v=2.4 cv=NOfYOk6g c=1 sm=1 tr=0 ts=69818812 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VjulNiziwJIgjV26a9wA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-ORIG-GUID: Bcgwk7g3quaFhOh0UtLQf6k4m5WkrXov X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-03_01,2026-02-02_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602030042 On 2/3/2026 1:02 PM, Jayasaikiran Banigallapati wrote: > > On 2/3/26 08:21, Baochen Qiang wrote: >> >> On 2/2/2026 11:17 PM, Saikiran wrote: >>> Commit 8d5f4da8d70b ("wifi: ath12k: support suspend/resume") introduced >>> system suspend/resume support but caused a critical regression where >>> CMA pages are corrupted during resume. >>> >>> 1. CMA page corruption: >>>     Calling mhi_unprepare_after_power_down() during suspend (via >>>     ATH12K_MHI_DEINIT) prematurely frees the fbc_image and rddm_image >>>     DMA buffers. When these pages are accessed during resume, the kernel >>>     detects corruption (Bad page state). >> How, FBC image and RDDM image get re-allocated at resume, no? >> >> To clarify, the BUG: Bad page state crash actually occurs during the suspend phase, >> specifically when ath12k_mhi_stop() calls mhi_unprepare_after_power_down(). >> >> The stack trace shows the panic happens inside mhi_free_bhie_table() while trying to >> free the pages: >> >>  mhi_free_bhie_table+0x50/0xa0 [mhi] >>  mhi_unprepare_after_power_down+0x30/0x70 [mhi] >>  ath12k_mhi_stop+0xf8/0x210 [ath12k] >>  ath12k_core_suspend_late+0x94/0xc0 [ath12k] >> >> The kernel reports nonzero _refcount when attempting to free the CMA pages (fbc_image/ >> rddm_image). This suggests that something is still holding a reference to these pages >> when DEINIT attempts to free them, causing the kernel to panic before we reach the >> resume stage. this seems like a bug either in MHI stack or in kernel DMA/MM subsystems, rather than in ath12k >> >> Since the pages cannot be safely freed during suspend, skipping DEINIT (and using >> MHI_POWER_OFF_KEEP_DEV) avoids this invalid free operation. This also aligns with the >> existing comment in ath12k_mhi_stop which suggests using mhi_power_down_keep_dev() for >> suspend. first of all, this is a workaround rather than fix. Ideally we should try to root cause the issue and fix it in the right way. Secondly the workaround here seems problematic: you skip INIT druing resume. However note several hardware registers need to be re-programmed during this stage, how could the target work if its power is cutoff during suspend and the register context is not restored during resume? >> >> Thanks & Regards, >> Saikiran