16 Mar, 2020

1 commit


11 Mar, 2020

2 commits


08 Mar, 2020

1 commit

  • This change introduces a wide band speech setting which allows higher
    level clients to query the local controller support for wide band speech
    as well as set the setting state when the radio is powered off.
    Internally, this setting controls if erroneous data reporting is enabled
    on the controller.

    Signed-off-by: Alain Michaud
    Signed-off-by: Marcel Holtmann

    Alain Michaud
     

05 Mar, 2020

1 commit

  • This patch replaces devm_gpiod_get() with devm_gpiod_get_optional() to get
    bt_en and replaces devm_clk_get() with devm_clk_get_optional() to get
    susclk. It also uses NULL check to determine whether the resource is
    available or not.

    Fixes: 8a208b24d770 ("Bluetooth: hci_qca: Make bt_en and susclk not mandatory for QCA Rome")
    Signed-off-by: Rocky Liao
    Signed-off-by: Marcel Holtmann

    Rocky Liao
     

04 Mar, 2020

1 commit


01 Mar, 2020

1 commit


28 Feb, 2020

6 commits

  • QCA Rome doesn't support the pre-shutdown vendor hci command, this patch
    will check the soc type in qca_power_off() and only send this command
    for wcn399x.

    Fixes: ae563183b647 ("Bluetooth: hci_qca: Enable power off/on support during hci down/up for QCA Rome")
    Signed-off-by: Rocky Liao
    Signed-off-by: Marcel Holtmann

    Rocky Liao
     
  • This patch provides a mechanism for MGMT interface client to query the
    capability of the controller to support WBS.

    Signed-off-by: Alain Michaud
    Signed-off-by: Marcel Holtmann

    Alain Michaud
     
  • This change adds a new flag to define a controller's wideband speech
    capability. This is required since no reliable over HCI mechanism
    exists to query the controller and driver's compatibility with
    wideband speech.

    Signed-off-by: Alain Michaud
    Signed-off-by: Marcel Holtmann

    Alain Michaud
     
  • 'hu->priv' is set twice to NULL in this function.
    Axe one of these assignments.

    Signed-off-by: Christophe JAILLET
    Signed-off-by: Marcel Holtmann

    Christophe JAILLET
     
  • 'transmittion' should be 'transmission'

    Signed-off-by: Christophe JAILLET
    Signed-off-by: Marcel Holtmann

    Christophe JAILLET
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marcel Holtmann

    Gustavo A. R. Silva
     

18 Feb, 2020

3 commits

  • The variable was declared in an unnecessarily broad scope.

    Signed-off-by: Marcel Holtmann
    Signed-off-by: Johan Hedberg

    Marcel Holtmann
     
  • This patch will fix the below issues
    1. Discarding memory dump events if memdump state is moved to
    MEMDUMP_TIMEOUT.
    2. Fixed race conditions between qca_hw_error() and qca_controller_memdump
    while free memory dump buffers using mutex lock
    3. Moved timeout timer to delayed work queue
    4. Injecting HW error event in a case when dumps failed to receive and HW
    error event is not yet received.
    5. Clearing hw error and command timeout function callbacks before
    sending pre shutdown command.

    Collecting memory dump will follow any of the below sequence.

    Sequence 1:
    Receiving Memory dump events from the controller
    Received entire dump in stipulated time
    Received HW error event from the controller
    Controller Reset from HOST

    Sequence 2:
    Receiving Memory dump events from the controller
    Failed to Receive entire dump in stipulated time
    A Timeout schedules and if no HW error event received a fake HW
    error event will be injected.
    Controller Reset from HOST.

    Sequence 3:
    Received HW error event
    HOST trigger SSR by sending crash packet to controller.
    Received entire dump in stipulated time
    Controller Reset from HOST

    Fixes: d841502c79e3 ("Bluetooth: hci_qca: Collect controller memory dump during SSR")
    Reported-by: Abhishek Pandit-Subedi
    Signed-off-by: Venkata Lakshmi Narayana Gubba
    Reviewed-by: Abhishek Pandit-Subedi
    Signed-off-by: Marcel Holtmann

    Venkata Lakshmi Narayana Gubba
     
  • Add new compatible and FW loading support for RTL8822C.

    Signed-off-by: Max Chou
    Signed-off-by: Marcel Holtmann

    Max Chou
     

16 Feb, 2020

1 commit


13 Feb, 2020

3 commits

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marcel Holtmann

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marcel Holtmann

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marcel Holtmann

    Gustavo A. R. Silva
     

09 Feb, 2020

