Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Alexander Sabourenkov
Jeff Garzik wrote: > > Alan's point was that the existing code will give you up to > LIBATA_MAX_PRD entries. After the post-virtual-merge splitting code in > ata_fill_sg() executes, the worst case result is ATA_MAX_PRD entries. > > Thus, since your code has the potential to increase the number o

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Mikael Pettersson
On Sun, 28 Oct 2007 12:03:16 +0100 (MET), Mikael Pettersson wrote: > On Sun, 28 Oct 2007 06:29:32 -0400, Jeff Garzik wrote: > > BTW, looking at the Promise code I see > > > > > cam_con.h: > > > /* for ASIC bug, limit the last element of SG byteCount must < 32 Dword */ > > > #define SG_COUNT_ASIC_B

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Jeff Garzik
Alexander Sabourenkov wrote: Jeff Garzik wrote: BTW, looking at the Promise code I see cam_con.h: /* for ASIC bug, limit the last element of SG byteCount must < 32 Dword */ #define SG_COUNT_ASIC_BUG 32 //#define SG_COUNT_ASIC_BUG 128 and in the code itself /* check PRD table,

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Mikael Pettersson
On Sun, 28 Oct 2007 06:29:32 -0400, Jeff Garzik wrote: > BTW, looking at the Promise code I see > > > cam_con.h: > > /* for ASIC bug, limit the last element of SG byteCount must < 32 Dword */ > > #define SG_COUNT_ASIC_BUG 32 > > //#define SG_COUNT_ASIC_BUG 128 > > and in the code

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Alexander Sabourenkov
Jeff Garzik wrote: > BTW, looking at the Promise code I see > >> cam_con.h: >> /* for ASIC bug, limit the last element of SG byteCount must < 32 >> Dword */ >> #define SG_COUNT_ASIC_BUG 32 >> //#define SG_COUNT_ASIC_BUG 128 > > and in the code itself > >> /* check PRD table, last e

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Jeff Garzik
BTW, looking at the Promise code I see cam_con.h: /* for ASIC bug, limit the last element of SG byteCount must < 32 Dword */ #define SG_COUNT_ASIC_BUG 32 //#define SG_COUNT_ASIC_BUG 128 and in the code itself /* check PRD table, last element <= (32 Dword), fix ASIC bug */

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-28 Thread Jeff Garzik
Alexander Sabourenkov wrote: Alan Cox wrote: I can't think of a way to avoid second pass over scatterlist without duplicating code (ata_qc_prep() and ata_fill_sg() from libata-core.c). This appears to be incomplete: [...] What guarantees you have enough PRD entries to do this without chang

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-27 Thread Alexander Sabourenkov
Alexander Sabourenkov wrote: > Alan Cox wrote: >>> I can't think of a way to avoid second pass over scatterlist without >>> duplicating code (ata_qc_prep() and ata_fill_sg() from libata-core.c). >> This appears to be incomplete: >> > > [...] > >> What guarantees you have enough PRD entries to do

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-27 Thread Alexander Sabourenkov
Alan Cox wrote: >> I can't think of a way to avoid second pass over scatterlist without >> duplicating code (ata_qc_prep() and ata_fill_sg() from libata-core.c). > > This appears to be incomplete: > [...] > > What guarantees you have enough PRD entries to do this without changing > the limit i

Re: [PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-27 Thread Alan Cox
> I can't think of a way to avoid second pass over scatterlist without > duplicating code (ata_qc_prep() and ata_fill_sg() from libata-core.c). This appears to be incomplete: > + VPRINTK("Splitting last PRD.\n"); > + > + ap->prd[idx - 1].flags_len -= > cpu

[PATCH-RFC] Promise TX4 implement hw-bug workaround

2007-10-27 Thread Alexander Sabourenkov
Hello. Once again, There appears to be a hardware bug in that it chokes on scatterlist if the last item is larger than 164 bytes. This was discovered by reading the code of vendor-supplied driver. The patch that follows fixes my problem on 2.6.22. I can't think of a way to avoid second pass over