[PATCH V7 03/10] accel/amdxdna: Support hardware mailbox

Lizhi Hou lizhi.hou at amd.com
Tue Dec 10 16:26:28 UTC 2024


On 12/6/24 14:55, Jeffrey Hugo wrote:
> On 12/6/2024 11:47 AM, Lizhi Hou wrote:
>>
>> On 12/6/24 09:01, Mike Lothian wrote:
>>> On Fri, 6 Dec 2024 at 16:41, Mike Lothian <mike at fireburn.co.uk> wrote:
>>>> On Fri, 6 Dec 2024 at 16:26, Jeffrey Hugo <quic_jhugo at quicinc.com> 
>>>> wrote:
>>>>> On 12/5/2024 8:44 AM, Mike Lothian wrote:
>>>>>> Hi
>>>>>>
>>>>>> I needed to add the following to get things compiling for me
>>>>>>
>>>>>>
>>>>>> diff --git a/drivers/accel/amdxdna/amdxdna_mailbox.c
>>>>>> b/drivers/accel/amdxdna/amdxdna_mailbox.c
>>>>>> index fe684f463b945..79b9801935e71 100644
>>>>>> --- a/drivers/accel/amdxdna/amdxdna_mailbox.c
>>>>>> +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c
>>>>>> @@ -6,6 +6,7 @@
>>>>>> #include <drm/drm_device.h>
>>>>>> #include <drm/drm_managed.h>
>>>>>> #include <linux/bitfield.h>
>>>>>> +#include <linux/interrupt.h>
>>>>>> #include <linux/iopoll.h>
>>>>> Looking at the code, this is valid.  However, I'm not sure why 
>>>>> this is
>>>>> broken for you and not others.  Do you have any ideas? How are you
>>>>> building this?  Is the tree and/or defconfig unique in some way?
>>>>>
>>>>>> #define CREATE_TRACE_POINTS
>>>>>>
>>>>>>
>>>>>> I also had to rename the firmware in /lib/firmware/amdnpu/1502_00/
>>>>>> from npu.sbin.1.5.2.380 to npu.sbin
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Mike
>>>>>>
>>>> I'm building with clang 19.1.5, this is on linus's tree 6.13-rc1
>>>>
>>>> I've applied AMD-XDNA-driver and AMD-NPU-driver-improvements series
>>>>
>>>> These are the errors I see without the above patch:
>>>>
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:342:8: error: unknown type
>>>> name 'irqreturn_t'
>>>>    342 | static irqreturn_t mailbox_irq_handler(int irq, void *p)
>>>>        |        ^
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:352:9: error: use of
>>>> undeclared identifier 'IRQ_HANDLED'
>>>>    352 |         return IRQ_HANDLED;
>>>>        |                ^
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:380:4: error: call to
>>>> undeclared function 'disable_irq'; ISO C99 and later do not support
>>>> implicit function declarations [-Wimplicit-function-declaration]
>>>>    380 | disable_irq(mb_chann->msix_irq);
>>>>        |                         ^
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:497:8: error: call to
>>>> undeclared function 'request_irq'; ISO C99 and later do not support
>>>> implicit function declarations [-Wimplicit-function-declaration]
>>>>    497 |         ret = request_irq(mb_irq, mailbox_irq_handler, 0,
>>>> MAILBOX_NAME, mb_chann);
>>>>        |               ^
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:521:2: error: call to
>>>> undeclared function 'free_irq'; ISO C99 and later do not support
>>>> implicit function declarations [-Wimplicit-function-declaration]
>>>>    521 |         free_irq(mb_chann->msix_irq, mb_chann);
>>>>        |         ^
>>>> drivers/accel/amdxdna/amdxdna_mailbox.c:538:2: error: call to
>>>> undeclared function 'disable_irq'; ISO C99 and later do not support
>>>> implicit function declarations [-Wimplicit-function-declaration]
>>>>    538 |         disable_irq(mb_chann->msix_irq);
>>>>        |         ^
>>>> 6 errors generated.
>>>>
>>>> With the patch applied I then got firmware issues so I had to rename
>>>> the newly upstreamed firmware, I'm not sure of the code needs to load
>>>> the versioned file or if the file needs renamed in linux-firmware
>>>>
>>>> I'm attaching my .config
>>>>
>>>> Cheers
>>>>
>>>> Mike
>>> The attachment bounced so heres a link to the .config on github
>>> https://github.com/FireBurn/KernelStuff/blob/quark/dot_config_tip
>>
>> I am able to reproduce with your .config. I believe it is because 
>> CONFIG_TRACING is disabled.
>>
>> If you are ok, I can include your fix to 
>> https://lore.kernel.org/dri-devel/20241204213729.3113941-1-lizhi.hou@amd.com/T/#t 
>
>
> It should be a separate patch, with a reported-by and a fixes tag.

I have sent out 8/8 patch to fix it. It has all the tags. Maybe it is ok 
to use it?

https://lore.kernel.org/dri-devel/20241206220001.164049-9-lizhi.hou@amd.com/


Thanks,

Lizhi

>
> -Jeff


More information about the dri-devel mailing list