2002-01-19 21:59:10

by Rob Radez

[permalink] [raw]
Subject: [PATCH] Andre's IDE Patch (1/7)

This is the first of seven patches against 2.4.18-pre4, beginning the breakup
of Andre Hedrick's IDE patch into smaller chunks. This group of seven
patches is ~2000 lines long and consists of about one fifth of the entire
IDE patch. None of these patches include anything related to Taskfile I/O
yet, and all of them have been successfully compiled. Patches 2, 3, and 7
have also all been booted. Patch 2, which deals with drivers/ide/hpt366.c
also correctly located my on-board HPT370, however I couldn't test any
drives on it since I don't have any hooked up to that controller.
These aren't being sent to Marcelo yet, just because I want to make sure
there are no major objections/problems with them. I'm standing by with
the brown paper bag just in case I screw something up, so the delay will
hopefully flesh out any problems with any of this first batch of patches.

Description of patch 1:
Very simple patch, touches 4 files of which only two get compiled.
Updates CREDITS and MAINTAINERS with correct contact info, and adds some
ifdef/ifndef's to drivers/ide/ide-cd.h and drivers/ide/ide-geometry.c

Regards,
Rob Radez

diff -ruN linux-2.4.18-pre3/CREDITS linux-2.4.18-pre3-ide-rr/CREDITS
--- linux-2.4.18-pre3/CREDITS Thu Jan 10 17:04:42 2002
+++ linux-2.4.18-pre3-ide-rr/CREDITS Mon Jan 14 18:28:54 2002
@@ -586,6 +586,13 @@
S: University of Michigan
S: Ann Arbor, MI

+N: Michael Cornwell
+E: [email protected]
+D: Original designer and co-author of ATA Taskfile
+D: Kernel module SMART utilities
+S: Santa Cruz, California
+S: USA
+
N: Kees Cook
E: [email protected]
W: http://outflux.net/
@@ -1184,22 +1191,19 @@

N: Andre Hedrick
E: [email protected]
-E: [email protected]
-E: [email protected]
+E: [email protected]
W: http://www.linux-ide.org/
+W: http://www.linuxdiskcert.org/
D: Random SMP kernel hacker...
D: Uniform Multi-Platform E-IDE driver
D: Active-ATA-Chipset maddness..........
-D: Ultra DMA 100/66/33
-D: ATA-Disconnect
+D: Ultra DMA 133/100/66/33 w/48-bit Addressing
+D: ATA-Disconnect, ATA-TCQ
D: ATA-Smart Kernel Daemon
+D: Serial ATA
+D: ATA Command Block and Taskfile
S: Linux ATA Development (LAD)
S: Concord, CA
-S: ASL, Inc. 1-877-ASL-3535
-S: 1757 Houret Court, Milpitas, CA 95035
-S: SuSE Linux, Inc.
-S: 580 Second Street, Suite 210 Oakland, CA 94607
-S: USA

N: Jochen Hein
E: [email protected]
diff -ruN linux-2.4.18-pre3/drivers/ide/ide-cd.h linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h
--- linux-2.4.18-pre3/drivers/ide/ide-cd.h Thu Nov 22 14:46:58 2001
+++ linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h Mon Jan 14 18:29:06 2002
@@ -38,7 +38,9 @@
/************************************************************************/

#define SECTOR_BITS 9
+#ifndef SECTOR_SIZE
#define SECTOR_SIZE (1 << SECTOR_BITS)
+#endif
#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
#define SECTORS_BUFFER (SECTOR_BUFFER_SIZE >> SECTOR_BITS)
diff -ruN linux-2.4.18-pre3/drivers/ide/ide-geometry.c linux-2.4.18-pre3-ide-rr/drivers/ide/ide-geometry.c
--- linux-2.4.18-pre3/drivers/ide/ide-geometry.c Fri Nov 9 17:23:34 2001
+++ linux-2.4.18-pre3-ide-rr/drivers/ide/ide-geometry.c Mon Jan 14 18:29:06 2002
@@ -6,6 +6,8 @@
#include <linux/mc146818rtc.h>
#include <asm/io.h>

+#ifdef CONFIG_BLK_DEV_IDE
+
/*
* We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc
* controller that is BIOS compatible with ST-506, and thus showing up in our
@@ -40,7 +42,11 @@
* Consequently, also the former "drive->present = 1" below was a mistake.
*
* Eventually the entire routine below should be removed.
+ *
+ * 17-OCT-2000 [email protected] Added spin-locks for reading CMOS
+ * chip.
*/
+
void probe_cmos_for_drives (ide_hwif_t *hwif)
{
#ifdef __i386__
@@ -80,9 +86,10 @@
}
#endif
}
+#endif /* CONFIG_BLK_DEV_IDE */


-#ifdef CONFIG_BLK_DEV_IDE
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)

extern ide_drive_t * get_info_ptr(kdev_t);
extern unsigned long current_capacity (ide_drive_t *);
@@ -214,4 +221,4 @@
drive->bios_cyl, drive->bios_head, drive->bios_sect);
return ret;
}
-#endif /* CONFIG_BLK_DEV_IDE */
+#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
diff -ruN linux-2.4.18-pre3/MAINTAINERS linux-2.4.18-pre3-ide-rr/MAINTAINERS
--- linux-2.4.18-pre3/MAINTAINERS Thu Jan 10 17:04:42 2002
+++ linux-2.4.18-pre3-ide-rr/MAINTAINERS Mon Jan 14 18:28:55 2002
@@ -706,12 +706,12 @@
IDE DRIVER [GENERAL]
P: Andre Hedrick
M: [email protected]
-M: [email protected]
-M: [email protected]
+M: [email protected]
L: [email protected]
W: http://www.kernel.org/pub/linux/kernel/people/hedrick/
W: http://www.linux-ide.org/
-S: Supported
+W: http://www.linuxdiskcert.org/
+S: Maintained

IDE/ATAPI CDROM DRIVER
P: Jens Axboe








2002-01-19 22:21:59

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)

On Sat, Jan 19, 2002 at 04:58:42PM -0500, Rob Radez wrote:

> This is the first of seven patches against 2.4.18-pre4

Do you wanna wait and do this again vs 2.4.18-final (for 2.4.19-pre1?)
Maybe I missed something but this is still a large set of changes to a
working subsystem, and requires drivers not in Andres patchset (like say
the ones for PowerMacs) to be updated occordingly.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

2002-01-19 22:42:20

by D. Hugh Redelmeier

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)

| From: Rob Radez <[email protected]>

| This is the first of seven patches against 2.4.18-pre4, beginning the breakup
| of Andre Hedrick's IDE patch into smaller chunks.

I'm glad you are doing this, although I am ignorant of the politics.

I have an HPT366 that I have never used due to fear of drivers not in
the mainstream.

| diff -ruN linux-2.4.18-pre3/drivers/ide/ide-cd.h linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h
| --- linux-2.4.18-pre3/drivers/ide/ide-cd.h Thu Nov 22 14:46:58 2001
| +++ linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h Mon Jan 14 18:29:06 2002
| @@ -38,7 +38,9 @@
| /************************************************************************/
|
| #define SECTOR_BITS 9
| +#ifndef SECTOR_SIZE
| #define SECTOR_SIZE (1 << SECTOR_BITS)
| +#endif
| #define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
| #define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
| #define SECTORS_BUFFER (SECTOR_BUFFER_SIZE >> SECTOR_BITS)

Being a chicken, I wonder if this would be better as:

#define SECTOR_BITS 9
+#ifdef SECTOR_SIZE
+#if SECTOR_SIZE != (1 << SECTOR_BITS)
+#error SECTOR_SIZE != (1 << SECTOR_BITS)
+#else
#define SECTOR_SIZE (1 << SECTOR_BITS)
+#endif
#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
#define SECTORS_BUFFER (SECTOR_BUFFER_SIZE >> SECTOR_BITS)

Hugh Redelmeier
[email protected] voice: +1 416 482-8253

2002-01-20 00:58:56

by Rob Radez

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)


On Sat, 19 Jan 2002, Andre Hedrick wrote:

>
> Please don't do that. There is a fatal flaw in those patches we all
> observed in 2.5.3pre1. I have 2.4.16 as a possible candidate and
> auto-patching for 2.4.17 at the moment.

On Wed, 16 Jan 2002, Andre Hedrick wrote:
> If the driver falls out of DMA, DEADBOX!!!!
> There is a conflict of BIO and ACB and it is very fatal.

It was my impression that the problem with 2.5.3-pre1 was a complication
that existed only because of bio in 2.5. Oops. I assume this means then
that all of us running your ide.2.4.16.12102001.patch should immediately
revert so Bad Things don't happen?

Regards,
Rob Radez

2002-01-20 01:20:01

by Anton Altaparmakov

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)

I think I know what Andre is referring to (Andre please correct me if I am
wrong) and if I am correct than you are still safe to use the currently
existing big patch (as long as you do NOT tamper with it in any way - I
mean that, a one line change is sufficient to destroy your data). If you
split it up, there is a _very_ high chance broken code will be executed
which will destroy your data on first time a PIO transfer occurs...

Best regards,

Anton

At 00:58 20/01/02, Rob Radez wrote:
>On Sat, 19 Jan 2002, Andre Hedrick wrote:
> > Please don't do that. There is a fatal flaw in those patches we all
> > observed in 2.5.3pre1. I have 2.4.16 as a possible candidate and
> > auto-patching for 2.4.17 at the moment.
>
>On Wed, 16 Jan 2002, Andre Hedrick wrote:
> > If the driver falls out of DMA, DEADBOX!!!!
> > There is a conflict of BIO and ACB and it is very fatal.
>
>It was my impression that the problem with 2.5.3-pre1 was a complication
>that existed only because of bio in 2.5. Oops. I assume this means then
>that all of us running your ide.2.4.16.12102001.patch should immediately
>revert so Bad Things don't happen?




--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

2002-01-21 05:50:00

by Andre Hedrick

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)


No but if you miss a one liner stub that bit me in the 2.5.3, you will
have the problems of 2.5.3.


On Sat, 19 Jan 2002, Rob Radez wrote:

>
> On Sat, 19 Jan 2002, Andre Hedrick wrote:
>
> >
> > Please don't do that. There is a fatal flaw in those patches we all
> > observed in 2.5.3pre1. I have 2.4.16 as a possible candidate and
> > auto-patching for 2.4.17 at the moment.
>
> On Wed, 16 Jan 2002, Andre Hedrick wrote:
> > If the driver falls out of DMA, DEADBOX!!!!
> > There is a conflict of BIO and ACB and it is very fatal.
>
> It was my impression that the problem with 2.5.3-pre1 was a complication
> that existed only because of bio in 2.5. Oops. I assume this means then
> that all of us running your ide.2.4.16.12102001.patch should immediately
> revert so Bad Things don't happen?
>
> Regards,
> Rob Radez
>

Andre Hedrick
Linux Disk Certification Project Linux ATA Development

2002-01-21 05:50:00

by Andre Hedrick

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)


Anton is correct, his the first person to ever sit down and do a peer
review of the code otherwise it would have been found earlier.
The code is correct, but how it interfaces to the kernel is dead wrong,
with the exclusion of DMA.

Data should not be damaged, since a simple pio mount would deadlock cold,
or even faster earlier deadlock would happen durning partition checking,
long before.

The full disclosure is one line was stubbed out/ changed to an undef,
thus disk io was not running PIO taskfile, a simple one line change made
things appear one way and not as reality suggested.

For the most part, the patch cleans up all the other automatic services.
This stablized some minor issues but to specifics are not fully chased and
documented.

It comes down to one thing, I got to deep in the hardware to make it run
perfect and clean and forgot how to make it interface to the kernel.

Regards,

On Sun, 20 Jan 2002, Anton Altaparmakov wrote:

