From owner-freebsd-current@freebsd.org Tue May 26 22:14: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 D07C92F5A85 for ; Tue, 26 May 2020 22:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49WpCx5CN2z43Mx for ; Tue, 26 May 2020 22:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id B094C2F55D3; Tue, 26 May 2020 22:14:37 +0000 (UTC) Delivered-To: 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 AF4D72F55D2 for ; Tue, 26 May 2020 22:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49WpCx46vXz43KY; Tue, 26 May 2020 22:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:357e:46d1:e539:9658]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E14FE126C9; Tue, 26 May 2020 22:14:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: acpi timer reads all ones [Was: efirtc + atrtc at the same time] To: Konstantin Belousov , Andriy Gapon Cc: FreeBSD Current References: <021d8df4-a4f8-620d-73b6-b6103d0bf7f1@FreeBSD.org> <199c8845-e42c-fbee-3f13-0b3d0d7234dc@FreeBSD.org> <20200526185528.GA48478@kib.kiev.ua> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 26 May 2020 15:14:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200526185528.GA48478@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Tue, 26 May 2020 22:14:37 -0000 On 5/26/20 11:55 AM, Konstantin Belousov wrote: > On Tue, May 26, 2020 at 06:22:13PM +0300, Andriy Gapon wrote: >> On 25/05/2020 11:37, Andriy Gapon wrote: >>> Also, there is another issue related to atrtc. >>> When I have both drivers attached, and also when I have only atrtc attached >>> (efi.rt.disabled=1), system clock jumps 10 minutes forward after each suspend / >>> resume cycle (S0 -> S3 -> S0). That does not happen for reboot and shutdown >>> cycles. I haven't investigated this deeper, but it is a curious problem. >> >> Actually, I was wrong. The problem can also occur with efirtc alone. >> Also, sometimes there is a different problem where there are no callouts for a >> period of time on the order of minutes. I tracked it to cc_lastscan being set >> to a value greater than the current uptime. So, any scheduled callout gets >> scheduled at cc_lastscan and it is a while before the uptime catches up. >> >> It seemed that both issues were connected and were a result of the uptime >> jumping forward by some minutes and then jumping back to a sane value. >> If something important happened during the weird period, like getting time of >> day from hardware or invoking a callout, it lead to the observed effects. >> >> So, that gave me some ideas where to add debugging checks. >> What I determined is that ACPI timer (ACPI-fast) could produce a reading of all >> 1-s like happens when there is no hardware response. >> >> I caught one such instance and got a stack trace for it (but no crash dump >> because devices had not resumed yet): >> tc_windup() at tc_windup+0x318/frame 0xfffffe00a7a19300 >> tc_ticktock() at tc_ticktock+0x4b/frame 0xfffffe00a7a19320 >> hardclock() at hardclock+0x107/frame 0xfffffe00a7a19360 >> handleevents() at handleevents+0xb3/frame 0xfffffe00a7a193a0 >> timercb() at timercb+0x196/frame 0xfffffe00a7a193f0 >> lapic_handle_timer() at lapic_handle_timer+0x98/frame 0xfffffe00a7a19420 >> Xtimerint() at Xtimerint+0xb1/frame 0xfffffe00a7a19420 >> --- interrupt, rip = 0xffffffff80b34500, rsp = 0xfffffe00a7a194f8, rbp = >> 0xfffffe00a7a19540 --- >> acpi_pcib_write_config() at acpi_pcib_write_config/frame 0xfffffe00a7a19540 >> pci_cfg_restore() at pci_cfg_restore+0x2cc/frame 0xfffffe00a7a195a0 >> pci_resume_child() at pci_resume_child+0xee/frame 0xfffffe00a7a195e0 >> pci_resume() at pci_resume+0x49/frame 0xfffffe00a7a19630 >> bus_generic_resume_child() at bus_generic_resume_child+0x43/frame 0xfffffe00a7a19650 >> bus_generic_resume() at bus_generic_resume+0x29/frame 0xfffffe00a7a19680 >> bus_generic_resume_child() at bus_generic_resume_child+0x43/frame 0xfffffe00a7a196a0 >> bus_generic_resume() at bus_generic_resume+0x29/frame 0xfffffe00a7a196d0 >> bus_generic_resume_child() at bus_generic_resume_child+0x43/frame 0xfffffe00a7a196f0 >> bus_generic_resume() at bus_generic_resume+0x29/frame 0xfffffe00a7a19720 >> bus_generic_resume_child() at bus_generic_resume_child+0x43/frame 0xfffffe00a7a19740 >> root_resume() at root_resume+0x29/frame 0xfffffe00a7a19770 >> acpi_EnterSleepState() at acpi_EnterSleepState+0x73b/frame 0xfffffe00a7a197f0 >> acpi_AckSleepState() at acpi_AckSleepState+0x144/frame 0xfffffe00a7a19820 >> devfs_ioctl() at devfs_ioctl+0xcb/frame 0xfffffe00a7a19870 >> vn_ioctl() at vn_ioctl+0x132/frame 0xfffffe00a7a19980 >> devfs_ioctl_f() at devfs_ioctl_f+0x1e/frame 0xfffffe00a7a199a0 >> kern_ioctl() at kern_ioctl+0x27b/frame 0xfffffe00a7a19a00 >> sys_ioctl() at sys_ioctl+0x123/frame 0xfffffe00a7a19ad0 >> amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe00a7a19bf0 >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00a7a19bf0 >> >> I am not sure if this is just a coincidence but it appears as if a write to some >> PCI configuration register could temporarily interfere with access to the PM >> timer I/O port. >> Is that plausible? > If something disabled a BAR, then typical response of x86 chipset for timed > out read from PCIe is 0xfffff... . And the ACPI timer might be "behind" the isab0 bridge device which would indeed cause this. -- John Baldwin