From owner-freebsd-current@freebsd.org Sat Dec 7 00:10:00 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 539631BC72E for ; Sat, 7 Dec 2019 00:10:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (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 47V8wQ70KRz47TW for ; Sat, 7 Dec 2019 00:09:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-ot1-x343.google.com with SMTP id d17so7405651otc.0 for ; Fri, 06 Dec 2019 16:09:58 -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=ztU/zrn0r6b2gZURTPDATu/hOhrmPgFzKykuCPKGrMs=; b=c7mq0socHXhKiLnzWar9HV/8mwPxZhL3b1LHNrVM88HF3o6+0jMeWxkmT76iXcoKbe UWGabkiIxhm5mn2tIUJfNwGado8Vq3dXQh1tzLbn9cC0sV9mhaKTUIxFuTLwniU//ocB G3nleLXgiJsaQSALVUj8Z5a2N446jL//Fv43dSq7vAYmBzFQYQVxgl0u4SmXqAD0Gpwg dzQHYH8MeVCYV4GPgMDHdoFHSF1NVoR5fG4yVq9lk78BoYzz/iaNEzOtYmFC7NuCBORj b+LyRlB5SK41iQ0aG1d/vmev2aC0pnv/2UbsJrgOp7kJVmxL/D2cwmcTZEb6kd9oa/ta KtUA== 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=ztU/zrn0r6b2gZURTPDATu/hOhrmPgFzKykuCPKGrMs=; b=YJBavJ4OnIm6RfsYed28Z36dZMONtucWlxsN4tr+XNrbpLlS48qJXySM+d898eUN9K Z5+qCp9i3qBvZzYISgpcaTlAZAsTHLSldabhwief4VQrllJjcwNmC0gj1IA7lE6rbIqz 5lUAMJotgDoaltzsyDPW/EB+HN/1NduUcq3PFFsRjCAGBNF+nNXHw2g5+ndEAzvMyrUP ZpINtF7I6Ty5TKjJIl7dyARuRAKoushMbwnuzGmWiuAlQv7vo3s7IJ7DjFrxmMeqYhqq HXxfCytVSI9wfhG6CDdg9nc8uPVzvDBVGI54yXRhEIH40og1zBxG+m3WdWszcRzIMC5y IC3A== X-Gm-Message-State: APjAAAU3Ju2HiTtXfCLLPpXj7Dh5VnyN6JNNqBfXUq1U+/7woiZ7Wa/C g0fqiMBzk0fLm421qnnN8fTcy3QQ X-Google-Smtp-Source: APXvYqxAXbvMEXsOIloLU/QxcFYTnLwZbJNJUCsKdJtQJ5omZfADav/5fQ1INmi2Ot48jL3WbGZq3Q== X-Received: by 2002:a9d:6f07:: with SMTP id n7mr139536otq.112.1575677397011; Fri, 06 Dec 2019 16:09:57 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id 91sm3056882otb.7.2019.12.06.16.09.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Dec 2019 16:09:56 -0800 (PST) Sender: Alexander Motin Subject: Re: CAM breaks USB [was Re: USB causing boot to hang] To: sgk@troutmask.apl.washington.edu Cc: 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> 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 Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvS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8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <3df3ff25-9f62-6f0f-7823-e846a43725eb@FreeBSD.org> Date: Fri, 6 Dec 2019 19:09:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20191206234105.GA1027@troutmask.apl.washington.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47V8wQ70KRz47TW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=c7mq0soc; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::343 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.47 / 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)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; 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)[3.4.3.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.27)[ip: (2.87), 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 00:10:00 -0000 On 06.12.2019 18:41, Steve Kargl wrote: > On Fri, Dec 06, 2019 at 06:15:32PM -0500, Alexander Motin wrote: >> On 06.12.2019 17:52, Steve Kargl wrote: >>> On Fri, Dec 06, 2019 at 03:33:09PM -0700, Warner Losh wrote: >>>> On Fri, Dec 6, 2019 at 3:31 PM Steve Kargl >>>> wrote: >>>>> The problem seems to be caused 355010. This is a commit to >>>>> fix CAM, which seems to break USB. >>>>> >>>> Yes. mav@ made this change... >>>> >>> src/UPDATING seems to be missing an entry about CAM breaking USB. >> >> And also that moon is made of cheese. :-\ > > Not sure what you mean. I mean that if we are going to write there random fairy-tales, then I prefer my moon. If serious, then my change did not change semantics of any existing tunables, only the way some of them are implemented, so there was nothing to write in UPDATING. > You made a change, and the commit log > even notes that there could be an issue. Yet, you want a user > to waste half a day finding the root cause of the problem. I am sorry that you wasted your time, but quick and ungrounded blames is the last thing I want to read on Friday evening after the long day. >>> The commit message for 355010 states: >>> >>> Devices appearing on USB bus later may still require setting >>> kern.cam.boot_delay, but hopefully those are minority. >>> >>> There is no statement about "where" kern.cam.boot_delay should be set. >>> There is no statement about "what" value(s) kern.cam.boot_delay should be. >> >> If you never needed it before, you still don't need it. > > Prior to 355010 the system just boots up. After 355010 > the system hangs. Will kern.cam.boot_delay paper over > whatever (latent?) bug you've exposed? My change affected the timing of system boot process, allowing system to continue booting some further, not waiting for CAM to scan its buses and disks. If the problem is reproducible even without USB storage, then CAM probably does not wait for it, so it is not the problem I first thought about. >> If system hangs even without any USB disk attached, then I don't see a >> relation between CAM and USB here. My change could affect some timings >> of the boot process, but without closer debugging it is hard to guess >> something. To be sure whether USB is related I would try to disable all >> USB controllers either in BIOS or with set of loader tunables like >> hint.ehci.0.disabled=1 , hint.ohci.0.disabled=1 , >> hint.xhci.0.disabled=1, ... > > Yep. Completely disabling USB allows the system to boot. I don't > see how this would be unexpected as umass using cam. umass uses CAM, but you've told the problem happens even without umass, that is why I told that I don't see any relation. Does disabling of _all_ USB fixes the problem? Have you tried to narrow it down to specific controller or device? Is there anything special in your system? Are you running GENERIC kernel? If not, then what do you have changed? If your kernel includes VERBOSE_SYSINIT as GENERIC does, I would try to set debug.verbose_sysinit=1 and see how far the boot process goes and at which stage it may is hanging (if we guess that hang is related to the stage and not asynchronous). -- Alexander Motin