qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] ahci: fix FIS I bit and PIO Setup FIS interrupt
Date: Fri, 22 Jun 2018 23:06:25 +0200	[thread overview]
Message-ID: <99e7e292-4fb4-7ce1-b69d-b69ee352abec@redhat.com> (raw)
In-Reply-To: <5de1e7ce-a0ef-f4a8-45af-bfd7e7d68d30@redhat.com>

On 22/06/2018 21:07, John Snow wrote:
>> @@ -1251,6 +1249,7 @@ static void handle_reg_h2d_fis(AHCIState *s, int port,
>>  
>>      /* Copy the ACMD field (ATAPI packet, if any) from the AHCI command
>>       * table to ide_state->io_buffer */
>> +    s->dev[port].done_first_drq = false;
> 
> If you don't mind I'm going to shift this down so that it's beneath the
> ATAPI section, just before the ide_exec_cmd call alongside all of the
> other reset/init calls.

It's okay if the tests pass. :)

>> @@ -883,19 +879,24 @@ AHCICommand *ahci_command_create(uint8_t command_name)
>>      return cmd;
>>  }
>>  
>> -AHCICommand *ahci_atapi_command_create(uint8_t scsi_cmd, uint16_t bcl)
>> +AHCICommand *ahci_atapi_command_create(uint8_t scsi_cmd, uint16_t bcl, bool dma)
>>  {
>>      AHCICommand *cmd = ahci_command_create(CMD_PACKET);
>>      cmd->atapi_cmd = g_malloc0(16);
>>      cmd->atapi_cmd[0] = scsi_cmd;
>>      stw_le_p(&cmd->fis.lba_lo[1], bcl);
>> +    if (dma) {
>> +        ahci_command_enable_atapi_dma(cmd);
>> +    } else {
>> +        cmd->interrupts |= bcl ? AHCI_PX_IS_PSS : 0;
>> +    }
> 
> Why are we gating on the DRQ byte count limit?
> 
> (Oh, I guess it CAN'T be zero if we expect to transfer any data, so this
> assumption is good to test if we expect to see even a single DRQ block.)

This is ATAPI, so "having a PIO Setup FIS with I=1" is the same as
"having >1 PIO Setup FIS's" (data direction doesn't matter) and in turn
that is the same as "having some bytes to transfer while DMA is off".

Thanks,

Paolo

  reply	other threads:[~2018-06-22 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 16:51 [Qemu-devel] [PATCH v2] ahci: fix FIS I bit and PIO Setup FIS interrupt Paolo Bonzini
2018-06-22 19:07 ` John Snow
2018-06-22 21:06   ` Paolo Bonzini [this message]
2018-06-22 21:12     ` John Snow
2018-06-22 19:39 ` John Snow

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=99e7e292-4fb4-7ce1-b69d-b69ee352abec@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@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).