* NFS mounted rootfs possible via PCMCIA NIC ?
@ 2002-12-11 21:53 Andreas Schaufler
2002-12-11 22:34 ` Andrew Morton
2002-12-11 23:12 ` Alan Cox
0 siblings, 2 replies; 8+ messages in thread
From: Andreas Schaufler @ 2002-12-11 21:53 UTC (permalink / raw)
To: Linux Kernel Mailing List
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello list,
I am trying to configure a notebook with a PCMCIA NIC to boot over network.
(kernel 2.4.20)
In order to accomplish this I passed over the neccessary configuration
paramters through the boot loader (ip, root, nfsroot)
The problem is: When the kernel is booting it is trying to configure the
Network interface, before it has been activated.
Thus my question is: Is it possible somehow to change the order by some
configuration parameter ?!?
Thanks for answers in advance
- -Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD4DBQE997P0hFLSFNIrGmsRAjMpAJitzpgKyTJDg6ubFy17u9GA+EZEAJ9kgBKv
k7Euyw1aT6/6ORWhzPjZwg==
=AmIZ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-11 21:53 NFS mounted rootfs possible via PCMCIA NIC ? Andreas Schaufler
@ 2002-12-11 22:34 ` Andrew Morton
2002-12-12 17:29 ` Andreas Schaufler
2002-12-11 23:12 ` Alan Cox
1 sibling, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2002-12-11 22:34 UTC (permalink / raw)
To: Andreas Schaufler; +Cc: Linux Kernel Mailing List
Andreas Schaufler wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello list,
>
> I am trying to configure a notebook with a PCMCIA NIC to boot over network.
> (kernel 2.4.20)
Nope. The kernel does the NFS thing before bringing up cardbus.
This patch worked, back in the 2.4.17 days. It also fixes some
cardbus bugs. I don't immediately recall what they were.
drivers/pcmcia/Makefile | 3 +
drivers/pcmcia/ds.c | 13 ++-----
drivers/pcmcia/yenta.c | 85 ++++++++++++++++++++++--------------------------
init/main.c | 3 -
4 files changed, 45 insertions(+), 59 deletions(-)
--- 24/drivers/pcmcia/ds.c~pcmcia-ip-autoconf Wed Dec 11 14:30:56 2002
+++ 24-akpm/drivers/pcmcia/ds.c Wed Dec 11 14:30:56 2002
@@ -968,14 +968,7 @@ int __init init_pcmcia_ds(void)
return 0;
}
-#ifdef MODULE
-
-int __init init_module(void)
-{
- return init_pcmcia_ds();
-}
-
-void __exit cleanup_module(void)
+void __exit cleanup_pcmcia_ds(void)
{
int i;
#ifdef CONFIG_PROC_FS
@@ -990,4 +983,6 @@ void __exit cleanup_module(void)
kfree(socket_table);
}
-#endif
+module_init(init_pcmcia_ds);
+module_exit(cleanup_pcmcia_ds);
+
--- 24/drivers/pcmcia/Makefile~pcmcia-ip-autoconf Wed Dec 11 14:30:56 2002
+++ 24-akpm/drivers/pcmcia/Makefile Wed Dec 11 14:30:56 2002
@@ -22,7 +22,7 @@ ifeq ($(CONFIG_CARDBUS),y)
endif
ifeq ($(CONFIG_PCMCIA),y)
- obj-y := cistpl.o rsrc_mgr.o bulkmem.o ds.o cs.o
+ obj-y := cistpl.o rsrc_mgr.o bulkmem.o cs.o
ifeq ($(CONFIG_CARDBUS),y)
obj-y += cardbus.o yenta.o pci_socket.o
endif
@@ -38,6 +38,7 @@ ifeq ($(CONFIG_PCMCIA),y)
ifeq ($(CONFIG_HD64465_PCMCIA),y)
obj-y += hd64465_ss.o
endif
+ obj-y += ds.o
else
ifeq ($(CONFIG_PCMCIA),m)
obj-m := pcmcia_core.o ds.o
--- 24/drivers/pcmcia/yenta.c~pcmcia-ip-autoconf Wed Dec 11 14:30:56 2002
+++ 24-akpm/drivers/pcmcia/yenta.c Wed Dec 11 14:30:56 2002
@@ -574,38 +574,6 @@ static void yenta_get_socket_capabilitie
printk("Yenta IRQ list %04x, PCI irq%d\n", socket->cap.irq_mask, socket->cb_irq);
}
-extern void cardbus_register(pci_socket_t *socket);
-
-/*
- * 'Bottom half' for the yenta_open routine. Allocate the interrupt line
- * and register the socket with the upper layers.
- */
-static void yenta_open_bh(void * data)
-{
- pci_socket_t * socket = (pci_socket_t *) data;
-
- /* It's OK to overwrite this now */
- socket->tq_task.routine = yenta_bh;
-
- if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->name, socket)) {
- /* No IRQ or request_irq failed. Poll */
- socket->cb_irq = 0; /* But zero is a valid IRQ number. */
- socket->poll_timer.function = yenta_interrupt_wrapper;
- socket->poll_timer.data = (unsigned long)socket;
- socket->poll_timer.expires = jiffies + HZ;
- add_timer(&socket->poll_timer);
- }
-
- /* Figure out what the dang thing can do for the PCMCIA layer... */
- yenta_get_socket_capabilities(socket, isa_interrupts);
- printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
-
- /* Register it with the pcmcia layer.. */
- cardbus_register(socket);
-
- MOD_DEC_USE_COUNT;
-}
-
static void yenta_clear_maps(pci_socket_t *socket)
{
int i;
@@ -823,6 +791,8 @@ static struct cardbus_override_struct {
#define NR_OVERRIDES (sizeof(cardbus_override)/sizeof(struct cardbus_override_struct))
+extern void cardbus_register(pci_socket_t *socket);
+
/*
* Initialize a cardbus controller. Make sure we have a usable
* interrupt, and that we can map the cardbus area. Fill in the
@@ -832,15 +802,19 @@ static int yenta_open(pci_socket_t *sock
{
int i;
struct pci_dev *dev = socket->dev;
+ int retval = -1;
+ int polling = 0;
+
+ MOD_INC_USE_COUNT;
/*
* Do some basic sanity checking..
*/
if (pci_enable_device(dev))
- return -1;
+ goto fail;
if (!pci_resource_start(dev, 0)) {
printk("No cardbus resource!\n");
- return -1;
+ goto fail;
}
/*
@@ -849,7 +823,7 @@ static int yenta_open(pci_socket_t *sock
*/
socket->base = ioremap(pci_resource_start(dev, 0), 0x1000);
if (!socket->base)
- return -1;
+ goto fail;
yenta_config_init(socket);
@@ -867,24 +841,43 @@ static int yenta_open(pci_socket_t *sock
if (dev->vendor == d->vendor && dev->device == d->device) {
socket->op = d->op;
if (d->op->open) {
- int retval = d->op->open(socket);
- if (retval < 0)
- return retval;
+ int ret = d->op->open(socket);
+ if (ret < 0) {
+ iounmap(socket->base);
+ retval = ret;
+ goto fail;
+ }
}
}
}
- /* Get the PCMCIA kernel thread to complete the
- initialisation later. We can't do this here,
- because, er, because Linus says so :)
- */
- socket->tq_task.routine = yenta_open_bh;
+ socket->tq_task.routine = yenta_bh;
socket->tq_task.data = socket;
- MOD_INC_USE_COUNT;
- schedule_task(&socket->tq_task);
+ if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt,
+ SA_SHIRQ, socket->dev->name, socket)) {
+ /* No IRQ or request_irq failed. Poll */
+ socket->cb_irq = 0; /* But zero is a valid IRQ number. */
+ socket->poll_timer.function = yenta_interrupt_wrapper;
+ socket->poll_timer.data = (unsigned long)socket;
+ socket->poll_timer.expires = jiffies + HZ;
+ polling = 1;
+ }
- return 0;
+ /* Figure out what the dang thing can do for the PCMCIA layer... */
+ yenta_get_socket_capabilities(socket, isa_interrupts);
+ printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
+
+ /* Register it with the pcmcia layer.. */
+ cardbus_register(socket);
+
+ if (polling)
+ add_timer(&socket->poll_timer);
+
+ retval = 0;
+fail:
+ MOD_DEC_USE_COUNT;
+ return retval;
}
/*
--- 24/init/main.c~pcmcia-ip-autoconf Wed Dec 11 14:30:56 2002
+++ 24-akpm/init/main.c Wed Dec 11 14:30:56 2002
@@ -533,9 +533,6 @@ static void __init do_basic_setup(void)
irda_proto_init();
irda_device_init(); /* Must be done after protocol initialization */
#endif
-#ifdef CONFIG_PCMCIA
- init_pcmcia_ds(); /* Do this last */
-#endif
}
extern void prepare_namespace(void);
_
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-11 21:53 NFS mounted rootfs possible via PCMCIA NIC ? Andreas Schaufler
2002-12-11 22:34 ` Andrew Morton
@ 2002-12-11 23:12 ` Alan Cox
2002-12-12 17:29 ` Andreas Schaufler
1 sibling, 1 reply; 8+ messages in thread
From: Alan Cox @ 2002-12-11 23:12 UTC (permalink / raw)
To: Andreas Schaufler; +Cc: Linux Kernel Mailing List
On Wed, 2002-12-11 at 21:53, Andreas Schaufler wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello list,
>
> I am trying to configure a notebook with a PCMCIA NIC to boot over network.
> (kernel 2.4.20)
> In order to accomplish this I passed over the neccessary configuration
> paramters through the boot loader (ip, root, nfsroot)
>
> The problem is: When the kernel is booting it is trying to configure the
> Network interface, before it has been activated.
PCMCIA relies in part on user space. You can do this, it involves
building a large initrd with a dhcp client on it that sets up pcmcia,
then nfs mounts stuff, then pivot_root()'s into it. Its not exactly
trivial
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-11 22:34 ` Andrew Morton
@ 2002-12-12 17:29 ` Andreas Schaufler
2002-12-12 17:35 ` Andrew Morton
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schaufler @ 2002-12-12 17:29 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> > Hello list,
> >
> > I am trying to configure a notebook with a PCMCIA NIC to boot over
> > network. (kernel 2.4.20)
>
> Nope. The kernel does the NFS thing before bringing up cardbus.
>
> This patch worked, back in the 2.4.17 days. It also fixes some
> cardbus bugs. I don't immediately recall what they were.
I got the 2.4.17 sources and applied the patch. yenta.c and main.c could not
be patched automatically, so I tried to apply it by hand line by line.
Unfortunately when I boot a kernel compiled witch this modified sources I get
an "Unable to handle kernel pagin request at virtual address 0000413d"
Maybe this patch is to be used on some Pre Version of 2.4.17 ?!?!
regards
- -Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9+MeFhFLSFNIrGmsRAg0HAJ0RBZ/WKDxvv8YXXTLbT7REnqoVowCcC8tL
sGgZre0DIZOAdFVW6kn56rg=
=23D5
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-11 23:12 ` Alan Cox
@ 2002-12-12 17:29 ` Andreas Schaufler
2002-12-12 21:49 ` H. Peter Anvin
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schaufler @ 2002-12-12 17:29 UTC (permalink / raw)
To: Alan Cox; +Cc: Linux Kernel Mailing List
...
> PCMCIA relies in part on user space. You can do this, it involves
> building a large initrd with a dhcp client on it that sets up pcmcia,
> then nfs mounts stuff, then pivot_root()'s into it. Its not exactly
> trivial
Thanks for your reply. I get the basic idea from what you say. But what do you
mean by pivot_root()'ing into it ?!?
I'll try Andrew Morton's suggestion first, because it sounds easier. If I
can't get it running I'll try your suggestion.
regards
-Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-12 17:29 ` Andreas Schaufler
@ 2002-12-12 17:35 ` Andrew Morton
2002-12-13 20:28 ` Andreas Schaufler
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2002-12-12 17:35 UTC (permalink / raw)
To: Andreas Schaufler; +Cc: Linux Kernel Mailing List
Andreas Schaufler wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > > Hello list,
> > >
> > > I am trying to configure a notebook with a PCMCIA NIC to boot over
> > > network. (kernel 2.4.20)
> >
> > Nope. The kernel does the NFS thing before bringing up cardbus.
> >
> > This patch worked, back in the 2.4.17 days. It also fixes some
> > cardbus bugs. I don't immediately recall what they were.
>
> I got the 2.4.17 sources and applied the patch. yenta.c and main.c could not
> be patched automatically, so I tried to apply it by hand line by line.
> Unfortunately when I boot a kernel compiled witch this modified sources I get
> an "Unable to handle kernel pagin request at virtual address 0000413d"
>
> Maybe this patch is to be used on some Pre Version of 2.4.17 ?!?!
>
Sorry, that patch was against 2.4.20. It was last tested in 2.4.17.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-12 17:29 ` Andreas Schaufler
@ 2002-12-12 21:49 ` H. Peter Anvin
0 siblings, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2002-12-12 21:49 UTC (permalink / raw)
To: linux-kernel
Followup to: <200212121829.46465.andreas.schaufler@gmx.de>
By author: Andreas Schaufler <andreas.schaufler@gmx.de>
In newsgroup: linux.dev.kernel
>
> ...
> > PCMCIA relies in part on user space. You can do this, it involves
> > building a large initrd with a dhcp client on it that sets up pcmcia,
> > then nfs mounts stuff, then pivot_root()'s into it. Its not exactly
> > trivial
>
> Thanks for your reply. I get the basic idea from what you say. But what do you
> mean by pivot_root()'ing into it ?!?
>
pivot_root() is a system call which flips the root directory around.
See Documentation/initrd.txt.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: NFS mounted rootfs possible via PCMCIA NIC ?
2002-12-12 17:35 ` Andrew Morton
@ 2002-12-13 20:28 ` Andreas Schaufler
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Schaufler @ 2002-12-13 20:28 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List
Am Donnerstag, 12. Dezember 2002 18:35 schrieb Andrew Morton:
...
> >
> > Maybe this patch is to be used on some Pre Version of 2.4.17 ?!?!
>
> Sorry, that patch was against 2.4.20. It was last tested in 2.4.17.
Ok, thank you very much. It did not patch automatically in 2.4.20 though. But
after I applied it manually everything works fine.
Now I can use my old Notebook, which has a broken IDE Controller, again :-)
best regards from a happy Linux User
-Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-12-13 19:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-11 21:53 NFS mounted rootfs possible via PCMCIA NIC ? Andreas Schaufler
2002-12-11 22:34 ` Andrew Morton
2002-12-12 17:29 ` Andreas Schaufler
2002-12-12 17:35 ` Andrew Morton
2002-12-13 20:28 ` Andreas Schaufler
2002-12-11 23:12 ` Alan Cox
2002-12-12 17:29 ` Andreas Schaufler
2002-12-12 21:49 ` 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