<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bluetooth/rfcomm/tty.c, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-11-22T21:50:46Z</updated>
<entry>
<title>Bluetooth: Fix using the correct source address type</title>
<updated>2016-11-22T21:50:46Z</updated>
<author>
<name>Johan Hedberg</name>
</author>
<published>2016-11-12T15:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39385cb5f3274735b03ed1f8e7ff517b02a0beed'/>
<id>urn:sha1:39385cb5f3274735b03ed1f8e7ff517b02a0beed</id>
<content type='text'>
The hci_get_route() API is used to look up local HCI devices, however
so far it has been incapable of dealing with anything else than the
public address of HCI devices. This completely breaks with LE-only HCI
devices that do not come with a public address, but use a static
random address instead.

This patch exteds the hci_get_route() API with a src_type parameter
that's used for comparing with the right address of each HCI device.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Convert RFCOMM spinlocks into mutexes</title>
<updated>2014-05-06T02:25:06Z</updated>
<author>
<name>Libor Pechacek</name>
</author>
<published>2014-04-29T18:38:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=86aae6c7b577654b7293374973985a153e0c147e'/>
<id>urn:sha1:86aae6c7b577654b7293374973985a153e0c147e</id>
<content type='text'>
Enabling CONFIG_DEBUG_ATOMIC_SLEEP has shown that some rfcomm functions
acquiring spinlocks call sleeping locks further in the chain.  Converting
the offending spinlocks into mutexes makes sleeping safe.

Signed-off-by: Libor Pechacek &lt;lpechacek@suse.cz&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix write_room() calculation</title>
<updated>2014-02-14T21:39:32Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8981be9b2fe5553af35a43865d9ab4271c3aa2e2'/>
<id>urn:sha1:8981be9b2fe5553af35a43865d9ab4271c3aa2e2</id>
<content type='text'>
The skb truesize of a 12-byte payload with a 10-byte head/tail
reserve is 768 bytes. Consequently, even with 40 tx_credits, at
most 6 packets could be queued at any one time:

  40 tx_credits * 127-byte mtu &lt; 768-byte truesize * 7

This error could also cause the tx queue to apparently stall if
credit flow control is disabled (where tx_credits is fixed at 5),
or if the receiver only granted a limited number of tx credits
(eg., less than 7).

Instead, track the outstanding number of queued packets not yet sent
in wmem_alloc and allow for a maximum of 40 queued packets. Report
the space avail for a single write() as the mtu * number of packets
left before reaching the maximum.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Refactor write_room() calculation</title>
<updated>2014-02-14T21:39:32Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b16b4351313fb89ccb4c227d432d16aa32ffec72'/>
<id>urn:sha1:b16b4351313fb89ccb4c227d432d16aa32ffec72</id>
<content type='text'>
Compute the amount of space available for a single write()
within rfcomm_room(); clamp to 0 for negative values. Note
this patch does not change the result of the computation.

Report the amount of room returned in the debug printk.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Don't fail RFCOMM tty writes</title>
<updated>2014-02-14T21:39:32Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=72e5108c6d637ea2f4c0e64b09621a79f363b664'/>
<id>urn:sha1:72e5108c6d637ea2f4c0e64b09621a79f363b664</id>
<content type='text'>
The tty driver api design prefers no-fail writes if the driver
write_room() method has previously indicated space is available
to accept writes. Since this is trivially possible for the
RFCOMM tty driver, do so.

Introduce rfcomm_dlc_send_noerror(), which queues but does not
schedule the krfcomm thread if the dlc is not yet connected
(and thus does not error based on the connection state).
The mtu size test is also unnecessary since the caller already
chunks the written data into mtu size.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Force -EIO from tty read/write if .activate() fails</title>
<updated>2014-02-14T21:39:32Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5326a4ee982703ddba14a9821fe5cb10d122e1b0'/>
<id>urn:sha1:5326a4ee982703ddba14a9821fe5cb10d122e1b0</id>
<content type='text'>
If rfcomm_dlc_open() fails, set tty into error state which returns
-EIO from reads and writes.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Cleanup RFCOMM device registration error handling</title>
<updated>2014-02-14T21:39:32Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb856e50900a84dd9f8d50d3882eb4a26ba6ea54'/>
<id>urn:sha1:fb856e50900a84dd9f8d50d3882eb4a26ba6ea54</id>
<content type='text'>
If RFCOMM tty device registration fails, cleanup by releasing
the tty_port reference to trigger rfcomm_dev destruction
(rather than open-coding it).

The dlc reference release is moved into rfcomm_dev_add(),
which ensures cleanup in both error paths -- ie., if
__rfcomm_dev_add() fails or if tty_port_register_device() fails.

Fixes releasing the module reference if device registration fails.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Refactor rfcomm_dev_add()</title>
<updated>2014-02-14T21:39:31Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f355095756c2a0b77a5b0aa0384c0c09d9735252'/>
<id>urn:sha1:f355095756c2a0b77a5b0aa0384c0c09d9735252</id>
<content type='text'>
Move rfcomm_dev allocation and initialization into new function,
__rfcomm_dev_add(), to simplify resource release in error handling.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Serialize RFCOMMCREATEDEV and RFCOMMRELEASEDEV ioctls</title>
<updated>2014-02-14T21:39:31Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=033ace99c444daa4141b84419f670513ce637b77'/>
<id>urn:sha1:033ace99c444daa4141b84419f670513ce637b77</id>
<content type='text'>
At least two different race conditions exist with multiple concurrent
RFCOMMCREATEDEV and RFCOMMRELEASEDEV ioctls:
* Multiple concurrent RFCOMMCREATEDEVs with RFCOMM_REUSE_DLC can
  mistakenly share the same DLC.
* RFCOMMRELEASEDEV can destruct the rfcomm_dev still being
  constructed by RFCOMMCREATEDEV.

Introduce rfcomm_ioctl_mutex to serialize these add/remove operations.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Rename __rfcomm_dev_get() to __rfcomm_dev_lookup()</title>
<updated>2014-02-14T21:39:31Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2014-02-10T01:59:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7611fcedd6caae0586397508a2414788d87a231c'/>
<id>urn:sha1:7611fcedd6caae0586397508a2414788d87a231c</id>
<content type='text'>
Functions which search lists for matching id's are more
commonly named *_lookup, which is the convention in the
bluetooth core as well.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-By: Alexander Holler &lt;holler@ahsoftware.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