1 commit

  • The ASUS FX505DV laptop contains RTL8822CE device with an
    associated BT chip using a USB ID of 13d3:3548.
    This patch add fw download support for it.

    T: Bus=03 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 4 Spd=12 MxCh= 0
    D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
    P: Vendor=13d3 ProdID=3548 Rev= 0.00
    S: Manufacturer=Realtek
    S: Product=Bluetooth Radio
    S: SerialNumber=00e04c000001
    C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
    E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
    E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
    I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
    I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
    I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
    I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
    I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
    E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms

    Signed-off-by: Sergey Shatunov
    Signed-off-by: Marcel Holtmann

    Sergey Shatunov
     

05 Feb, 2020

1 commit


03 Feb, 2020

1 commit


25 Jan, 2020

1 commit

  • Currently, kmemdup is applied to the firmware data, and it invokes
    kmalloc under the hood. The firmware size and patch_length are big (more
    than PAGE_SIZE), and on some low-end systems (like ASUS E202SA) kmalloc
    may fail to allocate a contiguous chunk under high memory usage and
    fragmentation:

    Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000a lmp_ver=06 lmp_subver=8821
    Bluetooth: hci0: RTL: rom_version status=0 version=1
    Bluetooth: hci0: RTL: loading rtl_bt/rtl8821a_fw.bin
    kworker/u9:2: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0

    As firmware load happens on each resume, Bluetooth will stop working
    after several iterations, when the kernel fails to allocate an order-4
    page.

    This patch replaces kmemdup with kvmalloc+memcpy. It's not required to
    have a contiguous chunk here, because it's not mapped to the device
    directly.

    Signed-off-by: Maxim Mikityanskiy
    Signed-off-by: Marcel Holtmann

    Maxim Mikityanskiy
     

16 Jan, 2020

8 commits


14 Jan, 2020

1 commit


10 Jan, 2020

1 commit


09 Jan, 2020

2 commits

  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/bluetooth/hci_qca.c: In function 'qca_controller_memdump':
    drivers/bluetooth/hci_qca.c:980:6: warning:
    variable 'opcode' set but not used [-Wunused-but-set-variable]

    It is never used since commit d841502c79e3 ("Bluetooth: hci_qca: Collect
    controller memory dump during SSR"), so remove it.

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: Marcel Holtmann

    YueHaibing
     
  • Use vfree() instead of kfree() to free vmalloc()
    allocated data.

    Fixes: d841502c79e3 ("Bluetooth: hci_qca: Collect controller memory dump during SSR")
    Signed-off-by: Wei Yongjun
    Reviewed-by: Balakrishna Godavarthi
    Signed-off-by: Marcel Holtmann

    Wei Yongjun
     

06 Jan, 2020

1 commit

  • USB "VendorID:04ca ProductID:3021" is a new QCA ROME USB
    Bluetooth device, this patch will support firmware downloading for it.

    T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
    D: Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
    P: Vendor=04ca ProdID=3021 Rev= 0.01
    C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
    E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
    E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
    I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
    I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
    I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
    I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
    I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
    E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms

    Signed-off-by: Rocky Liao
    Signed-off-by: Marcel Holtmann

    Rocky Liao
     

04 Jan, 2020

3 commits

  • We will collect the ramdump of BT controller when hardware error event
    received before rebooting the HCI layer. Before restarting a subsystem
    or a process running on a subsystem, it is often required to request
    either a subsystem or a process to perform proper cache dump and
    software failure reason into a memory buffer which application
    processor can retrieve afterwards. SW developers can often provide
    initial investigation by looking into that debugging information.

    Signed-off-by: Balakrishna Godavarthi
    Signed-off-by: Venkata Lakshmi Narayana Gubba
    Signed-off-by: Marcel Holtmann

    Balakrishna Godavarthi
     
  • The commit 3347a80965b3 ("Bluetooth: hci_bcm: Fix RTS handling during
    startup") is causing at least a regression for AP6256 on Orange Pi 3.
    So do the RTS line handing during startup only on the necessary platform.

    Fixes: 3347a80965b3 ("Bluetooth: hci_bcm: Fix RTS handling during startup")
    Reported-by: Ondřej Jirman
    Signed-off-by: Stefan Wahren
    Signed-off-by: Marcel Holtmann

    Stefan Wahren
     
  • This fixes a double definition error when CONFIG_BT_BCM is not set.

    Fixes: 528379902337 ("Bluetooth: btbcm: Support pcm configuration")
    Signed-off-by: Abhishek Pandit-Subedi
    Signed-off-by: Marcel Holtmann

    Abhishek Pandit-Subedi