Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3694150pxb; Mon, 24 Jan 2022 15:34:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwwAI70FWcT9Le4Ws3VWeQP0D/TWISHLGjyIIcv9wLj3OP6RSm8zzfRZG4Gm0UU7UdgdxN X-Received: by 2002:a17:903:1107:b0:149:98f7:9629 with SMTP id n7-20020a170903110700b0014998f79629mr16309758plh.160.1643067243431; Mon, 24 Jan 2022 15:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067243; cv=none; d=google.com; s=arc-20160816; b=r19OkwgBNd6DVuBvPuN+GmAlFYwvgKO9KS81yfhTnR8kc0Jf8PJu9X9V0BFleYowcl /3L7FgW/xm/3dxrts7i4Ze4JOC1F+1JCummH0eafGmbi6H4vNapdpg3Gl4JejZceuRbo PfscJsalJ6cRRAtVzVxMgjEPtDo3qlw7JifTU7KFFz+Nr5RGiqe45qAPm7C/0eQ9oMrU LeR07opg4dvoOMdjH9Scm66jsmxU8heA+X8w2qGgqa+hSdCBMim9JRyROQkbfrF5a7oX 4hS1SjI9RZUUQrOiNq0OgW37+EmmSuSd5u3bk9pPnlgYMxa346GRaSmMNtg63ZRMI7SU MeuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kdRJqJcTlxTvuwuOKRMNUVaguoSgyj7mIHyWNhsvjyE=; b=VuzXxhvtGXoqhu5s/OuZr61/SCKpsP3u3Wbb9s/PRHOSs2g6YWUpqwHUyMZYH6nQ7B dFU9fBhsam7gjGiPxXBSAwXUbn+ogWq34NZy5nq/Na9+0BMKV5YN5GTCp4WgFZ2aa56C mBXY7ITs8bB7vGVHHkjoERim0MiLtXOqMCD0gUoYMcmvGheebicLkUuN7UXU1zo7z/j2 6plYnkFfZDtU5BzaiREUISOkVDUtmQNhCaf02uccGF0eZmJCvY9k9xbArh4pBmiNdKP1 bseceKQ/ZU6mKICMRu9d+ScePRqfuDX472fF6YRkddHg6/UzF/080SXKdiHn3p7lVKgJ byrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oaiQMlzJ; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si16902956pgr.202.2022.01.24.15.33.36; Mon, 24 Jan 2022 15:34:03 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=oaiQMlzJ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849891AbiAXX0y (ORCPT + 99 others); Mon, 24 Jan 2022 18:26:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835106AbiAXWfm (ORCPT ); Mon, 24 Jan 2022 17:35:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B202C097FBC; Mon, 24 Jan 2022 12:58:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D045C60B28; Mon, 24 Jan 2022 20:58:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9BB9C36AF6; Mon, 24 Jan 2022 20:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057896; bh=BykGNsLEgQJQdE8IpuoLOMELyB8uGOFV2k4xkifpK4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oaiQMlzJPJ4uPthPFn1e6EoMFgTCquhYnI8kw6Ir6KQICb8aW+XKyckGEXT9N6ukl hdbt1KBW7zYIdLEnCKm/fQW3xSJfjPdLHP5QRFhozJsJDcSJLpSadMnf5ZzWVo4CY3 ScgqUhysRSPa4znBjtN3DJ83bWUyMIm7uiMtpA94= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bryan ODonoghue , Kalle Valo , Sasha Levin Subject: [PATCH 5.16 0113/1039] wcn36xx: Put DXE block into reset before freeing memory Date: Mon, 24 Jan 2022 19:31:42 +0100 Message-Id: <20220124184128.929460481@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue [ Upstream commit ed04ea76e69e7194f7489cebe23a32a68f39218d ] When deiniting the DXE hardware we should reset the block to ensure there is no spurious DMA write transaction from the downstream WCNSS to upstream MSM at a skbuff address we will have released. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211105122152.1580542-4-bryan.odonoghue@linaro.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wcn36xx/dxe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 017c7d78072ba..e1a35c2eadb6c 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -997,6 +997,8 @@ out_err_txh_ch: void wcn36xx_dxe_deinit(struct wcn36xx *wcn) { + int reg_data = 0; + /* Disable channel interrupts */ wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_H); wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_L); @@ -1012,6 +1014,10 @@ void wcn36xx_dxe_deinit(struct wcn36xx *wcn) wcn->tx_ack_skb = NULL; } + /* Put the DXE block into reset before freeing memory */ + reg_data = WCN36XX_DXE_REG_RESET; + wcn36xx_dxe_write_register(wcn, WCN36XX_DXE_REG_CSR_RESET, reg_data); + wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_l_ch); wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_h_ch); -- 2.34.1