Re: [PATCH v2 2/2] Bluetooth: btnxpuart: Add support for set BD address

From: Johan Korsnes
Date: Tue Jan 14 2025 - 09:11:09 EST


On 1/14/25 3:07 PM, Neeraj Sanjay Kale wrote:
>
> Hi Johan,
>
>>
>> On 1/14/25 2:35 PM, Neeraj Sanjay Kale wrote:
>>> This adds support for setting BD address during hci registration. NXP
>>> FW does not allow vendor commands unless it receives a reset command
>>> after FW download and initialization done.
>>> As a workaround, the .set_bdaddr callback function will first send the
>>> HCI reset command, followed by the actual vendor command to set BD
>>> address.
>>>
>>
>> Hi Neeraj,
>>
>> If NXP firmware does not allow vendor commands prior to this reset, would it
>> not be better to perform this reset during probe/init?
>>
> HCI reset is already part of kernel init sequence hci_init0_sync().
> However, .set_bdaddr() is called immediately after FW download is complete, but before this init sequence.
>
> Also, if local-bd-address property is not defined in the DTB, sending HCI reset command in probe does not add any value.
>
> With current implementation, if local-bd-address is defined, driver sends HCI reset, followed by set BD address vendor command, and kernel continues with the HCI init sequence.
>

Thanks for clarifying, that makes sense :-)

Kind regards,
Johan

> Thanks,
> Neeraj