> I think I know what Andre is referring to (Andre please correct me if I am
> wrong) and if I am correct than you are still safe to use the currently
> existing big patch (as long as you do NOT tamper with it in any way - I
> mean that, a one line change is sufficient to destroy your data). If you
> split it up, there is a _very_ high chance broken code will be executed
> which will destroy your data on first time a PIO transfer occurs...
>
> Best regards,
>
> Anton
>
> At 00:58 20/01/02, Rob Radez wrote:
> >On Sat, 19 Jan 2002, Andre Hedrick wrote:
> > > Please don't do that. There is a fatal flaw in those patches we all
> > > observed in 2.5.3pre1. I have 2.4.16 as a possible candidate and
> > > auto-patching for 2.4.17 at the moment.
> >
> >On Wed, 16 Jan 2002, Andre Hedrick wrote:
> > > If the driver falls out of DMA, DEADBOX!!!!
> > > There is a conflict of BIO and ACB and it is very fatal.
> >
> >It was my impression that the problem with 2.5.3-pre1 was a complication
> >that existed only because of bio in 2.5. Oops. I assume this means then
> >that all of us running your ide.2.4.16.12102001.patch should immediately
> >revert so Bad Things don't happen?
>
>
>
>
> --
> "I've not lost my mind. It's backed up on tape somewhere." - Unknown
> --
> Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
> Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
> ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/
>

Andre Hedrick
Linux Disk Certification Project Linux ATA Development

2002-01-21 05:49:50

by Andre Hedrick

[permalink] [raw]
Subject: Re: [PATCH] Andre's IDE Patch (1/7)


Please don't do that. There is a fatal flaw in those patches we all
observed in 2.5.3pre1. I have 2.4.16 as a possible candidate and
auto-patching for 2.4.17 at the moment.

Regards,

On Sat, 19 Jan 2002, Rob Radez wrote:

