Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-macppc/39176



Hi,

> My old mac Mini has problems with interrups on wdc1.  The problem started
> when the ppcoea-renovation was merged.
> [...]
> The merge did change the dmesg output for the wdc0 in a way that
> that may be relevant:
> [...]
> +wdc1:0:0: lost interrupt
> +     type: ata tc_bcount: 512 tc_skip: 0
> +wdc1:0:0: intr with DRQ (st=0x58)
> +wd0c: device timeout reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
> +wdc1:0:0: lost interrupt

I don't know if it's related to your problem, but I think the timing
setting stuff on wdc at pci (src/sys/arch/macppc/dev/kauai.c) it's
currently broken.

Can you test the attached patch for kauai.c to see if your problems persist?

It works fine for me on a Intrepid Kauai controller.
Thanks!


Some comments with respect to the patch:
 I think that the following lines in kauai.c (rev. 1.25):
    58 #define PIO_CONFIG_REG (0x200 >> 4)      /* PIO and DMA access timing */
    59 #define DMA_CONFIG_REG (0x210 >> 4)      /* UDMA access timing */
should read instead:
    58 #define PIO_CONFIG_REG   0x200  /* PIO and DMA access timing */
    59 #define DMA_CONFIG_REG  0x210 /* UDMA access timing */

Before the ppcoea-renovation branch was merged, kauai.c used
macppc_make_bus_space_tag(regbase, 4); to map the registers so the tag
included an automatic stride.
 After the branch was merged, it does not create a private tag anymore
and this automatic stride is not done; so the definitions should be
updated to reflect that (the '>> 4' shift is no longer necessary).

Another issue is that the code in calc_timing_kauai() uses the
DMA_CONFIG_REG register to set both DMA and UDMA access timing; but
this register is only for UDMA; the DMA timings should go along with
the PIO timings into the PIO_CONFIG_REG register (as the comments in
the above lines 58-59 say).

This can be verified by looking at Mac OS X's AppleKauaiATA.cpp
driver, in lines 985 and 986 [1] .

(The patch also renames the DMA_CONFIG_REG to UDMA_CONFIG_REG to avoid
confussion.)

[1] 
http://www.opensource.apple.com/darwinsource/10.4.11.ppc/AppleKauaiATA-121.3.4/AppleKauaiATA.cpp


Greetings,
Marco.

Attachment: kauai.c.diff
Description: Binary data



Home | Main Index | Thread Index | Old Index