From owner-freebsd-current@freebsd.org Wed May 27 21:17:37 2020 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 E9E762CFB94 for ; Wed, 27 May 2020 21:17:37 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 49XNvh4l5Cz49Mf; Wed, 27 May 2020 21:17:36 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: by mail-lj1-x231.google.com with SMTP id z13so21068270ljn.7; Wed, 27 May 2020 14:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AQUHwwlHw5peLM6wa239NiTn7ETdPN9krG9rlatPkEo=; b=krKZm+Z2Wz8KfwEjLqrdz8NHRNniaMubzmfpvQj/YYBCQ4vUt3CjyHIDsrafZLNF0u bXlLIl/2lwUZzmHf/3ohjyh7aIWwiS4I8cLCAkKhuhJPJJEwexno1l4yHIoElkheVUz5 gQMDEiBB7ewyzxVn37tJQ0f4IHYOnPHWo2ppaBfhPr/wpTctlaCzhjeJtGLewdjRc8PD XOR9r+cNGW4z7hOm7diNlTefwGfzwh0rSSBayVk/zuy0mjLy6/GWHdlX2J6b5f8hEeVj c+pULRxyYJwo6h7oRoOg3bTKpOq8fL1eep27sltpODxnlAJt910Fm0Bq9LtsJJILMD4Q Wd4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AQUHwwlHw5peLM6wa239NiTn7ETdPN9krG9rlatPkEo=; b=aJfqypKXFUM1zU3HY04rJYGedB2PtG/U1EnjeV7cP/kiqUxKw5Z2qvg/9U+vRtHoS9 Nv1zX2LSwmYmzlrSpeemTeX2TSTfVMtiGgYWEzdRaUp9A6okC1dmIM4ZY7z6lyi03mob K1bdn1MlgSOqkEaIt60OXgDBkrOleUB9SoHtMHc+hF19IMkNU1WUWMzKwrcTo5sHFg94 TeKkG2O1U/81PXIluoKcljyIQFsLOYvdQV/zSNMSNA/TXYWi9Is4hanNyuh5MCZi1F8J 0H/q7tsB6/5ZuyDwhlBLD8/YOfT3QnDhq1WPtgvTSrPTBAJzeyHXY9e/ngjZZF0xHwod pUsw== X-Gm-Message-State: AOAM531EMmL/+sdsKkpLhyPOxXxnm0av6pPKgB5J+Nqvkiqbx6YX5OPN FgLwyFozH4BmSlRgQRwxOLlaFgCl4Yn+xIVLE6U= X-Google-Smtp-Source: ABdhPJzLGdMy6uz0LHkGs4KQmA2LuXLv4t/9z5Z4+xSSnvuxfR4SS1kZkisqKEPXTsAMrugdkKULbXSgWGqqKo/DaGQ= X-Received: by 2002:a2e:8e7a:: with SMTP id t26mr3630049ljk.150.1590614254190; Wed, 27 May 2020 14:17:34 -0700 (PDT) MIME-Version: 1.0 References: <20200521235659.GA14173@night.db.net> <20200527191242.GB13064@night.db.net> In-Reply-To: <20200527191242.GB13064@night.db.net> From: Andreas Nilsson Date: Wed, 27 May 2020 23:17:22 +0200 Message-ID: Subject: Re: hwpstate_intel hangs kernel To: Diane Bruce Cc: cem@freebsd.org, "Andrey V. Elsukov" , Current FreeBSD X-Rspamd-Queue-Id: 49XNvh4l5Cz49Mf X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=krKZm+Z2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of andrnils@gmail.com designates 2a00:1450:4864:20::231 as permitted sender) smtp.mailfrom=andrnils@gmail.com X-Spamd-Result: default: False [-3.21 / 15.00]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; NEURAL_HAM_LONG(-1.00)[-0.999]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::231:from]; NEURAL_HAM_SHORT(-0.21)[-0.208]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_CC(0.00)[freebsd.org,yandex.ru]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 27 May 2020 21:17:38 -0000 On Wed, May 27, 2020, 21:12 Diane Bruce wrote: > On Wed, May 27, 2020 at 08:25:52PM +0200, Andreas Nilsson wrote: > > On Fri, May 22, 2020 at 1:57 AM Diane Bruce wrote: > > > > > On Wed, Feb 05, 2020 at 02:45:50PM +0100, Andreas Nilsson wrote: > > > > > > Ok I am going to respond to this old email from February.. > > > > > > > Hello, > > > > > > > > I upgraded to a newer version, git 87d669d3863-c266265, and I do not > > > > experience the random hang anymore. The machine still hangs on boot > on > > > > "hwpstate_intel0: on cpu0" unless I set > > > > 'hint.hwpstate_intel.0.disabled="1"' in loader.conf. > > > > > > > > > > As a few others know on IRC I ran into exactly this same problem > > > on a brand new Lenovo Carbon. I missed this thread somehow. > > > I also had to bisect the commit. Would it be possible to put > > > a note into UPDATING and default to disabled=1 for now? ;) > > > > > > > > > Well, I've been trying to chase this a bit more. But I could sure use > some > > help from more experienced kernel developers. > > > > debug.hwpstate_verbose="1" in loader.conf, and booting in verbose mode I > > get this: > > > > pcib0: allocated type 4 (8x3f8-8xaf8) for rid 8 of uart0 > > uart0 failed to probe at port 0x3f8 irg 4 on isa0 > > pcib0: allocated type 4 (0x2f8-0x2f8) for rid 0 uart1 > > uart1 failed to probe at port 0x2f8 irq 3 on isa0 > > isa_probe_children: probing PnP devices > > Acpi0sExecute: task queue not started > > cpu0: hwpstate registered > > Acpi0sExecute: task queue not started > > cpu1: hwpstate registered > > Acpi0sExecute; task queue not started > > cpu2: hwpstate registered > > Acpi0sExecute: task queue not started > > cpu3: hwpstate registered > > hwpstate_intel0: on cpu0 > > hwpstate_intel0: hwpstate_attach1 > > hwpstate_intel0: hwpstate_attach2 > > hwpstate_intel0: hwpstate_attach3 > > > > where the hwpstate_attachX is some > device_printf(dev,"hwpstate_attachX\n"); > > I've sprinkled in to try to where it actually fails. > > > > I'm not sure about if device_printf happens immediately. The > modifications > > have been made to the function intel_hwpstate_attach around line 480 in > > sys/x86/cpufreq/hwpstate_intel.c > > > In my tests No it does not fail immediately it fails after a few minutes. > Thinking that was a possible bogus setting I have tried this: > > > +#if 0 > sc->high = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); > sc->guaranteed = > IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(caps); > sc->efficient = IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(caps); > sc->low = IA32_HWP_CAPABILITIES_LOWEST_PERFORMANCE(caps); > - > +#else > + sc->high = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); > + sc->guaranteed = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); > + sc->efficient = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); > + sc->low = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); > +#endif > > e.g. setting all the steps to the same state. > > It still hangs but not immediately. What is confounding the matter is > the Lenovo bios also allows one to set Intel Speed Shift. > > I've also been poking at this and reading the fine docs but I also > have other stuff to look at and do. > Thanks for the info! I tried as you to have them all point to the same state. My machine still hangs during attach. What settings did you use in the bios? I could only choose min/max, no is control which I seem to remember being able to on my other machines. Could this all be down to a buggy bios? Best regards Andreas . > > > > Yep. I also had to bisect this from what is now some 5 months ago :-( > > > > > > Diane > > > -- > > > - db@FreeBSD.org db@db.net http://www.db.net/~db > > > > > -- > - db@FreeBSD.org db@db.net http://www.db.net/~db >