Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1640532ybv; Fri, 21 Feb 2020 00:50:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzoOko7TcWAEK5GP0pEulSvZn4KtAuu7qok26UkZcQWPcPtNrGjHtQI8PZNGntrrkBUmFHE X-Received: by 2002:a9d:32f:: with SMTP id 44mr26444449otv.234.1582275002912; Fri, 21 Feb 2020 00:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582275002; cv=none; d=google.com; s=arc-20160816; b=pBRQeVqJjuE0w7c7vKokjvr8PBYfcUoRi7DifCIPU2WBe1VOOPxjam/0A8FFh+YGkH 2Yj6A/W+CYJ6PxGMmqvInLk32LSjWsI+AugXeCX12O5DUnZ5o49HyvtcqmJa/uBZd/uJ yeZKAdI+lQbI7ivX3XVEkjOndJTupwmP2FqsZfq9T5mTp9LZbSRwWQcTwFvT+/9TGA4G dyWY/bMG+0wVpOyOoJ37sRWgREGQ4RsKVdFU/uRaplFoMETd2ajf55s2+ZxlVctapGOm 8MsKmMKIJXgMQSARJeJO9JDG2DUKUZ914SKU7Sgb0emspYfZeNsOsoFb+qBHK7bhzGO7 Vz0g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ifVK/6hV1K7VlrT1PwahPHwrnBFW0aYFWM+pEFy3np8=; b=jmoyRUN2E4Z10tGCit6T+hLNeIjw0D32cUwOWOa6pMTXlXHvXTyEfDWOYUEnJdHAZZ AHwgmFEP3QcUOGX0H88DibWkhmUew/rgAK46/N2qeaHKTLeoSuFcfLZyhKU9PIjxaheV qFJQ2oibVokN+k7rkDY+l3dYU2uR1f9jGK8HDucenev3IUUnPT1UMbaFndLwa+5aCk+W 68YGlWG7GedAkZnDVabc9w4v4h3HyJ0WNDwJI5r2jG1qwO5qeOqzbvWZvLqQaLymwJgg dxGgUWYuKa3GRR+00kPwJe8rzeXHjQMM1b7mxtJ3DFWNlGVirzQDqDiWBTGgaO+/ThhL vjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HzlgMZud; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si1238313otf.36.2020.02.21.00.49.50; Fri, 21 Feb 2020 00:50:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HzlgMZud; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731392AbgBUIsX (ORCPT + 99 others); Fri, 21 Feb 2020 03:48:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:42878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbgBUHrH (ORCPT ); Fri, 21 Feb 2020 02:47:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E90024650; Fri, 21 Feb 2020 07:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271226; bh=I6NtYLAPNib460xwCVxXUT8qx07WuH0UxST/BdX8blg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HzlgMZud36xM76U7VQexBxusJraGwT+gsC0kYpI7RzN78ISWyeQNP+CrysAUzZA1c aLSohVxhZbtKdA6F2l+3A68MnZG7lVMOq326ZJZCopAptUlyMrby8/bFfzEeF9AD2c Wt3rB51pFewQai0060t2jdX+7U7ep8g7nb2/1A1U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rakesh Pillai , Kalle Valo , Sasha Levin Subject: [PATCH 5.5 087/399] ath10k: Correct the DMA direction for management tx buffers Date: Fri, 21 Feb 2020 08:36:52 +0100 Message-Id: <20200221072410.803417902@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rakesh Pillai [ Upstream commit 6ba8b3b6bd772f575f7736c8fd893c6981fcce16 ] The management packets, send to firmware via WMI, are mapped using the direction DMA_TO_DEVICE. Currently in case of wmi cleanup, these buffers are being unmapped using an incorrect DMA direction. This can cause unwanted behavior when the host driver is handling a restart of the wlan firmware. We might see a trace like below [] __dma_inv_area+0x28/0x58 [] ath10k_wmi_mgmt_tx_clean_up_pending+0x60/0xb0 [ath10k_core] [] idr_for_each+0x78/0xe4 [] ath10k_wmi_detach+0x4c/0x7c [ath10k_core] [] ath10k_core_stop+0x58/0x68 [ath10k_core] [] ath10k_halt+0xec/0x13c [ath10k_core] [] ath10k_core_restart+0x11c/0x1a8 [ath10k_core] [] process_one_work+0x16c/0x31c Fix the incorrect DMA direction during the wmi management tx buffer cleanup. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1 Fixes: dc405152bb6 ("ath10k: handle mgmt tx completion event") Signed-off-by: Rakesh Pillai Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 9f564e2b7a148..214d65108b294 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -9476,7 +9476,7 @@ static int ath10k_wmi_mgmt_tx_clean_up_pending(int msdu_id, void *ptr, msdu = pkt_addr->vaddr; dma_unmap_single(ar->dev, pkt_addr->paddr, - msdu->len, DMA_FROM_DEVICE); + msdu->len, DMA_TO_DEVICE); ieee80211_free_txskb(ar->hw, msdu); return 0; -- 2.20.1