21 Sep, 2009

1 commit


18 Sep, 2009

6 commits

  • This is a new pata driver for ARTOP 867X 64bit 4-channel UDMA133 ATA ctrls.
    Based on the Atp867 data sheet rev 1.2, Acard, and in part on early ide codes
    from Eric Uhrhane .

    Signed-off-by: John(Jung-Ik) Lee
    Reviewed-by: Grant Grundler
    Reviewed-by: Gwendal Gringo
    Signed-off-by: Jeff Garzik

    John(Jung-Ik) Lee
     
  • On a Compaq Presario V3000 laptop (NVIDIA MCP51 chipset), pata_amd selects
    PIO0 mode for the PATA DVD-RAM drive instead of MWDMA2 which it supports:

    ata4.00: ATAPI: HL-DT-ST DVDRAM GSA-4084N, KQ09, max MWDMA2
    ata4: nv_mode_filter: 0x39f&0x7001->0x1, BIOS=0x0 (0x0) ACPI=0x7001 (60:600:0x11)
    ata4.00: configured for PIO0

    For some reason, the BIOS-set UDMA configuration returns 0 and the ACPI _GTM
    reports that UDMA2 and PIO0 are enabled. This causes nv_mode_filter to end up
    allowing only PIO0 and UDMA0-2. Since the drive doesn't support UDMA we end up
    using PIO0.

    Since the controllers should always support PIO4, MWDMA2 and UDMA2 regardless
    of what cable type is used, let's make sure we don't filter out these modes
    regardless of what wacky settings the BIOS is using.

    Signed-off-by: Robert Hancock
    Cc: stable@kernel.org
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • sata_promise's reset code has deviated quite a bit from
    the Promise reference driver's, and it has been observed
    to fail to recover from errors in some cases.

    This patch thus updates the reset code to more closely
    match the reference driver:

    - soft reset (pdc_reset_port):
    * wait for ATA engine to not be in packet command mode
    (2nd gen only)
    * write reset bit in PDC_CTLSTAT before the first read
    in the loop
    * for 2nd gen SATA follow up with FPDMA reset and clearing
    error status registers
    - hard reset (pdc_sata_hardreset):
    * wait for ATA engine to not be in packet command mode
    (2nd gen only)
    * reset ATA engine via the PCI control register
    * Tejun's change to use non-waiting hardreset + follow-up SRST

    I'm not changing the hotplug mask bits since they are taken care
    of by sata_promise's ->freeze() and ->thaw() operations. And I'm
    not writing the PMP port # because that's always zero (for now).

    Tested here on various controllers. In particular, one disk
    which used to timeout and fail to recover from certain hdparm
    and smartmonctl commands now works nicely.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Jeff Garzik

    Mikael Pettersson
     
  • 1st generation Promise SATA chips are prone to generating spurious
    hotplug events which can disrupt normal operation. This has been
    observed on 20376 and 20378 chips. This patch thus disables hotplug
    support on 1st gen chips while leaving it enabled for 2nd gen chips.

    The pdc_sata_hotplug_offset() function becomes redundant so it is
    removed.

    Tested on 1st gen 20376 and 20378 mainboard chips and on a 2nd gen
    SATA300 PCI card.

    Signed-off-by: Mikael Pettersson
    Tested-by: Kurt Roeckx
    Signed-off-by: Jeff Garzik

    Mikael Pettersson
     
  • Commit 54c38444fad6a99b4b19512f8f0055d69115e69e makes libata abort qcs
    after the port is frozen. This is necessary to guarantee that TF
    registers are accessed after the DMA engine is shutdown after an
    error. However, this triggers WARN_ON_ONCE() check in
    ata_qc_complete() spuriously. Move WARN_ON_ONCE() downwards such that
    failing commands while frozen doesn't trigger it.

    Signed-off-by: Tejun Heo
    Cc: stable
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Commit a5bfc4714b3f01365aef89a92673f2ceb1ccf246 dropped explicit
    pci_intx() manipulation from ahci because it seemed unnecessary and
    ahci doesn't seem to be the right place to be tweaking it if it were.
    This was largely okay but there are exceptions. There was one on an
    embedded platform which was fixed via firmware and now bko#14124
    reports it on a HP DL320.

    http://bugzilla.kernel.org/show_bug.cgi?id=14124

    I still think this isn't something libata drivers should be caring
    about (the only ones which are calling pci_intx() explicitly are
    libata ones and one other driver) but for now reverting the change
    seems to be the right thing to do.

    Signed-off-by: Tejun Heo
    Reported-by: Thomas Jarosch
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

11 Sep, 2009

5 commits


09 Sep, 2009

8 commits

  • Fix for non-ncq & ncq commands causing timeouts when both are issued
    simultaneously to the same device.

    Signed-off-by: Ashish Kalra
    [fixed to be actual compileable C code -jg]
    Signed-off-by: Jeff Garzik

    Ashish Kalra
     
  • This small patch is just adding the information for PMP spec 1.2

    Signed-off-by: Shane Huang
    Signed-off-by: Jeff Garzik

    Shane Huang
     
  • ata_tf_read_block() has off-by-one error when converting CHS address
    to LBA. The bug isn't very visible because ata_tf_read_block() is
    used only when generating sense data for a failed RW command and CHS
    addressing isn't used too often these days.

    This problem was spotted by Atsushi Nemoto.

    Signed-off-by: Tejun Heo
    Reported-by: Atsushi Nemoto
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Gigabyte GA-MA69VM-S2 can't do 64bit DMA either. It's yet unknown
    whether recent BIOS fixes the problem. Blacklist regardless of BIOS
    revisions for now.

    Sandor Bodo-Merle reported and provided the initial patch for this
    issue.

    Signed-off-by: Tejun Heo
    Reported-by: Sandor Bodo-Merle
    Cc: Shane Huang
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • It turns out ASUS M2A-VM isn't the only one with the 32bit DMA
    problem. Make ahci_asus_m2a_vm_32bit_only() more generic using the
    new dmi_get_date() and rename it to ahci_sb600_32bit_only(). Cut off
    date is now pointed to by dmi_system_id->driver_data in "yyyymmdd"
    format and it's now also allowed to be omitted.

    Signed-off-by: Tejun Heo
    Cc: Sandor Bodo-Merle
    Cc: Shane Huang
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • There are cases where full date information is required instead of
    just the year. Add month and day parsing to dmi_get_year() and rename
    it to dmi_get_date().

    As the original function only required '/' followed by any number of
    parseable characters at the end of the string, keep that behavior to
    avoid upsetting existing users.

    The new function takes dates of format [mm[/dd]]/yy[yy]. Year, month
    and date are checked to be in the ranges of [1-9999], [1-12] and
    [1-31] respectively and any invalid or out-of-range component is
    returned as zero.

    The dummy implementation is updated accordingly but the return value
    is updated to indicate field not found which is consistent with how
    other dummy functions behave.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • ata_scsi_pass_thru() was checking for input sanity and disallowed
    commands while initializaing qc from scmd. TPM filtering was added
    right after protocol check at which point tf wasn't initialized
    properly. This means that TPM filtering has never really worked.

    This patch fixes the bug by reorganizing ata_scsi_pass_thru() such
    that qc is fully initialized before checking for invalid conditions
    which is way less error prone.

    Discovered while Thilo-Alexander Ginkel was trying debug patches for
    bko#13416.

    Signed-off-by: Tejun Heo
    Cc: Thilo-Alexander Ginkel
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • During introduction of slave_link, sata_sis slipped through the crack
    and left with ad-hoc merged SCR access. As SCR status was shared for
    both the master and slave devices, when only one of the device is
    online, libata EH would think both are online but would only get valid
    device signature for the actually present one, which in turn trigger
    the probing safety net mechanism and make EH retry causing large delay
    during boot. This patch converts sata_sis to slave_link mechanism.

    This bug was reported by TAXI in bko#14075.

    http://bugzilla.kernel.org/show_bug.cgi?id=14075

    Signed-off-by: Tejun Heo
    Reported-by: TAXI
    Cc: Uwe Koziolek
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

02 Sep, 2009

11 commits

  • The sil24 hardware has a built-in list of commands and associated protocols
    that gets used by default to decide how to handle a given command. However,
    if the command is not known to the controller then it presumably assumes it to
    be a non-data command which then causes protocol mismatch errors if the device
    ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command
    causes this issue since it's a DMA data-out command.

    Since we should always know best what protocol the command should be using,
    let's just set the override flag to inform the controller what protocol to use
    for all non-ATAPI commands with data transfer.

    Signed-off-by: Robert Hancock
    Tested-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • AHCI exports various capability bits that may be of interest to userspace
    such as whether the BIOS claims a port is hotpluggable or eSATA. Providing
    these via sysfs along with the version of the AHCI spec implemented by
    the host allows userspace to make policy decisions for things like ALPM.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Jeff Garzik

    Matthew Garrett
     
  • Now that the SCSI disk driver correctly handles non-rotational devices
    we can move setting the queue flag to SCSI.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jeff Garzik

    Martin K. Petersen
     
  • From: Alan Cox

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan Cox
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • This was a hack to give userland shutdown tools time to drop manual
    spindown. All popular distros updated quite some time ago and the due
    is well passed. Drop it.

    Signed-off-by: Tejun Heo
    Cc: Jaswinder Singh Rajput
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • This patch improve libata's output for error/notification messages
    to allow easier comprehension and debugging:

    When ATAPI commands issued through the SCSI layer fail, use SCSI
    functions to print the CDB in human-readable form instead of just
    dumping out the CDB in hex.

    Print out the name of the failed command (as defined by the ATA
    specification) in error handling output along with the raw register
    contents.

    When reporting status of ACPI taskfile commands executed on resume,
    also output the names of the commands being executed (or not) in
    readable form.

    Since the extra data for printing command names increases kernel
    size slightly, a config option has been added to allow disabling
    command name output (as well as some of the error register parsing)
    for those highly sensitive to kernel text size.

    Signed-off-by: Robert Hancock
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • Resets are done with port frozen but some controllers still issue
    interrupts during reset and they may end up recording error conditions
    in ehi leading to unnecessary EH retrials.

    This patch makes ata_eh_reset() clear ehi on reset completion. As
    reset is the most severe recovery action, there's nothing to lose by
    clearing ehi on its completion.

    Signed-off-by: Tejun Heo
    Reported-by: Zdenek Kaspar
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Hopefully results in fewer on-the-wire FIS's and no breakage. We'll see!

    Signed-off-by: Shaohua Li
    Signed-off-by: Jeff Garzik

    Shaohua Li
     
  • We must disable the DMA engine before accessing taskfile registers.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • Call the ->freeze() hook before aborting qc's, because some hardware
    requires special handling prior to accessing the taskfile registers
    (for diagnosis/analysis/reset). Most notably, hardware may wish to
    disable the DMA engine or interrupts in the ->freeze() hook.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

01 Sep, 2009

1 commit

  • Commit log for commit 517d3cc15b36392e518abab6bacbb72089658313
    ("[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
    Acked-by: Alan Cox
    Cc: Jeff Garzik
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Linus Torvalds

    Bartlomiej Zolnierkiewicz
     

12 Aug, 2009

6 commits

  • Some gigabytes have on-board SIMG5723s connected to JMB ahcis. These
    are used to implement hardware raid. Unfortunately some firmware
    revisions on these 5723s don't bring the link down when all the
    downstream ports are unoccupied while not responding to reset protocol
    which makes libata think that there's device attached to the port but
    is not responding and retry. This results in painfully wrong boot
    detection time for these ports when they're empty.

    This patch quirks those boards such that ahci gives up after the
    initial timeout. Combined with parallel probing, this gives quick
    enough probing and also is safe because SIMG5723 will respond to the
    first try if any of the downstream ports is occupied.

    Signed-off-by: Tejun Heo
    Reported-by: Marc Bowes
    Reported-by: Nicolas Mailhot
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Too strong words led to spurious bug reports: Novell bugzilla #527748,
    RedHat bugzilla #468800. This patch is used to soften up the dmesg on
    SB600 PMP softreset failure recovery, so as to remove the scariness and
    concern from community.

    Reported-by: pgnet Dev
    Signed-off-by: Shane Huang
    Cc: Tejun Heo
    Signed-off-by: Jeff Garzik

    Shane Huang
     
  • At least the nVidia MCP55 controller quite happily supports MSI.
    This adds an option to use it. It is disabled by default.
    As per feedback by Robert Hancock, it will honour the user
    request as the kernel will not enable MSI where the controller
    or the specific system configuration do not support it.

    Signed-off-by: Tony Vroon
    Cc: Robert Hancock
    Signed-off-by: Jeff Garzik

    Tony Vroon
     
  • OCZ Vertex SSD can't do HPA and not in a usual way. It reports HPA,
    allows unlocking but then fails all IOs which fall in the unlocked
    area. Quirk it so that HPA unlocking is not used for the device.

    Reported by Daniel Perup in bnc#522414.

    https://bugzilla.novell.com/show_bug.cgi?id=522414

    Signed-off-by: Tejun Heo
    Reported-by: Daniel Perup
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • PIO and MWDMA timings are never programmed for the second channel
    because timing registers are treated as 16-bit long ones.

    The bug is an attixp -> pata_atiixp regression and goes back to:

    commit 669a5db411d85a14f86cd92bc16bf7ab5b8aa235
    Author: Jeff Garzik
    Date: Tue Aug 29 18:12:40 2006 -0400

    [libata] Add a bunch of PATA drivers.

    Cc: Krystian Juskowiak
    Cc: Andrew Morton
    Cc: Borislav Petkov
    Cc: Robert Hancock
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jeff Garzik

    Bartlomiej Zolnierkiewicz
     
  • Julias Lawall discovered that pata_at91 wasn't freeing a memory region
    allocated with kzalloc() on init failure paths. Upon review,
    pata_at91 also seems to be doing unnecessary explicit resource
    releases for managed resources too. Convert memory allocation to
    managed one and drop unnecessary explicit resource releases.

    Signed-off-by: Tejun Heo
    Cc: Julia Lawall
    Cc: Sergey Matyukevich
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

29 Jul, 2009

2 commits

  • On certain configurations, HPA isn't or can't be unlocked during
    probing but it somehow ends up unlocked afterwards. In the following
    thread, the problem can be reliably reproduced after resuming from
    STR. The BIOS turns on HPA during boot but forgets to do it during
    resume.

    http://thread.gmane.org/gmane.linux.kernel/858310

    This patch updates libata revalidation such that it considers native
    n_sectors. If the device size has increased to match native
    n_sectors, it's assumed that HPA has been unlocked involuntarily and
    the device is recognized as the same one. This should be fairly safe
    while nicely working around the problem.

    Signed-off-by: Tejun Heo
    Reported-by: Christof Warlich
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Please consider the following updates and fixes for pata_at91 driver.

    * Removed extra headers
    Here we need only static memory controller properties, which are
    contained in generic header at91sam9_smc.h.
    No need to include any specific headers for at91sam9260 SoC.

    * No harsh BUG_ON for get_clk in set_smc_timing function
    get_clk is now performed in driver probing function,
    probing fails if master clock is not available

    * Fixed uint/ulong mess in calc_mck_cycles function

    Signed-off-by: Sergey Matyukevich
    Signed-off-by: Jeff Garzik

    Sergey Matyukevich