From owner-freebsd-current@freebsd.org Sat Dec 7 17:09:31 2019 Return-Path: Delivered-To: freebsd-current@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 4E8D31D71A8 for ; Sat, 7 Dec 2019 17:09:31 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47VbXp3bdNz3yNq for ; Sat, 7 Dec 2019 17:09:30 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb44.google.com with SMTP id p137so4363978ybg.9 for ; Sat, 07 Dec 2019 09:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q4kc+MoTELc/sPMzGzu36fcGSeGvtdAZCugzFegxX30=; b=CKm0oGV68Sf53egGyPtVc2lsCm2zNIQAamTSGky/5hVXCVRoQ8vjRBwpkyyWXQ9hSp ia6pQbYPGXHwzhsHThxKnVvCyj1K6a05E0OG0qvyjY2mXrmp0anjTC8c7D6dwmE9gK0W QBhErsGx5qE59yf9SEa0wT6wf/gh8ModtUKM6sAk+poD9kIOrprAaceQgQbEcDkVl97P 3gn1mkRxwRmkq2MaGV8GYcRGPEOCDNZ5QxbfMlz9mqS4CWi97WIXKOZL91QSnmfFIvFd HeYpbiJkUQGFtRTgRXjpc8LBBVueJ99IyY90vo0+Wn0I1AuQv+9xLXMdVejscxKvYxgH H9Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=q4kc+MoTELc/sPMzGzu36fcGSeGvtdAZCugzFegxX30=; b=gT6pTHWaqmvRDuLAyEmS+LVh09Rh5fJIMXtf+36m0XdQPodu23O7nkpV8EJbKsbiSg Qbh8S3DKCfsS7t4ssR1u6wf2rEQyEfo73jGjc60rYFPHBFt41CKCqf18myKHKcUGE8ep ZF8yE6l9j7Mpc/8MmYnr+msbP6XJytdcWUS2iHLTy9qVauhpPjd6xhppsOLBp9cxgtlM hcEtpE6pwaJ0CrswQcwPMkAADKxa1WPARSIlgl6ejQmAUr1M2CQnX1uZy3DP3n/DYBZ/ yacbFaK2WEpuJ5WVqxgqtGivK09thJ0rZK5+ewM9XBwDZ840MA4+KDPYEZjNIXGwn/7L fTTQ== X-Gm-Message-State: APjAAAWAsus2lY3kXR+E3gY9prjReBaEkBGimX9aZahCVYULDXNNK7GR MmsZFr2uuM2M2py9O9M4cUmDs61n X-Google-Smtp-Source: APXvYqxhC61anvKu5lanes3JsBoc2WhgEgVozY82VwrXtfooIQjtOamb11/6VIyjtfYtHcRSwSf/Xw== X-Received: by 2002:a25:7cc7:: with SMTP id x190mr13824288ybc.156.1575738568882; Sat, 07 Dec 2019 09:09:28 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id g18sm7702006ywb.25.2019.12.07.09.09.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Dec 2019 09:09:27 -0800 (PST) Sender: Alexander Motin Subject: Re: CAM breaks USB [was Re: USB causing boot to hang] To: bob prohaska Cc: sgk@troutmask.apl.washington.edu, Warner Losh , FreeBSD Current References: <20191206202316.GA1053@troutmask.apl.washington.edu> <20191206223144.GA3224@troutmask.apl.washington.edu> <20191206225231.GA949@troutmask.apl.washington.edu> <20191206234105.GA1027@troutmask.apl.washington.edu> <3df3ff25-9f62-6f0f-7823-e846a43725eb@FreeBSD.org> <20191207020809.GA1234@troutmask.apl.washington.edu> <20191207045709.GA72838@www.zefox.net> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ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eup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <92fb687a-9c2c-2dc3-298d-4cfd135d6e3e@FreeBSD.org> Date: Sat, 7 Dec 2019 12:09:27 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20191207045709.GA72838@www.zefox.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47VbXp3bdNz3yNq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=CKm0oGV6; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::b44 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.b.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-0.41)[ip: (2.17), ipnet: 2607:f8b0::/32(-2.23), asn: 15169(-1.93), country: US(-0.05)]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2019 17:09:31 -0000 Hi Bob, On 06.12.2019 23:57, bob prohaska wrote: > For what it's worth, there does seem to be something amiss with USB. > > An RPI2 at r355446 is having difficulty finding its USB devices > on a hands-off reboot. The problem wasn't apparent until this most > recent upgrade. Here's the console output: > > Trying to mount root from ufs:/dev/ufs/rootfs [rw]... > Warning: no time-of-day clock registered, system time will not be set accurately > uhub0: 1 port with 1 removable, self powered > Setting hostuuid: 95acec23-6e2c-11e7-8cb9-b827eb1a5a4b. > Setting hostid: 0x6aebd8b6. > swapon: /dev/da0b: No such file or directory > Starting file system checks: > /dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/ufs/rootfs: clugen0.2: at usbus0 ... > Warning! Some of the devices might not be available; retrying > Waiting 30s for the root mount holders: usbus0 CAM ... > The machine seems able to boot hands-off a kernel from r333740, > so I don't think it's hardware. > > /boot/loader.conf contains > bob@www:~ % more /boot/loader.conf > kern.cam.boot_delay="20000" > vm.pageout_oom_seq="2048" > bob@www:~ % > > Booting direct to single-user, running fsck and exiting the shell > brought multi-user operation. Your situation seem to be different from the first one. As I understand, you have root file system on SD card, while some other file systems and swap on a USB stick. The problem in your case is that root mount wait for UFS waits only for root file system to appear, rather then all of them. There is an rc.d scripts that should wait for other devices via calling root_hold_wait function, and you may see in logs that they try, but I guess something is not right there. As a workaround for the rc.d problem you may set tunable vfs.root_mount_always_wait=1 . After that I guess you may be even able to remove kern.cam.boot_delay tunable to make boot even faster then before, while still remain reliable if your USB stick behaves properly. I think we should either enable vfs.root_mount_always_wait=1 by default, or really fix the rc.d scripts to properly wait when needed. > Still, It appears that recognition > of an FTDI FT232 usb-serial adapter is impaired as well. It had to > be unplugged and replugged after booting to be recognized. I don't know what is the problem here, but I guess that vfs.root_mount_always_wait may help here too, if we assume that the problem is that some app is trying to open the serial adapter before the USB scan is complete, that previously was workarounded by delay caused by kern.cam.boot_delay setting. -- Alexander Motin