NetBSD Problem Report #55009

From tsutsui@ceres.dti.ne.jp  Mon Feb 24 05:55:20 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 B64631A9213
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 Feb 2020 05:55:20 +0000 (UTC)
Message-Id: <202002240554.01O5sGVl002080@ceres.dti.ne.jp>
Date: Mon, 24 Feb 2020 14:54:16 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Fatal defects on cobalt panel -> lcdpanel rename
X-Send-Pr-Version: 3.95

>Number:         55009
>Category:       port-cobalt
>Synopsis:       Fatal defects on cobalt panel -> lcdpanel rename
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 06:00:01 +0000 2020
>Closed-Date:    Sun Jun 21 07:10:56 +0000 2020
>Last-Modified:  Sun Jun 21 07:10:56 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/cobalt/compile/GENERIC
Architecture: mipsel
Machine: cobalt
>Description:
/dev/panel device for cobalt was renaned from "panel" to "lcdpanel"
to avoid a conflict against FDT device back on April 2018:
 https://mail-index.netbsd.org/source-changes/2018/04/09/msg094149.html
 https://mail-index.netbsd.org/source-changes/2018/04/09/msg094151.html
 https://mail-index.netbsd.org/source-changes/2018/04/09/msg094156.html
 https://mail-index.netbsd.org/source-changes/2018/04/09/msg094158.html

But there were at least three fatal defects in these changes
so the LCD panel device on NetBSD/cobalt 9.0 is not functional at all.

1) src/sys/arch/cobalt/conf/majors.cobalt was not changed on the rename

This means cobalt kernels have no device node corresponding to
a new renamed "lcdpanel" attribute.

2) The device name in /dev should not be changed

In etc/etc.cobalt/MAKEDEV.conf the device node name "/dev/panel0" was
also renamed to "/dev/lcdpanel0".

However it was not necessary to avoid a confict at all
(cobalt doesn't need FDT and naming strategy can be handled in MD)
and chaning userland exported names breaks compatibility.

3) Updated etc/etc.cobalt/MAKEDEV.conf contains "%lcdpanel_chr%" format

