Re: [PATCH v4 4/6] Bluetooth: Introduce Qualcomm IPQ5018 IPC based HCI driver
From: George Moussalem
Date: Wed Jul 08 2026 - 10:14:36 EST
On 7/8/26 16:37, Bartosz Golaszewski wrote:
> On Mon, 6 Jul 2026 19:26:20 +0200, George Moussalem via B4 Relay
> <devnull+george.moussalem.outlook.com@xxxxxxxxxx> said:
>> From: George Moussalem <george.moussalem@xxxxxxxxxxx>
>>
>> Add support for the Bluetooth controller found in the IPQ5018 SoC.
>> This driver implements firmware loading and the transport layer between
>> the HCI core and the Bluetooth controller.
>>
>> The firmware is loaded by the host into the dedicated reserved memory
>> carveout and authenticated by TrustZone. A Secure Channel Manager (SCM)
>> call safely brings the peripheral core out of reset.
>>
>> A shared memory ring buffer topology handles runtime data frame
>> transport between the host APSS and the controller.
>>
>> An outgoing APCS IPC bit and an incoming GIC interrupt handle host/guest
>> signaling.
>>
>> Signed-off-by: George Moussalem <george.moussalem@xxxxxxxxxxx>
>> ---
>
> ...
>
>> +
>> + /* Check if firmware is split across multiple segment files */
>> + if (phdr->p_offset > fw->size ||
>> + phdr->p_filesz > fw->size - phdr->p_offset) {
>> + seg_name = kasprintf(GFP_KERNEL, "%.*sb%02d",
>> + (int)stem_len, desc->firmware, i);
>> + if (!seg_name) {
>> + ret = -ENOMEM;
>> + goto release_fw;
>> + }
>> +
>> + ret = request_firmware(&seg_fw, seg_name,
>> + desc->dev);
>> + if (ret)
>> + dev_err(desc->dev,
>> + "Could not find split segment binary: %s\n",
>> + seg_name);
>> +
>> + /*
>> + * Use the virtual instead of the physical address as
>> + * the offset
>> + */
>> + memcpy_toio(desc->mem_region + phdr->p_vaddr, seg_fw->data,
>> + phdr->p_filesz);
>> +
>> + release_firmware(seg_fw);
>
> I think sashiko is correct pointing out this would be left uninitialized.
yeah, I'm working my way through the issues reported. Will fix this.
>
> Bart
Best regards,
George