Skip to contentSkip to conversation

libata build fix

PATCH In review Jeff Garzik 2 participants 3 messages Oct 9, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata build fix

Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/ahci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Markus Trippelsdorf (1):
ahci: Add ifdef wrapper to ahci_gtf_filter_workaround

drivers/ata/ahci.c +5 -0
index 4edca6e..b1a2577 100644
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
+#ifdef CONFIG_ATA_ACPI
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
 	static const struct dmi_system_id sysids[] = {
@@ -2927,6 +2928,10 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
 				dev->gtf_filter |= filter;
 	}
 }
+#else
+static inline void ahci_gtf_filter_workaround(struct ata_host *host)
+{}
+#endif
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
#1 lore raw
Quoted 24 lines · Jeff Garzik

Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/ahci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Markus Trippelsdorf (1):
ahci: Add ifdef wrapper to ahci_gtf_filter_workaround

drivers/ata/ahci.c +1 -0
index 4edca6e..b1a2577 100644
@@ -2884,6 +2884,7 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 	return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff);
 }
 
+#ifdef CONFIG_ATA_ACPI
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
 	static const struct dmi_system_id sysids[] = {

drivers/ata/ahci.c static void ahci_gtf_filter_workaround(struct ata_host *host) · line 2934

Quoted 7 lines
drivers/ata/ahci.c +4 -0
@@ -2927,6 +2928,10 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
 				dev->gtf_filter |= filter;
 	}
 }
+#else
+static inline void ahci_gtf_filter_workaround(struct ata_host *host)
+{}
+#endif

btw., i made the slightly different fix below before i saw your fix on lkml, and i think it's slightly cleaner to have a single definition of a function instead of an
#else branch.

Ingo

---------------------->
From 1f4a08ff9647d24d9590a7e23349036dbeafbb1b Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Fri, 9 Oct 2009 10:13:56 +0200
Subject: [PATCH] ahci: Fix "filter FPDMA non-zero offset enable for Aspire 3810T" on !CONFIG_ATA_ACPI
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Commit f80ae7e ("ahci: filter FPDMA non-zero offset enable for Aspire 3810T") introduced a new build breakage:

drivers/ata/ahci.c: In function ‘ahci_gtf_filter_workaround’:
drivers/ata/ahci.c:2927: error: ‘struct ata_device’ has no member named ‘gtf_filter’ make[2]: *** [drivers/ata/ahci.o] Error 1
make[1]: *** [drivers/ata] Error 2
make[1]: *** Waiting for unfinished jobs....

As the acpi taskfile command filter support is a property of libata-acpi - so the ata_device::gtf_filter field only exists under CONFIG_ATA_ACPI.

Add the trivial #ifdef to turn ahci_gtf_filter_workaround() into a NOP on !CONFIG_ATA_ACPI.

Cc Marcus Meissner <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/ata/ahci.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/ata/ahci.c +2 -0
index 4edca6e..fc8d527 100644
@@ -2886,6 +2886,7 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 
 static void ahci_gtf_filter_workaround(struct ata_host *host)
 {
+#ifdef CONFIG_ATA_ACPI
 	static const struct dmi_system_id sysids[] = {
 		/*
 		 * Aspire 3810T issues a bunch of SATA enable commands
@@ -2926,6 +2927,7 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
 			ata_for_each_dev(dev, link, ALL)
 				dev->gtf_filter |= filter;
 	}
+#endif
 }
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
author Acked-by
#2 lore raw
Quoted 43 lines · Ingo Molnar

From: Ingo Molnar<[email protected]>
Date: Fri, 9 Oct 2009 10:13:56 +0200
Subject: [PATCH] ahci: Fix "filter FPDMA non-zero offset enable for Aspire 3810T" on !CONFIG_ATA_ACPI
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Commit f80ae7e ("ahci: filter FPDMA non-zero offset enable for Aspire 3810T") introduced a new build breakage:

drivers/ata/ahci.c: In function ‘ahci_gtf_filter_workaround’:
drivers/ata/ahci.c:2927: error: ‘struct ata_device’ has no member named ‘gtf_filter’ make[2]: *** [drivers/ata/ahci.o] Error 1
make[1]: *** [drivers/ata] Error 2
make[1]: *** Waiting for unfinished jobs....

As the acpi taskfile command filter support is a property of libata-acpi - so the ata_device::gtf_filter field only exists under CONFIG_ATA_ACPI.

Add the trivial #ifdef to turn ahci_gtf_filter_workaround() into a NOP on !CONFIG_ATA_ACPI.

Cc Marcus Meissner<[email protected]>
Cc Jeff Garzik<[email protected]>
---
  drivers/ata/ahci.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
drivers/ata/ahci.c +1 -0
index 4edca6e..fc8d527 100644
@@ -2886,6 +2886,7 @@ static bool ahci_broken_online(struct pci_dev *pdev)
 
  static void ahci_gtf_filter_workaround(struct ata_host *host)
  {
+#ifdef CONFIG_ATA_ACPI
  	static const struct dmi_system_id sysids[] = {
  		/*
  		 * Aspire 3810T issues a bunch of SATA enable commands

drivers/ata/ahci.c static void ahci_gtf_filter_workaround(struct ata_host *host) · line 2931

Quoted 5 lines
drivers/ata/ahci.c +1 -0
@@ -2926,6 +2927,7 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
  			ata_for_each_dev(dev, link, ALL)
  				dev->gtf_filter |= filter;
  	}
+#endif
  }

Either way is fine with me. I tend to prefer conditional compilation to be outside a function, but it's not a big deal. Linus can pull my submit, or add

to this Ingo patch.

Same end result; whichever makes people happier, and fixes builds the most rapidly...

Jeff