The %foo_chr% format only valid in MI src/etc/MAKEDEV.tmpl template.
/dev/MAKEDEV script in the release etc.tgz created by current
MD etc.cobalt/MAKEDEV.conf fails to create panel device:
>> mtree: invalid number `%lcdpanel_chr%'

>How-To-Repeat:
See above.

>Fix:

(1) Set proper attribute.

Index: sys/arch/cobalt/conf/majors.cobalt
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/conf/majors.cobalt,v
retrieving revision 1.32
diff -u -p -d -r1.32 majors.cobalt
--- sys/arch/cobalt/conf/majors.cobalt	28 Jan 2019 02:28:57 -0000	1.32
+++ sys/arch/cobalt/conf/majors.cobalt	23 Feb 2020 14:55:29 -0000
@@ -39,7 +39,7 @@ device-major	ld		char 27  block 10	ld
 device-major	clockctl	char 33			clockctl
 #device-major	obsolete	char 34			obsolete (systrace)
 device-major	cgd		char 35  block 11	cgd
-device-major	panel		char 36			panel
+device-major	lcdpanel	char 36			lcdpanel
 device-major	ksyms		char 37			ksyms
 device-major	pci		char 38			pci
 device-major	zstty		char 39			zstty


(2)(3) Restore old "panel" name and remove invald %foo_chr% format.

Note if device name is different from attribute
(defined in majors.${MACHINE}) src/etc/MAKEDEV.awk
doesn't seem to handle it as before.

Index: etc/etc.cobalt/MAKEDEV.conf
===================================================================
RCS file: /cvsroot/src/etc/etc.cobalt/MAKEDEV.conf,v
retrieving revision 1.16
diff -u -p -d -r1.16 MAKEDEV.conf
--- etc/etc.cobalt/MAKEDEV.conf	23 Sep 2018 09:20:58 -0000	1.16
+++ etc/etc.cobalt/MAKEDEV.conf	23 Feb 2020 14:55:29 -0000
@@ -12,7 +12,7 @@ all_md)
 	makedev ld0 ld1 ld2 ld3
 	makedev usbs
 	makedev pci0
-	makedev lcdpanel
+	makedev panel
 	makedev altq
 	makedev nsmb
 	;;
@@ -25,8 +25,8 @@ minimal)
 	makedev bpf
 	;;

-lcdpanel)
-        mkdev lcdpanel0 c %lcdpanel_chr% 0 660
+panel)
+	mkdev panel0 c 36 0 660
 	;;



---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-cobalt-maintainer->thorpej
Responsible-Changed-By: thorpej@NetBSD.org
Responsible-Changed-When: Wed, 04 Mar 2020 03:49:17 +0000
Responsible-Changed-Why:
Take.


From: "Jason R Thorpe" <thorpej@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55009 CVS commit: src/sys/arch/cobalt/conf
Date: Wed, 4 Mar 2020 04:58:52 +0000

 Module Name:	src
 Committed By:	thorpej
 Date:		Wed Mar  4 04:58:52 UTC 2020

 Modified Files:
 	src/sys/arch/cobalt/conf: majors.cobalt

 Log Message:
 panel -> lcdpanel

 Part of PR port-cobalt/55009


 To generate a diff of this commit:
 cvs rdiff -u -r1.33 -r1.34 src/sys/arch/cobalt/conf/majors.cobalt

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

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-cobalt/55009: Fatal defects on cobalt panel -> lcdpanel
 rename
Date: Tue, 21 Apr 2020 16:47:09 +0000

 Hi thorpej, given that this bug has a patch, I wonder why only part of
 it was committed. Can you elaborate on that?
 Thanks!

From: Jason Thorpe <thorpej@me.com>
To: gnats-bugs@netbsd.org
Cc: Jason Thorpe <thorpej@netbsd.org>,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 tsutsui@ceres.dti.ne.jp
Subject: Re: port-cobalt/55009: Fatal defects on cobalt panel -> lcdpanel
 rename
Date: Tue, 21 Apr 2020 10:05:26 -0700

 > On Apr 21, 2020, at 9:50 AM, coypu@sdf.org wrote:
 > 
 > Hi thorpej, given that this bug has a patch, I wonder why only part of
 > it was committed. Can you elaborate on that?
 > Thanks!

 I wanted to fix part of it slightly differently.  I'll wrap it up this week.

 -- thorpej

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: thorpej@me.com
Cc: gnats-bugs@netbsd.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-cobalt/55009: Fatal defects on cobalt panel -> lcdpanelrename
Date: Sat, 13 Jun 2020 04:52:09 +0900

 (ping)

 > > Hi thorpej, given that this bug has a patch, I wonder why only part of
 > > it was committed. Can you elaborate on that?
 > > Thanks!
 > 
 > I wanted to fix part of it slightly differently.  I'll wrap it up this week.

 What's your intention?
 Which part should be modified in my patch?

 It's a bit annoying debug cobalt sysinst without these fixes
 and pullups so if you don't have spare time I'd like to commit it
 as is, if it's style issue.

 ---
 Izumi Tsutsui

From: Jason Thorpe <thorpej@me.com>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: netbsd-bugs@netbsd.org,
 gnats-bugs@netbsd.org
Subject: Re: port-cobalt/55009: Fatal defects on cobalt panel ->
 lcdpanelrename
Date: Sat, 13 Jun 2020 08:03:49 -0700

 > On Jun 12, 2020, at 12:55 PM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> =
 wrote:
 >=20
 > The following reply was made to PR port-cobalt/55009; it has been =
 noted by GNATS.
 >=20
 > From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
 > To: thorpej@me.com
 > Cc: gnats-bugs@netbsd.org, tsutsui@ceres.dti.ne.jp
 > Subject: Re: port-cobalt/55009: Fatal defects on cobalt panel -> =
 lcdpanelrename
 > Date: Sat, 13 Jun 2020 04:52:09 +0900
 >=20
 > (ping)
 >=20
 >>> Hi thorpej, given that this bug has a patch, I wonder why only part =
 of
 >>> it was committed. Can you elaborate on that?
 >>> Thanks!
 >>=20
 >> I wanted to fix part of it slightly differently.  I'll wrap it up =
 this week.
 >=20
 > What's your intention?
 > Which part should be modified in my patch?

 I'm sorry, I have neglected this.  I will wrap it up today.  The final =
 tweak I wanted to make (leave the new /dev/lcdpanel0 and create a link =
 to support the legacy /dev/panel0 name) is now building to see that it =
 works correctly.

 >=20
 > It's a bit annoying debug cobalt sysinst without these fixes
 > and pullups so if you don't have spare time I'd like to commit it
 > as is, if it's style issue.
 >=20
 > ---
 > Izumi Tsutsui
 >=20

 -- thorpej

State-Changed-From-To: open->feedback
State-Changed-By: thorpej@NetBSD.org
State-Changed-When: Sat, 13 Jun 2020 19:48:41 +0000
State-Changed-Why:
Fixed the awk script that generates MAKEDEV to perform the substitutions
property, and added a compatibility symlink.  OK?


From: "Jason R Thorpe" <thorpej@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55009 CVS commit: src/etc
Date: Sat, 13 Jun 2020 19:46:23 +0000

 Module Name:	src
 Committed By:	thorpej
 Date:		Sat Jun 13 19:46:23 UTC 2020

 Modified Files:
 	src/etc: MAKEDEV.awk

 Log Message:
 When reading in the MD MAKEDEV.conf, perform block / char major
 substitutions that may be present in that file.

 PR port-cobalt/55009


 To generate a diff of this commit:
 cvs rdiff -u -r1.28 -r1.29 src/etc/MAKEDEV.awk

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

From: "Jason R Thorpe" <thorpej@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55009 CVS commit: src/etc/etc.cobalt
Date: Sat, 13 Jun 2020 19:47:10 +0000

 Module Name:	src
 Committed By:	thorpej
 Date:		Sat Jun 13 19:47:10 UTC 2020

 Modified Files:
 	src/etc/etc.cobalt: MAKEDEV.conf

 Log Message:
 Create a compatibility symlink panel0 -> lcdpanel0

 PR port-cobalt/55009


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.18 src/etc/etc.cobalt/MAKEDEV.conf

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

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: thorpej@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-cobalt/55009 (Fatal defects on cobalt panel -> lcdpanel rename)
Date: Sun, 14 Jun 2020 21:56:07 +0900

 > Fixed the awk script that generates MAKEDEV to perform the substitutions
 > property, and added a compatibility symlink.  OK?

 Works fine on RestoreCD/USB with patched netbsd-9.
 (maybe it's the only user of the panel(4) device)

 Renaming MD device node is still a bit pain, but anyway it's done.
 https://github.com/tsutsui/netbsd-cobalt-restorecd/commit/506c0d3473f7af5c0f265751e0275273fe69673a

 ---
 Izumi Tsutsui

From: Jason Thorpe <thorpej@me.com>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: gnats-bugs@netbsd.org,
 Jason Thorpe <thorpej@NetBSD.org>
Subject: Re: port-cobalt/55009 (Fatal defects on cobalt panel -> lcdpanel
 rename)
Date: Sun, 14 Jun 2020 08:22:40 -0700

 > On Jun 14, 2020, at 5:56 AM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> =
 wrote:
 >=20
 >> Fixed the awk script that generates MAKEDEV to perform the =
 substitutions
 >> property, and added a compatibility symlink.  OK?
 >=20
 > Works fine on RestoreCD/USB with patched netbsd-9.
 > (maybe it's the only user of the panel(4) device)
 >=20
 > Renaming MD device node is still a bit pain, but anyway it's done.
 > =
 https://github.com/tsutsui/netbsd-cobalt-restorecd/commit/506c0d3473f7af5c=
 0f265751e0275273fe69673a

 You should don't need to do that... I specifically added an "lndev" =
 directive to MAKEDEV that ensure /dev/panel0 exists (and points to the =
 new /dev/lcdpanel0).

 -- thorpej

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: thorpej@me.com
Cc: gnats-bugs@netbsd.org, thorpej@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-cobalt/55009 (Fatal defects on cobalt panel -> lcdpanelrename)
Date: Mon, 15 Jun 2020 00:38:27 +0900

 > You should don't need to do that... I specifically added an "lndev" directive to MAKEDEV that ensure /dev/panel0 exists (and points to the new /dev/lcdpanel0).

 Except a line that calls "MAKEDEV panel" after "[ ! -f /dev/panel0 ]":
  https://github.com/tsutsui/netbsd-cobalt-restorecd/blob/0e3e2a2583057b18fb66d4f5daee30646938b476/data/cobalt/etc/rc.d/mountmfs#L22

 I had to fix this line, so also did all others.

 ---
 Izumi Tsutsui

State-Changed-From-To: feedback->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Thu, 18 Jun 2020 17:01:43 +0000
State-Changed-Why:
[pullup-9 #962]


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55009 CVS commit: [netbsd-9] src
Date: Sat, 20 Jun 2020 16:19:43 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Jun 20 16:19:43 UTC 2020

 Modified Files:
 	src/etc [netbsd-9]: MAKEDEV.awk
 	src/etc/etc.cobalt [netbsd-9]: MAKEDEV.conf
 	src/sys/arch/cobalt/conf [netbsd-9]: majors.cobalt

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #962):

 	sys/arch/cobalt/conf/majors.cobalt: revision 1.34
 	etc/MAKEDEV.awk: revision 1.29
 	etc/etc.cobalt/MAKEDEV.conf: revision 1.18
 	etc/etc.cobalt/MAKEDEV.conf: revision 1.19

 panel -> lcdpanel

 Part of PR port-cobalt/55009

 When reading in the MD MAKEDEV.conf, perform block / char major
 substitutions that may be present in that file.
 PR port-cobalt/55009

 Create a compatibility symlink panel0 -> lcdpanel0
 PR port-cobalt/55009

 Fix leading 8 spaces to a tab.


 To generate a diff of this commit:
 cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/etc/MAKEDEV.awk
 cvs rdiff -u -r1.16 -r1.16.2.1 src/etc/etc.cobalt/MAKEDEV.conf
 cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/arch/cobalt/conf/majors.cobalt

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

State-Changed-From-To: pending-pullups->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 21 Jun 2020 07:10:56 +0000
State-Changed-Why:
Pullup complete.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.