2005-01-08 21:45:57

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] drivers/block/ps2esdi.c: remove two unused functions (fwd)

The patch below still applies and compiles against 2.6.10-mm2.

Please apply.


----- Forwarded message from Adrian Bunk <[email protected]> -----

Date: Mon, 29 Nov 2004 13:35:00 +0100
From: Adrian Bunk <[email protected]>
To: [email protected]
Subject: [2.6 patch] drivers/block/ps2esdi.c: remove two unused functions

The patch below removes two unused global functions.


diffstat output:
drivers/block/ps2esdi.c | 42 ----------------------------------------
1 files changed, 42 deletions(-)


Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.10-rc1-mm3-full/drivers/block/ps2esdi.c.old 2004-11-06 20:17:34.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/block/ps2esdi.c 2004-11-06 20:18:33.000000000 +0100
@@ -221,48 +221,6 @@
}
#endif /* MODULE */

-/* handles boot time command line parameters */
-void __init tp720_setup(char *str, int *ints)
-{
- /* no params, just sets the tp720esdi flag if it exists */
-
- printk("%s: TP 720 ESDI flag set\n", DEVICE_NAME);
- tp720esdi = 1;
-}
-
-void __init ed_setup(char *str, int *ints)
-{
- int hdind = 0;
-
- /* handles 3 parameters only - corresponding to
- 1. Number of cylinders
- 2. Number of heads
- 3. Sectors/track
- */
-
- if (ints[0] != 3)
- return;
-
- /* print out the information - seen at boot time */
- printk("%s: ints[0]=%d ints[1]=%d ints[2]=%d ints[3]=%d\n",
- DEVICE_NAME, ints[0], ints[1], ints[2], ints[3]);
-
- /* set the index into device specific information table */
- if (ps2esdi_info[0].head != 0)
- hdind = 1;
-
- /* set up all the device information */
- ps2esdi_info[hdind].head = ints[2];
- ps2esdi_info[hdind].sect = ints[3];
- ps2esdi_info[hdind].cyl = ints[1];
- ps2esdi_info[hdind].wpcom = 0;
- ps2esdi_info[hdind].lzone = ints[1];
- ps2esdi_info[hdind].ctl = (ints[2] > 8 ? 8 : 0);
-#if 0 /* this may be needed for PS2/Mod.80, but it hurts ThinkPad! */
- ps2esdi_drives = hdind + 1; /* increment index for the next time */
-#endif
-} /* ed_setup */
-
static int ps2esdi_getinfo(char *buf, int slot, void *d)
{
int len = 0;


2005-01-08 23:43:50

by Andries Brouwer

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/block/ps2esdi.c: remove two unused functions (fwd)

On Sat, Jan 08, 2005 at 10:40:36PM +0100, Adrian Bunk wrote:
> The patch below still applies and compiles against 2.6.10-mm2.
>
> Date: Mon, 29 Nov 2004 13:35:00 +0100
> From: Adrian Bunk <[email protected]>
> To: [email protected]
> Subject: [2.6 patch] drivers/block/ps2esdi.c: remove two unused functions
>
> The patch below removes two unused global functions.
>
> --- linux-2.6.10-rc1-mm3-full/drivers/block/ps2esdi.c.old 2004-11-06 20:17:34.000000000 +0100
> +++ linux-2.6.10-rc1-mm3-full/drivers/block/ps2esdi.c 2004-11-06 20:18:33.000000000 +0100
...
> -void __init tp720_setup(char *str, int *ints)
> -{
...
> -
> -void __init ed_setup(char *str, int *ints)
> -{
...

Hmm. You remove the setup functions, but not the rest of the code.

Of course it is true that nobody uses these today.
On the other hand, I imagine that there was no conscious decision
to kill them. Patch 2.3.13 (August 1999) introduces the
__setup/__initcall setup, and Linus wrote

"Ok, I finally did what I've wanted to do for a _loong_ time: get rid of
the horrible #ifdef CONFIG_XXXX mess in init/main.c.
...
I've fixed up a few of the old command lines and initialization functions,
but I'm hoping that driver writers can re-instate their own setup
functions rather than me trying to fix up them all by hand."

Many ancient drivers were broken, and perhaps nobody noticed.

For example, Documentation/kernel-parameters.txt tells us that we
can use tp720=, which is false today. It becomes true upon adding
a line

__setup("tp720=", tp720_setup)

and changing the tp720_setup prototype a little.
(Remove the int *ints, possibly add a call to get_options().)

Since there was no storm of complaints, it may be that we can just
remove all reference to tp720, possibly all of ps2esdi, and
similarly for xd. For the past few years the only discussions
have been about these not compiling and getting janitor-type fixes.

Is Paul Gortmaker the only Linux user who still uses this hardware?

Andries

2005-01-11 04:35:33

by Andries Brouwer

[permalink] [raw]
Subject: Do PS/2 ESDI users exist?

Yesterday I mentioned that patch 2.3.13 killed the setup,
so that tp720_setup and ed_setup would not be called anymore.
Hand-specifying the geometry failed from then on.

Since nobody noticed, maybe nobody with compiled-in ps2esdi
needed to specify the geometry.

In 2.1.128 (Nov 1998) the driver was modularised, but that patch
contained a few typos so that the driver would not build as a module.
Several people - all without ps2 hardware - submitted a patch,
and the correction finally went into patch-2.6.0-test6 (Sep 2003).

All that time, no actual (potential) users complained.
So, maybe nobody tried to use it as a module.

Google shows that lots of people have CONFIG_BLK_DEV_PS2=m.
Why didn't they notice? Because that setting results (e.g. under 2.4) in
#undef CONFIG_BLK_DEV_PS2
#define CONFIG_BLK_DEV_PS2_MODULE 1
in <linux/autoconf.h>, and ps2esdi.c is inside #ifdef CONFIG_BLK_DEV_PS2.

Have there ever existed ESDI users? Yes, using out-of-tree patches before
2.1.15, and in the 2.1 - 2.2 time frame. I seem to be unable to find traces
of later users - just a few people who try and fail.

I wonder whether ps2esdi should be removed.
Does the present driver work for someone?
Have there been users in this millennium? With 2.3 or later?

Andries

2005-01-11 04:50:26

by Andrew Morton

[permalink] [raw]
Subject: Re: Do PS/2 ESDI users exist?

Andries Brouwer <[email protected]> wrote:
>
> I wonder whether ps2esdi should be removed.
> Does the present driver work for someone?
> Have there been users in this millennium? With 2.3 or later?

We could mark it CONFIG_BROKEN, leave it six months or so, see if anyone
complains.

2005-01-11 10:37:22

by Erik Mouw

[permalink] [raw]
Subject: Re: Do PS/2 ESDI users exist?

On Tue, Jan 11, 2005 at 05:32:20AM +0100, Andries Brouwer wrote:
> I wonder whether ps2esdi should be removed.
> Does the present driver work for someone?
> Have there been users in this millennium? With 2.3 or later?

If you really insist, I have an IBM PS/2 model 55/SX on my attic with
an ESDI interface that I could give a try. I need to put some more
memory in it though, it currently has 2MB and that's insufficient (an
80387SX/16 FPU would also be nice, I guess).


Erik

--
+-- Erik Mouw -- http://www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

2005-01-11 17:20:02

by Alan

[permalink] [raw]
Subject: Re: Do PS/2 ESDI users exist?

On Maw, 2005-01-11 at 04:32, Andries Brouwer wrote:
> I wonder whether ps2esdi should be removed.
> Does the present driver work for someone?
> Have there been users in this millennium? With 2.3 or later?

Doubt it. esdi is the earlier end of the PS/2 world, and the tp720 is a
specific laptop with MCA bus from prehistory. I have used p2esdi years
ago but solely for the purpose of checking it worked.

2005-01-15 19:09:22

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: Do PS/2 ESDI users exist?

On Mon, Jan 10, 2005 at 08:49:09PM -0800, Andrew Morton wrote:
> Andries Brouwer <[email protected]> wrote:
> >
> > I wonder whether ps2esdi should be removed.
> > Does the present driver work for someone?
> > Have there been users in this millennium? With 2.3 or later?
>
> We could mark it CONFIG_BROKEN, leave it six months or so, see if anyone
> complains.

OK.

diff -uprN -X /linux/dontdiff a/drivers/block/Kconfig b/drivers/block/Kconfig
--- a/drivers/block/Kconfig 2004-12-29 03:39:44.000000000 +0100
+++ b/drivers/block/Kconfig 2005-01-11 12:35:25.000000000 +0100
@@ -42,7 +42,7 @@ config MAC_FLOPPY

config BLK_DEV_PS2
tristate "PS/2 ESDI hard disk support"
- depends on MCA && MCA_LEGACY
+ depends on MCA && MCA_LEGACY && BROKEN
help
Say Y here if you have a PS/2 machine with a MCA bus and an ESDI
hard disk.

I hesitated a bit: Just removing something means: we do no longer
want to support it. That might happen even when a feature still
works. For example, xiafs was removed, but it worked fine.
On the other hand, saying that something is broken invites the
question "what precisely is broken?", and is an invitation to fix
rather than an announcement of an intention to obsolete.

Maybe I would prefer just to throw ps2esdi out, and say that
2.2 is the preferred distribution for people who need ps2esdi.

As observed earlier, ps2esdi was broken as a module,
and the passing of geometry boot parameters is broken.
But does it still work with kernels 2.3 or later?
I think it does, but failed to verify that.

I found an IBM PS/2 model 70-A21 with 8 MB and 120 MB ESDI disk.
Tried a few distribution boot floppies to see whether they would boot.

Slackware has special ibmmca bootdisks.
SW 3.3 - Linux 2.1.43 - boots fine
SW 4.0 - Linux 2.2.6 - hangs
SW 7.0 - Linux 2.2.13 - boots fine
SW 8.1 - Linux 2.4.18 - boots, but every single command is killed by OOM
SW 10.0 - Linux 2.4.26 - kernel panic: no 386 supported

Then Debian:
Woody - Linux 2.2.10 - boots fine, but the rootdisk hangs
Sarge - Linux 2.4.27 - does not recognize the ESDI disk, and the rootdisk
crashes by OOM.

So, good luck with 2.1 and 2.2 kernels, only failures with later kernels.

What about other people? The two major Linux/MCA sites were
http://glycerine.itsmm.uni.edu/mca (also referenced in Documentation/mca.txt)
but it doesnt exist any longer, and http://www.dgmicro.com/mca/,
which still exists ("last update: Jan 28 1999"), but the binaries
it refers to live on ftp.dgmicro.com, which isn't there anymore.

Concerning the speed:
I measured this ESDI disk under Linux as transferring 50 kB/s,
that is 4% of the speed the IBM specs claim. Also other Linux users
complained that the disk is much faster under DOS.

Andries