From nobody Wed Sep 01 17:28:38 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5160217A940F for ; Wed, 1 Sep 2021 17:28:40 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H09yJ1qbxz3sg5; Wed, 1 Sep 2021 17:28:40 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:e20:f2ad:4eff:fe0b:a065]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id BF503291BE; Wed, 1 Sep 2021 17:28:39 +0000 (UTC) (envelope-from leres@freebsd.org) Subject: Re: Patched gpsd and /dev/pps0 results in "sleeping thread" kernel panic To: Ian Lepore , Warner Losh Cc: FreeBSD Hackers References: <5476ea21-9e8a-32f5-08ff-add46c02d910@freebsd.org> <5d812d36e5291af35ecadf910a6d5f76b60f1441.camel@freebsd.org> From: Craig Leres Message-ID: <24848efe-aee7-8fe2-9437-005a854a3525@freebsd.org> Date: Wed, 1 Sep 2021 10:28:38 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: <5d812d36e5291af35ecadf910a6d5f76b60f1441.camel@freebsd.org> Content-Type: multipart/mixed; boundary="------------E2E1F9FA8C577A7C7CF5D5DB" Content-Language: en-US X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N This is a multi-part message in MIME format. --------------E2E1F9FA8C577A7C7CF5D5DB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 9/1/21 8:07 AM, Ian Lepore wrote: > Warner, I pointed out a small change needed to your proposed patch in > D31763. I was able to figure out what to change and am happy to report that it solves the kernel panic; thanks! Now I'm back to only fighting with gpsd. Are the other calls to pps_init() ok? steel 183 # find . -name '*.c' | xargs fgrep -w pps_init ./dev/sio/sio.c: pps_init(&com->pps); ./i386/i386/elan-mmcr.c: pps_init(&elan_pps); ./kern/kern_tc.c:pps_init(struct pps_state *pps) ./kern/kern_tc.c: pps_init(pps); I've attached my working version of the patch. Craig --------------E2E1F9FA8C577A7C7CF5D5DB Content-Type: text/plain; charset=UTF-8; name="patch2.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch2.txt" SW5kZXg6IGRldi9wcGJ1cy9wcGJfYmFzZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGRldi9wcGJ1 cy9wcGJfYmFzZS5jCShyZXZpc2lvbiAxOCkKKysrIGRldi9wcGJ1cy9wcGJfYmFzZS5jCSh3 b3JraW5nIGNvcHkpCkBAIC0yMjAsNiArMjIwLDE0IEBACiAJbXR4X3VubG9jayhwcGItPnBw Y19sb2NrKTsKIH0KIAorc3RydWN0IG10eCAqCitwcGJfZ2V0X2xvY2soZGV2aWNlX3QgYnVz KQoreworCXN0cnVjdCBwcGJfZGF0YSAqcHBiID0gREVWVE9TT0ZUQyhidXMpOworCisJcmV0 dXJuIChwcGItPnBwY19sb2NrKTsKK30KKwogdm9pZAogX3BwYl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