> This is the first of seven patches against 2.4.18-pre4, beginning the breakup
> of Andre Hedrick's IDE patch into smaller chunks. This group of seven
> patches is ~2000 lines long and consists of about one fifth of the entire
> IDE patch. None of these patches include anything related to Taskfile I/O
> yet, and all of them have been successfully compiled. Patches 2, 3, and 7
> have also all been booted. Patch 2, which deals with drivers/ide/hpt366.c
> also correctly located my on-board HPT370, however I couldn't test any
> drives on it since I don't have any hooked up to that controller.
> These aren't being sent to Marcelo yet, just because I want to make sure
> there are no major objections/problems with them. I'm standing by with
> the brown paper bag just in case I screw something up, so the delay will
> hopefully flesh out any problems with any of this first batch of patches.
>
> Description of patch 1:
> Very simple patch, touches 4 files of which only two get compiled.
> Updates CREDITS and MAINTAINERS with correct contact info, and adds some
> ifdef/ifndef's to drivers/ide/ide-cd.h and drivers/ide/ide-geometry.c
>
> Regards,
> Rob Radez
>
> diff -ruN linux-2.4.18-pre3/CREDITS linux-2.4.18-pre3-ide-rr/CREDITS
> --- linux-2.4.18-pre3/CREDITS Thu Jan 10 17:04:42 2002
> +++ linux-2.4.18-pre3-ide-rr/CREDITS Mon Jan 14 18:28:54 2002
> @@ -586,6 +586,13 @@
> S: University of Michigan
> S: Ann Arbor, MI
>
> +N: Michael Cornwell
> +E: [email protected]
> +D: Original designer and co-author of ATA Taskfile
> +D: Kernel module SMART utilities
> +S: Santa Cruz, California
> +S: USA
> +
> N: Kees Cook
> E: [email protected]
> W: http://outflux.net/
> @@ -1184,22 +1191,19 @@
>
> N: Andre Hedrick
> E: [email protected]
> -E: [email protected]
> -E: [email protected]
> +E: [email protected]
> W: http://www.linux-ide.org/
> +W: http://www.linuxdiskcert.org/
> D: Random SMP kernel hacker...
> D: Uniform Multi-Platform E-IDE driver
> D: Active-ATA-Chipset maddness..........
> -D: Ultra DMA 100/66/33
> -D: ATA-Disconnect
> +D: Ultra DMA 133/100/66/33 w/48-bit Addressing
> +D: ATA-Disconnect, ATA-TCQ
> D: ATA-Smart Kernel Daemon
> +D: Serial ATA
> +D: ATA Command Block and Taskfile
> S: Linux ATA Development (LAD)
> S: Concord, CA
> -S: ASL, Inc. 1-877-ASL-3535
> -S: 1757 Houret Court, Milpitas, CA 95035
> -S: SuSE Linux, Inc.
> -S: 580 Second Street, Suite 210 Oakland, CA 94607
> -S: USA
>
> N: Jochen Hein
> E: [email protected]
> diff -ruN linux-2.4.18-pre3/drivers/ide/ide-cd.h linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h
> --- linux-2.4.18-pre3/drivers/ide/ide-cd.h Thu Nov 22 14:46:58 2001
> +++ linux-2.4.18-pre3-ide-rr/drivers/ide/ide-cd.h Mon Jan 14 18:29:06 2002
> @@ -38,7 +38,9 @@
> /************************************************************************/
>
> #define SECTOR_BITS 9
> +#ifndef SECTOR_SIZE
> #define SECTOR_SIZE (1 << SECTOR_BITS)
> +#endif
> #define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
> #define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
> #define SECTORS_BUFFER (SECTOR_BUFFER_SIZE >> SECTOR_BITS)
> diff -ruN linux-2.4.18-pre3/drivers/ide/ide-geometry.c linux-2.4.18-pre3-ide-rr/drivers/ide/ide-geometry.c
> --- linux-2.4.18-pre3/drivers/ide/ide-geometry.c Fri Nov 9 17:23:34 2001
> +++ linux-2.4.18-pre3-ide-rr/drivers/ide/ide-geometry.c Mon Jan 14 18:29:06 2002
> @@ -6,6 +6,8 @@
> #include <linux/mc146818rtc.h>
> #include <asm/io.h>
>
> +#ifdef CONFIG_BLK_DEV_IDE
> +
> /*
> * We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc
> * controller that is BIOS compatible with ST-506, and thus showing up in our
> @@ -40,7 +42,11 @@
> * Consequently, also the former "drive->present = 1" below was a mistake.
> *
> * Eventually the entire routine below should be removed.
> + *
> + * 17-OCT-2000 [email protected] Added spin-locks for reading CMOS
> + * chip.
> */
> +
> void probe_cmos_for_drives (ide_hwif_t *hwif)
> {
> #ifdef __i386__
> @@ -80,9 +86,10 @@
> }
> #endif
> }
> +#endif /* CONFIG_BLK_DEV_IDE */
>
>
> -#ifdef CONFIG_BLK_DEV_IDE
> +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
>
> extern ide_drive_t * get_info_ptr(kdev_t);
> extern unsigned long current_capacity (ide_drive_t *);
> @@ -214,4 +221,4 @@
> drive->bios_cyl, drive->bios_head, drive->bios_sect);
> return ret;
> }
> -#endif /* CONFIG_BLK_DEV_IDE */
> +#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
> diff -ruN linux-2.4.18-pre3/MAINTAINERS linux-2.4.18-pre3-ide-rr/MAINTAINERS
> --- linux-2.4.18-pre3/MAINTAINERS Thu Jan 10 17:04:42 2002
> +++ linux-2.4.18-pre3-ide-rr/MAINTAINERS Mon Jan 14 18:28:55 2002
> @@ -706,12 +706,12 @@
> IDE DRIVER [GENERAL]
> P: Andre Hedrick
> M: [email protected]
> -M: [email protected]
> -M: [email protected]
> +M: [email protected]
> L: [email protected]
> W: http://www.kernel.org/pub/linux/kernel/people/hedrick/
> W: http://www.linux-ide.org/
> -S: Supported
> +W: http://www.linuxdiskcert.org/
> +S: Maintained
>
> IDE/ATAPI CDROM DRIVER
> P: Jens Axboe
>
>
>
>
>
>
>

Andre Hedrick
Linux Disk Certification Project Linux ATA Development