From patchwork Thu Jul 14 10:21:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9229521 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 90385607D0 for ; Thu, 14 Jul 2016 10:22:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E6A327FBB for ; Thu, 14 Jul 2016 10:22:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 709512808C; Thu, 14 Jul 2016 10:22:34 +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 A012327FBB for ; Thu, 14 Jul 2016 10:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751069AbcGNKWS (ORCPT ); Thu, 14 Jul 2016 06:22:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48172 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbcGNKWQ (ORCPT ); Thu, 14 Jul 2016 06:22:16 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1bNdmT-0003jr-13; Thu, 14 Jul 2016 10:22:09 +0000 From: Colin King To: Larry Finger , Jes Sorensen , Greg Kroah-Hartman , Bhaktipriya Shridhar , Bhumika Goyal , Amitoj Kaur Chawla , Shivani Bhardwaj , Daniil Leshchev , Ksenija Stanojevic , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723au: hal: check BT_Active and BT_State with correct bit pattern Date: Thu, 14 Jul 2016 11:21:28 +0100 Message-Id: <1468491688-17225-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.8.1 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 From: Colin Ian King BT_Active and BT_State are being masked with 0x00ffffff so it the subsequent comparisons with 0xffffffff are therefore a buggy check. Instead, check them against 0x00ffffff. Unfortunately I couldn't find a datasheet or hardware to see if 0xffffffff is an expected invalid bit pattern that should be checked before BT_Active and BT_State are masked with 0x00ffffff, so for now, this fix seems like the least risky approach. Signed-off-by: Colin Ian King --- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index bfcbd7a..6989580 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -9824,7 +9824,7 @@ void BTDM_CheckBTIdleChange1Ant(struct rtw_adapter *padapter) BT_Polling = rtl8723au_read32(padapter, regBTPolling); RTPRINT(FBT, BT_TRACE, ("[DM][BT], BT_Polling(0x%x) =%x\n", regBTPolling, BT_Polling)); - if (BT_Active == 0xffffffff && BT_State == 0xffffffff && BT_Polling == 0xffffffff) + if (BT_Active == 0x00ffffff && BT_State == 0x00ffffff && BT_Polling == 0xffffffff) return; if (BT_Polling == 0) return;