3d17f6a
From: Laura Abbott <labbott@fedoraproject.org>
3d17f6a
Date: Tue, 28 Apr 2015 15:37:44 -0700
3d17f6a
Subject: [PATCH] firmware: Drop WARN from usermodehelper_read_trylock error
3d17f6a
 case
3d17f6a
3d17f6a
We've received a number of reports of warnings when coming
3d17f6a
out of suspend with certain bluetooth firmware configurations:
3d17f6a
3d17f6a
WARNING: CPU: 3 PID: 3280 at drivers/base/firmware_class.c:1126
3d17f6a
_request_firmware+0x558/0x810()
3d17f6a
Modules linked in: ccm ip6t_rpfilter ip6t_REJECT nf_reject_ipv6
3d17f6a
xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter
3d17f6a
ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6
3d17f6a
ip6table_mangle ip6table_security ip6table_raw ip6table_filter
3d17f6a
ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4
3d17f6a
nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw
3d17f6a
binfmt_misc bnep intel_rapl iosf_mbi arc4 x86_pkg_temp_thermal
3d17f6a
snd_hda_codec_hdmi coretemp kvm_intel joydev snd_hda_codec_realtek
3d17f6a
iwldvm snd_hda_codec_generic kvm iTCO_wdt mac80211 iTCO_vendor_support
3d17f6a
snd_hda_intel snd_hda_controller snd_hda_codec crct10dif_pclmul
3d17f6a
snd_hwdep crc32_pclmul snd_seq crc32c_intel ghash_clmulni_intel uvcvideo
3d17f6a
snd_seq_device iwlwifi btusb videobuf2_vmalloc snd_pcm videobuf2_core
3d17f6a
 serio_raw bluetooth cfg80211 videobuf2_memops sdhci_pci v4l2_common
3d17f6a
videodev thinkpad_acpi sdhci i2c_i801 lpc_ich mfd_core wacom mmc_core
3d17f6a
media snd_timer tpm_tis hid_logitech_hidpp wmi tpm rfkill snd mei_me mei
3d17f6a
shpchp soundcore nfsd auth_rpcgss nfs_acl lockd grace sunrpc i915
3d17f6a
i2c_algo_bit drm_kms_helper e1000e drm hid_logitech_dj ptp pps_core
3d17f6a
video
3d17f6a
CPU: 3 PID: 3280 Comm: kworker/u17:0 Not tainted 3.19.3-200.fc21.x86_64
3d17f6a
Hardware name: LENOVO 343522U/343522U, BIOS GCET96WW (2.56 ) 10/22/2013
3d17f6a
Workqueue: hci0 hci_power_on [bluetooth]
3d17f6a
 0000000000000000 0000000089944328 ffff88040acffb78 ffffffff8176e215
3d17f6a
 0000000000000000 0000000000000000 ffff88040acffbb8 ffffffff8109bc1a
3d17f6a
 0000000000000000 ffff88040acffcd0 00000000fffffff5 ffff8804076bac40
3d17f6a
Call Trace:
3d17f6a
 [<ffffffff8176e215>] dump_stack+0x45/0x57
3d17f6a
 [<ffffffff8109bc1a>] warn_slowpath_common+0x8a/0xc0
3d17f6a
 [<ffffffff8109bd4a>] warn_slowpath_null+0x1a/0x20
3d17f6a
 [<ffffffff814dbe78>] _request_firmware+0x558/0x810
3d17f6a
 [<ffffffff814dc165>] request_firmware+0x35/0x50
3d17f6a
 [<ffffffffa03a7886>] btusb_setup_bcm_patchram+0x86/0x590 [btusb]
3d17f6a
 [<ffffffff814d40e6>] ? rpm_idle+0xd6/0x230
3d17f6a
 [<ffffffffa04d4801>] hci_dev_do_open+0xe1/0xa90 [bluetooth]
3d17f6a
 [<ffffffff810c51dd>] ? ttwu_do_activate.constprop.90+0x5d/0x70
3d17f6a
 [<ffffffffa04d5980>] hci_power_on+0x40/0x200 [bluetooth]
3d17f6a
 [<ffffffff810b487c>] process_one_work+0x14c/0x3f0
3d17f6a
 [<ffffffff810b52f3>] worker_thread+0x53/0x470
3d17f6a
 [<ffffffff810b52a0>] ? rescuer_thread+0x300/0x300
3d17f6a
 [<ffffffff810ba548>] kthread+0xd8/0xf0
3d17f6a
 [<ffffffff810ba470>] ? kthread_create_on_node+0x1b0/0x1b0
3d17f6a
 [<ffffffff81774958>] ret_from_fork+0x58/0x90
3d17f6a
 [<ffffffff810ba470>] ? kthread_create_on_node+0x1b0/0x1b0
3d17f6a
3d17f6a
This occurs after every resume.
3d17f6a
3d17f6a
When resuming, the bluetooth driver needs to re-request the
3d17f6a
firmware. This re-request is happening before usermodehelper
3d17f6a
is fully enabled. If the firmware load succeeded previously, the
3d17f6a
caching behavior of the firmware code typically negates the
3d17f6a
need to call the usermodehelper code again and the request
3d17f6a
succeeds. If the firmware was never loaded because it isn't
3d17f6a
actually present in the file system, this results in a call
3d17f6a
to usermodehelper and a failure warning every resume.
3d17f6a
3d17f6a
The proper fix is to add a reset_resume functionality to the
3d17f6a
btusb driver to be able to handle the resume case. The
3d17f6a
work for this is ongoing so in the mean time just silence
3d17f6a
the warning since we know it's a problem.
3d17f6a
3d17f6a
Bugzilla: 1133378
3d17f6a
Upstream-status: Working on it. It's a difficult problem :(
3d17f6a
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
3d17f6a
---
3d17f6a
 drivers/base/firmware_class.c | 2 +-
3d17f6a
 1 file changed, 1 insertion(+), 1 deletion(-)
3d17f6a
3d17f6a
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
228ccc4
index 894bda114224..f7a8d27b6459 100644
3d17f6a
--- a/drivers/base/firmware_class.c
3d17f6a
+++ b/drivers/base/firmware_class.c
228ccc4
@@ -1144,7 +1144,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
3d17f6a
 		}
3d17f6a
 	} else {
3d17f6a
 		ret = usermodehelper_read_trylock();
3d17f6a
-		if (WARN_ON(ret)) {
3d17f6a
+		if (ret) {
3d17f6a
 			dev_err(device, "firmware: %s will not be loaded\n",
3d17f6a
 				name);
3d17f6a
 			goto out;