Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp218392rdb; Thu, 16 Nov 2023 17:31:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMRjK9WcKUWRyUu60b9d1RWZUiemM2nsVj7XvUUIUb6G+iZWitSSuwz9hyTA05H2UWXJK6 X-Received: by 2002:a17:903:244d:b0:1cc:2ef7:2abe with SMTP id l13-20020a170903244d00b001cc2ef72abemr13024083pls.48.1700184717528; Thu, 16 Nov 2023 17:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700184717; cv=none; d=google.com; s=arc-20160816; b=T4Mj1lBBvmjyownquxBANlduVqQGdr55XbWCVnLMpYtgUEiAAs7Y2wKwPRf7iZvBzE p0xpXx55WXnrPHXGpFqBDprrWpef4EcpPaCpwWiNe6SSGzr7aNyeiz2Du782tGILUIfM rBoRvF9MLezaOg/uV00CqB7LegmlP4+dbB7xSw5of086LvHIwV5k07s44Aq1h0EoSKeT IUi3N/MHAdzckQd3Xc84sFxuvM31UCOFKJgy5bYc6or6bh1jXQDckzPnE4UVxwTc2O4B dZSes++5PQeTBOXY2BTMOe3LRGFyggdMg0PeiuavlkuVn9dr97yETm/mw8zqbWDo9pJa 9Zvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sqg4Xz/17GfEmjamOFsQf5DpoV5qumNYXp9eABsg9/Y=; fh=lP+FyPnTPmJOMA/wP4iC1fr6HzuBVIppIk9dmo9v2y0=; b=CGmf0pcunB1CBexwddVHZglESTD0h3qtkKVGXS0bp/C9vfdqfSui3ZRea5JmZtOLzI QJuFYy8EHMMKUiHmdpiOldo7VT8q5FEs6OggnwclXSDWeDzMdLhEc/xakHNuqgo8OoTK 6i4LIsSYHTEeFfk4jI4ouCUqsIutwc9HWhnejqjwGO4uHZgVn6CJJREQmJ/WWPvdF1YZ jAKvP6GdTBPzx/3twpvUtwRMAqWir7uC+kjwJWChPisR0SxkYJXb0wPoirU5F4LlsW1M J+J4GiePR0jHSt2MdI8QOcGAkeRcMbEXI1gk207QGBSCcb6kUatunR1qqEr0oqtYp5uX k86w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Lcywg6F1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g1-20020a170902c38100b001ce5df1a160si264868plg.540.2023.11.16.17.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 17:31:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Lcywg6F1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7ADDF807E466; Thu, 16 Nov 2023 17:31:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345553AbjKQBbM (ORCPT + 53 others); Thu, 16 Nov 2023 20:31:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjKQBbL (ORCPT ); Thu, 16 Nov 2023 20:31:11 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C65C5 for ; Thu, 16 Nov 2023 17:31:06 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AH0GV70000409; Fri, 17 Nov 2023 01:31:00 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=sqg4Xz/17GfEmjamOFsQf5DpoV5qumNYXp9eABsg9/Y=; b=Lcywg6F1sgd9l3IZGGw9j+HJ2R9KtO/BMkEjpAFJtXNx+2CbFOjqiNSdhczlZqWB6dlI +GJsJuqjlP13A3ueCh9CdI0wezHJkuKgK5mr9C5ibW6bldrpkBOEGF15j8RJdlucFBei 7r7MKbXgSuSGzuOcaZsR23l6IynXminVtedb922ADILLw/Tuh9Az0TU1AS6Y7JgMzN+m WQrKSJEGmTwL9vPX+VLCeyZPsth0RUEN2rahPVzyMcZyIKg1qTND9GIdxtNUfkWl51vW 4RssLxEcpRMPkRJBB5pcAmce7aex/hE7Iwk0BUASu0XVrFQnXciCwdJ6wV7AbJpUqGQx Fg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3udkqa1kbf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 01:31:00 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AH1V0Zd026130 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 01:31:00 GMT Received: from [10.110.1.143] (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.39; Thu, 16 Nov 2023 17:30:59 -0800 Message-ID: <911a18d7-3c2c-4c9c-b309-6e0879ed7867@quicinc.com> Date: Thu, 16 Nov 2023 17:30:58 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early Content-Language: en-US To: Baochen Qiang , CC: References: <20231117003919.26218-1-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20231117003919.26218-1-quic_bqiang@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] 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: uJOU8_SZRIorsq4hpjR191A23BL36rTZ X-Proofpoint-GUID: uJOU8_SZRIorsq4hpjR191A23BL36rTZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=738 suspectscore=0 bulkscore=0 impostorscore=0 mlxscore=0 spamscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311170010 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 17:31:15 -0800 (PST) On 11/16/2023 4:39 PM, Baochen Qiang wrote: > We are seeing below error randomly in the case where only > one MSI vector is configured: > > kernel: ath11k_pci 0000:03:00.0: wmi command 16387 timeout > > The reason is, currently, in ath11k_pcic_ext_irq_enable(), > ATH11K_FLAG_EXT_IRQ_ENABLED is set before NAPI is enabled. > This results in a race condition: after > ATH11K_FLAG_EXT_IRQ_ENABLED is set but before NAPI enabled, > CE interrupt breaks in. Since IRQ is shared by CE and data > path, ath11k_pcic_ext_interrupt_handler() is also called > where we call disable_irq_nosync() to disable IRQ. Then > napi_schedule() is called but it does nothing because NAPI > is not enabled at that time, meaning > ath11k_pcic_ext_grp_napi_poll() will never run, so we have > no chance to call enable_irq() to enable IRQ back. Finally > we get above error. > > Fix it by setting ATH11K_FLAG_EXT_IRQ_ENABLED after all > NAPI and IRQ work are done. With the fix, we are sure that > by the time ATH11K_FLAG_EXT_IRQ_ENABLED is set, NAPI is > enabled. > > Note that the fix above also introduce some side effects: > if ath11k_pcic_ext_interrupt_handler() breaks in after NAPI > enabled but before ATH11K_FLAG_EXT_IRQ_ENABLED set, nothing > will be done by the handler this time, the work will be > postponed till the next time the IRQ fires. > > Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 > > Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson