[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200803152257.10439.bzolnier@gmail.com>
Date: Sat, 15 Mar 2008 22:57:10 +0100
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To: Sergei Shtylyov <sshtylyov@...mvista.com>
Cc: linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] ide: sanitize handling of IDE_HFLAG_NO_SET_MODE host flag
Hi,
On Wednesday 12 March 2008, Sergei Shtylyov wrote:
> Hello.
>
> Bartlomiej Zolnierkiewicz wrote:
>
> > * Check for IDE_HFLAG_NO_SET_MODE host flag in ide_set_pio(),
> > ide_set_[pio,dma]_mode(), ide_set_xfer_rate() and set_pio_mode().
>
> > * Remove no longer needed IDE_HFLAG_NO_SET_MODE host flag checking
> > from ide_tune_dma().
>
> > * Remove superfluous ->set_pio_mode checking from do_special().
>
> > This is a part of preparations for adding 'struct ide_port_ops'.
>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
>
> > Index: b/drivers/ide/ide-lib.c
> > ===================================================================
> > --- a/drivers/ide/ide-lib.c
> > +++ b/drivers/ide/ide-lib.c
> > @@ -353,6 +354,9 @@ int ide_set_pio_mode(ide_drive_t *drive,
> > {
> > ide_hwif_t *hwif = drive->hwif;
> >
> > + if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
> > + return 0;
> > +
>
> Shouldn't this be considered an error?
Nope, we want to cheat kernel-level PIO tuning into succeeding. ;)
[ This host flag is used by it821x in "smart" mode so HW takes care of
tuning transfer mode on controller / device itself. ]
> > if (hwif->set_pio_mode == NULL)
> > return -1;
> >
> > @@ -380,6 +384,9 @@ int ide_set_dma_mode(ide_drive_t *drive,
> > {
> > ide_hwif_t *hwif = drive->hwif;
> >
> > + if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
> > + return 0;
> > +
>
> Same here....
same for DMA tuning
> > if (hwif->set_dma_mode == NULL)
> > return -1;
> >
> > @@ -410,7 +417,8 @@ int ide_set_xfer_rate(ide_drive_t *drive
> > {
> > ide_hwif_t *hwif = drive->hwif;
> >
> > - if (hwif->set_dma_mode == NULL)
> > + if (hwif->set_dma_mode == NULL ||
> > + (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
> > return -1;
>
> Hm, this is was not considered an error before...
Yep, but transfer mode changes are unsupported on it821x in "smart" mode.
PS Thanks for detailed review of 'struct ide_dma_ops' patch
(I'll recast the patch as soon as possible, hopefully tomorrow).
Thanks,
Bart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists