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: 13665462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B23D9C25B75 for ; Wed, 15 May 2024 18:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bt3UZPCWU4x0tLyLhKq8XG6mbYwCVdx8Lxwdd7us9/c=; b=d71xJJwUHqe4ar mzEP/NepqdkRu2WhW2hmHq5tvNuUlc8VTGvzw/z3Pr46z87H5K+MevFvz7bS9F50ETP6FtKLppX6M ixbBUhgeQDfYIZ49pvx+BXiHhN57BQP6ttKlEjOGtxue62XdckgQwMjarqPGkmKSiORWv48ubMjQy eqw8m7qd9lGLBGMkkypATIvbcvkygIvKXmGHuLcZB7pV+Rz3D1KRwuo/su5bAABhGtC2XkDev6jde wJxmVMXz5euuxOlbytoicSsi6F9KAqvmqaLKEds85rkqFTOLuFY7brqnItnT7gvrpivevNTtoNHex IDjtdUK4cayaZcQ7bkzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7J9v-00000002WMd-2da4; Wed, 15 May 2024 18:15:23 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7J9n-00000002WKp-2zzD for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2024 18:15:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F107DCE0AB7; Wed, 15 May 2024 18:15:13 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240515_111520_869837_D3EB5D93 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sven@svenpeter.dev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13665464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A659AC25B79 for ; Wed, 15 May 2024 18:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WwJcRwmJWddLl5yrCTYO9kz3+sJzhJDycL/TWIUW5qA=; b=TDCM4OVRCYG4vW FSOB68CnxmQnPwSHlu/MY6HN1OZUqm9tQKV5PKjCj5RY9SIPAQyLEqbXXh6r4U6CEiTYFFt8es4wG aX9YTj22Ec2jC86T4LNFMB21RteTK8cmJvHO2+Aa4zmbxEM8dGrr/yABRJtUL5H0z+21ruB1IuhA4 uFqo7SUQPagr52ZcWviESqPa1zCt5ijsdEN6864UKaB4gmr/6THvhcPctMEr/BiDB/hL/JhgA67jO fBovRf5Ko6ODUJXoy4FoRgiF8KOChuOtpohkr7l/6aF/cNXuR8dYMibBJsG034Gu3q5lG4ehgizF3 btLM2G5leInKq3tlsJqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7JA3-00000002WQH-3QRh; Wed, 15 May 2024 18:15:31 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7J9n-00000002WKq-37ua for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2024 18:15:23 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 043FDCE174A; Wed, 15 May 2024 18:15:14 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240515_111520_916817_84D22BF6 X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sven@svenpeter.dev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13665465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34F84C25B75 for ; Wed, 15 May 2024 18:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KNOso+ajMOSEdJNpRtJWDiK5v9JhCQWg1GF+7jJjclI=; b=3wD36lJtKtHTZV WnbrIRz10mRl9AWfNiEmOBpvsq3jiJMc4vDs/U6z3yJyCf5Wueg8Q+EgNfgOdAWu3BnVJ/9IZtf7f HhM4q8aoYSNSJMUbzBMPqvtS04POOhItiwjVanZ0qfgfq5Zs3r0OphX/oA5RU1fL2dy7emjv3KdLg CAOedsk6L+xEhROMTIkZ7zlldRqsc1VJDm9WOJzF8EMXHva0QXTdDYry5NvKB3GS+NgMffkcz5Opw 4+H5aTTMsJ+BurPg77GORVe1xc6RUXG73hEd42NF3MFJcps8iSAo+A1VadMdoK7/s1Oq7j3D1QO9c jgJ3G2MZc4r8PjIhwMCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7JA5-00000002WQq-1xvk; Wed, 15 May 2024 18:15:33 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7J9n-00000002WKr-3Nua for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2024 18:15:23 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 0E820CE175A; Wed, 15 May 2024 18:15:14 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240515_111520_931227_FAF337E6 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sven@svenpeter.dev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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);