1. 08 9月, 2009 1 次提交
  2. 07 9月, 2009 10 次提交
  3. 05 9月, 2009 14 次提交
  4. 03 9月, 2009 3 次提交
  5. 02 9月, 2009 5 次提交
  6. 01 9月, 2009 1 次提交
    • B
      ata_piix: parallel scanning on PATA needs an extra locking · 60c3be38
      Bartlomiej Zolnierkiewicz 提交于
      Commit log for commit 517d3cc1
      ("[libata] ata_piix: Enable parallel scan") says:
      
          This patch turns on parallel scanning for the ata_piix driver.
          This driver is used on most netbooks (no AHCI for cheap storage it seems).
          The scan is the dominating time factor in the kernel boot for these
          devices; with this flag it gets cut in half for the device I used
          for testing (eeepc).
          Alan took a look at the driver source and concluded that it ought to be safe
          to do for this driver.  Alan has also checked with the hardware team.
      
      and it is all true but once we put all things together additional
      constraints for PATA controllers show up (some hardware registers
      have per-host not per-port atomicity) and we risk misprogramming
      the controller.
      
      I used the following test to check whether the issue is real:
      
        @@ -736,8 +736,20 @@ static void piix_set_piomode(struct ata_
         			(timings[pio][1] << 8);
         	}
         	pci_write_config_word(dev, master_port, master_data);
        -	if (is_slave)
        +	if (is_slave) {
        +		if (ap->port_no == 0) {
        +			u8 tmp = slave_data;
        +
        +			while (slave_data == tmp) {
        +				pci_read_config_byte(dev, slave_port, &tmp);
        +				msleep(50);
        +			}
        +
        +			dev_printk(KERN_ERR, &dev->dev, "PATA parallel scan "
        +				   "race detected\n");
        +		}
         		pci_write_config_byte(dev, slave_port, slave_data);
        +	}
      
         	/* Ensure the UDMA bit is off - it will be turned back on if
         	   UDMA is selected */
      
      and it indeed triggered the error message.
      
      Lets fix all such races by adding an extra locking to ->set_piomode
      and ->set_dmamode methods for PATA controllers.
      
      [ Alan: would be better to take the host lock in libata-core for these
        cases so that we fix all the adapters in one swoop.  "Looks fine as a
        temproary quickfix tho" ]
      
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Cc: Jeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60c3be38
  7. 31 8月, 2009 6 次提交