NetBSD Problem Report #57088

From www@netbsd.org  Sun Nov 20 03:23:41 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5DC4C1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 Nov 2022 03:23:41 +0000 (UTC)
Message-Id: <20221120032340.9C0A31A9239@mollari.NetBSD.org>
Date: Sun, 20 Nov 2022 03:23:40 +0000 (UTC)
From: lloyd@must-have-coffee.gen.nz
Reply-To: lloyd@must-have-coffee.gen.nz
To: gnats-bugs@NetBSD.org
Subject: The owtemp driver isn't available as a kernel module
X-Send-Pr-Version: www-1.0

>Number:         57088
>Category:       kern
>Synopsis:       The owtemp driver isn't available as a kernel module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 20 03:25:00 +0000 2022
>Closed-Date:    Tue Oct 10 20:15:26 +0000 2023
>Last-Modified:  Tue Oct 10 20:15:26 +0000 2023
>Originator:     Lloyd Parkes
>Release:        9.99.106
>Organization:
Must Have Coffee
>Environment:
NetBSD biorhythm.must-have-coffee.gen.nz 9.99.106 NetBSD 9.99.106 (RPI2) #3: Sun Nov 20 14:16:08 NZDT 2022  lloyd@riftsweeper.must-have-coffee.gen.nz:/home/lloyd/NetBSD/current/objdir.evbarm/sys/arch/evbarm/compile/RPI2 evbarm
>Description:
The owtemp driver cannot be loaded as a module at runtime. 

To make matters worse, in order to compile owtemp into the kernel, you also have to compile "onewire" and "gpioow" drivers into the kernel even though these latter two drivers are available as modules.
>How-To-Repeat:

>Fix:
I put a patch at https://gist.github.com/lparkes/bea894126a860562fecebd3c645b51cb

I just copied the code from onewire and adjusted it so that it looked like it was going to work.

I have tested that modload works, but I haven't tested modunload. 


>Release-Note:

>Audit-Trail:
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57088: The owtemp driver isn't available as a kernel module
Date: Mon, 21 Nov 2022 08:45:09 +1300

 I have updated the diff in the gist to include the new kmod into the 
 modules set.

From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57088: The owtemp driver isn't available as a kernel module
Date: Mon, 21 Nov 2022 09:54:08 +1300

 And hopefully finally, I have tested that modunload works.

From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57088: The owtemp driver isn't available as a kernel module
Date: Mon, 21 Nov 2022 09:10:36 +1300

 And another update to the gist. The module now lists "onewire" as a 
 required module because it references a bunch of onewire_* symbols and 
 won't load unless onewire is already loaded.

From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
To: gnats-bugs@netbsd.org, kardel@netbsd.org
Cc: 
Subject: Re: kern/57088: The owtemp driver isn't available as a kernel module
Date: Wed, 11 Oct 2023 07:59:43 +1300

 Frank has pretty much resolved this PR with his recent changes to 
 owtemp. He did make the same mistake I did though, and owtemp doesn't 
 list "onewire" as a linker dependency. This means that if the "onewire" 
 module isn't already loaded into the kernel, then "modload owtemp" will 
 fail with undefined symbol errors instead of automatically loading the 
 onewire module.

 This fix is to change line 321 of owtemp.c v1.20 to read 
 'MODULE(MODULE_CLASS_DRIVER, owtemp, "onewire");'.

 Once that's fixed, this PR can be closed.

 Thanks for making owtemp a module Frank.

 Cheers,
 Lloyd

From: "Frank Kardel" <kardel@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57088 CVS commit: src/sys/dev/onewire
Date: Tue, 10 Oct 2023 19:21:39 +0000

 Module Name:	src
 Committed By:	kardel
 Date:		Tue Oct 10 19:21:39 UTC 2023

 Modified Files:
 	src/sys/dev/onewire: owtemp.c

 Log Message:
 PR kern/57088:
 add missing "onewire" link dependency

 Thanks Lloyd for pointing me to this PR as
 I independently fixed the missing module functionality (and also missing the
 link dependency).


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 src/sys/dev/onewire/owtemp.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: kardel@NetBSD.org
State-Changed-When: Tue, 10 Oct 2023 20:15:26 +0000
State-Changed-Why:
onewire link dependency added


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.