qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <fan.ni@samsung.com>, <ravis.opensrc@micron.com>,
	<ajay.opensrc@micron.com>, <qemu-devel@nongnu.org>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH -qemu] hw/cxl: Use runtime for bg cmd running semantics
Date: Mon, 23 Jun 2025 15:05:40 +0100	[thread overview]
Message-ID: <20250623150540.00005450@huawei.com> (raw)
In-Reply-To: <20250617214832.579960-1-dave@stgolabs.net>

On Tue, 17 Jun 2025 14:48:32 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> The current check incorrectly misses the 0% case, which semantically
> can either be not running or one that just started. The runtime
> is a better way to check for 0%, 100% or aborted. This is currently
> benign in the kernel equivalent without cancel support.
> 
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Looks good to me. I'll carry this on my local tree for now and combine
it with some other fixes to send to MST.

Probably push out a new cxl staging tree sometime in next few weeks.
> ---
> 
> Applies against 'cxl-2025-06-10' from jic23 tree.
> 
>  hw/cxl/cxl-device-utils.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> index e150d7445762..add0ab615976 100644
> --- a/hw/cxl/cxl-device-utils.c
> +++ b/hw/cxl/cxl-device-utils.c
> @@ -95,13 +95,10 @@ static uint64_t mailbox_reg_read(void *opaque, hwaddr offset, unsigned size)
>          }
>          if (offset == A_CXL_DEV_MAILBOX_STS) {
>              uint64_t status_reg = cxl_dstate->mbox_reg_state64[offset / size];
> -            int bgop;
>  
>              qemu_mutex_lock(&cci->bg.lock);
> -            bgop = !(cci->bg.complete_pct == 100 || cci->bg.aborted);
> -
>              status_reg = FIELD_DP64(status_reg, CXL_DEV_MAILBOX_STS, BG_OP,
> -                                    bgop);
> +                                    !!cci->bg.runtime);
>              cxl_dstate->mbox_reg_state64[offset / size] = status_reg;
>              qemu_mutex_unlock(&cci->bg.lock);
>          }



      reply	other threads:[~2025-06-23 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 21:48 [PATCH -qemu] hw/cxl: Use runtime for bg cmd running semantics Davidlohr Bueso
2025-06-23 14:05 ` Jonathan Cameron via [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=20250623150540.00005450@huawei.com \
    --to=qemu-devel@nongnu.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ajay.opensrc@micron.com \
    --cc=dave@stgolabs.net \
    --cc=fan.ni@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ravis.opensrc@micron.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;
as well as URLs for NNTP newsgroup(s).