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