From patchwork Mon Oct 3 18:00:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Minor X-Patchwork-Id: 9360777 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D820E607D8 for ; Mon, 3 Oct 2016 18:01:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B68C7287E2 for ; Mon, 3 Oct 2016 18:01:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB1FA2888D; Mon, 3 Oct 2016 18:01:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43F83287E2 for ; Mon, 3 Oct 2016 18:01:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbcJCSBR (ORCPT ); Mon, 3 Oct 2016 14:01:17 -0400 Received: from skprod3.natinst.com ([130.164.80.24]:34272 "EHLO ni.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752266AbcJCSBO (ORCPT ); Mon, 3 Oct 2016 14:01:14 -0400 Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id u93I0nZ7007400; Mon, 3 Oct 2016 13:00:49 -0500 Received: from kal9064.amer.corp.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6 HF1218) with ESMTP id 2016100313004958-548813 ; Mon, 3 Oct 2016 13:00:49 -0500 From: James Minor To: linux-wireless@vger.kernel.org, ath6kl@lists.infradead.org Cc: kvalo@qca.qualcomm.com, julia.cartwright@ni.com, steve.derosier@lairdtech.com, James Minor Subject: [PATCH 1/3] ath6kl: fix busreqs so they can be reused when sg is cleaned up Date: Mon, 3 Oct 2016 13:00:02 -0500 Message-Id: <1475517604-17710-2-git-send-email-james.minor@ni.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475517604-17710-1-git-send-email-james.minor@ni.com> References: <1475510510-16906-1-git-send-email-james.minor@ni.com> <1475517604-17710-1-git-send-email-james.minor@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 10/03/2016 01:00:49 PM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 10/03/2016 01:00:49 PM, Serialize complete at 10/03/2016 01:00:49 PM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-03_10:, , signatures=0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To reuse the busreqs in case of hardware restart, they must be properly reinitialized. If the scat_req pointer isn't reset to 0, __ath6kl_sdio_write_async() will assume there is sg work to be done (causing a kernel OOPS). Signed-off-by: James Minor Reviewed-by: Steve deRosier --- drivers/net/wireless/ath/ath6kl/sdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index eab0ab9..96ed060 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -703,8 +703,10 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar) * ath6kl_hif_rw_comp_handler() with status -ECANCELED so * that the packet is properly freed? */ - if (s_req->busrequest) + if (s_req->busrequest) { + s_req->busrequest->scat_req = 0; ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest); + } kfree(s_req->virt_dma_buf); kfree(s_req->sgentries); kfree(s_req);