Patchwork [Quantal] UBUNTU: SAUCE: ata_piix: add a disable_driver option

login
register
mail settings
Submitter Tim Gardner
Date Sept. 25, 2012, 7:29 p.m.
Message ID <5062060C.5060909@canonical.com>
Download mbox | patch
Permalink /patch/186881/
State New
Headers show

Comments

Tim Gardner - Sept. 25, 2012, 7:29 p.m.
Andy - do we still need this for Quantal Hyper-V ?

rtg
Leann Ogasawara - Sept. 27, 2012, 7:48 p.m.
I went ahead and picked this back up for Quantal.  It seemed relatively
harmless.  Andy, feel free to rip it back out if you feel it is
unnecessary to continue carrying.

Thanks,
Leann

On 09/25/2012 12:29 PM, Tim Gardner wrote:
> Andy - do we still need this for Quantal Hyper-V ?
>
> rtg
>
>

Patch

From 86243ae6dbfc5d02ee714d7de5c2d8120bb8e52d Mon Sep 17 00:00:00 2001
From: Andy Whitcroft <apw@canonical.com>
Date: Thu, 17 May 2012 18:55:28 +0100
Subject: [PATCH Quantal] UBUNTU: SAUCE: ata_piix: add a disable_driver option

We need to be able to fully disable the ata_piix driver from the kernel
command line.  Add a generic disable_driver to the module init to
completely short circuit the initialisation.

BugLink: http://bugs.launchpad.net/bugs/994870
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/ata/ata_piix.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3c809bf..424084d 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1719,10 +1719,16 @@  static void piix_remove_one(struct pci_dev *pdev)
 	ata_pci_remove_one(pdev);
 }
 
+static bool disable_driver = 0;
 static int __init piix_init(void)
 {
 	int rc;
 
+	if (disable_driver) {
+		printk(KERN_WARNING "ata_piix: driver disabled completely\n");
+		return 0;
+	}
+
 	DPRINTK("pci_register_driver\n");
 	rc = pci_register_driver(&piix_pci_driver);
 	if (rc)
@@ -1739,5 +1745,6 @@  static void __exit piix_exit(void)
 	pci_unregister_driver(&piix_pci_driver);
 }
 
+module_param(disable_driver, bool, 0);
 module_init(piix_init);
 module_exit(piix_exit);
-- 
1.7.9.5