Insta-panic with recent -current on Ultra10
Pyun YongHyeon
yongari at kt-is.co.kr
Wed Aug 18 00:42:42 PDT 2004
>
> The following patch seems to fix the issue on AXe.
>
...
> --- ata-chipset.c.orig Mon Aug 16 20:29:47 2004
> +++ ata-chipset.c Wed Aug 18 16:15:48 2004
> @@ -1578,7 +1578,7 @@
> wordp[idx++] = htole32(prd[i].count & ~ATA_DMA_EOT);
> length += (prd[i].count & ~ATA_DMA_EOT);
> } while (!(prd[i++].count & ATA_DMA_EOT));
> - wordp[idx - 1] |= htole32(ATA_DMA_EOT);
> + wordp[idx - 1] = htole32(ATA_DMA_EOT | wordp[idx - 1]);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oops. This is not correct one. Sorry.
Please ignore the patch for ata-chipset.c.
> wordp = (u_int32_t *)
> (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_LSG_OFFSET);
> --- ata-dma.c.orig Mon Aug 16 20:29:47 2004
> +++ ata-dma.c Wed Aug 18 16:06:45 2004
> @@ -57,6 +57,7 @@
> static MALLOC_DEFINE(M_ATADMA, "ATA DMA", "ATA driver DMA");
>
> /* misc defines */
> +#define MAXSEGSZ PAGE_SIZE
> #define MAXTABSZ PAGE_SIZE
> #define MAXWSPCSZ PAGE_SIZE
> #define MAXCTLDMASZ (2 * (MAXTABSZ + MAXPHYS))
> @@ -199,16 +200,25 @@
> {
> struct ata_dmasetprd_args *args = xsc;
> struct ata_dma_prdentry *prd = args->dmatab;
> - int i;
> + bus_size_t cnt;
> + u_int32_t lastcount;
> + int i, j;
>
> if ((args->error = error))
> return;
> -
> + lastcount = j = 0;
> for (i = 0; i < nsegs; i++) {
> - prd[i].addr = htole32(segs[i].ds_addr);
> - prd[i].count = htole32(segs[i].ds_len);
> + /*
> + * A maximum segment size was specified for bus_dma_tag_create, but
> + * some busdma code does not seem to honor this, so fix up if needed.
> + */
> + for (cnt = 0; cnt < segs[i].ds_len; cnt += MAXSEGSZ, j++) {
> + prd[j].addr = htole32(segs[i].ds_addr + cnt);
> + lastcount = ulmin(segs[i].ds_len - cnt, MAXSEGSZ) & 0xffff;
> + prd[j].count = htole32(lastcount);
> + }
> }
> - prd[i - 1].count |= htole32(ATA_DMA_EOT);
> + prd[j - 1].count = htole32(ATA_DMA_EOT | lastcount);
> }
>
> static int
Regards,
Pyun YongHyeon
--
Pyun YongHyeon <http://www.kr.freebsd.org/~yongari>
More information about the freebsd-sparc64
mailing list