<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/bluetooth, branch v4.12</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=v4.12</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=v4.12'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2017-04-30T10:22:14Z</updated>
<entry>
<title>Bluetooth: hci_ldisc: Add protocol check to hci_uart_tx_wakeup()</title>
<updated>2017-04-30T10:22:14Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-28T12:57:26Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=2d6f1da168e1d62c47f7d50135ac4cbd8411dcb1'/>
<id>urn:sha1:2d6f1da168e1d62c47f7d50135ac4cbd8411dcb1</id>
<content type='text'>
Before attempting to schedule a work-item onto hu-&gt;write_work in
hci_uart_tx_wakeup(), check that the Data Link protocol layer is
still bound to the HCI UART driver.

Failure to perform this protocol check causes a race condition between
the work queue hu-&gt;write_work running hci_uart_write_work() and the
Data Link protocol layer being unbound (closed) in hci_uart_tty_close().

Note hci_uart_tty_close() does have a "cancel_work_sync(&amp;hu-&gt;write_work)"
but it is ineffective because it cannot prevent work-items being added
to hu-&gt;write_work after cancel_work_sync() has run.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_tx_wakeup()
which prevents scheduling of the work queue when HCI_UART_PROTO_READY
is in the clear state. However, note a small race condition remains
because the hci_uart_tx_wakeup() thread can run in parallel with the
hci_uart_tty_close() thread so it is possible that a schedule of
hu-&gt;write_work can occur when HCI_UART_PROTO_READY is cleared. A complete
solution needs locking of the threads which is implemented in a future
commit.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ldisc: Add protocol check to hci_uart_dequeue()</title>
<updated>2017-04-30T10:22:14Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-28T12:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=048e1bd3a27fbeb84ccdff52e165370c1339a193'/>
<id>urn:sha1:048e1bd3a27fbeb84ccdff52e165370c1339a193</id>
<content type='text'>
Before attempting to dequeue a Data Link protocol encapsulated message,
check that the Data Link protocol is still bound to the HCI UART driver.
This makes the code consistent with the usage of the other proto
function pointers.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_dequeue()
and return NULL if the Data Link protocol is not bound.

This is needed for robustness as there is a scheduling race condition.
hci_uart_write_work() is scheduled to run via work queue hu-&gt;write_work
from hci_uart_tx_wakeup(). Therefore, there is a delay between
scheduling hci_uart_write_work() to run and hci_uart_dequeue() running
whereby the Data Link protocol layer could become unbound during the
scheduling delay. In this case, without the check, the call to the
unbound Data Link protocol layer dequeue function can crash.

It is noted that hci_uart_tty_close() has a
"cancel_work_sync(&amp;hu-&gt;write_work)" statement but this only reduces
the window of the race condition because it is possible for a new
work-item to be added to work queue hu-&gt;write_work after the call to
cancel_work_sync(). For example, Data Link layer retransmissions can
be added to the work queue after the cancel_work_sync() has finished.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ldisc: Add protocol check to hci_uart_send_frame()</title>
<updated>2017-04-30T10:22:14Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-28T12:57:24Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=ab00f89fdff61975fa52a61608080ea7b8d8e800'/>
<id>urn:sha1:ab00f89fdff61975fa52a61608080ea7b8d8e800</id>
<content type='text'>
Before attempting to send a HCI message, check that the Data Link
protocol is still bound to the HCI UART driver. This makes the code
consistent with the usage of the other proto function pointers.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_send_frame()
and return -EUNATCH if the Data Link protocol is not bound.

This also allows hci_send_frame() to report the error of an unbound
Data Link protocol layer. Therefore, it assists with diagnostics into
why HCI messages are being sent when the Data Link protocol is not
bound and avoids potential crashes.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add module license for HCI UART Nokia H4+</title>
<updated>2017-04-30T10:22:14Z</updated>
<author>
<name>Frédéric Danis</name>
<email>frederic.danis.oss@gmail.com</email>
</author>
<published>2017-04-28T11:26:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=377a6eac58e3492fbf74fed0a5e40ee90ed73f8e'/>
<id>urn:sha1:377a6eac58e3492fbf74fed0a5e40ee90ed73f8e</id>
<content type='text'>
Fix the following error preventing to load Nokia H4+ module:
  kernel: [  826.461619] hci_nokia: module license 'unspecified' taints kernel.
  kernel: [  826.461629] Disabling lock debugging due to kernel taint
  kernel: [  826.461836] hci_nokia: Unknown symbol gpiod_get_value_cansleep (err 0)
  kernel: [  826.461876] hci_nokia: Unknown symbol devm_kmalloc (err 0)
  kernel: [  826.461908] hci_nokia: Unknown symbol gpiod_set_value (err 0)
  kernel: [  826.461937] hci_nokia: Unknown symbol serdev_device_set_baudrate (err 0)
  kernel: [  826.461994] hci_nokia: Unknown symbol gpiod_set_value_cansleep (err 0)
  kernel: [  826.462021] hci_nokia: Unknown symbol hci_uart_tx_wakeup (err 0)
  kernel: [  826.462043] hci_nokia: Unknown symbol serdev_device_set_flow_control (err 0)
  kernel: [  826.462064] hci_nokia: Unknown symbol gpiod_to_irq (err 0)
  kernel: [  826.462085] hci_nokia: Unknown symbol serdev_device_open (err 0)
  kernel: [  826.462106] hci_nokia: Unknown symbol gpiod_get_value (err 0)
  kernel: [  826.462150] hci_nokia: Unknown symbol clk_prepare (err 0)
  kernel: [  826.462182] hci_nokia: Unknown symbol pm_runtime_enable (err 0)
  kernel: [  826.462204] hci_nokia: Unknown symbol h4_recv_buf (err 0)
  kernel: [  826.462246] hci_nokia: Unknown symbol serdev_device_write_flush (err 0)
  kernel: [  826.462268] hci_nokia: Unknown symbol serdev_device_get_tiocm (err 0)
  kernel: [  826.462298] hci_nokia: Unknown symbol driver_unregister (err 0)
  kernel: [  826.462318] hci_nokia: Unknown symbol serdev_device_wait_until_sent (err 0)
  kernel: [  826.462347] hci_nokia: Unknown symbol __serdev_device_driver_register (err 0)
  kernel: [  826.462384] hci_nokia: Unknown symbol serdev_device_set_tiocm (err 0)
  kernel: [  826.462417] hci_nokia: Unknown symbol clk_get_rate (err 0)
  kernel: [  826.462454] hci_nokia: Unknown symbol __pm_runtime_resume (err 0)
  kernel: [  826.462486] hci_nokia: Unknown symbol serdev_device_close (err 0)
  kernel: [  826.462524] hci_nokia: Unknown symbol cancel_work_sync (err 0)
  kernel: [  826.462546] hci_nokia: Unknown symbol btbcm_set_bdaddr (err 0)
  kernel: [  826.462567] hci_nokia: Unknown symbol clk_disable (err 0)
  kernel: [  826.462610] hci_nokia: Unknown symbol __pm_runtime_disable (err 0)
  kernel: [  826.462632] hci_nokia: Unknown symbol hci_uart_register_device (err 0)
  kernel: [  826.462653] hci_nokia: Unknown symbol clk_enable (err 0)
  kernel: [  826.462675] hci_nokia: Unknown symbol __pm_runtime_idle (err 0)
  kernel: [  826.462700] hci_nokia: Unknown symbol clk_unprepare (err 0)

Signed-off-by: Frédéric Danis &lt;frederic.danis.oss@gmail.com&gt;
Acked-by: Sebastian Reichel &lt;sre@kernel.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ldisc: Add missing clear HCI_UART_PROTO_READY</title>
<updated>2017-04-22T08:28:40Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-20T17:06:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d160b74da85a4ec072b076db056e27ba7246eba0'/>
<id>urn:sha1:d160b74da85a4ec072b076db056e27ba7246eba0</id>
<content type='text'>
Ensure that HCI_UART_PROTO_READY is cleared before close(hu) is
called which closes the Data Link protocol layer.

Therefore, add the missing bit clear of HCI_UART_PROTO_READY to
hci_uart_init_work() so that the flag is cleared when
hci_register_dev fails.

