From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
pbonzini@redhat.com, fam@euphon.net, laurent@vivier.eu,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 02/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase()
Date: Wed, 13 Mar 2024 12:03:17 +0100 [thread overview]
Message-ID: <9c36ddab-59a9-47fa-ab2e-ab0e9cff5fb6@linaro.org> (raw)
In-Reply-To: <20240313085810.2655062-3-mark.cave-ayland@ilande.co.uk>
On 13/3/24 09:57, Mark Cave-Ayland wrote:
> The aim is to restrict the esp_fifo_*() functions so that they only operate on
> the hardware FIFO. When reading from cmdfifo in do_message_phase() use the
> underlying Fifo8 functions directly.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/scsi/esp.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index f8230c74b3..100560244b 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -309,6 +309,8 @@ static void do_command_phase(ESPState *s)
>
> static void do_message_phase(ESPState *s)
> {
> + uint32_t n;
> +
> if (s->cmdfifo_cdb_offset) {
> uint8_t message = esp_fifo_pop(&s->cmdfifo);
>
> @@ -320,7 +322,10 @@ static void do_message_phase(ESPState *s)
> /* Ignore extended messages for now */
> if (s->cmdfifo_cdb_offset) {
> int len = MIN(s->cmdfifo_cdb_offset, fifo8_num_used(&s->cmdfifo));
> - esp_fifo_pop_buf(&s->cmdfifo, NULL, len);
> +
> + if (len) {
> + fifo8_pop_buf(&s->cmdfifo, len, &n);
'n' is unused, use NULL?
> + }
> s->cmdfifo_cdb_offset = 0;
> }
> }
next prev parent reply other threads:[~2024-03-13 11:04 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-13 8:57 [PATCH v2 00/16] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine Mark Cave-Ayland
2024-03-13 8:57 ` [PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase() Mark Cave-Ayland
2024-03-13 11:03 ` Philippe Mathieu-Daudé
2024-03-13 21:08 ` Mark Cave-Ayland
2024-03-13 21:40 ` Philippe Mathieu-Daudé
2024-03-13 8:57 ` [PATCH v2 02/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase() Mark Cave-Ayland
2024-03-13 11:03 ` Philippe Mathieu-Daudé [this message]
2024-03-13 21:41 ` Philippe Mathieu-Daudé
2024-03-13 8:57 ` [PATCH v2 03/16] esp.c: replace cmdfifo use of esp_fifo_pop() " Mark Cave-Ayland
2024-03-13 10:51 ` Philippe Mathieu-Daudé
2024-03-13 8:57 ` [PATCH v2 04/16] esp.c: change esp_fifo_push() to take ESPState Mark Cave-Ayland
2024-03-13 10:53 ` Philippe Mathieu-Daudé
2024-03-13 8:57 ` [PATCH v2 05/16] esp.c: change esp_fifo_pop() " Mark Cave-Ayland
2024-03-13 10:52 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 06/16] esp.c: use esp_fifo_push() instead of fifo8_push() Mark Cave-Ayland
2024-03-13 10:53 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 07/16] esp.c: change esp_fifo_pop_buf() to take ESPState Mark Cave-Ayland
2024-03-13 10:54 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 08/16] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO Mark Cave-Ayland
2024-03-13 10:56 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 09/16] esp.c: don't assert() if FIFO empty when executing non-DMA SELATNS Mark Cave-Ayland
2024-03-13 10:56 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 10/16] esp.c: don't assert() if FIFO empty when executing esp_cdb_length() Mark Cave-Ayland
2024-03-13 8:58 ` [PATCH v2 11/16] esp.c: don't overflow cmdfifo if cmdfifo_cdb_offset >= ESP_CMDFIFO_SZ Mark Cave-Ayland
2024-03-13 8:58 ` [PATCH v2 12/16] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file Mark Cave-Ayland
2024-03-13 10:58 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 13/16] esp.c: introduce esp_update_drq() and update esp_fifo_{push, pop}_buf() to use it Mark Cave-Ayland
2024-03-13 11:01 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 14/16] esp.c: update esp_fifo_{push, pop}() to call esp_update_drq() Mark Cave-Ayland
2024-03-13 11:01 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 15/16] esp.c: ensure esp_pdma_write() always calls esp_fifo_push() Mark Cave-Ayland
2024-03-13 11:05 ` Philippe Mathieu-Daudé
2024-03-13 8:58 ` [PATCH v2 16/16] esp.c: remove explicit setting of DRQ within ESP state machine Mark Cave-Ayland
2024-03-13 11:01 ` Philippe Mathieu-Daudé
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=9c36ddab-59a9-47fa-ab2e-ab0e9cff5fb6@linaro.org \
--to=philmd@linaro.org \
--cc=fam@euphon.net \
--cc=laurent@vivier.eu \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).