From owner-freebsd-ppc@freebsd.org Mon Mar 6 10:25:38 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EF56CFA558 for ; Mon, 6 Mar 2017 10:25:38 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-199.reflexion.net [208.70.211.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5024816F0 for ; Mon, 6 Mar 2017 10:25:37 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 19239 invoked from network); 6 Mar 2017 10:26:17 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 6 Mar 2017 10:26:17 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.30.2) with SMTP; Mon, 06 Mar 2017 05:25:31 -0500 (EST) Received: (qmail 13152 invoked from network); 6 Mar 2017 10:25:31 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 Mar 2017 10:25:31 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 5FA41EC7B1F; Mon, 6 Mar 2017 02:25:30 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: powerpc64 head -r314687 (PowerMac G5 so-called "Quad Core", clang based): CAM status: Command timeout (always?) From: Mark Millard In-Reply-To: <4C78F6AA-5ABD-4445-B5EF-4E6778CE36FE@dsl-only.net> Date: Mon, 6 Mar 2017 02:25:29 -0800 Cc: Justin Hibbits , Nathan Whitehorn Content-Transfer-Encoding: quoted-printable Message-Id: <9ECE50B1-82AE-4E9D-9A70-C2CB423DC44F@dsl-only.net> References: <98A62E0D-C2A0-40B1-AE6D-5810906208AE@dsl-only.net> <4C78F6AA-5ABD-4445-B5EF-4E6778CE36FE@dsl-only.net> To: markj@FreeBSD.org, FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3259) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 10:25:38 -0000 On 2017-Mar-6, at 2:05 AM, Mark Millard wrote: > On 2017-Mar-6, at 1:37 AM, Mark Millard = wrote: >=20 >> When I tried to jump from head -r314479 to -r314687 the -r314687 = kernel >> the result failed by always(?) getting: >>=20 >> CAM status: Command timeout >>=20 >> for: >>=20 >> ATAPI_IDENTIFY >> INQUIRY >> DSM TRIM >> READ_DMA48 >> SETFEATURES ENABLE RCACHE >> WRITE_DMA48 >> etc. >>=20 >> at: >>=20 >> ada0:ata2:0:0:0 >> aprobe0:ata0:0:0:0 >>=20 >> Booting with the older -r314479 works fine (same -r314687 world). >>=20 >> [FYI: It is a ufs context.] >>=20 >>=20 >> The only thing that looks likely to me for >> the change in behavior is. . . >>=20 >> Author: markj >> Date: Fri Mar 3 20:51:57 2017 >> New Revision: 314624 >> URL:=20 >> https://svnweb.freebsd.org/changeset/base/314624 >>=20 >>=20 >> Log: >> Reject userland CCBs that have CAM_UNLOCKED set. >>=20 >> CAM_UNLOCKED is internal flag and cannot correctly be set by = userland. >> Return EINVAL from CAMIOCOMMAND and CAMIOQUEUE if it is set. >>=20 >> Also fix leaks in some of the error paths for CAMIOQUEUE. >>=20 >> PR: 215356 >> Reviewed by: ken, mav >> MFC after: 1 week >> Differential Revision:=09 >> https://reviews.freebsd.org/D9869 >>=20 >>=20 >> Modified: >> head/sys/cam/cam_xpt.c >> head/sys/cam/scsi/scsi_pass.c >>=20 >>=20 >>=20 >> [This may just mean that it exposes other problems.] >=20 > Yep: reverting the two files allowed the PowerMac G5 so-called > "Quad Core" to boot fully and I could log in. >=20 > It appears that if such powerpc64 machines are to stay bootable > then other things need to be cleaned up before the two updated > files from -r314624 should be used. >=20 > Should the 2 files be reverted until other things are cleaned up? An interesting note is where CAM_UNLOCKED occurs (this is from after reverting the 2 files relative to the -r314687 that I started with): # grep -r CAM_UNLOCKED /usr/src/* | more /usr/src/sys/cam/cam_periph.c: KASSERT((ccb->ccb_h.flags & = CAM_UNLOCKED) =3D=3D 0, /usr/src/sys/cam/scsi/scsi_da.c: start_ccb->ccb_h.flags = |=3D CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_da.c: ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_da.c: ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_da.c: ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_xpt.c: = work_ccb->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_xpt.c: = request_ccb->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_xpt.c: = request_ccb->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/scsi/scsi_xpt.c: request_ccb->ccb_h.flags = |=3D CAM_UNLOCKED; /usr/src/sys/cam/nvme/nvme_da.c: = start_ccb->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/nvme/nvme_da.c: start_ccb->ccb_h.flags = |=3D CAM_UNLOCKED; /usr/src/sys/cam/cam_ccb.h: CAM_UNLOCKED =3D 0x80000000 = /* Call callback without lock. */ /usr/src/sys/cam/ata/ata_da.c: start_ccb->ccb_h.flags = |=3D CAM_UNLOCKED; /usr/src/sys/cam/ata/ata_da.c: start_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ata/ata_xpt.c: work_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ata/ata_xpt.c: request_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ctl/scsi_ctl.c: new_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ctl/scsi_ctl.c: new_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ctl/scsi_ctl.c: start_ccb->ccb_h.flags |=3D = CAM_UNLOCKED; /usr/src/sys/cam/ctl/scsi_ctl.c: KASSERT((done_ccb->ccb_h.flags & = CAM_UNLOCKED) !=3D 0, /usr/src/sys/cam/ctl/scsi_ctl.c: ("CCB in ctlfedone() without = CAM_UNLOCKED flag")); /usr/src/sys/cam/ctl/scsi_ctl.c: = csio->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/cam_xpt.c: ccb->ccb_h.flags |=3D CAM_UNLOCKED; /usr/src/sys/cam/cam_xpt.c: if ((ccb_h->flags & CAM_UNLOCKED) =3D=3D = 0) { =3D=3D=3D Mark Millard markmi at dsl-only.net