Without the fix, the functions of the Data Link protocol layer could
potentially be accessed after that layer has been closed. This
could lead to a crash as memory would have been freed in that layer.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ldisc: Ensure hu-&gt;hdev set to NULL before freeing hdev</title>
<updated>2017-04-22T08:28:40Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-20T17:06:40Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a225b8c70af9368cfcb52a3608bc862bc88a7801'/>
<id>urn:sha1:a225b8c70af9368cfcb52a3608bc862bc88a7801</id>
<content type='text'>
When hci_register_dev() fails, hu-&gt;hdev should be set to NULL before
freeing hdev. This avoids potential use of hu-&gt;hdev after it has been
freed.

This commit sets hu-&gt;hdev to NULL before calling hci_free_dev() in error
handling scenarios in hci_uart_init_work() and hci_uart_register_dev().

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ldisc: Add missing return in hci_uart_init_work()</title>
<updated>2017-04-22T08:28:40Z</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2017-04-20T17:06:39Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=cb926520e18e6aecc63614b8aa2e40d431aa29cd'/>
<id>urn:sha1:cb926520e18e6aecc63614b8aa2e40d431aa29cd</id>
<content type='text'>
If hci_register_dev() returns an error in hci_uart_init_work()
then the HCI_UART_REGISTERED bit gets erroneously set due to
a missing return statement. Therefore, add the missing return
statement.

The consequence of the missing return is that the HCI UART is not
registered but HCI_UART_REGISTERED is set which allows the code
to think that hu-&gt;hdev is safe to access but hu-&gt;hdev has been
freed so could lead to a crash.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: try to improve CONFIG_SERIAL_DEV_BUS dependency</title>
<updated>2017-04-22T08:28:40Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-04-19T17:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=1fb78fb6c6ad3751cce18d37e773d07858c1ced9'/>
<id>urn:sha1:1fb78fb6c6ad3751cce18d37e773d07858c1ced9</id>
<content type='text'>
With CONFIG_SERIAL_DEV_BUS=m, the hci_serdev.o file does not actually
get built into hci_uart.o as the Makefile doesn't pick it up, leading
to a link error with anything referring to it:

ERROR: "hci_uart_register_device" [drivers/bluetooth/hci_nokia.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed

Changing this in the Makefile would cause another problem when
hci_uart itself is built-in and cannot reference symbols from the
serdev module.

This tries to address both problems by introducing a new hidden
Kconfig symbol that controls both the compilation of hci_serdev.o
and whether the Nokia driver can be selected. This seems to address
the problem for me, though there might be a better way to do it.

Fixes: 7bb318680e86 ("Bluetooth: add nokia driver")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_ll: Fix NULL pointer deref on FW upload failure</title>
<updated>2017-04-22T08:28:40Z</updated>
<author>
<name>Sebastian Reichel</name>
<email>sre@kernel.org</email>
</author>
<published>2017-04-15T21:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f2edd9f67b8bdbe8cc3bc5c0ba4992e511147642'/>
<id>urn:sha1:f2edd9f67b8bdbe8cc3bc5c0ba4992e511147642</id>
<content type='text'>
Avoid NULL pointer dereference occurring due to freeing
skb containing an error pointer. It can easily be triggered
by using the driver with broken uart (i.e. due to misconfigured
pinmuxing).

Fixes: 371805522f87 ("bluetooth: hci_uart: add LL protocol serdev driver support")
Signed-off-by: Sebastian Reichel &lt;sre@kernel.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>bluetooth: hci_uart: add LL protocol serdev driver support</title>
<updated>2017-04-13T17:22:53Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2017-04-13T15:03:52Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=371805522f870986144fcd88727a47858e364a2c'/>
<id>urn:sha1:371805522f870986144fcd88727a47858e364a2c</id>
<content type='text'>
Turns out that the LL protocol and the TI-ST are the same thing AFAICT.
The TI-ST adds firmware loading, GPIO control, and shared access for
NFC, FM radio, etc. For now, we're only implementing what is needed for
BT. This mirrors other drivers like BCM and Intel, but uses the new
serdev bus.

The firmware loading is greatly simplified by using existing
infrastructure to send commands. It may be a bit slower than the
original code using synchronous functions, but the real bottleneck is
likely doing firmware load at 115.2kbps.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Gustavo Padovan &lt;gustavo@padovan.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
