From patchwork Wed May 15 18:15:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter via B4 Relay X-Patchwork-Id: 797083 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0A1A158DA8; Wed, 15 May 2024 18:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; cv=none; b=h1IgBe02HoJ3C6NpWjqGvz/rekxwyPYiOHqdyeuDUYaAUzWJNZxHzoh0p+Vjr90+cHXsoFIw5hYLUOTiKWyzGPukOnI4FRp72pslKjWsj3yrflFUGZ7Tch/cUeiIQqnySEYL70TyNDgnZYOsPx5eh9Fqy2DYvgX3zzD87xg6R+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; c=relaxed/simple; bh=06YY8ApMgy1OpGHdIukderyzK7KzMNwwBa335Fe5Jbo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O5KClwUwerdleU7Kd72ZAuZtk479TPk2fzINrqG5SWuD3t/5WdcPenA2R8V/tQdPFkDaFBsOMHfq4zbLEv897r7gOMnAv5m25BdtHUFDNf+6dUCQIPkFkyQCI19/glru66S57SYjUB0KD4w2rLzukpcM+8AzEElUhDN0txBgZmk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OoetWJYT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OoetWJYT" Received: by smtp.kernel.org (Postfix) with ESMTPS id 93A7EC32781; Wed, 15 May 2024 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715796912; bh=06YY8ApMgy1OpGHdIukderyzK7KzMNwwBa335Fe5Jbo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OoetWJYTHEGhiEbwzPmF15VydeMUzSo15wEoZUAf52avZs8u9Z0Capl5nyjpRk3W4 S+/7xbtCMD1BMV0K80Uf3kyV19yF+ERRAyBN5FB/I2NmBlBgKRfR1rxLxLCyby4Jel DjF+igxvNhXh5xzcC4tZ3vqqGK+e5BL1um58rLGP1ph8QbLpoZIVrDxZw0uzT08EB6 qoTMoKkSVDpXgjrsNuWfoWqww6P8+/WpCqYuIWkSrH721Kjpdy1IVlZw+W9IiluqZ6 M8hO6mx+1M7F2AaKCXS+ykqCaY2v8ohJD8SofkvBSXoHfo07bN5loH25qTdX4AUu9q ejsYMQfY1cziQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85575C25B78; Wed, 15 May 2024 18:15:12 +0000 (UTC) From: Sven Peter via B4 Relay Date: Wed, 15 May 2024 18:15:02 +0000 Subject: [PATCH v2 1/3] Bluetooth: hci_bcm4377: Use correct unit for timeouts Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240515-btfix-msgid-v2-1-bb06b9ecb6d1@svenpeter.dev> References: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> In-Reply-To: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> To: Hector Martin , Alyssa Rosenzweig , Marcel Holtmann , Luiz Augusto von Dentz Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715796911; l=839; i=sven@svenpeter.dev; s=20240512; h=from:subject:message-id; bh=7gQn02PYjfQWipM5wmSh7cRXbC3rcrKdfUfT0gxlvsA=; b=5vuT3iBepkv/NY4S5torbyPLDbQY84+ans4BusJj/uJoM6EIqY5izWUCJv/R9gWadUKYhg+sU pnvq3oniF36ArujjWEGXIvjbZukR6B/RB7+8A1jxROyY4DQpNkQcJra X-Developer-Key: i=sven@svenpeter.dev; a=ed25519; pk=jIiCK29HFM4fFOT2YTiA6N+4N7W+xZYQDGiO0E37bNU= X-Endpoint-Received: by B4 Relay for sven@svenpeter.dev/20240512 with auth_id=159 X-Original-From: Sven Peter Reply-To: sven@svenpeter.dev From: Sven Peter BCM4377_TIMEOUT is always used to wait for completitions and their API expects a timeout in jiffies instead of msecs. Fixes: 8a06127602de ("Bluetooth: hci_bcm4377: Add new driver for BCM4377 PCIe boards") Signed-off-by: Sven Peter --- drivers/bluetooth/hci_bcm4377.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 9a7243d5db71..caf9b64c8111 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -32,7 +32,7 @@ enum bcm4377_chip { #define BCM4378_DEVICE_ID 0x5f69 #define BCM4387_DEVICE_ID 0x5f71 -#define BCM4377_TIMEOUT 1000 +#define BCM4377_TIMEOUT msecs_to_jiffies(1000) /* * These devices only support DMA transactions inside a 32bit window From patchwork Wed May 15 18:15:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter via B4 Relay X-Patchwork-Id: 797338 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0A64158DB4; Wed, 15 May 2024 18:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; cv=none; b=TcRHRu7kCvAbEJMWB/Y2O+UDkoNzxYLn+S7vJ63QzN4RH5YarjUvYjiU2QI2uEyzN69v+zFlKPSibOR/3d+pUMNPAgHX12wN0kzq/woLQk4WhYX/wjc2kQ/Ry1+ZOLszfYBTRuuBtWptnt9ObHKUVHUlqKxzormdg3wF826BQY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; c=relaxed/simple; bh=rOhhqY9hje6LUTOx+VqYEfek2yHOAqEb5xlvLohkfOM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DLnx+bawrmk2Xcoh78qiiNGl5KFP9HKolLSXWVbbP5tFPsLkf9VCu0fb2cwY0wSb9b34ZlAIMpnVyMIRWvrfLM5kQLNBjgcwDEkasCs54t+DWy2uILDGXSZtsfXhM43yERni1CXfiA/dtzQ0cjOlrv7dl9T07ok2sHneYHrMQwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WrnF4tHA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WrnF4tHA" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9E066C2BD11; Wed, 15 May 2024 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715796912; bh=rOhhqY9hje6LUTOx+VqYEfek2yHOAqEb5xlvLohkfOM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=WrnF4tHAAdtiQV7UgMCXO7PGnll/7swVO/4gZuiWSqcJyopfRnmJmi0iFfWKSCt4L 0K1FRq0tqo0JIfZ3Gy2iPwrK0qoWvpbFHFFZac8n2sj430T8TLl33yto6VqXgaoqAw 3qmx3WaQFmv7c9Mv1cQxn7ydkkkPC6FHhBA9TvG3qQyl9e2I9SN4e/qR9/hU3czfHy Iybi/fyQLdkfh98ybgroRW2iismmCjlZ8G5sKALuytMLbIJ5F3JoT2SFQkdMmxZHvi 80mwyJZbX/PD8qgxwu4P/1+7Mcp7usmLr3W0Zg5cTBA105y0tfuhgB/JnUuXgx4+BV 0W+xDt4od8WJA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9167EC25B7B; Wed, 15 May 2024 18:15:12 +0000 (UTC) From: Sven Peter via B4 Relay Date: Wed, 15 May 2024 18:15:03 +0000 Subject: [PATCH v2 2/3] Bluetooth: hci_bcm4377: Increase boot timeout Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240515-btfix-msgid-v2-2-bb06b9ecb6d1@svenpeter.dev> References: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> In-Reply-To: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> To: Hector Martin , Alyssa Rosenzweig , Marcel Holtmann , Luiz Augusto von Dentz Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Sven Peter X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715796911; l=1118; i=sven@svenpeter.dev; s=20240512; h=from:subject:message-id; bh=byENbovROROZ6LTg/OZr99a9V8DiMo0qMmjQUs9RxZg=; b=U9OQBMfY7bWDNjv5YOB/lQunPI+LOIMFM3a0UzhVjqnHTbEFME1936bVtxWbKi+DIDVIlYqcF 0so1SLJpV7sBpS2pfElZdkeeOyTLScDMjekuT0kVZMv0y9Y6VFbTIEs X-Developer-Key: i=sven@svenpeter.dev; a=ed25519; pk=jIiCK29HFM4fFOT2YTiA6N+4N7W+xZYQDGiO0E37bNU= X-Endpoint-Received: by B4 Relay for sven@svenpeter.dev/20240512 with auth_id=159 X-Original-From: Sven Peter Reply-To: sven@svenpeter.dev From: Hector Martin BCM4388 takes over 2 seconds to boot, so increase the timeout. Signed-off-by: Hector Martin Reviewed-by: Sven Peter Signed-off-by: Sven Peter --- drivers/bluetooth/hci_bcm4377.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index caf9b64c8111..5b818a0e33d6 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -33,6 +33,7 @@ enum bcm4377_chip { #define BCM4387_DEVICE_ID 0x5f71 #define BCM4377_TIMEOUT msecs_to_jiffies(1000) +#define BCM4377_BOOT_TIMEOUT msecs_to_jiffies(5000) /* * These devices only support DMA transactions inside a 32bit window @@ -1857,7 +1858,7 @@ static int bcm4377_boot(struct bcm4377_data *bcm4377) dev_dbg(&bcm4377->pdev->dev, "waiting for firmware to boot\n"); ret = wait_for_completion_interruptible_timeout(&bcm4377->event, - BCM4377_TIMEOUT); + BCM4377_BOOT_TIMEOUT); if (ret == 0) { ret = -ETIMEDOUT; goto out_dma_free; From patchwork Wed May 15 18:15:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter via B4 Relay X-Patchwork-Id: 797337 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CB5E158DB5; Wed, 15 May 2024 18:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; cv=none; b=q4EfGdw6+G3eOlPg3AduzmUIMfW4OYIzzCPerPPrueLKknmyVd+CKjAUUsvb1a/sA0un3diV4SjX6tQnuJiG71XaoBfbKm6KrXwBjQiqdZUK882SMMXRfgAZIvt5zsWoF9mcJvT+6Nq8Ok8ivj8E/6nB3ICpIIlM+nZQkSTCxDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796913; c=relaxed/simple; bh=E4Iwtxu2+/Psbmp/h4kJfXYz2OBjkeQjEI+8/JjX5EQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CZO2liQI1eIMxRsKJBK1CTHO+4/jFZsrUB5Q7d9tKTMjDRRaIdc8ome7Zi6d3lJxVaRSgQ+F8aensaruHP9EtmOhqZ2gMBGaOSWHoKWZ1n/APw1BdSl0KyI0OzWPVELLya5R1u3/qyVFlTDpbOTcqK0KuDOs00yXPgp8aBA8pow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sKUqQOrb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sKUqQOrb" Received: by smtp.kernel.org (Postfix) with ESMTPS id AB7CBC32789; Wed, 15 May 2024 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715796912; bh=E4Iwtxu2+/Psbmp/h4kJfXYz2OBjkeQjEI+8/JjX5EQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sKUqQOrbz6+9qshSPT2m6n9CPcGSpJYbgbS4SDi0MrIy6RHgArm68GqmaXKrkeaGD aNSQYFNyduY4YcVwM1FF0YkWvEz6g7AfDON19cVhn7hs00pj+1tWY7wgDvi9d+k3NE JceTtG8UNk7+qUzK3mjYuFgXLzeFGqpl986LbLTbkkegvC84FnGAt016nXBtv2g3Ev uBPD0DoZjMhvCPuB0Cyhr6OxnZ0DPs1wFPC/ceSqwVRShdHWJNGdg1Akbw8Pp7ZLsr t+EoubXP+pHp+AaCB1EO5Co0MldOti9/8bvfd12H+erKgJSVdPTF6HFfLDX5GPNiZr 0CjDztkf1oJVQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A291DC25B79; Wed, 15 May 2024 18:15:12 +0000 (UTC) From: Sven Peter via B4 Relay Date: Wed, 15 May 2024 18:15:04 +0000 Subject: [PATCH v2 3/3] Bluetooth: hci_bcm4377: Fix msgid release Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240515-btfix-msgid-v2-3-bb06b9ecb6d1@svenpeter.dev> References: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> In-Reply-To: <20240515-btfix-msgid-v2-0-bb06b9ecb6d1@svenpeter.dev> To: Hector Martin , Alyssa Rosenzweig , Marcel Holtmann , Luiz Augusto von Dentz Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Sven Peter , stable@vger.kernel.org, Neal Gompa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715796911; l=1005; i=sven@svenpeter.dev; s=20240512; h=from:subject:message-id; bh=S7xKEZCg+8p3UVaw49Z8FtTJmOjvz1UbYciOj2+ura0=; b=Ozstng7yF96uysi12zXuTli9Av64oDUsLQGnA5QC7XKF+rkN/vFAN8YmgOFkBAkzcgLMw+oG8 v1/n4dTc7moC9rw82K6I7tGXE6vhBtG/SHGdxQJmXK/iIGr0pvp3Djb X-Developer-Key: i=sven@svenpeter.dev; a=ed25519; pk=jIiCK29HFM4fFOT2YTiA6N+4N7W+xZYQDGiO0E37bNU= X-Endpoint-Received: by B4 Relay for sven@svenpeter.dev/20240512 with auth_id=159 X-Original-From: Sven Peter Reply-To: sven@svenpeter.dev From: Hector Martin We are releasing a single msgid, so the order argument to bitmap_release_region must be zero. Fixes: 8a06127602de ("Bluetooth: hci_bcm4377: Add new driver for BCM4377 PCIe boards") Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Reviewed-by: Sven Peter Reviewed-by: Neal Gompa Signed-off-by: Sven Peter --- drivers/bluetooth/hci_bcm4377.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 5b818a0e33d6..92d734f02e00 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -717,7 +717,7 @@ static void bcm4377_handle_ack(struct bcm4377_data *bcm4377, ring->events[msgid] = NULL; } - bitmap_release_region(ring->msgids, msgid, ring->n_entries); + bitmap_release_region(ring->msgids, msgid, 0); unlock: spin_unlock_irqrestore(&ring->lock, flags);