From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
pbonzini@redhat.com, fam@euphon.net, laurent@vivier.eu,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()
Date: Wed, 13 Mar 2024 21:08:20 +0000 [thread overview]
Message-ID: <bcd010a7-c09c-483c-9ebb-0e75be578545@ilande.co.uk> (raw)
In-Reply-To: <c0a5a1cc-a6bb-4856-a708-d19195aacb9f@linaro.org>
On 13/03/2024 11:03, Philippe Mathieu-Daudé wrote:
> 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_command_phase() use the
>> underlying Fifo8 functions directly.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>> hw/scsi/esp.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
>> index 590ff99744..f8230c74b3 100644
>> --- a/hw/scsi/esp.c
>> +++ b/hw/scsi/esp.c
>> @@ -265,7 +265,7 @@ static void esp_do_nodma(ESPState *s);
>> static void do_command_phase(ESPState *s)
>> {
>> - uint32_t cmdlen;
>> + uint32_t cmdlen, n;
>> int32_t datalen;
>> SCSIDevice *current_lun;
>> uint8_t buf[ESP_CMDFIFO_SZ];
>> @@ -275,7 +275,7 @@ static void do_command_phase(ESPState *s)
>> if (!cmdlen || !s->current_dev) {
>> return;
>> }
>> - esp_fifo_pop_buf(&s->cmdfifo, buf, cmdlen);
>> + memcpy(buf, fifo8_pop_buf(&s->cmdfifo, cmdlen, &n), cmdlen);
>
> 'n' is unused, use NULL?
I was sure I had tried that before and it had failed, but I see that you made it work
with NULL in commit cd04033dbe ("util/fifo8: Allow fifo8_pop_buf() to not populate
popped length") - thanks!
I'll make the change for v3, but I'll wait a couple of days first to see if there are
any further comments, in particular R-B tags for patches 10 and 11.
>> current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, s->lun);
>> if (!current_lun) {
ATB,
Mark.
next prev parent reply other threads:[~2024-03-13 21:09 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 [this message]
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é
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=bcd010a7-c09c-483c-9ebb-0e75be578545@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=fam@euphon.net \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--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).