Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/arm64/imx9 Usb driver cache #289

Closed
wants to merge 1 commit into from
Closed

Conversation

joukkone
Copy link

Modify cache clean/invalidate to get
mass-storage transfer work (WIP)

Summary

Impact

Testing

@joukkone joukkone requested a review from jlaitine September 25, 2024 10:41
Modify cache clean/invalidate to get
mass-storage transfer work (WIP)

Signed-off-by: Jouni Ukkonen <[email protected]>
@@ -764,6 +765,9 @@ static inline void imx9_writedtd(struct imx9_dtd_s *dtd,
const uint8_t *data,
uint32_t nbytes)
{
up_invalidate_dcache((uintptr_t)data,

Choose a reason for hiding this comment

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

This shouldn't be needed, the same is done below

@@ -776,8 +780,9 @@ static inline void imx9_writedtd(struct imx9_dtd_s *dtd,

up_clean_dcache((uintptr_t)dtd,
(uintptr_t)dtd + sizeof(struct imx9_dtd_s));
up_clean_dcache((uintptr_t)data,
(uintptr_t)data + nbytes);

Choose a reason for hiding this comment

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

I believe the original line is correct, except for CACHE_ALIGN_UP.

The *3 should not be needed

Perhaps the whole buffer should be invalidated (or cleaned) when it is allocated in imx9_epallocbuffer.

up_invalidate_dcache((uintptr_t)dtd->buffer0,
(uintptr_t)dtd->buffer0 + dtd->xfer_len);
(uintptr_t)dtd->buffer0 + CACHE_ALIGN_UP(dtd->xfer_len));
Copy link

@jlaitine jlaitine Sep 25, 2024

Choose a reason for hiding this comment

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

This part is fishy at best :) Just add the CACHE_ALIGN_UP(), and remove the additional lines below.

buffer1,2,3,4 are adjacent, so if xfer_len is longer than 1 first buffer, then next ones are just invalidated

@joukkone joukkone closed this Oct 3, 2024
@joukkone joukkone deleted the imx9_usb_cache branch October 3, 2024 06:55
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.

2 participants