All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Enable writing to ATA devices, fix several bugs
Date: Thu, 03 Jul 2008 16:50:11 -0400	[thread overview]
Message-ID: <1215118211.2734.8.camel@dv> (raw)
In-Reply-To: <87lk0i6cxo.fsf@xs4all.nl>

On Thu, 2008-07-03 at 20:27 +0200, Marco Gerards wrote:

> The more patches I get, the better ;-)
> 
> > ChangeLog:
> >
> > 	* disk/ata.c (grub_ata_pio_write): Check status before writing,
> > 	like we do in grub_ata_pio_read().
> >
> > 	(grub_ata_readwrite): Always write individual sectors.  Fix the
> > 	sector count for the remainder.
> 
> Why?

Because we do it elsewhere.  I assume you forgot to convert the code for
writing, but you meant to do it:

r1335 | marco_g | 2007-11-03 08:25:19 -0400 (Sat, 03 Nov 2007) | 6 lines

2007-11-03  Marco Gerards  <marco@gnu.org>

        * disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and
        grub_ata_pio_write once for every single sector, instead of for
        multiple sectors.

I guess it's safer.  We can explore some optimization, but first we
should make it reliable.

> > 	(grub_ata_write): Enable writing to ATA devices.  Correctly
> > 	report error for ATAPI devices.

> Great!  Did you test this?

Yes, I tested this part.  env_save didn't report any error originally,
so I introduced grub_error(), and env_save started reporting the error.
Then I enabled writing and tested it in qemu.

I cannot get the ata module to recognize the hard drive on my test
machine, so more work is needed to test it on the real hardware.

> If you can fix Roberts comment, it would be great!  Can you commit it
> afterwards?

Sure.

If you check Linux include/linux/ata.h, 1 is ATA_ERR, and we really need
ata_ok(), which checks multiple flags.  So it's clearly material for a
separate patch.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2008-07-03 20:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03  0:17 [PATCH] Enable writing to ATA devices, fix several bugs Pavel Roskin
2008-07-03 14:10 ` Robert Millan
2008-07-03 18:27 ` Marco Gerards
2008-07-03 20:50   ` Pavel Roskin [this message]
2008-07-04 11:50     ` Marco Gerards
2008-07-04 17:07       ` Pavel Roskin
2008-07-20 18:55         ` Marco Gerards
2008-07-20 20:24           ` Pavel Roskin
2008-07-21 12:49             ` Marco Gerards
2008-07-21 13:19               ` Javier Martín
2008-07-21 15:20                 ` Marco Gerards
2008-07-21 15:33                   ` Javier Martín
2008-07-21 15:56                     ` Marco Gerards
2008-07-21 15:41                   ` Pavel Roskin
2008-07-21 15:53                     ` Marco Gerards
2008-07-21 16:00                       ` Pavel Roskin
2008-07-21 16:10                         ` Marco Gerards

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=1215118211.2734.8.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.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.