qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fea Wang <fea.wang@sifive.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	 Alistair Francis <alistair@alistair23.me>,
	Peter Maydell <peter.maydell@linaro.org>,
	 Jason Wang <jasowang@redhat.com>,
	"open list:Xilinx Zynq" <qemu-arm@nongnu.org>
Subject: Re: [PATCH 2/4] hw/dma: Break the loop when loading descriptions fails
Date: Tue, 4 Jun 2024 14:52:02 +0800	[thread overview]
Message-ID: <CAKhCfsfnDK9A0hpV4cUQMfhg3VBS7_tzbZy783Q3xcePGZefJA@mail.gmail.com> (raw)
In-Reply-To: <CAJy5ezp6pkpEqCHc+ggXi+-VR+u+3HKyn5inzasyqBR9FaGiog@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1851 bytes --]

Hi Edgar,
thank you for the advice, I will squash them in the next version of the
patch series.

Sincerely,
Fea

On Mon, Jun 3, 2024 at 6:21 PM Edgar E. Iglesias <edgar.iglesias@gmail.com>
wrote:

> On Mon, Jun 3, 2024 at 7:48 AM Fea.Wang <fea.wang@sifive.com> wrote:
>
>> When calling the loading a description function, it should be noticed
>> that the function may return a failure value. Breaking the loop is one
>> of the possible ways to handle it.
>>
>> Signed-off-by: Fea.Wang <fea.wang@sifive.com>
>>
>
>
> Looks good, a nitpick comment, I would either squash this with patch #1
> or move the change to return of error code in stream_desc_load() to this
> patch.
>
>
>
>
>> ---
>>  hw/dma/xilinx_axidma.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
>> index 4b475e5484..b8ab5a423d 100644
>> --- a/hw/dma/xilinx_axidma.c
>> +++ b/hw/dma/xilinx_axidma.c
>> @@ -291,7 +291,9 @@ static void stream_process_mem2s(struct Stream *s,
>> StreamSink *tx_data_dev,
>>      }
>>
>>      while (1) {
>> -        stream_desc_load(s, s->regs[R_CURDESC]);
>> +        if (MEMTX_OK != stream_desc_load(s, s->regs[R_CURDESC])) {
>> +            break;
>> +        }
>>
>>          if (s->desc.status & SDESC_STATUS_COMPLETE) {
>>              s->regs[R_DMASR] |= DMASR_HALTED;
>> @@ -348,7 +350,9 @@ static size_t stream_process_s2mem(struct Stream *s,
>> unsigned char *buf,
>>      }
>>
>>      while (len) {
>> -        stream_desc_load(s, s->regs[R_CURDESC]);
>> +        if (MEMTX_OK != stream_desc_load(s, s->regs[R_CURDESC])) {
>> +            break;
>> +        }
>>
>>          if (s->desc.status & SDESC_STATUS_COMPLETE) {
>>              s->regs[R_DMASR] |= DMASR_HALTED;
>> --
>> 2.34.1
>>
>>

[-- Attachment #2: Type: text/html, Size: 2837 bytes --]

  reply	other threads:[~2024-06-04  6:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  5:52 [PATCH 0/4] hw/dma: Add error handling for loading descriptions failing Fea.Wang
2024-06-03  5:52 ` [PATCH 1/4] hw/dma: Enhance error handling in loading description Fea.Wang
2024-06-03 10:18   ` Edgar E. Iglesias
2024-06-04  6:41     ` Fea Wang
2024-06-04  7:00   ` Frank Chang
2024-06-03  5:52 ` [PATCH 2/4] hw/dma: Break the loop when loading descriptions fails Fea.Wang
2024-06-03 10:21   ` Edgar E. Iglesias
2024-06-04  6:52     ` Fea Wang [this message]
2024-06-04  7:00   ` Frank Chang
2024-06-03  5:52 ` [PATCH 3/4] hw/dma: Add a trace log for a description loading failure Fea.Wang
2024-06-03 10:22   ` Edgar E. Iglesias
2024-06-04  7:01   ` Frank Chang
2024-06-03  5:52 ` [PATCH 4/4] hw/net: Fix the transmission return size Fea.Wang
2024-06-03 10:31   ` Edgar E. Iglesias
2024-06-04  6:57     ` Fea Wang
2024-06-04  7:01   ` Frank Chang

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=CAKhCfsfnDK9A0hpV4cUQMfhg3VBS7_tzbZy783Q3xcePGZefJA@mail.gmail.com \
    --to=fea.wang@sifive.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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).