All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: <linux-bluetooth@vger.kernel.org>, Marcel Holtmann <marcel@holtmann.org>
Subject: [PATCH] I have no idea what I'm doing
Date: Tue, 14 Jul 2015 15:16:12 -0400	[thread overview]
Message-ID: <20150714191612.GA27622@ret.masoncoding.com> (raw)

Hi Marcel,

I upgraded my macbook from 4.0.2 to 4.1.2, and now I get
messages similar to this bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=100651

and this one:

https://bugzilla.kernel.org/show_bug.cgi?id=101171

[21552.711888] Bluetooth: hci0: BCM: Read verbose config info failed (-16)
[21728.019676] Bluetooth: hci0: BCM: Read verbose config info failed (-16)

A little poking around shows you recently added this check, and from
what I can tell with grep and friends the btbcm_read_verbose_config()
function is completely new?  I don't see similar reads being done by
older kernels.

So, I pushed some code around.  It does compile, but printk proves that
only the second hunk is happening on my box, so testing is somewhat
light.

With this applied, I'm able to use bluetooth again.

Signed-off-by: Chris Mason <clm@fb.com>

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 4bba866..90e7099 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -294,11 +294,10 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
 
 	/* Read Verbose Config Version Info */
 	skb = btbcm_read_verbose_config(hdev);
-	if (IS_ERR(skb))
-		return PTR_ERR(skb);
-
-	BT_INFO("%s: BCM: chip id %u", hdev->name, skb->data[1]);
-	kfree_skb(skb);
+	if (!IS_ERR(skb)) {
+		BT_INFO("%s: BCM: chip id %u", hdev->name, skb->data[1]);
+		kfree_skb(skb);
+	}
 
 	switch ((rev & 0xf000) >> 12) {
 	case 0:
@@ -378,12 +377,11 @@ int btbcm_setup_apple(struct hci_dev *hdev)
 
 	/* Read Verbose Config Version Info */
 	skb = btbcm_read_verbose_config(hdev);
-	if (IS_ERR(skb))
-		return PTR_ERR(skb);
-
-	BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
-		get_unaligned_le16(skb->data + 5));
-	kfree_skb(skb);
+	if (!IS_ERR(skb)) {
+		BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
+			get_unaligned_le16(skb->data + 5));
+		kfree_skb(skb);
+	}
 
 	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
 

             reply	other threads:[~2015-07-14 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 19:16 Chris Mason [this message]
2015-07-14 19:49 ` [PATCH] I have no idea what I'm doing Marcel Holtmann
2015-07-14 19:59   ` Chris Mason
2015-07-14 20:49     ` Marcel Holtmann
2015-07-14 20:53       ` Chris Mason
2015-07-14 20:58         ` Marcel Holtmann
2015-07-14 21:01           ` Chris Mason
2015-07-14 21:11             ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150714191612.GA27622@ret.masoncoding.com \
    --to=clm@fb.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.