public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
	<jacek.lawrynowicz@linux.intel.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<max.zhen@amd.com>, <min.ma@amd.com>, <sonal.santan@amd.com>,
	<mario.limonciello@amd.com>
Subject: Re: [PATCH V1] accel/amdxdna: Fix incorrect PSP firmware size
Date: Wed, 4 Jun 2025 17:12:47 -0700	[thread overview]
Message-ID: <e70bdb30-66cc-7e9e-b666-efff3203bf27@amd.com> (raw)
In-Reply-To: <CADnq5_NMamTAd0whqwr+xcokFThCNX7T7qFBfX+u3vnS6oc=tA@mail.gmail.com>


On 6/4/25 07:51, Alex Deucher wrote:
> On Wed, Jun 4, 2025 at 10:42 AM Lizhi Hou <lizhi.hou@amd.com> wrote:
>> The incorrect PSP firmware size is used for initializing. It may
>> cause error for newer version firmware.
>>
>> Fixes: 8c9ff1b181ba ("accel/amdxdna: Add a new driver for AMD AI Engine")
>> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
>> ---
>>   drivers/accel/amdxdna/aie2_psp.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/accel/amdxdna/aie2_psp.c b/drivers/accel/amdxdna/aie2_psp.c
>> index dc3a072ce3b6..f28a060a8810 100644
>> --- a/drivers/accel/amdxdna/aie2_psp.c
>> +++ b/drivers/accel/amdxdna/aie2_psp.c
>> @@ -126,8 +126,8 @@ struct psp_device *aie2m_psp_create(struct drm_device *ddev, struct psp_config *
>>          psp->ddev = ddev;
>>          memcpy(psp->psp_regs, conf->psp_regs, sizeof(psp->psp_regs));
>>
>> -       psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN) + PSP_FW_ALIGN;
>> -       psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz, GFP_KERNEL);
>> +       psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN);
>> +       psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz + PSP_FW_ALIGN, GFP_KERNEL);
> Why do you need the extra PSP_FW_ALIGN in the allocation?

The start address of the firmware is also required to be PSP_FW_ALIGN 
aligned.


Thanks,

Lizhi

>
> Alex
>
>>          if (!psp->fw_buffer) {
>>                  drm_err(ddev, "no memory for fw buffer");
>>                  return NULL;
>> --
>> 2.34.1
>>

  reply	other threads:[~2025-06-05  0:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 14:32 [PATCH V1] accel/amdxdna: Fix incorrect PSP firmware size Lizhi Hou
2025-06-04 14:51 ` Alex Deucher
2025-06-05  0:12   ` Lizhi Hou [this message]
2025-06-09 13:35     ` Alex Deucher
2025-06-09 14:27       ` Lizhi Hou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e70bdb30-66cc-7e9e-b666-efff3203bf27@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=max.zhen@amd.com \
    --cc=min.ma@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox