From owner-freebsd-bugs@freebsd.org Tue Jan 12 18:02:20 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD80F4E116B for ; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DFdhD4LhBz4RS0 for ; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 9535F4E116A; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94FA54E10F2 for ; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFdhD3lvyz4RRx for ; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 742971220 for ; Tue, 12 Jan 2021 18:02:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 10CI2K9S080200 for ; Tue, 12 Jan 2021 18:02:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 10CI2Kc6080199 for bugs@FreeBSD.org; Tue, 12 Jan 2021 18:02:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 243401] [patch] ahci driver problems with Marvell 88SE9230 (Dell BOSS-S1) Date: Tue, 12 Jan 2021 18:02:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: pen@lysator.liu.se X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 18:02:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243401 --- Comment #9 from Peter Eriksson --- 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 w= ith 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 chan= ge 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 wh= at'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=3D10000us 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=3D30us ahcich14: SATA changed status 0x00000001 -> 0x00000133 at time=3D211790us ahcich14: SATA connect status 0x00000133 at time=3D211790us 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=3D1): 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=3D0): starting ahcich14: ahci_start: Done ahcich15: ahci_sata_connect: Start ahcich15: SATA changed status 0x00000000 -> 0x00000001 at time=3D30us ahcich14: ahci_end_transaction: Reinit port (eslots=3D00000004) ahcich14: AHCI engine: stopping ahcich15: SATA changed status 0x00000001 -> 0x00000133 at time=3D220650us ahcich15: SATA connect status 0x00000133 at time=3D220650us 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=3D1): 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=3D70us ahcich16: SATA connect status 0x00000113 at time=3D70us 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=3D1): 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=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich14: ahci_clo: Start ahcich14: ahci_clo: Done ahcich14: AHCI engine(fbs=3D1): starting ahcich14: ahci_start: Done ahcich15: ahci_execute_transaction: Kicking controller into sane state ahcich15: AHCI engine: stopping ugen0.2: at usbus0 umass0 numa-domain 0 on uhub0 umass0: on us= bus0 umass0: SCSI over Bulk-Only; quirks =3D 0xc000 umass0:20:0: Attached to scbus20 Root mount waiting for: CAM usbus0 ahcich15: stopping AHCI engine: timeout at 1000000 us (cr=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=3D0): starting ahcich15: ahci_start: Done ahcich15: ahci_end_transaction: Reinit port (eslots=3D00000004) ahcich15: AHCI engine: stopping ugen0.3: at usbus0 uhub1 numa-domain 0 on uhub0 uhub1: on usbus0 Root mount waiting for: CAM usbus0 ahcich15: stopping AHCI engine: timeout at 1000000 us (cr=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=3D1): 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=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=3D0): starting ahcich15: ahci_start: Done uhub1: 4 ports with 4 removable, self powered Root mount waiting for: CAM usbus0 ugen0.4: at usbus0 uhub2 numa-domain 0 on uhub1 uhub2: on usbus0 Root mount waiting for: CAM usbus0 ahcich15: ahci_end_transaction: Reinit port (eslots=3D00000010) ahcich15: AHCI engine: stopping Root mount waiting for: CAM usbus0 hcich15: stopping AHCI engine: timeout at 1000000 us (cr=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich15: ahci_clo: Start ahcich15: ahci_clo: Done ahcich15: AHCI engine(fbs=3D1): 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=3D0): starting ahcich16: ahci_start: Done ahcich16: ahci_end_transaction: Reinit port (eslots=3D00000004) ahcich16: AHCI engine: stopping uhub2: 4 ports with 4 removable, self powered Root mount waiting for: CAM usbus0 ugen0.5: at usbus0 uhub3 numa-domain 0 on uhub1 uhub3: on usbus0 ahcich16: stopping AHCI engine: timeout at 1000000 us (cr=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=3D1): 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=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=3D0): 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=3D00000010) ahcich16: AHCI engine: stopping Root mount waiting for: CAM ahcich16: stopping AHCI engine: timeout at 1000000 us (cr=3D1, ccs=3D0, ci= =3D0, sact=3D0) ahcich16: ahci_clo: Start ahcich16: ahci_clo: Done ahcich16: AHCI engine(fbs=3D1): starting ahcich16: ahci_start: Done However, eventually things seem to work anyway. I've attached the full dmesg.boot file --=20 You are receiving this mail because: You are the assignee for the bug.=