Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751583AbaKYQkw (ORCPT ); Tue, 25 Nov 2014 11:40:52 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45644 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbaKYQkt (ORCPT ); Tue, 25 Nov 2014 11:40:49 -0500 Date: Tue, 25 Nov 2014 17:40:47 +0100 Message-ID: From: Takashi Iwai To: Dave Jones Cc: Linux Kernel , pgynther@google.com, marcel@holtmann.org, linux-bluetooth@vger.kernel.org Subject: Re: bluetooth related firmware loader spew on resume. In-Reply-To: <20141111181228.GA27815@redhat.com> References: <20141111181228.GA27815@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Tue, 11 Nov 2014 13:12:28 -0500, Dave Jones wrote: > > Since the addition of 10d4c6736ea "Bluetooth: btusb: Add Broadcom patch > RAM support", I (and a number of other people[*]) have been seeing > this trace on resume from suspend. > > WARNING: CPU: 1 PID: 8565 at drivers/base/firmware_class.c:1127 _request_firmware+0x4c1/0x7c0() > CPU: 1 PID: 8565 Comm: kworker/u17:0 Not tainted 3.17.2-200.fc20.x86_64 #1 > Hardware name: LENOVO 2356JK8/2356JK8, BIOS G7ET94WW (2.54 ) 04/30/2013 > Workqueue: hci0 hci_power_on [bluetooth] > 0000000000000000 00000000f52a564b ffff8800a8c63be8 ffffffff817271cc > 0000000000000000 ffff8800a8c63c20 ffffffff81094ced ffff8800a8c63d10 > ffff8801365ddf00 ffff8801387b4b00 ffff8800a8c63d08 00000000fffffff5 > Call Trace: > [] dump_stack+0x45/0x56 > [] warn_slowpath_common+0x7d/0xa0 > [] warn_slowpath_null+0x1a/0x20 > [] _request_firmware+0x4c1/0x7c0 > [] ? snprintf+0x49/0x70 > [] request_firmware+0x31/0x50 > [] btusb_setup_bcm_patchram+0x83/0x550 [btusb] > [] ? rpm_idle+0xd6/0x2b0 > [] hci_dev_do_open+0xe1/0xa60 [bluetooth] > ACPI: \_SB_.PCI0.LPC_.EC__.BAT1: docking > Restarting tasks ... > [] ? ttwu_do_activate.constprop.90+0x5d/0x70 > [] hci_power_on+0x40/0x1e0 [bluetooth] > [] ? lock_timer_base.isra.34+0x2b/0x50 > [] process_one_work+0x149/0x3d0 > [] worker_thread+0x11b/0x490 > [] ? rescuer_thread+0x2e0/0x2e0 > [] kthread+0xd8/0xf0 > [] ? kthread_create_on_node+0x190/0x190 > [] ret_from_fork+0x7c/0xb0 > [] ? kthread_create_on_node+0x190/0x190 > ---[ end trace 75a0e9c7f33ebb4c ]--- > bluetooth hci0: firmware: brcm/BCM20702A0-0a5c-21e6.hcd will not be loaded > Bluetooth: hci0: BCM: patch brcm/BCM20702A0-0a5c-21e6.hcd not found > > > At first I thought it was just over-reaction to the file being missing, but > looking at the WARN_ON, it appears that we're trying to invoke the firmware > loader before userspace is back up ? > > In this (and probably other related) kernel, CONFIG_FW_LOADER_USER_HELPER is unset, > in case that matters at all. If it's the case where no matching firmware file is present, the patch below might help. It's only compile-tested. Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] btusb: Give up firmware loading once when failed Otherwise it may trigger request_firmware() for the non-existing file in the resume path, resulting in a warning. For the success paths, calling request_firmware() is fine, as it's cached properly at suspend. The problem is only for the error paths. Signed-off-by: Takashi Iwai --- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index edfc17bfcd44..62d8e23fd3cb 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1569,6 +1569,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) if (!fw) { kfree_skb(skb); btusb_check_bdaddr_intel(hdev); + hdev->setup = NULL; return 0; } fw_ptr = fw->data; @@ -1756,6 +1757,7 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev) ret = request_firmware(&fw, fw_name, &hdev->dev); if (ret < 0) { BT_INFO("%s: BCM: patch %s not found", hdev->name, fw_name); + hdev->setup = NULL; return 0; } -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/