* [2.6 patch] kill drive_info
@ 2004-07-14 0:08 Adrian Bunk
2004-07-14 9:01 ` Andries Brouwer
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2004-07-14 0:08 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel
The only user of drive_info in 2.6 seems to be drivers/ide/legacy/hd.c .
What about the patch below to kill drive_info?
Please double-check this patch, all I checked was a test of compilation
on i386.
diffstat output:
arch/cris/kernel/setup.c | 1 -
arch/i386/kernel/i386_ksyms.c | 5 -----
arch/i386/kernel/setup.c | 2 --
arch/ia64/dig/setup.c | 10 ----------
arch/ia64/sn/kernel/setup.c | 14 --------------
arch/ppc/platforms/pmac_setup.c | 2 --
arch/sh64/kernel/sh_ksyms.c | 8 --------
arch/x86_64/kernel/setup.c | 2 --
arch/x86_64/kernel/x8664_ksyms.c | 5 -----
drivers/ide/legacy/hd.c | 7 +++++--
10 files changed, 5 insertions(+), 51 deletions(-)
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
--- linux-2.6.7-mm7-full/arch/x86_64/kernel/setup.c.old 2004-07-14 01:18:28.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/x86_64/kernel/setup.c 2004-07-14 01:19:45.000000000 +0200
@@ -85,7 +85,6 @@
/*
* Setup options
*/
-struct drive_info_struct { char dummy[32]; } drive_info;
struct screen_info screen_info;
struct sys_desc_table_struct {
unsigned short length;
@@ -429,7 +428,6 @@
unsigned long kernel_end;
ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
- drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
edid_info = EDID_INFO;
aux_device_present = AUX_DEVICE_INFO;
--- linux-2.6.7-mm7-full/arch/x86_64/kernel/x8664_ksyms.c.old 2004-07-14 01:20:15.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/x86_64/kernel/x8664_ksyms.c 2004-07-14 01:20:25.000000000 +0200
@@ -41,11 +41,6 @@
extern void __read_lock_failed(rwlock_t *rw);
#endif
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
-extern struct drive_info_struct drive_info;
-EXPORT_SYMBOL(drive_info);
-#endif
-
extern unsigned long get_cmos_time(void);
/* platform dependent support */
--- linux-2.6.7-mm7-full/arch/i386/kernel/i386_ksyms.c.old 2004-07-14 01:22:27.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/i386/kernel/i386_ksyms.c 2004-07-14 01:22:39.000000000 +0200
@@ -51,11 +51,6 @@
extern void FASTCALL( __read_lock_failed(rwlock_t *rw));
#endif
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
-extern struct drive_info_struct drive_info;
-EXPORT_SYMBOL(drive_info);
-#endif
-
extern unsigned long cpu_khz;
extern unsigned long get_cmos_time(void);
--- linux-2.6.7-mm7-full/arch/ia64/sn/kernel/setup.c.old 2004-07-14 01:23:27.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/ia64/sn/kernel/setup.c 2004-07-14 01:24:19.000000000 +0200
@@ -109,20 +109,6 @@
};
/*
- * This is here so we can use the CMOS detection in ide-probe.c to
- * determine what drives are present. In theory, we don't need this
- * as the auto-detection could be done via ide-probe.c:do_probe() but
- * in practice that would be much slower, which is painful when
- * running in the simulator. Note that passing zeroes in DRIVE_INFO
- * is sufficient (the IDE driver will autodetect the drive geometry).
- */
-#ifdef CONFIG_IA64_GENERIC
-extern char drive_info[4*16];
-#else
-char drive_info[4*16];
-#endif
-
-/*
* This routine can only be used during init, since
* smp_boot_data is an init data structure.
* We have to use smp_boot_data.cpu_phys_id to find
--- linux-2.6.7-mm7-full/arch/ia64/dig/setup.c.old 2004-07-14 01:24:45.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/ia64/dig/setup.c 2004-07-14 01:25:02.000000000 +0200
@@ -25,16 +25,6 @@
#include <asm/machvec.h>
#include <asm/system.h>
-/*
- * This is here so we can use the CMOS detection in ide-probe.c to
- * determine what drives are present. In theory, we don't need this
- * as the auto-detection could be done via ide-probe.c:do_probe() but
- * in practice that would be much slower, which is painful when
- * running in the simulator. Note that passing zeroes in DRIVE_INFO
- * is sufficient (the IDE driver will autodetect the drive geometry).
- */
-char drive_info[4*16];
-
void __init
dig_setup (char **cmdline_p)
{
--- linux-2.6.7-mm7-full/arch/ppc/platforms/pmac_setup.c.old 2004-07-14 01:25:51.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/ppc/platforms/pmac_setup.c 2004-07-14 01:25:57.000000000 +0200
@@ -95,8 +95,6 @@
struct device_node *memory_node;
-unsigned char drive_info;
-
int ppc_override_l2cr = 0;
int ppc_override_l2cr_value;
int has_l2cache = 0;
--- linux-2.6.7-mm7-full/arch/cris/kernel/setup.c.old 2004-07-14 01:26:26.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/cris/kernel/setup.c 2004-07-14 01:26:42.000000000 +0200
@@ -23,7 +23,6 @@
/*
* Setup options
*/
-struct drive_info_struct { char dummy[32]; } drive_info;
struct screen_info screen_info;
unsigned char aux_device_present;
--- linux-2.6.7-mm7-full/arch/sh64/kernel/sh_ksyms.c.old 2004-07-14 01:27:07.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/sh64/kernel/sh_ksyms.c 2004-07-14 01:27:16.000000000 +0200
@@ -32,14 +32,6 @@
extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
-#if 0
-/* Not yet - there's no declaration of drive_info anywhere. */
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
-extern struct drive_info_struct drive_info;
-EXPORT_SYMBOL(drive_info);
-#endif
-#endif
-
/* platform dependent support */
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
--- linux-2.6.7-mm7-full/drivers/ide/legacy/hd.c.old 2004-07-14 01:29:42.000000000 +0200
+++ linux-2.6.7-mm7-full/drivers/ide/legacy/hd.c 2004-07-14 01:53:21.000000000 +0200
@@ -47,6 +47,10 @@
#include <asm/io.h>
#include <asm/uaccess.h>
+#ifdef __i386__
+#include <asm/setup.h>
+#endif
+
#ifdef __arm__
#undef HD_IRQ
#endif
@@ -726,8 +730,7 @@
#ifdef __i386__
if (!NR_HD) {
- extern struct drive_info drive_info;
- unsigned char *BIOS = (unsigned char *) &drive_info;
+ unsigned char *BIOS = &boot_params[0x80];
unsigned long flags;
int cmos_disks;
--- linux-2.6.7-mm7-full/arch/i386/kernel/setup.c.old 2004-07-14 01:28:56.000000000 +0200
+++ linux-2.6.7-mm7-full/arch/i386/kernel/setup.c 2004-07-14 01:59:25.000000000 +0200
@@ -102,7 +102,6 @@
/*
* Setup options
*/
-struct drive_info_struct { char dummy[32]; } drive_info;
struct screen_info screen_info;
struct apm_info apm_info;
struct sys_desc_table_struct {
@@ -1288,7 +1287,6 @@
#endif
ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
- drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
edid_info = EDID_INFO;
apm_info.bios = APM_BIOS_INFO;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [2.6 patch] kill drive_info
2004-07-14 0:08 [2.6 patch] kill drive_info Adrian Bunk
@ 2004-07-14 9:01 ` Andries Brouwer
2004-07-15 2:59 ` Adrian Bunk
0 siblings, 1 reply; 5+ messages in thread
From: Andries Brouwer @ 2004-07-14 9:01 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
On Wed, Jul 14, 2004 at 02:08:10AM +0200, Adrian Bunk wrote:
> What about the patch below to kill drive_info?
>
> Please double-check this patch, all I checked was a test of compilation
> on i386.
> - unsigned char *BIOS = (unsigned char *) &drive_info;
> + unsigned char *BIOS = &boot_params[0x80];
Ugly. There is already a define DRIVE_INFO for this right hand side:
setup.h:#define PARAM (boot_params)
setup.h:#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
> - drive_info = DRIVE_INFO;
Hmm. setup.c copies this info from where it was left after booting
to some safe place. You seem to think that this saving is not required.
Is it not?
Andries
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [2.6 patch] kill drive_info
2004-07-14 9:01 ` Andries Brouwer
@ 2004-07-15 2:59 ` Adrian Bunk
2004-07-15 10:44 ` cannot ping from a usb-serial device pietro canevarolo
2004-07-15 11:10 ` [2.6 patch] kill drive_info Andries Brouwer
0 siblings, 2 replies; 5+ messages in thread
From: Adrian Bunk @ 2004-07-15 2:59 UTC (permalink / raw)
To: Andries Brouwer; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
On Wed, Jul 14, 2004 at 11:01:59AM +0200, Andries Brouwer wrote:
>...
> > - drive_info = DRIVE_INFO;
>
> Hmm. setup.c copies this info from where it was left after booting
> to some safe place. You seem to think that this saving is not required.
> Is it not?
- boot_params is __initdata
- hd_init in legacy/hd.c is __init
- legacy/hd.c can't be built modular
Did I miss something?
The situation is different in 2.4 where the new (possibly modular) IDE
driver also uses drive_info .
> Andries
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 5+ messages in thread* cannot ping from a usb-serial device
2004-07-15 2:59 ` Adrian Bunk
@ 2004-07-15 10:44 ` pietro canevarolo
2004-07-15 11:10 ` [2.6 patch] kill drive_info Andries Brouwer
1 sibling, 0 replies; 5+ messages in thread
From: pietro canevarolo @ 2004-07-15 10:44 UTC (permalink / raw)
To: linux-kernel
Hi all,
I am developing a portable device that I must connect to Internet via usb.
I connect to my linux box with pppd on ttyUSB0 and the link layer is
working ok. I can ping my device from all the machines connected, but
when the device pings some address known reacheable my linux box sees
the packets ("ifconfig ppp0" returns the correct number of packets
exchanged and "netstat -i" reports the correct number of bytes on the
interface), but no echo replies come back to my device.
I understand that my question may be silly for this forum, but I am
really out of resources.
Can someone out there point me to some info to understand why this is
happening?
many tnx
pietro canevarolo
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [2.6 patch] kill drive_info
2004-07-15 2:59 ` Adrian Bunk
2004-07-15 10:44 ` cannot ping from a usb-serial device pietro canevarolo
@ 2004-07-15 11:10 ` Andries Brouwer
1 sibling, 0 replies; 5+ messages in thread
From: Andries Brouwer @ 2004-07-15 11:10 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andries Brouwer, Bartlomiej Zolnierkiewicz, linux-kernel
On Thu, Jul 15, 2004 at 04:59:48AM +0200, Adrian Bunk wrote:
> On Wed, Jul 14, 2004 at 11:01:59AM +0200, Andries Brouwer wrote:
> >...
> > > - drive_info = DRIVE_INFO;
> >
> > Hmm. setup.c copies this info from where it was left after booting
> > to some safe place. You seem to think that this saving is not required.
> > Is it not?
>
> - boot_params is __initdata
> - hd_init in legacy/hd.c is __init
> - legacy/hd.c can't be built modular
>
> The situation is different in 2.4 where the new (possibly modular) IDE
> driver also uses drive_info .
Yes, I see that this area (which used to be empty_zero_page)
is independent since 2.6.5.
So, maybe your patch is correct.
[Still, the patch brings knowledge about boot_params that earlier was
concentrated in head.S, setup.c, setup.h to elsewhere in the kernel. Ach.]
The doc file is still called zero-page.txt. One might add
0x228 4 bytes command line buffer
and possibly rename it.
Andries
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-07-15 11:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-14 0:08 [2.6 patch] kill drive_info Adrian Bunk
2004-07-14 9:01 ` Andries Brouwer
2004-07-15 2:59 ` Adrian Bunk
2004-07-15 10:44 ` cannot ping from a usb-serial device pietro canevarolo
2004-07-15 11:10 ` [2.6 patch] kill drive_info Andries Brouwer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox