public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Allow number of IDE interfaces to be selected (X86)
@ 2005-06-25 15:41 Nick Warne
  2005-06-26 17:55 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Warne @ 2005-06-25 15:41 UTC (permalink / raw)
  To: linux-kernel

A small patch I done to allow X86 users to select the max number of IDE 
interfaces they have - this eliminates the need for passing idex=noprobe on 
the command line and/or stops the needless probes at boot on non-existant IDE 
interfaces.

I have done this as I assume the majority of X86 users will only have 2 IDE 
interfaces, and therefore it allows the option to specify this.

ALPHA and SUPERH users need to select this to continue as per the way it works 
for them.

For X86 people, not selecting this allows the kernel to use the defaults 'as 
was'.


By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and
I have the right to submit it under the open source license
indicated in the file.

Signed-off-by: Nick Warne<nick@linicks.net>



 drivers/ide/Kconfig    |   17 ++++++++++++++++-
 include/asm-i386/ide.h |    4 ++++
 2 files changed, 20 insertions(+), 1 deletion(-)


--- linux-2.6.12n/include/asm-i386/ide.h        2005-06-17 20:48:29.000000000 
+0100
+++ linux-2.6.12/include/asm-i386/ide.h 2005-06-25 14:13:43.000000000 +0100
@@ -16,11 +16,15 @@
 #include <linux/config.h>

 #ifndef MAX_HWIFS
+#ifndef CONFIG_IDE_HWIFS_NUM
 # ifdef CONFIG_BLK_DEV_IDEPCI
 #define MAX_HWIFS      10
 # else
 #define MAX_HWIFS      6
 # endif
+#else
+#define MAX_HWIFS       CONFIG_IDE_MAX_HWIFS
+#endif
 #endif

 #define IDE_ARCH_OBSOLETE_DEFAULTS

--- linux-2.6.12n/drivers/ide/Kconfig   2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12/drivers/ide/Kconfig    2005-06-25 14:11:17.000000000 +0100
@@ -52,14 +52,29 @@

 if IDE

+config IDE_HWIFS_NUM
+        bool "Specify the number of IDE Interfaces"
+       depends on (ALPHA || SUPERH || X86)
+        default n
+       help
+
+         ALPHA and SUPERH say 'y' here.
+
+         X86 say 'y' to this if you wish to specify the number of IDE
+         interfaces on your system.  If unsure, say 'n' to use
+         the kernel default options (6 or 10).
+
 config IDE_MAX_HWIFS
        int "Max IDE interfaces"
-       depends on ALPHA || SUPERH
+       depends on IDE_HWIFS_NUM
        default 4
        help
          This is the maximum number of IDE hardware interfaces that will
          be supported by the driver. Make sure it is at least as high as
          the number of IDE interfaces in your system.
+
+         On X86 architecture default is (6 or 10) IDE interfaces if this
+         is not used (IDE_HWIFS_NUM = n)

 config BLK_DEV_IDE
        tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"



Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

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

* Re: [PATCH] Allow number of IDE interfaces to be selected (X86)
@ 2005-06-25 17:22 Nick Warne
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Warne @ 2005-06-25 17:22 UTC (permalink / raw)
  To: linux-kernel

Oh well.... so much for my first patch - this needs to be allowed to set the 
default value correctly for ALPHA and SUPERH.

Here is the fixed patch of the patch...


By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and
I have the right to submit it under the open source license
indicated in the file.

Signed-off-by: Nick Warne<nick@linicks.net>




 drivers/ide/Kconfig    |   17 ++++++++++++++++-
 include/asm-i386/ide.h |    4 ++++
 2 files changed, 20 insertions(+), 1 deletion(-)


--- linux-2.6.12orig/include/asm-i386/ide.h     2005-06-17 20:48:29.000000000 
+0100
+++ linux-2.6.12/include/asm-i386/ide.h 2005-06-25 14:13:43.000000000 +0100
@@ -16,11 +16,15 @@
 #include <linux/config.h>

 #ifndef MAX_HWIFS
+#ifndef CONFIG_IDE_HWIFS_NUM
 # ifdef CONFIG_BLK_DEV_IDEPCI
 #define MAX_HWIFS      10
 # else
 #define MAX_HWIFS      6
 # endif
+#else
+#define MAX_HWIFS       CONFIG_IDE_MAX_HWIFS
+#endif
 #endif

 #define IDE_ARCH_OBSOLETE_DEFAULTS


--- linux-2.6.12orig/drivers/ide/Kconfig        2005-06-17 20:48:29.000000000 
+0100
+++ linux-2.6.12/drivers/ide/Kconfig    2005-06-25 18:01:07.000000000 +0100
@@ -52,14 +52,29 @@

 if IDE

+config IDE_HWIFS_NUM
+        bool "Specify the number of IDE Interfaces"
+       depends on (ALPHA || SUPERH || X86)
+       default y if !(X86)
+       help
+
+         ALPHA and SUPERH say 'y' here.
+
+         X86 say 'y' to this if you wish to specify the number of IDE
+         interfaces on your system.  If unsure, say 'n' to use
+         the kernel default options (6 or 10).
+
 config IDE_MAX_HWIFS
        int "Max IDE interfaces"
-       depends on ALPHA || SUPERH
+       depends on IDE_HWIFS_NUM
        default 4
        help
          This is the maximum number of IDE hardware interfaces that will
          be supported by the driver. Make sure it is at least as high as
          the number of IDE interfaces in your system.
+
+         On X86 architecture default is (6 or 10) IDE interfaces if this
+         is not used (IDE_HWIFS_NUM = n)

 config BLK_DEV_IDE
        tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"


Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

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

* Re: [PATCH] Allow number of IDE interfaces to be selected (X86)
  2005-06-25 15:41 [PATCH] Allow number of IDE interfaces to be selected (X86) Nick Warne
@ 2005-06-26 17:55 ` Alan Cox
  2005-06-26 20:34   ` Nick Warne
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2005-06-26 17:55 UTC (permalink / raw)
  To: Nick Warne; +Cc: Linux Kernel Mailing List

On Sad, 2005-06-25 at 16:41, Nick Warne wrote:
> A small patch I done to allow X86 users to select the max number of IDE 
> interfaces they have - this eliminates the need for passing idex=noprobe on 
> the command line and/or stops the needless probes at boot on non-existant IDE 
> interfaces.

The needless probe cases patch went into -mm already. Also your change
doesn't eliminate the need for noprobe in cases where its not the first
or second interface in order.

The assumption most x86 users will only have two IDE interfaces is also
generally wrong today, although they may fall under the SATA driver on
newer boards.

I don't think this patch should go in - the one real reason for having
it in embedded boxes was saving memory. The right fix for that is
already something Bartlomiej has talked about fixing - the static
allocation of the ide_hwifs array itself.

Alan


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

* Re: [PATCH] Allow number of IDE interfaces to be selected (X86)
  2005-06-26 17:55 ` Alan Cox
@ 2005-06-26 20:34   ` Nick Warne
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Warne @ 2005-06-26 20:34 UTC (permalink / raw)
  To: Alan Cox, linux-kernel

On Sunday 26 June 2005 18:55, you wrote:

> I don't think this patch should go in - the one real reason for having
> it in embedded boxes was saving memory. The right fix for that is
> already something Bartlomiej has talked about fixing - the static
> allocation of the ide_hwifs array itself.

OK :-).

But I learnt a lot here on the kernel.

Also found not to cut 'n' paste from nano in X.  It doesn't perserve tabs... 
so the patch was bum anyway.  I only found out it was fubar when I was 
looking at what Matt done to get the struct sizes on different vmlinuz 
builds, and cut and paste back into a file from the mail.

But here is the results anyway using my .config but with the option off and 
on:


Orig (off):

bash-2.05b# nm -t d -rS --size-sort linux-2.6.12orig/vmlinux | grep hwifs
0000003225966208 0000000000014080 B ide_hwifs


With the IDE selection option (but not EMBEDDED) with 2 IDE interfaces 
selected (on with 2):

bash-2.05b# nm -t d -rS --size-sort linux-2.6.12/vmlinux | grep hwifs
0000003225974400 0000000000002816 B ide_hwifs


Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

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

end of thread, other threads:[~2005-06-26 20:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-25 15:41 [PATCH] Allow number of IDE interfaces to be selected (X86) Nick Warne
2005-06-26 17:55 ` Alan Cox
2005-06-26 20:34   ` Nick Warne
  -- strict thread matches above, loose matches on Subject: below --
2005-06-25 17:22 Nick Warne

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