linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* set pio timing in pata_atiixp.c
@ 2008-04-18  5:21 Edward Shao
  2008-04-18  6:30 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Edward Shao @ 2008-04-18  5:21 UTC (permalink / raw)
  To: linux-ide

Hi all,
I read linux-2.6.25 stable

In function drivers/ata/pata_atiixp.c:atiixp_set_pio_timing()
	I see
 	pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
	pio_mode_data &= ~(0xFF << timing_shift);
	pio_mode_data |= (pio_timings[pio] << timing_shift);
	pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);

	but I think it should be

 	pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
	pio_timing_data &= ~(0xFF << timing_shift);
	pio_timing_data |= (pio_timings[pio] << timing_shift);
	pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);
	
	and I right?
-- 
Best Regards,
Edward

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: set pio timing in pata_atiixp.c
  2008-04-18  5:21 set pio timing in pata_atiixp.c Edward Shao
@ 2008-04-18  6:30 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-04-18  6:30 UTC (permalink / raw)
  To: Edward Shao; +Cc: linux-ide, Alan Cox

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

Edward Shao wrote:
> Hi all,
> I read linux-2.6.25 stable
> 
> In function drivers/ata/pata_atiixp.c:atiixp_set_pio_timing()
> 	I see
>  	pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
> 	pio_mode_data &= ~(0xFF << timing_shift);
> 	pio_mode_data |= (pio_timings[pio] << timing_shift);
> 	pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);
> 
> 	but I think it should be
> 
>  	pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
> 	pio_timing_data &= ~(0xFF << timing_shift);
> 	pio_timing_data |= (pio_timings[pio] << timing_shift);
> 	pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);

Yes, it certainly appears you noticed a bug...

Presumably the attached patch fixes?

	Jeff




[-- Attachment #2: patch.atiixp-fix --]
[-- Type: text/plain, Size: 677 bytes --]

diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 408bdc1..780144f 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -93,8 +93,8 @@ static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev,
 	pci_write_config_word(pdev, ATIIXP_IDE_PIO_MODE, pio_mode_data);
 
 	pci_read_config_word(pdev, ATIIXP_IDE_PIO_TIMING, &pio_timing_data);
-	pio_mode_data &= ~(0xFF << timing_shift);
-	pio_mode_data |= (pio_timings[pio] << timing_shift);
+	pio_timing_data &= ~(0xFF << timing_shift);
+	pio_timing_data |= (pio_timings[pio] << timing_shift);
 	pci_write_config_word(pdev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-18  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18  5:21 set pio timing in pata_atiixp.c Edward Shao
2008-04-18  6:30 ` Jeff Garzik

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).