Skip to content

Make AIE PSP code common for aie2 and aie4#1119

Open
donwalkarsoham wants to merge 8 commits intoamd:mainfrom
donwalkarsoham:dev_patch_3-4
Open

Make AIE PSP code common for aie2 and aie4#1119
donwalkarsoham wants to merge 8 commits intoamd:mainfrom
donwalkarsoham:dev_patch_3-4

Conversation

@donwalkarsoham
Copy link

Problem solved by the commit
Add common psp code for both aie2 and aie4

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
N/A

How problem was solved, alternative solutions (if any) and why they were rejected
1> Removed duplicates and merged common code.

Risks (if any) associated the changes in the commit
Should be backward compatible

What has been tested and how, request additional testing if necessary
1> Driver installation successful.

Documentation impact (if any)
N/A

Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
@AMDGithubSCIMAdmin
Copy link

Can one of the admins verify this patch?

@xdavidz
Copy link
Contributor

xdavidz commented Feb 26, 2026

ok to test

hlaccabu
hlaccabu previously approved these changes Feb 27, 2026
Copy link
Contributor

@hlaccabu hlaccabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

return aie2_psp_waitmode_poll(ndev->psp_hdl);
return aie_psp_waitmode_poll(ndev->psp_hdl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is aie2 only, so keep it as aie2_psp_waitmode_poll

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the implementations of aie2_psp_waitmode_poll() and aie4_psp_waitmode_poll() is identical hence made a common function for both platforms

Copy link
Contributor

@xdavidz xdavidz Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the implementations of aie2_psp_waitmode_poll() and aie4_psp_waitmode_poll() is identical hence made a common function for both platforms

aie4 doesn't use this api.
For upstreaming, we try not to move code around when it is not necessary.

I'd like to hold off my review for now. Please re-sync with the latest patches and update your PRs please.

including aie_message, aie_smu and aie_psp PRs.

Copy link
Author

@donwalkarsoham donwalkarsoham Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, makes sense. Working on integrating latest patches

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced with latest upstream patch as well as rebased the commit on top of other changes added to the driver.
Addressed above comments in the latest version.

void __iomem *tbl[PCI_NUM_RESOURCES] = {0};
struct amdxdna_dev_hdl *ndev;
struct psp_config psp_conf;
struct psp_config psp_conf = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not init it, community doesn't like this because it takes extra space to init, this will be init later when it is used.

please sync with my latest upstream patch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it. Will remove this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced with latest upstream patch as well as rebased the commit on top of other changes added to the driver.
Addressed above comments in the latest version.

donwalkarsoham and others added 2 commits March 2, 2026 15:48
Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
@donwalkarsoham donwalkarsoham requested a review from xdavidz March 3, 2026 04:06
return psp;
}

void aie_psp_destroy(struct device *dev, struct psp_device *psp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a 3rd comment to make xen based code in common, please take this out as a separate PR.

Copy link
Author

@donwalkarsoham donwalkarsoham Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back aie2_psp_destroy() and removed common aie_psp_destroy() in latest version

@NishadSaraf
Copy link
Member

retest this please

Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
@donwalkarsoham donwalkarsoham requested a review from xdavidz March 3, 2026 20:26
Signed-off-by: Soham Donwalkar <soham.donwalkar@amd.com>
#include "aie_common.h"
#include "amdxdna_xen.h"

struct psp_device *aie_psp_create(struct device *dev, struct psp_config *conf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name should be aiem_psp_create. Why because it is using drmm_zalloc.
your code is not up to data.

Please fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants