qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org
Subject: Re: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function
Date: Wed, 22 Jan 2025 22:59:07 +0800	[thread overview]
Message-ID: <Z5EHu/7nEbS51IlH@intel.com> (raw)
In-Reply-To: <20250117092657.1051233-5-pbonzini@redhat.com>

On Fri, Jan 17, 2025 at 10:26:51AM +0100, Paolo Bonzini wrote:
> Date: Fri, 17 Jan 2025 10:26:51 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into
>  a separate function
> X-Mailer: git-send-email 2.47.1
> 
> Prepare for moving all references to the registers and the FIFO into a
> separate struct.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/char/pl011/src/device.rs | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)

[snip]

> -    pub fn put_fifo(&mut self, value: c_uint) {
> +    pub fn put_fifo(&mut self, value: u32) {
>          let depth = self.fifo_depth();
>          assert!(depth > 0);
>          let slot = (self.read_pos + self.read_count) & (depth - 1);
> @@ -615,12 +621,9 @@ pub fn write(&mut self, offset: hwaddr, value: u64) {
>      unsafe {
>          debug_assert!(!opaque.is_null());
>          let mut state = NonNull::new_unchecked(opaque.cast::<PL011State>());
> -        if state.as_ref().loopback_enabled() {
> -            return;
> -        }
>          if size > 0 {
>              debug_assert!(!buf.is_null());
> -            state.as_mut().put_fifo(c_uint::from(buf.read_volatile()))

An extra question...here I'm not sure, do we really need read_volatile?

> +            state.as_mut().receive(u32::from(buf.read_volatile()));
>          }
>      }
>  }

Patch is fine for me,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




  reply	other threads:[~2025-01-22 14:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-17  9:26 [PATCH 00/10] rust: pl011: correctly use interior mutability Paolo Bonzini
2025-01-17  9:26 ` [PATCH 01/10] rust: pl011: remove unnecessary "extern crate" Paolo Bonzini
2025-01-22 13:37   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 02/10] rust: pl011: hide unnecessarily "pub" items from outside pl011::device Paolo Bonzini
2025-01-22 13:39   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset Paolo Bonzini
2025-01-22 14:34   ` Zhao Liu
2025-01-22 15:00     ` Paolo Bonzini
2025-01-22 17:00       ` Zhao Liu
2025-01-17  9:26 ` [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function Paolo Bonzini
2025-01-22 14:59   ` Zhao Liu [this message]
2025-01-22 15:04     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops Paolo Bonzini
2025-01-22 16:50   ` Zhao Liu
2025-01-22 16:49     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 06/10] rust: pl011: extract PL011Registers Paolo Bonzini
2025-01-23  3:44   ` Zhao Liu
2025-01-23  8:07     ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell Paolo Bonzini
2025-01-23  5:47   ` Zhao Liu
2025-01-23  8:05     ` Paolo Bonzini
2025-01-23  9:24       ` Zhao Liu
2025-01-23 11:39         ` Paolo Bonzini
2025-01-17  9:26 ` [PATCH 08/10] rust: pl011: remove duplicate definitions Paolo Bonzini
2025-01-23  6:12   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 09/10] rust: pl011: pull device-specific code out of MemoryRegionOps callbacks Paolo Bonzini
2025-01-23  6:18   ` Zhao Liu
2025-01-17  9:26 ` [PATCH 10/10] rust: qdev: make reset take a shared reference Paolo Bonzini
2025-01-23  6:19   ` Zhao Liu

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=Z5EHu/7nEbS51IlH@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).