All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Hrdina <phrdina@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 5/6] fdc_test: update media_change test
Date: Tue, 03 Jul 2012 16:43:28 +0200	[thread overview]
Message-ID: <4FF30510.7090106@redhat.com> (raw)
In-Reply-To: <4FE83483.4010204@redhat.com>

On 06/25/2012 11:50 AM, Kevin Wolf wrote:
> Am 22.06.2012 12:33, schrieb Pavel Hrdina:
>> After rewrite DSKCHG bit handling the test has to be updated. Now
>> is needed to seek to different track to clear DSKCHG bit.
>>
>> Signed-off-by: Pavel Hrdina<phrdina@redhat.com>
>> ---
>>   tests/fdc-test.c |   29 +++++++++++++++++++++--------
>>   1 files changed, 21 insertions(+), 8 deletions(-)
>>
>> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
>> index 610e2f1..5280eff 100644
>> --- a/tests/fdc-test.c
>> +++ b/tests/fdc-test.c
>> @@ -156,19 +156,20 @@ static uint8_t send_read_command(void)
>>       return ret;
>>   }
>>
>> -static void send_step_pulse(void)
>> +static void send_step_pulse(bool chg_cyl)
>>   {
>>       int drive = 0;
>>       int head = 0;
>> -    static int cyl = 0;
>> +    int cyl = 0;
>> +
>> +    if (chg_cyl)
>> +        cyl = (cyl + 1) % 4;
> Why do you remove the static? Previously, the function would cycle
> through cylinders 1-4. Now it's always 0 if !chg_cyl and 1 if chg_cyl. I
> think you need to fix this.
>
> I also don't quite understand why you move the increment to here instead
> of leaving it as the bottom. It doesn't look wrong, but pointless.
Now the functionality is different. I need seek to cylinder 0 or 1. 
After every change of media an actual cylinder is set to 0 and I need to 
try seek to cylinder 0 to test, that after this seek the DSKCHG bit is 
still set. Then I need to seek to different cylinder to reset the DSKCHG 
and for that seek to 1 is enough.

I'll chagne the

cyl = (cyl + 1) % 4; to cyl = 1;

>>
>>       floppy_send(CMD_SEEK);
>>       floppy_send(head<<  2 | drive);
>>       g_assert(!get_irq(FLOPPY_IRQ));
>>       floppy_send(cyl);
>>       ack_irq();
>> -
>> -    cyl = (cyl + 1) % 4;
>>   }
>>
>>   static uint8_t cmos_read(uint8_t reg)
>> @@ -195,8 +196,7 @@ static void test_no_media_on_start(void)
>>       assert_bit_set(dir, DSKCHG);
>>       dir = inb(FLOPPY_BASE + reg_dir);
>>       assert_bit_set(dir, DSKCHG);
>> -    send_step_pulse();
>> -    send_step_pulse();
>> +    send_step_pulse(1);
> This is a bool parameter, so you should pass true/false instead of 0/1.
>
> Other than that, the test case additions look good and I'll accept it as
> sufficient for the DSKCHG handling change. It would be great, though, to
> add some more cases that test the implicit seeks during commands like
> READ (ideally one for each command that can seek).
>
> Kevin
I'll fix the bool parameter and then I'll create new patches for more 
test cases.

Pavel

  parent reply	other threads:[~2012-07-03 14:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 10:33 [Qemu-devel] [PATCH v6 0/6] fdc: fix/rewrite seek, media_changed and interrupt handling Pavel Hrdina
2012-07-04  9:07 ` [Qemu-devel] [PATCH v7 " Pavel Hrdina
2012-06-22 10:33 ` [Qemu-devel] [PATCH v6 1/6] fdc: fix implied seek while there is no media in drive Pavel Hrdina
2012-06-22 10:33 ` [Qemu-devel] [PATCH v6 2/6] fdc-test: introduced qtest read_without_media Pavel Hrdina
     [not found] ` <3359847e9dbdf4531ed17e86ef55be8b8676e329.1340360906.git.phrdina@redhat.com>
2012-06-22 10:33   ` [Qemu-devel] [PATCH v6 3/6] fdc: rewrite seek and DSKCHG bit handling Pavel Hrdina
2012-06-22 10:33   ` [Qemu-devel] [PATCH v6 4/6] fdc: fix interrupt handling Pavel Hrdina
2012-06-22 10:33   ` [Qemu-devel] [PATCH v6 5/6] fdc_test: update media_change test Pavel Hrdina
2012-06-24  6:16     ` Blue Swirl
     [not found]     ` <4FE83483.4010204@redhat.com>
2012-07-03 14:43       ` Pavel Hrdina [this message]
2012-06-22 10:33   ` [Qemu-devel] [PATCH v6 6/6] fdc_test: introduce test_sense_interrupt Pavel Hrdina
2012-07-04  9:07   ` [Qemu-devel] [PATCH v7 5/6] fdc_test: update media_change test Pavel Hrdina
2012-07-04 14:43     ` [Qemu-devel] [PATCH v8 " Kevin Wolf
2012-07-04  9:07   ` [Qemu-devel] [PATCH v7 6/6] fdc_test: introduce test_sense_interrupt Pavel Hrdina

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=4FF30510.7090106@redhat.com \
    --to=phrdina@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.