From: Michael Ellerman <michael@ellerman.id.au>
To: Ranulf Doswell <ralf@ranulf.net>
Cc: cbe-oss-dev@ozlabs.org, bluez-devel@lists.sf.net
Subject: Re: [Bluez-devel] [Cbe-oss-dev] [PATCH] reset unexpected bluetooth data connections
Date: Sun, 01 Jul 2007 15:36:05 +1000 [thread overview]
Message-ID: <1183268165.8189.9.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <18a15270706300844t28c3aab6jb24f45453ce1557b@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2896 bytes --]
On Sat, 2007-06-30 at 16:44 +0100, Ranulf Doswell wrote:
> This is my first patch, so apologies if I've got the protocol wrong!
> I'm not sure if this is the best place to post this patch or even if
> I've done everything correctly (I assume I simply add a signed-off-by
> in my name).
Hi Ranulf,
This is one of the places you should send this patch, the other is the
bluetooth list, which I've CC'ed. The main issue is whether your patch
is safe in the general case, or if it's just a PS3 issue.
You do "simply" add a signed-off-by line, as long as you understand what
it means - read Documentation/SubmittingPatches for the full version.
Basically you're saying that you wrote the code and you're allowed to
release it under the GPL v2.
> I came across this bug when getting sixaxis controllers to work under
> Linux on the PS3, although it actually seems to be a generic bluetooth
> problem under Linux.
>
> Basically, the problem is that unless the bluetooth connection is
> killed prior to reboot, the PS3 controllers continue sending out data
> which the kernel correctly identifies as not associated with an active
> connection. However, it simply logs the error and continues, so the
> syslog rapidly fills up. It addition, because the device it will not
> attempt to re-initiate a new bluetooth connection, so the only current
> solution is to halt the linux box until the controller times out.
>
> This one line addition sends the device a reset which causes it to
> switch off.
Cool, do the sixaxis controllers work with this patch applied?
> Signed-off-by: Ranulf Doswell <ralf at ranulf.net>
>
> =====================================
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 8943c93..77b7eca 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1340,6 +1340,12 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
> } else {
> BT_ERR("%s ACL packet for unknown connection handle %d",
> hdev->name, handle);
> +
> + // Force the device to reset in the hope that it will then leave us alone.
> + // This is needed at least for PS3 sixaxis as the controllers will keep
> + // sending data until they are forcibly terminated. A reboot doesn't provide
> + // enough time for the controller's bluetooth stack to time out.
> + hci_reset_req(hdev, 0);
You should use C-style comments, eg. /* .. */, see
Documentation/CodingStyle for more info.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next parent reply other threads:[~2007-07-01 5:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <18a15270706300844t28c3aab6jb24f45453ce1557b@mail.gmail.com>
2007-07-01 5:36 ` Michael Ellerman [this message]
2007-07-02 19:02 ` [Bluez-devel] [Cbe-oss-dev] [PATCH] reset unexpected bluetooth data connections Ranulf Doswell
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=1183268165.8189.9.camel@concordia.ozlabs.ibm.com \
--to=michael@ellerman.id.au \
--cc=bluez-devel@lists.sf.net \
--cc=bluez-devel@lists.sourceforge.net \
--cc=cbe-oss-dev@ozlabs.org \
--cc=ralf@ranulf.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox