drivers/ata changes for SMBIOS and System Firmware
PATCH 5/35 drivers/ata changes for SMBIOS and System Firmware
drivers/ata changes for SMBIOS and System Firmware
As part of the new SMBIOS and System Firmware code:
- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them
--- drivers/ata/acard-ahci.c | 1 - drivers/ata/ahci.c | 177 +++++++++++++++++++++++---------------------- drivers/ata/ata_piix.c | 156 +++++++++++++++++++++++----------------- drivers/ata/pata_ali.c | 18 +++--- drivers/ata/pata_cs5530.c | 12 ++-- drivers/ata/pata_rdc.c | 1 - drivers/ata/pata_sch.c | 1 - drivers/ata/pata_via.c | 14 ++-- drivers/ata/sata_sil.c | 19 +++--- 9 files changed, 210 insertions(+), 189 deletions(-)
drivers/ata/acard-ahci.c +0 -1
@@ -42,7 +42,6 @@#include <linux/interrupt.h> #include <linux/dma-mapping.h> #include <linux/device.h> -#include <linux/dmi.h> #include <linux/gfp.h> #include <scsi/scsi_host.h> #include <scsi/scsi_cmnd.h>
drivers/ata/ahci.c +89 -88
350 lines not on this page · raw message
drivers/ata/ata_piix.c +89 -67
314 lines not on this page · raw message
drivers/ata/pata_ali.c +9 -9
@@ -32,7 +32,7 @@#include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> +#include <linux/sysfw.h> #define DRV_NAME "pata_ali"#define DRV_VERSION "0.7.8"
@@ -47,22 +47,22 @@ static struct pci_dev *ali_isa_bridge;* Cable special cases */ -static const struct dmi_system_id cable_dmi_table[] = { +static const struct sysfw_id cable_override_table[] = { { .ident ="HP Pavilion N5430" , .matches = { -DMI_MATCH (DMI_BOARD_VENDOR ,"Hewlett-Packard" ), -DMI_MATCH (DMI_BOARD_VERSION ,"OmniBook N32N-736" ), +SYSFW_MATCH (SYSFW_BOARD_VENDOR ,"Hewlett-Packard" ), +SYSFW_MATCH (SYSFW_BOARD_VERSION ,"OmniBook N32N-736" ), }, }, { .ident ="Toshiba Satelite S1800-814" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"TOSHIBA" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"S1800-814" ), +SYSFW_MATCH (SYSFW_SYS_VENDOR ,"TOSHIBA" ), +SYSFW_MATCH (SYSFW_PRODUCT_NAME ,"S1800-814" ), }, }, - { } + {} };static int ali_cable_override (struct pci_dev *pdev)
@@ -73,8 +73,8 @@ static int ali_cable_override(struct pci_dev *pdev)/* Mitac 8317 (Winbook-A) and relatives */ if (pdev->subsystem_vendor ==0x1071 && pdev->subsystem_device ==0x8317 )return 1 ; -/* Systems by DMI */ -if (dmi_check_system (cable_dmi_table)) +/* Systems by SMBIOS */ +if (sysfw_callback (cable_override_table))return 1 ;return 0 ; }
drivers/ata/pata_cs5530.c +6 -6
@@ -31,7 +31,7 @@#include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> +#include <linux/sysfw.h> #define DRV_NAME "pata_cs5530"#define DRV_VERSION "0.7.4"
@@ -175,20 +175,20 @@ static struct ata_port_operations cs5530_port_ops = { .set_dmamode = cs5530_set_dmamode, }; -static const struct dmi_system_id palmax_dmi_table[] = { +static const struct sysfw_id palmax_id_table[] = { { .ident ="Palmax PD1100" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Cyrix" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Caddis" ), +SYSFW_MATCH (SYSFW_SYS_VENDOR ,"Cyrix" ), +SYSFW_MATCH (SYSFW_PRODUCT_NAME ,"Caddis" ), }, }, - { } + {} };static int cs5530_is_palmax (void ) { -if (dmi_check_system (palmax_dmi_table)) { +if (sysfw_callback (palmax_id_table)) {printk (KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n" );return 1 ; }
drivers/ata/pata_rdc.c +0 -1
@@ -31,7 +31,6 @@#include <linux/gfp.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> #define DRV_NAME "pata_rdc"#define DRV_VERSION "0.01"
drivers/ata/pata_sch.c +0 -1
@@ -33,7 +33,6 @@#include <linux/device.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> #define DRV_NAME "pata_sch"#define DRV_VERSION "0.2"
drivers/ata/pata_via.c +7 -7
@@ -61,7 +61,7 @@#include <linux/gfp.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> +#include <linux/sysfw.h> #define DRV_NAME "pata_via"#define DRV_VERSION "0.3.4"
@@ -132,21 +132,21 @@ struct via_port {* Cable special cases */ -static const struct dmi_system_id cable_dmi_table[] = { +static const struct sysfw_id cable_override_table[] = { { .ident ="Acer Ferrari 3400" , .matches = { -DMI_MATCH (DMI_BOARD_VENDOR ,"Acer,Inc." ), -DMI_MATCH (DMI_BOARD_NAME ,"Ferrari 3400" ), +SYSFW_MATCH (SYSFW_BOARD_VENDOR ,"Acer,Inc." ), +SYSFW_MATCH (SYSFW_BOARD_NAME ,"Ferrari 3400" ), }, }, - { } + {} };static int via_cable_override (struct pci_dev *pdev) { -/* Systems by DMI */ -if (dmi_check_system (cable_dmi_table)) +/* Systems by SMBIOS */ +if (sysfw_callback (cable_override_table))return 1 ;/* Arima W730-K8/Targa Visionary 811/... */ if (pdev->subsystem_vendor ==0x161F && pdev->subsystem_device ==0x2032 )
drivers/ata/sata_sil.c +10 -9
@@ -44,7 +44,7 @@#include <linux/device.h> #include <scsi/scsi_host.h> #include <linux/libata.h> -#include <linux/dmi.h> +#include <linux/sysfw.h> #define DRV_NAME "sata_sil"#define DRV_VERSION "2.4"
@@ -707,23 +707,24 @@ static void sil_init_controller(struct ata_host *host)static bool sil_broken_system_poweroff (struct pci_dev *pdev) { -static const struct dmi_system_id broken_systems[] = { +static const struct sysfw_id broken_systems[] = { { .ident ="HP Compaq nx6325" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"HP Compaq nx6325" ), +SYSFW_MATCH (SYSFW_SYS_VENDOR , +"Hewlett-Packard" ), +SYSFW_MATCH (SYSFW_PRODUCT_NAME , +"HP Compaq nx6325" ), },/* PCI slot number of the controller */ .driver_data = (void *)0x12UL , }, - - { }/* terminate list */ + {}/* terminate list */ }; -const struct dmi_system_id *dmi =dmi_first_match (broken_systems); +const struct sysfw_id *id =sysfw_callback (broken_systems); -if (dmi) { -unsigned long slot = (unsigned long )dmi->driver_data; +if (id) { +unsigned long slot = (unsigned long )id->driver_data;/* apply the quirk only to on-board controllers */ return slot ==PCI_SLOT (pdev->devfn); }
Signature · 1 line
1.7.5.4
Quoted 26 lines · Prarit Bhargava
drivers/atachanges for SMBIOS and System FirmwareAs part of the new SMBIOS and System Firmware code:
- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanupsysfw_idlookup tables
- cleanup of includes fordmi.handmod_devicetable.hwhich were included in some files that did not need themSigned-off-by Prarit Bhargava<[email protected]>--- drivers/ata/acard-ahci.c | 1 - drivers/ata/ahci.c | 177 +++++++++++++++++++++++---------------------- drivers/ata/ata_piix.c | 156 +++++++++++++++++++++++----------------- drivers/ata/pata_ali.c | 18 +++--- drivers/ata/pata_cs5530.c | 12 ++-- drivers/ata/pata_rdc.c | 1 - drivers/ata/pata_sch.c | 1 - drivers/ata/pata_via.c | 14 ++-- drivers/ata/sata_sil.c | 19 +++--- 9 files changed, 210 insertions(+), 189 deletions(-)#ifdef CONFIG_PM
drivers/ata/ata_piix.c static bool piix_irq_check(struct ata_port *ap) · line 1027
Quoted 9 lines
drivers/ata/ata_piix.c +9
-0+bool sysfw_match (int field,const char *str) +{ +const char *info =sysfw_lookup (field); + +if (info ==NULL || str ==NULL ) +return info == str; + +return !strcmp (info, str); +}
It is surprising that nobody else needed this. I would rather that this sort of thing go into the generic code, where it lived prior to this change.
Either way, though,
I presume you'll merge this at the same time as the rest of the rename changes.
Quoted 29 lines · Jeff Garzik
Quoted 25 lines · Prarit Bhargava
drivers/atachanges for SMBIOS and System FirmwareAs part of the new SMBIOS and System Firmware code:
- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanupsysfw_idlookup tables
- cleanup of includes fordmi.handmod_devicetable.hwhich were included in
some files that did not need themSigned-off-by Prarit Bhargava<[email protected]>--- drivers/ata/acard-ahci.c | 1 - drivers/ata/ahci.c | 177 +++++++++++++++++++++++---------------------- drivers/ata/ata_piix.c | 156 +++++++++++++++++++++++----------------- drivers/ata/pata_ali.c | 18 +++--- drivers/ata/pata_cs5530.c | 12 ++-- drivers/ata/pata_rdc.c | 1 - drivers/ata/pata_sch.c | 1 - drivers/ata/pata_via.c | 14 ++-- drivers/ata/sata_sil.c | 19 +++--- 9 files changed, 210 insertions(+), 189 deletions(-)
Quoted 14 lines
drivers/ata/ata_piix.c static bool piix_irq_check(struct ata_port *ap) · line 1027
Quoted 10 lines
#ifdef CONFIG_PMdrivers/ata/ata_piix.c +9
-0+bool sysfw_match (int field,const char *str) +{ +const char *info =sysfw_lookup (field); + +if (info ==NULL || str ==NULL ) +return info == str; + +return !strcmp (info, str); +}It is surprising that nobody else needed this. I would rather that this sort of thing go into the generic code, where it lived prior to this change.
Jeff,
I took a closer look at this and, in fact, this isn't needed globally AFAICT.
The issue is that the code really should do sysfw_callback with a sysfw_id (which currently is a dmi_system_id). The dmi_system_id struct only has 4 matches/struct. I *could* expand that to 8 but it seems like a waste of space to do so.
But I see your point -- sysfw_match() implies a global function. I'll rework this to include a manual strcmp() instead of sysfw_match(). It seems more appropriate IMO.
I'll post a [v2] shortly.
P.