Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp49854ybg; Mon, 8 Jun 2020 16:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVMFrsm9w8p677KTzsbyU+pYzjYclcBovjTL8conb6e8GZ34EMqxi51kfuknXvs0jvN0Xn X-Received: by 2002:a17:906:4944:: with SMTP id f4mr22929626ejt.3.1591657707623; Mon, 08 Jun 2020 16:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657707; cv=none; d=google.com; s=arc-20160816; b=RhxW8Y1IT7G3ND5FiDZzuOVZzF4AS8imj+tHzg1gpo7ySL1jyJbKpIUIOvxfTUMr7q NbX3H4Aq2x15BFGAUj49R65FXW7paUk3cxapQLh5QN+7dTVB2vs+GsGYwZVNVKTQQJ9T qXO0b98KBcLXe0cfxO7Ii1DC/nYzDyLoang7Qjd6eHwjZYuIvNHJ7qxVhxsKgEHdAqQS Qvjyb0MXvDFS/3SpQ6+B07CYm1pLZ5Lrr96cY04bgNa4TYrWPEa4Og9nJd1UuSwgAnEU sk6fulJhBH9Af6/Ihq3arjxNyCdTyY5vviTPfoCPlZai4BSxic2igovuDFAjWI6PjcE4 F3KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R7zHVXSusaUJ41sBy6/vLxlPm5OZhF2mPtDaXJJSYjw=; b=kRvtxzN4tWUpK7fb9ogjbKBi3aDQ/VYGzH87Tan+CL7gONrCMuaBWfWAjJESuUp69q cAnmYZMM4NAkyNi/My1oa30txBp+qBMQNaABF0fZRckKzi6RPvy7Rd9z0durUyxaHRIi 10Pk16xYtCV3ONEAtFixzOzW6A38dKJ0ijOa1CqD6VQAN0bRHeDqOnIpa2sZQ1XOcGB6 Ets8JDZMqVf5gjyiRCe0hu4VUWg7z7MnVKSKfe5GkbDd/BdHBNZlgAX1iGd9XuEOvCJT aTJ89gPPSQhqfuq92wN0GeIXgOpknpOcwRVAPb0L76hLzGmVRwin9M/E/++32gQkWB3T d8Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UCWSXN3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si9237068ejq.306.2020.06.08.16.08.04; Mon, 08 Jun 2020 16:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UCWSXN3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbgFHXGR (ORCPT + 99 others); Mon, 8 Jun 2020 19:06:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:48960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbgFHXGL (ORCPT ); Mon, 8 Jun 2020 19:06:11 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0076520774; Mon, 8 Jun 2020 23:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657570; bh=PGlP+JP7FvYzxdcy4SX9/FZl2RROoPdsSLINcj/iE2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCWSXN3TdKUS3TAvBj9b4DTpRFhfWFUyMUA+BaF7WWO3aSDvoaX2L8FA4m2J9rNhI OoF+hkDfrJicKBX3kfOBWT8ayUgP1j1k/epyxff9hPc4QvCXfTH0h31MEbTZ7xpsEN yPU5eUgWx5ZuQ86f06+qj0/D42YKnUngRwFM1Ow8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maharaja Kennadyrajan , Govindaraj Saminathan , Kalle Valo , Sasha Levin , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 002/274] ath10k: Fix the race condition in firmware dump work queue Date: Mon, 8 Jun 2020 19:01:35 -0400 Message-Id: <20200608230607.3361041-2-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maharaja Kennadyrajan [ Upstream commit 3d1c60460fb2823a19ead9e6ec8f184dd7271aa7 ] There is a race condition, when the user writes 'hw-restart' and 'hard' in the simulate_fw_crash debugfs file without any delay. In the above scenario, the firmware dump work queue(scheduled by 'hard') should be handled gracefully, while the target is in the 'hw-restart'. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00044 Co-developed-by: Govindaraj Saminathan Signed-off-by: Govindaraj Saminathan Signed-off-by: Maharaja Kennadyrajan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585213077-28439-1-git-send-email-mkenna@codeaurora.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index ded7a220a4aa..cd1c5d60261f 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2074,6 +2074,7 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) ath10k_pci_irq_sync(ar); napi_synchronize(&ar->napi); napi_disable(&ar->napi); + cancel_work_sync(&ar_pci->dump_work); /* Most likely the device has HTT Rx ring configured. The only way to * prevent the device from accessing (and possible corrupting) host -- 2.25.1