The patch titled pata_via suspend/resume support has been removed from the -mm tree. Its filename was pata_via-suspend-resume-support.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: pata_via suspend/resume support From: Alan Cox <alan@xxxxxxxxxx> The major VIA issues were handled by the quirks update for resume quirks. The ATA driver also has to do some work however when resuming from RAM. Certain chips need the FIFO reconfiguring, and the 66MHz clock setup updating. Signed-off-by: Alan Cox <alan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/ata/pata_via.c | 92 +++++++++++++++++++++++++++++++-------- 1 files changed, 75 insertions(+), 17 deletions(-) diff -puN drivers/ata/pata_via.c~pata_via-suspend-resume-support drivers/ata/pata_via.c --- a/drivers/ata/pata_via.c~pata_via-suspend-resume-support +++ a/drivers/ata/pata_via.c @@ -60,7 +60,7 @@ #include <linux/libata.h> #define DRV_NAME "pata_via" -#define DRV_VERSION "0.1.14" +#define DRV_VERSION "0.2.0" /* * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx @@ -296,6 +296,8 @@ static struct scsi_host_template via_sht .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = ata_scsi_slave_config, .bios_param = ata_std_bios_param, + .resume = ata_scsi_device_resume, + .suspend = ata_scsi_device_suspend, }; static struct ata_port_operations via_port_ops = { @@ -369,8 +371,42 @@ static struct ata_port_operations via_po }; /** + * via_config_fifo - set up the FIFO + * @pdev: PCI device + * @flags: configuration flags + * + * Set the FIFO properties for this device if neccessary. Used both on + * set up and on and the resume path + */ + +static void via_config_fifo(struct pci_dev *pdev, unsigned int flags) +{ + u8 enable; + + /* 0x40 low bits indicate enabled channels */ + pci_read_config_byte(pdev, 0x40 , &enable); + enable &= 3; + + if (flags & VIA_SET_FIFO) { + u8 fifo_setting[4] = {0x00, 0x60, 0x00, 0x20}; + u8 fifo; + + pci_read_config_byte(pdev, 0x43, &fifo); + + /* Clear PREQ# until DDACK# for errata */ + if (flags & VIA_BAD_PREQ) + fifo &= 0x7F; + else + fifo &= 0x9f; + /* Turn on FIFO for enabled channels */ + fifo |= fifo_setting[enable]; + pci_write_config_byte(pdev, 0x43, fifo); + } +} + +/** * via_init_one - discovery callback - * @pdev: PCI device ID + * @pdev: PCI device * @id: PCI table info * * A VIA IDE interface has been discovered. Figure out what revision @@ -470,21 +506,8 @@ static int via_init_one(struct pci_dev * } /* Initialise the FIFO for the enabled channels. */ - if (config->flags & VIA_SET_FIFO) { - u8 fifo_setting[4] = {0x00, 0x60, 0x00, 0x20}; - u8 fifo; + via_config_fifo(pdev, config->flags); - pci_read_config_byte(pdev, 0x43, &fifo); - - /* Clear PREQ# until DDACK# for errata */ - if (config->flags & VIA_BAD_PREQ) - fifo &= 0x7F; - else - fifo &= 0x9f; - /* Turn on FIFO for enabled channels */ - fifo |= fifo_setting[enable]; - pci_write_config_byte(pdev, 0x43, fifo); - } /* Clock set up */ switch(config->flags & VIA_UDMA) { case VIA_UDMA_NONE: @@ -528,6 +551,39 @@ static int via_init_one(struct pci_dev * return ata_pci_init_one(pdev, port_info, 2); } +/** + * via_reinit_one - reinit after resume + * @pdev; PCI device + * + * Called when the VIA PATA device is resumed. We must then + * reconfigure the fifo and other setup we may have altered. In + * addition the kernel needs to have the resume methods on PCI + * quirk supported. + */ + +static int via_reinit_one(struct pci_dev *pdev) +{ + u32 timing; + struct ata_host *host = dev_get_drvdata(&pdev->dev); + const struct via_isa_bridge *config = host->private_data; + + via_config_fifo(pdev, config->flags); + + if ((config->flags & VIA_UDMA) == VIA_UDMA_66) { + /* The 66 MHz devices require we enable the clock */ + pci_read_config_dword(pdev, 0x50, &timing); + timing |= 0x80008; + pci_write_config_dword(pdev, 0x50, timing); + } + if (config->flags & VIA_BAD_CLK66) { + /* Disable the 66MHz clock on problem devices */ + pci_read_config_dword(pdev, 0x50, &timing); + timing &= ~0x80008; + pci_write_config_dword(pdev, 0x50, timing); + } + return ata_pci_device_resume(pdev); +} + static const struct pci_device_id via[] = { { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), }, @@ -541,7 +597,9 @@ static struct pci_driver via_pci_driver .name = DRV_NAME, .id_table = via, .probe = via_init_one, - .remove = ata_pci_remove_one + .remove = ata_pci_remove_one, + .suspend = ata_pci_device_suspend, + .resume = via_reinit_one, }; static int __init via_init(void) _ Patches currently in -mm which might be from alan@xxxxxxxxxx are git-libata-all.patch pci-move-pci_vdevice-from-libata-to-core.patch pata-libata-suspend-resume-simple-cases-fix.patch pata_cs5530-suspend-resume-support-tweak.patch pata_sil680-suspend-resume-tidy.patch pata_via-suspend-resume-support-fix.patch git-mtd.patch git-netdev-all.patch resend-iphase-64bit-cleanup.patch pci-introduce-pci_find_present.patch pci-fix-multiple-problems-with-via-hardware.patch pci-fix-multiple-problems-with-via-hardware-warning-fix.patch pci_module_init-convertion-in-tmscsimc.patch alpha-switch-to-pci_get-api.patch ioremap-balanced-with-iounmap-for-drivers-char-rio-rio_linuxc.patch ioremap-balanced-with-iounmap-for-drivers-char-moxac.patch ioremap-balanced-with-iounmap-for-drivers-char-istallionc.patch ide-complete-switch-to-pci_get.patch remove-drivers-pci-searchcpci_find_device_reverse.patch via82cxxx-handle-error-condition-properly.patch hz-300hz-support.patch ide_scsi-allow-it-to-be-used-for-non-cd-only.patch ide_scsi-allow-it-to-be-used-for-non-cd-only-fix.patch tty-signal-tty-locking.patch tty-signal-tty-locking-3270-fix.patch pci-mxser-pci-refcounts.patch tty-preparatory-structures-for-termios-revamp.patch tty-preparatory-structures-for-termios-revamp-strip-fix.patch tty-switch-to-ktermios-and-new-framework.patch tty-switch-to-ktermios-and-new-framework-warning-fix.patch tty-switch-to-ktermios-and-new-framework-irda-fix.patch tty-switch-to-ktermios.patch tty-switch-to-ktermios-nozomi-fix.patch tty-switch-to-ktermios-sclp-fix.patch tty-switch-to-ktermios-powerpc-fix.patch tty-switch-to-ktermios-uml-fix-2.patch tty_ioctl-use-termios-for-the-old-structure-and-termios2.patch tty_ioctl-use-termios-for-the-old-structure-and-termios2-fix.patch tty_ioctl-use-termios-for-the-old-structure-and-termios2-update.patch termios-enable-new-style-termios-ioctls-on-x86-64.patch char-isicom-expand-function.patch char-isicom-rename-init-function.patch char-isicom-remove-isa-code.patch char-isicom-remove-unneeded-memset.patch char-isicom-move-to-tty_register_device.patch char-isicom-use-pci_request_region.patch char-isicom-check-kmalloc-retval.patch drivers-isdn-trivial-vsnprintf-conversion.patch ide-more-conversion-to-pci_get-apis.patch igafb-switch-to-pci_get-api.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html