rendered paste body# cvs diff -u ahci.c
Index: ahci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ahci.c,v
retrieving revision 1.136
diff -u -r1.136 ahci.c
--- ahci.c 28 Nov 2007 16:01:34 -0000 1.136
+++ ahci.c 30 Mar 2008 17:37:24 -0000
@@ -1143,7 +1143,8 @@
ahci_port_stop(struct ahci_port *ap, int stop_fis_rx)
{
u_int32_t r;
-
+ static u_int64_t ahci_pstop_cnt = 0;
+
#ifdef AHCI_COALESCE
/* Disable coalescing on the port while it is stopped. */
if (ap->ap_sc->sc_ccc_ports & (1 << ap->ap_num)) {
@@ -1164,9 +1165,13 @@
if (ahci_pwait_clr(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_CR))
return (1);
- /* Wait for FR to go off */
- if (stop_fis_rx && ahci_pwait_clr(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_FR))
- return (2);
+ ahci_pstop_cnt++;
+
+ if (!(ap->ap_sc->sc_flags & AHCI_F_IGN_FR)) {
+ /* Wait for FR to come on */
+ if (ahci_pwait_set(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_FR))
+ return (2);
+ }
return (0);
}