aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/pci
AgeCommit message (Collapse)Author
2007-10-13alim15x3: remove redundant m5229_revision checkBartlomiej Zolnierkiewicz
init_dma_ali15x3() guarantees that hwif->dma_base will never be set for m5229_revision < 0x20 so remove redundant m5229_revision >= 0x20 check from init_hwif_common_ali15x3(). While at it remove incorrect comment. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13sc1200: fix ->dma_base equal zero handlingBartlomiej Zolnierkiewicz
Set hwif->atapi_dma/{ultra,mwdma}_mask and drive->autodma after checking that ->dma_base exists. If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. OTOH hwif->set_{pio,dma}_mode hooks should be set even if hwif->dma_base == 0. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13cs5520: fix ->dma_base equal zero handlingBartlomiej Zolnierkiewicz
Set hwif->ide_dma_{check,on} and hwif->autodma to 1 after checking that ->dma_base exists. If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13sgiioc4: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13cs5535: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: move ide_config_drive_speed() calls to upper layers (take 2)Bartlomiej Zolnierkiewicz
* Convert {ide_hwif_t,ide_pci_device_t}->host_flag to be u16. * Add IDE_HFLAG_POST_SET_MODE host flag to indicate the need to program the host for the transfer mode after programming the device. Set it in au1xxx-ide, amd74xx, cs5530, cs5535, pdc202xx_new, sc1200, pmac and via82cxxx host drivers. * Add IDE_HFLAG_NO_SET_MODE host flag to indicate the need to completely skip programming of host/device for the transfer mode ("smart" hosts). Set it in it821x host driver and check it in ide_tune_dma(). * Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all direct ->set_pio_mode/->speedproc users to use these helpers. * Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc methods to callers. * Rename ->speedproc method to ->set_dma_mode, make it void and update all implementations accordingly. * Update ide_set_xfer_rate() comments. * Unexport ide_config_drive_speed(). v2: * Fix issues noticed by Sergei: - export ide_set_dma_mode() instead of moving ->set_pio_mode abuse wrt to setting DMA modes from sc1200_set_pio_mode() to do_special() - check IDE_HFLAG_NO_SET_MODE in ide_tune_dma() - check for (hwif->set_pio_mode) == NULL in ide_set_pio_mode() - check for (hwif->set_dma_mode) == NULL in ide_set_dma_mode() - return -1 from ide_set_{pio,dma}_mode() if ->set_{pio,dma}_mode == NULL - don't set ->set_{pio,dma}_mode on it821x in "smart" mode - fix build problem in pmac.c - minor fixes in au1xxx-ide.c/cs5530.c/siimage.c - improve patch description Changes in behavior caused by this patch: - HDIO_SET_PIO_MODE ioctl would now return -ENOSYS for attempts to change PIO mode if it821x controller is in "smart" mode - removal of two debugging printk-s (from cs5530.c and sc1200.c) - transfer modes 0x00-0x07 passed from user space may be programmed twice on the device (not really an issue since 0x00 is not supported correctly by any host driver ATM, 0x01 is not supported at all and 0x02-0x07 are invalid) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13pdc202xx_new: check ide_config_drive_speed() return valueBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13cs5535: check ide_config_drive_speed() return valueBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13amd74xx/via82cxxx: check ide_config_drive_speed() return valueBartlomiej Zolnierkiewicz
* Check ide_config_drive_speed() return value. * While at also call ide_config_drive_speed() if the transfer mode is XFER_PIO_SLOW (this case happens iff the transfer mode has already been set on the device by ide-proc.c::set_xfer_rate()) and remove redundant setting of ->{init,current}_speed. * Bump driver version. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (24 commits) ide: use only ->set_pio_mode method for programming PIO modes (take 2) sis5513: don't change UDMA settings when programming PIO it8213/piix/slc90e66: don't change DMA settings when programming PIO alim15x3: PIO mode setup fixes siimage: fix ->set_pio_mode method to select PIO data transfer cs5520: don't enable VDMA in ->speedproc sc1200: remove redundant warning message from sc1200_tune_chipset() ide-pmac: PIO mode setup fixes (take 3) icside: fix ->speedproc to return on unsupported modes (take 5) sgiioc4: use ide_tune_dma() amd74xx/via82cxxx: use ide_tune_dma() ide: add ide_set{_max}_pio() (take 4) ide: Kconfig face-lift ide: move ide_rate_filter() calls to the upper layer (take 2) sis5513: add ->udma_filter method for chipset_family >= ATA_133 ide: mode limiting fixes for user requested speed changes ide: add missing ide_rate_filter() calls to ->speedproc()-s ide: call udma_filter() before resorting to the UltraDMA mask ide: make jmicron match vendor and device class pdc202xx_new: switch to using pci_get_slot() (take 2) ...
2007-10-11ide: use only ->set_pio_mode method for programming PIO modes (take 2)Bartlomiej Zolnierkiewicz
Use ->set_pio_mode method to program PIO modes in ide_set_xfer_rate() (the only place which used ->speedproc to program PIO modes) and remove handling of PIO modes from all ->speedproc implementations. v2: * Fix pmac_ide_tune_chipset() comment. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11sis5513: don't change UDMA settings when programming PIOBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11it8213/piix/slc90e66: don't change DMA settings when programming PIOBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11alim15x3: PIO mode setup fixesBartlomiej Zolnierkiewicz
* Return failure in ->speedproc method for unsupported/invalid transfer modes passed from user-space (fixes theoretical OOPS in ali_tune_pio() and/or setting random PIO timings on host controller + disabling UDMA bit + setting unsupported/invalid transfer mode on the device). * Don't disable UDMA bit when programming PIO modes. * Add FIXME about DMA timings never being set. * Bump driver version. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11siimage: fix ->set_pio_mode method to select PIO data transferBartlomiej Zolnierkiewicz
* Remember to select PIO data transfer (with IORDY monitored) in sil_tune_pio() (->set_pio_mode method) so the controller is always programmed correctly for PIO transfers (this is important if DMA is not going to be used). * Don't set DMA/UDMA timings for PIO modes in siimage_tune_chipset(). * Bump driver version. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11cs5520: don't enable VDMA in ->speedprocBartlomiej Zolnierkiewicz
There is no need to do it in cs5520_tune_chipset() (->speedproc method) since it is correctly handled by cs5520_dma_on() (->ide_dma_on method). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11sc1200: remove redundant warning message from sc1200_tune_chipset()Bartlomiej Zolnierkiewicz
ide_config_drive_speed() called by sc1200_set_xfer_mode() already gives a meaningful warning message in case of failure. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11sgiioc4: use ide_tune_dma()Bartlomiej Zolnierkiewicz
* Add DRV_NAME define and use it instead of sgiioc4_chipset.name. * Remove no longer needed sgiioc4_chipset. * Remove needless clearing of ->atapi_dma from ide_dma_sgiioc4(). * Fix ide_dma_sgiioc4() to return success/failure. Check return value in sgiioc4_ide_setup_pci_device() and set hwif->autodma accordingly. Also add missing setting of drive->autodma. * Add sgiioc4_speedproc() (implementation of ->speedproc method). * Fix ->mwdma_mask (MWDMA2 mask is 0x04 not 0x02) and remove incorrect ->swdma_mask. Also remove needless initialization of ->ultra_mask. * Use ide_tune_dma() in sgiioc4_ide_dma_check(), this fixes following bugs: - DMA capability bit not being checked on the device - DMA blacklist not being checked - MWDMA2 mode support by device not being checked Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeremy Higdon <jeremy@sgi.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11amd74xx/via82cxxx: use ide_tune_dma()Bartlomiej Zolnierkiewicz
* Use ide_tune_dma() in amd74xx/via82cxxx driver, this fixes following bugs: - DMA capability bit not being checked on the device - DMA blacklist not being checked - DMA mode being programmed even if drive->autodma == 0 (thus possibly destroying PIO timings) * Bump driver version. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: add ide_set{_max}_pio() (take 4)Bartlomiej Zolnierkiewicz
* Add IDE_HFLAG_ABUSE_{PREFETCH,FAST_DEVSEL,DMA_MODES} flags and set them in ht6560, cmd640, cmd64x and sc1200 host drivers. * Add set_pio_mode_abuse() for checking if host driver has a non-standard ->tuneproc() implementation and use it in do_special(). * Add ide_set_pio() for setting PIO mode (it uses hwif->pio_mask to find the maximum PIO mode supported by the host), also add ide_set_max_pio() wrapper for ide_set_pio() to use for auto-tuning. Convert users of ->tuneproc to use ide_set{_max}_pio() where possible. This leaves only do_special(), set_using_pio(), ide_hwif_restore() and ide_set_pio() as a direct users of ->tuneproc. * Remove no longer needed ide_get_best_pio_mode() calls and printk-s reporting PIO mode selected from ->tuneproc implementations. * Rename ->tuneproc hook to ->set_pio_mode and make 'pio' argument const. * Remove stale comment from ide_config_drive_speed(). v2: * Fix "ata_" prefix (Noticed by Jeff). v3: * Minor cleanups/fixups per Sergei's suggestions. v4: * Fix compile problem in drivers/ide/pci/cmd640.c (Noticed by Andrew Morton). * Improve some ->set_pio_mode comments. Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: move ide_rate_filter() calls to the upper layer (take 2)Bartlomiej Zolnierkiewicz
* Move ide_rate_filter() calls from host drivers to IDE core. * Make ide_rate_filter() static. * Make 'speed' argument of ->speedproc const. v2: * Fix it8213_tune_chipset() comment. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11sis5513: add ->udma_filter method for chipset_family >= ATA_133Bartlomiej Zolnierkiewicz
* Add sis5513_ata133_udma_filter() for chipset_family >= ATA_133, use it to filter UDMA6 mode if ATA133 bit is disabled. * Remove no longer needed UDMA6 limiting logic from sis5513_tune_chipset(). * Bump driver version. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: mode limiting fixes for user requested speed changesBartlomiej Zolnierkiewicz
* Add an extra argument to ide_max_dma_mode() for passing requested transfer mode. Use it as an upper limit when finding the best DMA for device/host. * Rename ide_max_dma_mode() to ide_find_dma_mode() and at the same time add ide_max_dma_mode() wrapper which passes XFER_UDMA_6 as a requested mode to ide_find_dma_mode(). Also add inline ide_find_dma_mode() version for CONFIG_BLK_DEV_IDEDMA=n case. * Pass requested transfer mode from ide_find_dma_mode() to ide_get_mode_mask() to avoid false warning from eighty_ninty_three(). * Use ide_find_dma_mode() to limit the user requested transfer mode in ide_rate_filter(). Also limit the requested mode by host max PIO mode. Above changes make ide_rate_filter() to: * Clip desired transfer mode down if it is invalid (values 0x0F, 0x13-0x19 and 0x25-0x39, values > 0x46 were already clipped down, same for values 0x25-0x39 but iff UDMA was not supported by the host). * Clip desired transfer mode down if it is currently unsupported by IDE core (PIO6 and MWDMA3-4, the latter were already clipped down but iff UDMA was not supported by the host). * Clip desired transfer mode down according to the host capabilities (UDMA modes were already clipped down but MWDMA/SWDMA/PIO weren't, also ->atapi_dma flag was not respected). * Clip desired transfer mode down according to the device capabilities (except PIO modes for now which require mode work) - shouldn't be a problem since ide_set_xfer_rate() is called _after_ device has accepted given transfer mode. and also result in a number of host driver specific bugfixes: * icside - clip unsupported PIO5 mode down - fix unsupported/invalid modes being set in drive->current_speed * ide-cris - clip unsupported PIO5 and SWDMA0-2 modes down - clip DMA modes down for ATAPI devices - fix BUG() on unsupported/invalid modes * au1xxx-ide - clip unsupported PIO5, SWDMA0-2 and MWDMA0-2 (if BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=n) modes down * aec62xx - clip unsupported PIO5 and SWDMA0-2 modes down - clip DMA modes down for ATAPI devices - fix 0x00 being programmed as PIO timing for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * alim15x3 - clip DMA modes down for ATAPI devices (chipset revision == 0x20 only) - fix theoretical OOPS for 0x0F mode - fix unsupported/invalid modes being set on the device * amd74xx - clip unsupported SWDMA0-2 (on COBRA_7401 revs <= 7) modes down - fix random PIO timings being set for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * atiixp - clip unsupported PIO5 and SWDMA0-2 modes down - fix cached MWDMA mode being cleared for unsupported/invalid modes - fix PIO{0,2} timings being programmed for unsupported/invalid modes - fix theoretical OOPS for PIO5-6 and 0x0F modes - fix unsupported/invalid modes being set on the device * cmd64x - clip unsupported SWDMA0-2 modes down * cs5530 - clip unsupported PIO5 and SWDMA0-2 modes down - fix unsupported/invalid modes being set on the device - fix BUG() on unsupported/invalid modes (which happened if the device accepted the setting) * cs5535 - clip unsupported PIO5 and SWDMA0-2 modes down - fix unsupported/invalid modes being set on the device - fix theoretical OOPS for PIO5-6 and 0x0F modes * hpt34x - clip DMA modes down for ATAPI devices - fix invalid timings being programmed for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * hpt366 - clip unsupported PIO5 and SWDMA0-2 modes down - fix PIO0 timings being programmed for unsupported/invalid modes - fix DMA timings being cleared for MWDMA3-4 and 0x25-0x39 modes - fix unsupported/invalid modes being set on the device * it8213 - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down * it821x - clip unsupported PIO5 and SWDMA0-2 modes down - clip DMA modes down for ATAPI devices (chipset in smart mode and revision 0x10 in pass-through mode) * jmicron - clip unsupported SWDMA0-2 modes down - fix unsupported/invalid modes being set on the device * pdc202xx_new - clip unsupported PIO5 and SWDMA0-2 modes down - fix unsupported/invalid modes being set on the device * pdc202xx_old - clip unsupported PIO5 mode down - fix incorrect timings being set for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * piix - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down * sc1200 - clip unsupported PIO5 and SWDMA0-2 modes down - fix unsupported/invalid modes being set on the device - fix BUG() on unsupported/invalid modes (which happened if the device accepted the setting) * scc_pata - clip unsupported PIO5, SWDMA0-2 and MWDMA0-2 modes down * serverworks - clip unsupported PIO5 and SWDMA0-2 modes down - fix DMA/UDMA timings/settings being cleared for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * siimage - clip unsupported PIO5 and SWDMA0-2 modes down - clip DMA modes down for ATAPI devices (SATA chipsets) * sis5513 - clip unsupported PIO5 mode down - fix BUG() on unsupported/invalid modes * sl82c105 - clip unsupported SWDMA0-2 modes down * slc90e66 - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down * tc86c001 - clip unsupported PIO5 and SWDMA0-2 modes down - fix PIO0 timings being programmed for PIO5/0x0F/SWDMA0-2/0x13-0x19 modes - fix invalid 0x00 DMA timing being programmed for MWDMA3-4/0x25-0x39 modes - fix unsupported/invalid modes being set on the device * triflex - clip unsupported PIO5 mode down * via82cxxx - fix random PIO timings being set for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * pmac - clip unsupported PIO5 and SWDMA0-2 modes down * cmd640/ht6560b - clip DMA modes down (if CONFIG_BLK_DEV_IDEDMA=y) - fix PIO5 being clipped to PIO4 (if CONFIG_BLK_DEV_IDEDMA=n) * opti621 - clip DMA modes down (if CONFIG_BLK_DEV_IDEDMA=y) - clip unsupported PIO4 to PIO3 (if CONFIG_BLK_DEV_IDEDMA=n) While at it: * Use ide_rate_filter() in cs5520.c::cs5520_tune_chipset(). * Remove no longer needed checks from hpt366.c::hpt3{6,7}x_tune_chipset(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: add missing ide_rate_filter() calls to ->speedproc()-sBartlomiej Zolnierkiewicz
* Fix icside, cris-ide, au1xxx-ide, amd74xx, via82cxxx and pmac host drivers to use ide_rate_filter(). This results in the following modes (from user requests) being clipped down: - invalid modes (values 0x46-0xFF) [ for all hosts ] - unsupported by a host UDMA modes [ for hosts which support UDMA] - all UDMA modes and MWDMA3-4 modes [ for hosts which don't support UDMA ] - invalid modes (values 0x25-0x39) [ for hosts which don't support UDMA ] * Host driver specific changes in behavior: icside: - no change cris-ide - clip unsupported UDMA3-6 modes down - fix BUG() on trying to set unsupported UDMA3-6 modes au1xxx-ide/pmac - clip unsupported UDMA modes down amd74xx/via82cxxx - clip unsupported UDMA modes down - fix random PIO timings being set for unsupported/invalid modes - fix unsupported/invalid modes being set on the device * While at it remove no longer needed checks from pmac.c driver. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: make jmicron match vendor and device classTejun Heo
PATA part of all current JMB controllers behave the same way and JMicron confirms that all future ones will stay compatible. Matching vendor and device class is enough. For backward compatibility, jmicron still needs to match 361,3,5,6,8 DIDs regardless of device class if libata is not configured but won't need further DID update from this point. Bart: cosmetic fixes to jmicron_chipset Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Ethan Hsiao <ethanhsiao@jmicron.com> Cc: Justin Tsai <justin@jmicron.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11pdc202xx_new: switch to using pci_get_slot() (take 2)Sergei Shtylyov
Switch to using pci_get_slot() in init_setup_pdc20270() to get to the mate chip behind DC21150 bridge as there's no need for the driver itself to walk the list of the PCI devices (and the driver didn't check the bus # of the found device). While at it, make it emit warning about IRQ # being fixed up (just like hpt366.c does) and "beautify" this whole function as well as init_setup_pdc20276()... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11hpt366: MWDMA filter for SATA cards (take 2)Sergei Shtylyov
The Marvell bridge chips used on HighPoint SATA cards do not seem to support the MWDMA modes (at least that could be seen in their so-called drivers :-), so the driver needs to account for this -- to achieve this: - add mdma_filter() method from the original patch by Bartlomiej Zolnierkiewicz with his consent; - install the method for all chips to only return empty mask if a SATA drive is detected on HPT372{AN]/374 chips... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11atiixp: SB700 contains more than one IDE channelShane Huang
SB700 supports one physical IDE channel, but SB700 SATA controller supports combined mode. When the SATA combined mode is enabled, two SATA ports (port4 and port5) share one IDE channel from IDE controller, and PATA will share the other IDE channel. Our previous patch adding SB700 IDE device ID only supports one IDE channel, which contains bug. The attached patch fixes the bug. Signed-off-by: "Shane Huang" <Shane.Huang@amd.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-09drivers/firmware: const-ify DMI API and internalsJeff Garzik
Three main sets of changes: 1) dmi_get_system_info() return value should have been marked const, since callers should not be changing that data. 2) const-ify DMI internals, since DMI firmware tables should, whenever possible, be marked const to ensure we never ever write to that data area. 3) const-ify DMI API, to enable marking tables const where possible in low-level drivers. And if we're really lucky, this might enable some additional optimizations on the part of the compiler. The bulk of the changes are #2 and #3, which are interrelated. #1 could have been a separate patch, but it was so small compared to the others, it was easier to roll it into this changeset. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-09-11pdc202xx_new: PLL detection fixMikael Pettersson
Fix a bitmask typo in the pdc202xx_new PLL frequency detection code which causes it to truncate an intermediate difference to 26 bits instead of the correct 30 bits (the PLL's bitwidth). Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11via82cxxx: add Arima W730-K8 and other rebadgings to short cables listBartlomiej Zolnierkiewicz
Port of Alan's patch for pata_via.c. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11pata_ali/alim15x3: override 80-wire cable detection for Toshiba S1800-814Daniel Exner
Add Toshiba S1800-814 to whitelist for both pata_ali and alim15x3, as it is correctly detected as 40-wire connected but this cable is short enough to still use transfer modes higher than UDMA33. Signed-off-by: Daniel Exner <dex@dragonslave.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11hpt366: UltraDMA filter for SATA cards (take 2)Sergei Shtylyov
The Marvell bridge chips used on HighPoint SATA cards do not seem to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes, so the driver needs to account for this in the udma_filter() method. In order to achieve that, do the following changes: - install the method for all chips, not only HPT36x/370 and improve the code formatting by killing the extra tabs while at it; - add to the end of the 'switch' statement in the method cases for HPT372[AN] and HPT374 chips upon which the known SATA cards are based; - use hwif->ultra_mask as a default mask for the ide_dma_filter() method to behave correctly; - move the HPT370[A] cases below the HPT36x case for consistency. While at it, replace the explicit UltraDMA mode masks with ATA_UDMA* constants all over the driver... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Bob Ham <rah@bash.sh> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11hpt366: fix PCI clock detection for HPT374 (take 4)Sergei Shtylyov
HPT374 BIOS seems to only save f_CNT register value for the function #0 before re-tuning DPLL (that causes the driver to report obviously distorted f_CNT for the function #1) -- fix this by always reading the saved f_CNT register value from the function #0 in the driver's init_chipset() method. While at it, introduce 'chip_type' for holding the 'struct hpt_info' field of the same name and replace the structure assignment with memcpy()... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11pdc202xx_new: fix PCI refcountingSergei Shtylyov
The driver erroneously "lets go" the mate IDE chip in init_setup_pdc20270() when ide_setup_pci_devices() call succeeds -- fix this, and drop a couple of useless assignments in this function while at it... Bart: keep "findev" variable initialization to silence gcc Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-10[libata, IDE] add new VIA bridge to VIA PATA driversJoseph Chan
Signed-off-by: Joseph Chan <josephchan@via.com.tw> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-08-20hpt34x: fix CONFIG_HPT34X_AUTODMA=n handlingBartlomiej Zolnierkiewicz
Programming DMA mode may destroy current PIO mode setting so if CONFIG_HPT34X_AUTODMA=n (the default case) make ide_tune_dma() fail early by disabling all host DMA masks and re-tune PIO mode. This fix doesn't help with the driver being broken but is needed for some other changes. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20triflex: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20pdc202xx_old: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20pdc202xx_new: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Also this host driver requires valid PCI BAR4 for normal operation so check it in ->init_chipset and fail initialization if not set. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20cs5530: add missing ->dma_base checkBartlomiej Zolnierkiewicz
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen. Also this host driver requires valid PCI BAR4 for normal operation so check it in ->init_chipset and fail initialization if not set. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20ide: config_drive_for_dma() fixesBartlomiej Zolnierkiewicz
* Add DMA blacklist checking (->ide_dma_on check probably can go now). * Add ->atapi_dma flag checking and remove no longer needed ns87415_ide_dma_check() from ns87415 host driver. * Remove now needless __ide_dma_check() wrapper and symbol export. * Check drive->autodma instead of hwif->autodma (there should be no changes in behavior as all users of config_drive_for_dma() set both ->autodma flags). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01scc_pata: PIO fixesBartlomiej Zolnierkiewicz
* Use pio == 255 == "auto-tune" in scc_config_drive_for_dma() instead of forcing PIO4 on PIO fallback. Fix comment while at it. * Rename scc_tuneproc() to scc_tune_pio() and add scc_tuneproc() wrapper. Move finding of the best PIO mode and setting of transfer mode on the device to the new wrapper. * Fix scc_tune_chipset() to tune PIO modes. Do a small cleanup while at it. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01piix/slc90e66: fix PIO1 handling in ->speedproc method (take 2)Bartlomiej Zolnierkiewicz
* Don't call {piix,slc90e66}_dma_2_pio() for PIO modes in {piix,slc90e66}_tune_chipset(). * Add PIO1 handling to {piix,slc90e66}_tune_chipset(). * Bump driver version. v2: * Remove PIO modes from {piix,slc90e66}_dma_2_pio(), they are no longer needed there (Noticed by Sergei) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01jmicron: PIO fixesBartlomiej Zolnierkiewicz
* Set transfer mode on the device in jmicron_tuneproc(), also add pio == 255 == "auto-tune" handling. * Use jmicron_tuneproc() in jmicron_config_drive_for_dma(). * Remove no longer needed config_jmicron_chipset_for_pio(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01it8213: PIO fixes (take 2)Bartlomiej Zolnierkiewicz
* Rename it8213_tuneproc() to it8213_tune_pio() and add it8213_tuneproc() wrapper. Move finding of the best PIO mode to the new wrapper. * Add setting of transfer mode on the device to it8213_tuneproc(). * Don't call it8213_dma_2_pio() for PIO modes in it8213_tune_chipset(). * Use it8213_tuneproc() in it8213_config_drive_for_dma(). v2: * Remove PIO modes from it8213_dma_2_pio(), they are no longer needed there (Noticed by Sergei) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01cs5535: PIO fixesBartlomiej Zolnierkiewicz
* Fix cs5535_tuneproc() to pass PIO transfer mode value instead of PIO mode number to cs5535_set_speed() (fixes random PIO timings being programmed and a possible OOPS). Do a little cleanup while at it. * Fix cs5535_set_speed() to check if the mate device is present (fixes PIO0 taskfile timings being used if there is no other device on the cable). * Use cs5535_tuneproc() in cs5535_dma_check(). The old code had the same issue as cs5535_tuneproc() and add additionally caused 0x00-0x04 transfer mode values (== default PIO, default PIO w/ IORDY + two invalid values) being set on the device instead of values 0x08-0x0c (XFER_PIO_[0,4]). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01cs5520: fix PIO auto-tuning in ->ide_dma_check methodBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01ide: fix runtogether printk's in cmd64x IDE driverMeelis Roos
Fix a couple of runtogether printks in cmd64x.c IDE driver by adding proper newlines. Signed-off-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01sis5513: Add FSC Amilo A1630 PCI subvendor/dev to laptopsDavid Lamparter
Recognise the FSC Amilo A1630's incarnation of a SiS5513 chip as laptop to get UDMA100 support. Signed-off-by: David Lamparter <equinox@diac24.net> Cc: Lionel Bouton <Lionel.Bouton@inet6.fr> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>