On Wed, Jan 12, 2011 at 08:32:12PM -0500, Brad wrote: > The following diff is ported from NetBSD (the workaround originated from > OpenSolaris) to workaround the issue of data corruption with the ALI M5229 > IDE chipset when using UltraDMA. Same workaround is also used by > FreeBSD/Linux. > This chipset is found in some sparc64 systems such as the Blade 100 and > Netra X1. > > I don't have any such systems but I went digging for this being curious > why the nasty hack was added to the kernel configs to disable UltraDMA > to workaround this bug and thus penalizing other IDE/SATA controllers > that could be in the same system. If you have one of the mentioned > systems please test this.
Ok with a bit more digging I think I found out why the workaround is not functioning correctly. I found in rev 1.90 of wdc.c jsg@ added the infrastructure to allow for the reset callback but then part of it was reverted by miod@ in rev 1.93 due to an issue with a NULL pointer dereference on some systems and no one bothered to go back and fix it. I brought over the fix for this issue from NetBSD. This needs testing on any IDE/SATA controllers. Index: wdc.c =================================================================== RCS file: /home/cvs/src/sys/dev/ic/wdc.c,v retrieving revision 1.109 diff -u -p -r1.109 wdc.c --- wdc.c 21 Sep 2010 03:33:32 -0000 1.109 +++ wdc.c 23 Jan 2011 19:46:03 -0000 @@ -589,6 +589,9 @@ wdcprobe(struct channel_softc *chp) int savedmask = wdcdebug_mask; #endif + if (chp->wdc->reset == NULL) + chp->wdc->reset = wdc_do_reset; + if (chp->_vtbl == 0) { int s = splbio(); chp->_vtbl = &wdc_default_vtbl; @@ -628,7 +631,7 @@ wdcprobe(struct channel_softc *chp) } /* reset the channel */ - wdc_do_reset(chp); + chp->wdc->reset(chp); ret_value = __wdcwait_reset(chp, ret_value); WDCDEBUG_PRINT(("%s:%d: after reset, ret_value=0x%d\n", -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.