lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Oct 2008 20:22:44 +0200
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 09/18] ide: add ->set_irq method

On Wednesday 15 October 2008, Sergei Shtylyov wrote:
> Hello.
> 
> Bartlomiej Zolnierkiewicz wrote:
> 
> > Add ->set_irq method for setting nIEN bit of ATA Device Control
> > register and use it instead of ide_set_irq().
> >
> > While at it:
> >
> > * Use ->set_irq in init_irq() and do_reset1().
> >
> > * Don't use HWIF() macro in ide_check_pm_state().
> >
> > There should be no functional changes caused by this patch.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> >   
> [...]
> > Index: b/drivers/ide/ide-iops.c
> > ===================================================================
> > --- a/drivers/ide/ide-iops.c
> > +++ b/drivers/ide/ide-iops.c
> > @@ -135,6 +135,23 @@ static u8 ide_read_sff_dma_status(ide_hw
> >  		return inb(hwif->dma_base + ATA_DMA_STATUS);
> >  }
> >  
> > +static void ide_set_irq(ide_hwif_t *hwif, int on)
> > +{
> > +	u8 ctl = ATA_DEVCTL_OBS;
> > +
> > +	if (on == 4) { /* hack for SRST */
> > +		ctl |= 4;
> > +		on &= ~4;
> > +	}
> > +
> > +	ctl |= on ? 0 : 2;
> > +
> > +	if (hwif->host_flags & IDE_HFLAG_MMIO)
> > +		writeb(ctl, (void __iomem *)hwif->io_ports.ctl_addr);
> > +	else
> > +		outb(ctl, hwif->io_ports.ctl_addr);
> > +}
> > +
> >  static void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
> >  {
> >  	ide_hwif_t *hwif = drive->hwif;
> >   
> [...]
> > @@ -1162,16 +1180,15 @@ static ide_startstop_t do_reset1 (ide_dr
> >  	 * immediate interrupt due to the edge transition it produces.
> >  	 * This single interrupt gives us a "fast poll" for drives that
> >  	 * recover from reset very quickly, saving us the first 50ms wait time.
> > +	 *
> > +	 * TODO: add ->softreset method and stop abusing ->set_irq
> >  	 */
> >  	/* set SRST and nIEN */
> > -	hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | 6, io_ports->ctl_addr);
> > +	hwif->set_irq(hwif, 4);
> >  	/* more than enough time */
> >  	udelay(10);
> 
>    It seems to me that the whole idea of having 2 separate methods for 
> writing the single device control register is a wrong idea.
> I'm suggesting to convert set_irq() method to write_devctrl() method and 
> pass the register value directly to it.

Makes sense.  Care to make a patch?
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