Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1422342pxb; Wed, 12 Jan 2022 14:31:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXHAAMiFVIrDtLSpUWbsBj/vVWl8GKulqIFXMtdt+L0Ut/+UyHn4IbScRMDemlB+htpvRT X-Received: by 2002:a17:902:ab12:b0:149:c5a5:5323 with SMTP id ik18-20020a170902ab1200b00149c5a55323mr1790046plb.97.1642026704692; Wed, 12 Jan 2022 14:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642026704; cv=none; d=google.com; s=arc-20160816; b=C8I1c1ZdsJ1P0PQM5IPU/DAs/eNctfIJwp9HZm6LfUFuwM5jnwhSgdLvbaViDpu6BW vhEKkH+N9te9XvZsDBm+KT9BSHT8aG26anFn+pg1OpCtFmCUHYocO/Uvgh9RLP50B6OY Ro5ij+m3PdMnTULfsBLOgiJiHFYPAGm4+sF+p4Im4hVic9kwJdxFcics5y3f1Rx5YUrF VnUWV+8unmMEYg5uB8eq3OCLrqajSKEzrVHHW0IRZzLsNIkdlDChjKG9NToJsqxwCPOU LqHVZ5jW4dQmcELq5kEemfNuPZlPv9hVaD4aY9dMLKEW30gv+yKNm5Wunzl7oR2s2gEs 4UjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=z6EQSldRtBfOYowNx4m98uZKJYBh6OKHlZ4iwZkNkRs=; b=wbgmdLZdkiSyxxygTYLEXmhy83w0IGBD6M9wyd8LQeK1vCzWUviBoXo7w35imtcpWh 71doVA/0scLN9ZHvWNDLaJyR5n3Z13HUM/mptjhG4Jn5KlmFE43AI29RsKfrhWkvDrMQ DldsYI6zFGTix6p+UJ2vNavazKQIXj7dr5pKv0tLttpKU4YCeI5UZO1j5xHPWg38BnoO XtwQx9iBP1lZs0PItkmej2T17JWzpgKhigpCAhMkgqil4Sk2NDMj+K/n744NEDvn8bfe WRWtfzM7BYLrNt15whG5d28z7lVx6rvcMpnQ24ld7KNV16xGXm+qC4OILDtRGiAOHHDI oXeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si1078492plb.245.2022.01.12.14.31.32; Wed, 12 Jan 2022 14:31:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351256AbiALHkh (ORCPT + 99 others); Wed, 12 Jan 2022 02:40:37 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:38308 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1351272AbiALHjd (ORCPT ); Wed, 12 Jan 2022 02:39:33 -0500 X-UUID: 4246199e049e4f0f80f9ecdb982e7845-20220112 X-UUID: 4246199e049e4f0f80f9ecdb982e7845-20220112 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1394784379; Wed, 12 Jan 2022 15:39:30 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 12 Jan 2022 15:39:28 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 12 Jan 2022 15:39:28 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 7/7] Bluetooth: btmtksdio: mask out interrupt status Date: Wed, 12 Jan 2022 15:39:17 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Sean Wang Currently, there is a loop in btmtksdio_txrx_work() which iteratively executes until the variable int_status is zero. But the variable int_status should be masked out with the actual interrupt sources (MTK_REG_CHISR bit 0-15) before we check the loop condition. Otherwise, RX_PKT_LEN (MTK_REG_CHISR bit 16-31) which is read-only and unclearable would cause the loop to get stuck on some chipsets like MT7663s. Fixes: 26270bc189ea ("Bluetooth: btmtksdio: move interrupt service to work") Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 491f029452ca..8be763ab3bf4 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -92,6 +92,7 @@ MODULE_DEVICE_TABLE(sdio, btmtksdio_table); #define TX_EMPTY BIT(2) #define TX_FIFO_OVERFLOW BIT(8) #define FW_MAILBOX_INT BIT(15) +#define INT_MASK GENMASK(15, 0) #define RX_PKT_LEN GENMASK(31, 16) #define MTK_REG_CSICR 0xc0 @@ -565,6 +566,7 @@ static void btmtksdio_txrx_work(struct work_struct *work) * FIFO. */ sdio_writel(bdev->func, int_status, MTK_REG_CHISR, NULL); + int_status &= INT_MASK; if ((int_status & FW_MAILBOX_INT) && bdev->data->chipid == 0x7921) { -- 2.25.1