https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243401
--- Comment #9 from Peter Eriksson <[email protected]> --- Sorry, have been busy with another problem (a HP server with a lot of disks panic:ing due to bugs in other parts of the kernel - sigh). I'll get back with a better patch soon. Anyway, the way I changed it was basically to chnage the loop: 1. DELAY(10) instead of DELAY(100) - it takes about 30us for status to change from 0 -> 1, so no need to wait the full 100us :-) 2. Only change the "full timeout" from 100ms to 500ms after ATA_SS_DEV_MASK has changed from ATA_SS_DET_NO_DEVICE. My current version of the patch contains a lot of debuging printouts so probably not really good for production use (it makes it easier to watch what's happening though :-) A sample of the dmesg output: First an ununes ahci channel/controller without devices: ahcich13: AHCI engine: stopping ahcich13: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich13: AHCI engine stopped at time 10 us ahcich13: ahci_sata_phy_reset: Start ahcich13: ahci_sata_connect: Start ahcich13: SATA connect timeout status 0x00000000 at time=10000us ahcich13: ahci_sata_connect: Done (0) ahcich13: ahci_sata_phy_reset: Done (0) ahcich13: AHCI reset: device not found ahcich13: ahci_reset: Done (ahci_sata_phy_reset failed) First port on the BOSS: ahcich14: ahciaction: Calling ahci_reset (XPT_RESET_BUS) ahcich14: ahci_reset: Start ahcich14: AHCI reset... ahcich14: AHCI engine: stopping ahcich14: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich14: AHCI engine stopped at time 10 us ahcich14: ahci_sata_phy_reset: Start ahcich14: ahci_sata_connect: Start ahcich14: SATA changed status 0x00000000 -> 0x00000001 at time=30us ahcich14: SATA changed status 0x00000001 -> 0x00000133 at time=211790us ahcich14: SATA connect status 0x00000133 at time=211790us ahcich14: ahci_sata_connect: Done (1) ahcich14: ahci_sata_phy_reset: Done (1) ahcich14: AHCI reset: device found ahcich14: AHCI reset: device ready after 0ms ahcich14: AHCI engine(fbs=1): starting ahcich14: ahci_start: Done ahcich14: ahci_reset: Done Then it resets the second port/channel (and starts doing stuff on the first port at the same time): ahcich15: ahciaction: Calling ahci_reset (XPT_RESET_BUS) ahcich15: ahci_reset: Start ahcich15: AHCI reset... ahcich15: AHCI engine: stopping ahcich15: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich15: AHCI engine stopped at time 10 us ahcich15: ahci_sata_phy_reset: Start ahcich14: ahci_execute_transaction: Kicking controller into sane state ahcich14: AHCI engine: stopping ahcich14: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich14: AHCI engine stopped at time 10 us ahcich14: ahci_clo: Start ahcich14: ahci_clo: Done ahcich14: AHCI engine(fbs=0): starting ahcich14: ahci_start: Done ahcich15: ahci_sata_connect: Start ahcich15: SATA changed status 0x00000000 -> 0x00000001 at time=30us ahcich14: ahci_end_transaction: Reinit port (eslots=00000004) ahcich14: AHCI engine: stopping ahcich15: SATA changed status 0x00000001 -> 0x00000133 at time=220650us ahcich15: SATA connect status 0x00000133 at time=220650us ahcich15: ahci_sata_connect: Done (1) ahcich15: ahci_sata_phy_reset: Done (1) ahcich15: AHCI reset: device found ahcich15: AHCI reset: device ready after 0ms ahcich15: AHCI engine(fbs=1): starting ahcich15: ahci_start: Done ahcich15: ahci_reset: Done And then the third (ses?) port - there is only two ports on this controller: ahcich16: ahciaction: Calling ahci_reset (XPT_RESET_BUS) ahcich16: ahci_reset: Start ahcich16: AHCI reset... ahcich16: AHCI engine: stopping ahcich16: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich16: AHCI engine stopped at time 10 us ahcich16: ahci_sata_phy_reset: Start ahcich16: ahci_sata_connect: Start ahcich16: SATA changed status 0x00000000 -> 0x00000113 at time=70us ahcich16: SATA connect status 0x00000113 at time=70us ahcich16: ahci_sata_connect: Done (1) ahcich16: ahci_sata_phy_reset: Done (1) ahcich16: AHCI reset: device found ahcich16: AHCI reset: device ready after 0ms ahcich16: AHCI engine(fbs=1): starting ahcich16: ahci_start: Done ahcich16: ahci_reset: Done But then things are a bit strange - notice the 1s timeouts (I increased the max timeout to 1s in this test boot): Root mount waiting for: CAM usbus0 uhub0: 26 ports with 26 removable, self powered ahcich14: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich14: ahci_clo: Start ahcich14: ahci_clo: Done ahcich14: AHCI engine(fbs=1): starting ahcich14: ahci_start: Done ahcich15: ahci_execute_transaction: Kicking controller into sane state ahcich15: AHCI engine: stopping ugen0.2: <Kingston DataTraveler 2.0> at usbus0 umass0 numa-domain 0 on uhub0 umass0: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/1.00, addr 1> on usbus0 umass0: SCSI over Bulk-Only; quirks = 0xc000 umass0:20:0: Attached to scbus20 Root mount waiting for: CAM usbus0 ahcich15: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=0): starting ahcich15: ahci_start: Done ahcich15: ahci_end_transaction: Reinit port (eslots=00000004) ahcich15: AHCI engine: stopping ugen0.3: <vendor 0x1604 product 0x10c0> at usbus0 uhub1 numa-domain 0 on uhub0 uhub1: <vendor 0x1604 product 0x10c0, class 9/0, rev 2.00/0.00, addr 2> on usbus0 Root mount waiting for: CAM usbus0 ahcich15: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=1): starting ahcich15: ahci_start: Done ahcich15: ahci_execute_transaction: Kicking controller into sane state ahcich15: AHCI engine: stopping Root mount waiting for: CAM usbus0 ahcich15: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=0): starting ahcich15: ahci_start: Done uhub1: 4 ports with 4 removable, self powered Root mount waiting for: CAM usbus0 ugen0.4: <vendor 0x1604 product 0x10c0> at usbus0 uhub2 numa-domain 0 on uhub1 uhub2: <vendor 0x1604 product 0x10c0, class 9/0, rev 2.00/0.00, addr 3> on usbus0 Root mount waiting for: CAM usbus0 ahcich15: ahci_end_transaction: Reinit port (eslots=00000010) ahcich15: AHCI engine: stopping Root mount waiting for: CAM usbus0 hcich15: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=1): starting ahcich15: ahci_start: Done ahcich16: ahci_execute_transaction: Kicking controller into sane state ahcich16: AHCI engine: stopping ahcich16: stopping AHCI engine: cr: 1 -> 0 at time 10 us ahcich16: AHCI engine stopped at time 10 us ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=0): starting ahcich16: ahci_start: Done ahcich16: ahci_end_transaction: Reinit port (eslots=00000004) ahcich16: AHCI engine: stopping uhub2: 4 ports with 4 removable, self powered Root mount waiting for: CAM usbus0 ugen0.5: <vendor 0x1604 product 0x10c0> at usbus0 uhub3 numa-domain 0 on uhub1 uhub3: <vendor 0x1604 product 0x10c0, class 9/0, rev 2.00/0.00, addr 4> on usbus0 ahcich16: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=1): starting ahcich16: ahci_start: Done ahcich16: ahci_execute_transaction: Kicking controller into sane state ahcich16: AHCI engine: stopping Root mount waiting for: CAM usbus0 ahcich16: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=0): starting ahcich16: ahci_start: Done Root mount waiting for: CAM usbus0 uhub3: 4 ports with 4 removable, self powered Root mount waiting for: CAM Root mount waiting for: CAM Root mount waiting for: CAM ahcich16: ahci_end_transaction: Reinit port (eslots=00000010) ahcich16: AHCI engine: stopping Root mount waiting for: CAM ahcich16: stopping AHCI engine: timeout at 1000000 us (cr=1, ccs=0, ci=0, sact=0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=1): starting ahcich16: ahci_start: Done However, eventually things seem to work anyway. I've attached the full dmesg.boot file -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
