From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Bingbu Cao <bingbu.cao@linux.intel.com>
Cc: bingbu.cao@intel.com, linux-media@vger.kernel.org,
sakari.ailus@linux.intel.com
Subject: Re: [PATCH 1/2] media: ipu6: fix the wrong type cast and 64-bit division
Date: Wed, 9 Oct 2024 16:16:47 +0300 [thread overview]
Message-ID: <ZwaCP253Ahgqvn0v@smile.fi.intel.com> (raw)
In-Reply-To: <6a6e8137-97f0-0af8-51b3-73e4f45e73c2@linux.intel.com>
On Wed, Oct 09, 2024 at 01:06:32PM +0800, Bingbu Cao wrote:
> On 10/8/24 11:23 PM, Andy Shevchenko wrote:
> > On Tue, Oct 08, 2024 at 02:19:15PM +0800, bingbu.cao@intel.com wrote:
> >> From: Bingbu Cao <bingbu.cao@intel.com>
...
> >> /* Shared structure between driver and FW - do not modify */
> >> struct ipu6_fw_sys_queue {
> >> - u64 host_address;
> >> + uintptr_t host_address;
> >
> > Okay, in the given semantic this probably should be phys_addr_t.
> > BUT, is this address somehow is going to be used by IPU6 hardware?
> > If "yes", the type shall not be changed.
> >
> > Looking at types used I hope the answer is "no", otherwise the types
> > in the structures should be properly choose WRT endianess (and what
> > __packed is doing here? Is it part of the protocol?).
>
> You are correct, the type here should not be changed.
Okay, so perhaps for now we can amend the code to work around 32-bit
compilation issues while leaving the type the same. Ideally this struct should
be modified to follow endianess (all those types with __le prefixes), but
that is another story.
> >> u32 vied_address;
> >> u32 size;
> >> u32 token_size;
> >> } __packed;
...
> > Side Q: What are the alignment requirements for the prog pointer?
>
> It should be 64 bytes alignment.
Okay, so in this case it's good to cast like this. Perhaps a comment should be
added at some point, because it sounds like I already asked the very same
question a while ago.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2024-10-09 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 6:19 [PATCH 1/2] media: ipu6: fix the wrong type cast and 64-bit division bingbu.cao
2024-10-08 6:19 ` [PATCH 2/2] media: ipu6: remove redundant dependency in Kconfig bingbu.cao
2024-10-08 15:24 ` Andy Shevchenko
2024-10-08 15:23 ` [PATCH 1/2] media: ipu6: fix the wrong type cast and 64-bit division Andy Shevchenko
2024-10-09 5:06 ` Bingbu Cao
2024-10-09 13:16 ` Andy Shevchenko [this message]
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=ZwaCP253Ahgqvn0v@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=bingbu.cao@intel.com \
--cc=bingbu.cao@linux.intel.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.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