qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] macio ide question/bug report
Date: Wed, 14 May 2014 21:09:38 +0100	[thread overview]
Message-ID: <5373CD82.6000407@ilande.co.uk> (raw)
In-Reply-To: <alpine.LMD.2.02.1405141304100.28935@jedlik.phy.bme.hu>

On 14/05/14 12:10, BALATON Zoltan wrote:

>>> I've tried doing this and it seems that the cmd_read_toc_pma_atip
>>> function returns all right (via the case 0 path) with a 20 byte result
>>> array and calls ide_atapi_cmd_reply which takes the DMA path as
>>> s->atapi_dma is set to 1 and the error comes from somewhere during
>>> trying to DMA the result back to the client. I could not follow it so
>>> I've only got a backtrace from where ide_atapi_cmd_error is called:
>>
>> So this basically confirms that the DMA errors out because s->lba ==
>> -1 in the macio callback. FWIW you should probably ensure that
>> DEBUG_IDE_ATAPI is enabled when posting logs in future as this helps
>> show the interaction between the two systems.
>
> The logs I've posted are with DEBUG_IDE_ATAPI, DEBUG_DBDMA and
> DEBUG_MACIO already enabled...

Well sure, but not the ones in your last email - I had to go back 
several mails back into the thread to pull them out. Bear in mind the 
high volume of these lists means that a lot of people who could help 
won't have the time to do this.

>>> Do you have any idea how to debug this further or does this help to tell
>>> where is the problem? (I think the question is where does the -5 return
>>> value come from?)
>>
>> Well from this the cause is fairly easy to spot: ide_atapi_cmd_reply()
>> sets s->lba == -1 when called from cmd_read_toc_pma_atip(). And since
>> as you correctly point out this is a DMA request, it invokes the
>> start_dma function in macio's dbdma_ops (ide_dbdma_start), which kicks
>> the DBDMA engine into life.
>>
>> I think the issue here is related to the fact that reading a TOC
>> doesn't actually involve reading physical blocks from disk (as the TOC
>> is placed directly in the buffer) and so the dma_bdrv_* functions
>> shouldn't actually be invoked in the first place. And because of the
>> DBDMA setup, ide_atapi_cmd_read_dma_cb() can't be used which is why
>> pmac_ide_transfer_cb() needs to do a lot of similar work itself. Maybe
>> you can find some clues there as to what the logic should be?
>
> I'm afraid I still can't understand it. Is there a way to trace the path
> after DBDMA engine is kicked? Where should I break to get some insight
> on what is happening? (Maybe it's a dbdma bug not a macio one.)

Which part is it that's still confusing you? Putting breakpoints on 
pmac_ide_transfer() and pmac_ide_atapi_transfer_cb() will show you the 
iterations on each DMA request (be sure to compare against a "known 
good" example to understand how it should work first). If you can give 
more detail as to which bits are confusing, I will try my best to 
explain them.


ATB,

Mark.

  reply	other threads:[~2014-05-14 20:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LMD.2.02.1405040120250.2612@jedlik.phy.bme.hu>
     [not found] ` <5366CA94.3030803@ilande.co.uk>
     [not found]   ` <alpine.LMD.2.02.1405071132470.25770@jedlik.phy.bme.hu>
     [not found]     ` <536A328F.6070100@ilande.co.uk>
     [not found]       ` <alpine.LMD.2.02.1405071854390.26524@jedlik.phy.bme.hu>
     [not found]         ` <536A6F3C.1030708@ilande.co.uk>
2014-05-10 12:30           ` [Qemu-devel] [Qemu-ppc] macio ide question/bug report BALATON Zoltan
2014-05-12 16:26             ` Mark Cave-Ayland
2014-05-12 19:32               ` BALATON Zoltan
2014-05-12 20:34                 ` Mark Cave-Ayland
2014-05-13 23:02                   ` BALATON Zoltan
2014-05-14  4:55                     ` Mark Cave-Ayland
2014-05-14 11:10                       ` BALATON Zoltan
2014-05-14 20:09                         ` Mark Cave-Ayland [this message]
2014-05-14 23:21                           ` BALATON Zoltan
2014-05-15  9:30                             ` Mark Cave-Ayland
2014-05-15 17:28                               ` BALATON Zoltan
2014-05-15 19:22                                 ` Mark Cave-Ayland
2014-05-15 20:14                                   ` BALATON Zoltan
2014-05-15 20:26                                     ` BALATON Zoltan
2014-05-15 20:28                                       ` BALATON Zoltan
2014-05-16 11:22                                         ` Mark Cave-Ayland
2014-05-16 20:31                                           ` BALATON Zoltan

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=5373CD82.6000407@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=agraf@suse.de \
    --cc=balaton@eik.bme.hu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).