qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] ahci: fix FIS I bit and PIO Setup FIS interrupt
Date: Fri, 22 Jun 2018 12:26:57 -0400	[thread overview]
Message-ID: <7d85b42b-89de-a8f1-c49d-945e392cf02c@redhat.com> (raw)
In-Reply-To: <7f6f37a7-538c-e7f9-5092-9ca9329153ae@redhat.com>



On 06/22/2018 04:58 AM, Paolo Bonzini wrote:
> On 21/06/2018 22:06, John Snow wrote:
>>
>> On 06/20/2018 09:25 AM, Paolo Bonzini wrote:
>>> +    pio_fis_i = is_atapi ? ad->done_atapi_packet : !is_write;
>> Per DPIOO1, does this go to false for the first DRQ block, or did I
>> misunderstand? Currently my understanding:
> 
> DPIOO1 is the !is_atapi && is_write case, where I is currently always 0.
>  When do we have more than one DRQ block, is it for multi-sector PIO
> reads?  Then perhaps we need something like ad->command->done_first_pio.
> 
> Paolo
> 

cmd_read_pio: req_nb_sectors = 1
ide_sector_read:
	sector_num = ide_get_sector(s) (LBA offset)
	n = s->nsector (1 or more sectors)
	but then we clamp it to s->req_nb_sectors, which is 1 here,
	then we build an SGlist pointed to s->io_buffer;

s->io_buffer_total_len = IDE_DMA_BUF_SECTORS*512 + 4;

Oh, actually our buffer here is quite big, 256 sectors plus four extra
bytes that Fabrice never explained.

Max request size for lba28 is going to be 256 sectors on the button, but
64K for lba48. I don't remember immediately if there is some
spec-mandated limit on how large a single DRQ block can be for PATA or SATA.

IDENTIFY Word 47 specifies how many for READ/WRITE Multiple, so I'm
intuiting here that READ/WRITE implicitly mandate one sector per DRQ block.

>> - device->host
>> 	DPIOI1
>> 	Interrupt bit shall be set.
>> - host->device:
>> 	DPIOO1:
>> 	0 for first block, 1 otherwise
>> - ATAPI:
>> 	0 for packet itself
>> 	1 for all data otherwise.
> 

-- 
—js

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 13:25 [Qemu-devel] [PATCH] ahci: fix FIS I bit and PIO Setup FIS interrupt Paolo Bonzini
2018-06-21 20:06 ` John Snow
2018-06-22  8:58   ` Paolo Bonzini
2018-06-22 16:26     ` John Snow [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=7d85b42b-89de-a8f1-c49d-945e392cf02c@redhat.com \
    --to=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --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).