Re: piss poor change in ncr53c8xx/linux-2.1.104

Pavel Machek (pavel@Elf.ucw.cz)
Sun, 7 Jun 1998 21:16:49 +0200


Hi!

> FOR YOUR INFORMATION, THIS DRIVER IS STILL MAINTAINED.

No need to be rude, that person did not have any bad intention. (I was
not that person, FYI).

> FYI, this change will not be incorporated in my personal driver version,
> which is currently 2.6n and will become 3.0 soon with a patch against
> 2.0.34 followed by the announce that I stop maintaining ncr53c8xx 2.5
> driver series.

Ook, what about following patch? (I consider having DELAY() function
when there are generic mdelay() and udelay() functions available bad
thing.)

Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

--- ncr53c8xx.c.ofic Sun Jun 7 21:10:00 1998 +++ ncr53c8xx.c Sun Jun 7 21:12:47 1998 @@ -364,16 +364,6 @@ #endif /* -** Insert a delay in micro-seconds. -*/ - -static void DELAY(long us) -{ - if (us/1000) mdelay(us/1000); - if (us%1000) udelay(us%1000); -} - -/* ** Internal data structure allocation. ** ** Linux scsi memory poor pool is adjusted for the need of @@ -3734,7 +3724,7 @@ if (opcode == 0) { printf ("%s: ERROR0 IN SCRIPT at %d.\n", ncr_name(np), (int) (src-start-1)); - DELAY (1000000); + mdelay (1000); }; if (DEBUG_FLAGS & DEBUG_SCRIPT) @@ -3760,7 +3750,7 @@ if ((tmp1 ^ tmp2) & 3) { printf ("%s: ERROR1 IN SCRIPT at %d.\n", ncr_name(np), (int) (src-start-1)); - DELAY (1000000); + mdelay (1000); } /* ** If PREFETCH feature not enabled, remove @@ -4594,7 +4584,7 @@ */ OUTB (nc_istat, SRST); - DELAY (1000); + mdelay (1); OUTB (nc_istat, 0 ); /* @@ -4671,7 +4661,7 @@ if (driver_setup.settle_delay > 2) { printf("%s: waiting %d seconds for scsi devices to settle...\n", ncr_name(np), driver_setup.settle_delay); - DELAY(1000000UL * driver_setup.settle_delay); + mdelay(1000UL * driver_setup.settle_delay); } /* @@ -5274,12 +5264,12 @@ ncr_name(np), settle_delay); OUTB (nc_istat, SRST); - DELAY (1000); + mdelay (1); OUTB (nc_istat, 0); if (enab_int) OUTW (nc_sien, RST); OUTB (nc_scntl1, CRST); - DELAY (100); + udelay (100); if (!driver_setup.bus_check) goto out; @@ -5519,7 +5509,7 @@ printf("%s: stopping the timer\n", ncr_name(np)); #endif np->release_stage = 1; - for (i = 50 ; i && np->release_stage != 2 ; i--) DELAY(100000); + for (i = 50 ; i && np->release_stage != 2 ; i--) mdelay(100); if (np->release_stage != 2) printf("%s: the timer seems to be already stopped\n", ncr_name(np)); else np->release_stage = 2; @@ -5558,7 +5548,7 @@ printf("%s: resetting chip\n", ncr_name(np)); OUTB (nc_istat, SRST); - DELAY (1000); + mdelay (1); OUTB (nc_istat, 0 ); OUTB(nc_dmode, np->sv_dmode); @@ -6012,7 +6002,7 @@ */ OUTB (nc_istat, SRST); - DELAY (10000); + mdelay (10); /* ** Message. @@ -8619,7 +8609,7 @@ ** Reset ncr chip */ OUTB (nc_istat, SRST); - DELAY (1000); + mdelay (1); OUTB (nc_istat, 0 ); /* ** check for timeout @@ -8822,11 +8812,11 @@ if (np->multiplier > 2) { /* Poll bit 5 of stest4 for quadrupler */ int i = 20; while (!(INB(nc_stest4) & LCKFRQ) && --i > 0) - DELAY(20); + udelay(20); if (!i) printf("%s: the chip cannot lock the frequency\n", ncr_name(np)); } else /* Wait 20 micro-seconds for doubler */ - DELAY(20); + udelay(20); OUTB(nc_stest3, HSC); /* Halt the scsi clock */ OUTB(nc_scntl3, scntl3); OUTB(nc_stest1, (DBLEN|DBLSEL));/* Select clock multiplier */ @@ -8867,7 +8857,7 @@ OUTB (nc_stime1, 0); /* disable general purpose timer */ OUTB (nc_stime1, gen); /* set to nominal delay of 1<<gen * 125us */ while (!(INW(nc_sist) & GEN) && ms++ < 100000) - DELAY(1000); /* count ms */ + mdelay(1); /* count ms */ OUTB (nc_stime1, 0); /* disable general purpose timer */ /* * set prescaler to divide by whatever 0 means @@ -8915,7 +8905,7 @@ if (np->multiplier != mult || (scntl3 & 7) < 3 || !(scntl3 & 1)) { unsigned f2; - OUTB(nc_istat, SRST); DELAY(5); OUTB(nc_istat, 0); + OUTB(nc_istat, SRST); udelay(5); OUTB(nc_istat, 0); (void) ncrgetfreq (np, 11); /* throw away first result */ f1 = ncrgetfreq (np, 11); @@ -10713,7 +10703,7 @@ static void nvram_setBit(ncr_slot *np, u_char write_bit, u_char *gpreg, int bit_mode) ) { - DELAY(5); + udelay(5); switch (bit_mode){ case SET_BIT: *gpreg |= write_bit; @@ -10730,7 +10720,7 @@ } OUTB (nc_gpreg, *gpreg); - DELAY(5); + udelay(5); } #undef SET_BIT 0 @@ -10867,7 +10857,7 @@ static void Tnvram_Read_Bit(ncr_slot *np, u_char *read_bit, u_char *gpreg) ) { - DELAY(2); + udelay(2); Tnvram_Clk(np, gpreg); *read_bit = INB (nc_gpreg); } @@ -10887,7 +10877,7 @@ *gpreg |= 0x10; OUTB (nc_gpreg, *gpreg); - DELAY(2); + udelay(2); Tnvram_Clk(np, gpreg); } @@ -10901,7 +10891,7 @@ { *gpreg &= 0xef; OUTB (nc_gpreg, *gpreg); - DELAY(2); + udelay(2); Tnvram_Clk(np, gpreg); } @@ -10914,7 +10904,7 @@ ) { OUTB (nc_gpreg, *gpreg | 0x04); - DELAY(2); + udelay(2); OUTB (nc_gpreg, *gpreg); }

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu