public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off}
@ 2008-02-22 16:22 Matt Domsch
  2008-02-22 16:53 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Domsch @ 2008-02-22 16:22 UTC (permalink / raw)
  To: akpm, hpa, Tim Gardner; +Cc: linux-kernel

Andrew, please add to -mm and forward during the the 2.6.27 merge window.

Thanks,
Matt

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux

>From 5c8fa0705c7f55ec5ae1b7da874029fe2000c595 Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Fri, 22 Feb 2008 06:59:39 -0700
Subject: [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off}

UBUNTU: Implemented default EDD control
OriginalAuthor: Tim Gardner <tim.gardner@canonical.com>

Add a kernel parameter option to 'edd' to enable/disable BIOS Enhanced Disk Drive Services.
CONFIG_EDD_OFF disables EDD while still compiling EDD into the kernel. Default
behavior can be forced using 'edd=on' or 'edd=off' as  a kernel parameter.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
---
 Documentation/kernel-parameters.txt |    3 +--
 arch/x86/boot/edd.c                 |   10 +++++++++-
 drivers/firmware/Kconfig            |    9 +++++++++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9a5b665..3e6f0f5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -625,8 +625,7 @@ and is between 256 and 4096 characters. It is defined in the file
 	eata=		[HW,SCSI]
 
 	edd=		[EDD]
-			Format: {"of[f]" | "sk[ipmbr]"}
-			See comment in arch/i386/boot/edd.S
+			Format: {"off" | "on" | "sk[ipmbr]"}
 
 	eisa_irq_edge=	[PARISC,HW]
 			See header of drivers/parisc/eisa.c.
diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index 8721dc4..4191805 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -128,17 +128,25 @@ void query_edd(void)
 {
 	char eddarg[8];
 	int do_mbr = 1;
+#ifdef CONFIG_EDD_OFF
+	int do_edd = 0;
+#else
 	int do_edd = 1;
+#endif
 	int be_quiet;
 	int devno;
 	struct edd_info ei, *edp;
 	u32 *mbrptr;
 
 	if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
-		if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
+		if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) {
+			do_edd = 1;
 			do_mbr = 0;
+		}
 		else if (!strcmp(eddarg, "off"))
 			do_edd = 0;
+		else if (!strcmp(eddarg, "on"))
+			do_edd = 1;
 	}
 
 	be_quiet = cmdline_find_option_bool("quiet");
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 05f02a3..c28e33f 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -17,6 +17,15 @@ config EDD
           obscure configurations. Most disk controller BIOS vendors do
           not yet implement this feature.
 
+config EDD_OFF
+	bool "Sets default behavior for EDD detection to off"
+	depends on EDD
+	default n
+	help
+	  Say Y if you want EDD disabled by default, even though it is compiled into the
+	  kernel. Say N if you want EDD enabled by default. EDD can be dynamically set
+	  using the kernel parameter 'edd={on|skipmbr|off}'.
+
 config EFI_VARS
 	tristate "EFI Variable Support via sysfs"
 	depends on EFI
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off}
  2008-02-22 16:22 [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off} Matt Domsch
@ 2008-02-22 16:53 ` Randy Dunlap
  2008-02-22 16:56   ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2008-02-22 16:53 UTC (permalink / raw)
  To: Matt Domsch; +Cc: akpm, hpa, Tim Gardner, linux-kernel

On Fri, 22 Feb 2008 10:22:52 -0600 Matt Domsch wrote:

>  Documentation/kernel-parameters.txt |    3 +--
>  arch/x86/boot/edd.c                 |   10 +++++++++-
>  drivers/firmware/Kconfig            |    9 +++++++++
>  3 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 9a5b665..3e6f0f5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -625,8 +625,7 @@ and is between 256 and 4096 characters. It is defined in the file
>  	eata=		[HW,SCSI]
>  
>  	edd=		[EDD]
> -			Format: {"of[f]" | "sk[ipmbr]"}
> -			See comment in arch/i386/boot/edd.S
> +			Format: {"off" | "on" | "sk[ipmbr]"}

Where is "sk" valid (parsed) as a value for "edd="?
I see "skip" or "skipmbr"....
or is that just a typo, should be "skip[mbr]"?


>  	eisa_irq_edge=	[PARISC,HW]
>  			See header of drivers/parisc/eisa.c.
> diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
> index 8721dc4..4191805 100644
> --- a/arch/x86/boot/edd.c
> +++ b/arch/x86/boot/edd.c
> @@ -128,17 +128,25 @@ void query_edd(void)
>  {
>  	char eddarg[8];
>  	int do_mbr = 1;
> +#ifdef CONFIG_EDD_OFF
> +	int do_edd = 0;
> +#else
>  	int do_edd = 1;
> +#endif
>  	int be_quiet;
>  	int devno;
>  	struct edd_info ei, *edp;
>  	u32 *mbrptr;
>  
>  	if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
> -		if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
> +		if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) {
> +			do_edd = 1;
>  			do_mbr = 0;
> +		}
>  		else if (!strcmp(eddarg, "off"))
>  			do_edd = 0;
> +		else if (!strcmp(eddarg, "on"))
> +			do_edd = 1;
>  	}
>  
>  	be_quiet = cmdline_find_option_bool("quiet");
> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
> index 05f02a3..c28e33f 100644
> --- a/drivers/firmware/Kconfig
> +++ b/drivers/firmware/Kconfig
> @@ -17,6 +17,15 @@ config EDD
>            obscure configurations. Most disk controller BIOS vendors do
>            not yet implement this feature.
>  
> +config EDD_OFF
> +	bool "Sets default behavior for EDD detection to off"
> +	depends on EDD
> +	default n
> +	help
> +	  Say Y if you want EDD disabled by default, even though it is compiled into the
> +	  kernel. Say N if you want EDD enabled by default. EDD can be dynamically set
> +	  using the kernel parameter 'edd={on|skipmbr|off}'.
> +
>  config EFI_VARS
>  	tristate "EFI Variable Support via sysfs"
>  	depends on EFI

---
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off}
  2008-02-22 16:53 ` Randy Dunlap
@ 2008-02-22 16:56   ` H. Peter Anvin
  0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2008-02-22 16:56 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Matt Domsch, akpm, Tim Gardner, linux-kernel

Randy Dunlap wrote:
> 
> Where is "sk" valid (parsed) as a value for "edd="?
> I see "skip" or "skipmbr"....
> or is that just a typo, should be "skip[mbr]"?
> 

It used to only parse the first two letters; we now have a proper 
command-line parser.

	-hpa

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-22 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 16:22 [PATCH] add default mode CONFIG_EDD_OFF=n, override with edd={on,off} Matt Domsch
2008-02-22 16:53 ` Randy Dunlap
2008-02-22 16:56   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox