OpenBSD Journal

How to write a useful bug report

Contributed by marco on from the bug-reports-r-us dept.

I see some pretty bad bug reports on a daily basis. Although today I was greeted by this gem from canacar@. I wish everyone took this amount of care to write up a bug report. Read and learn!

Date: Thu, 23 Feb 2006 08:40:49 +0200
From: Can Erkin Acar <canacar@eee.metu.edu.tr>
To: Marco Peereboom <marco@peereboom.us>,
Jordan Hargrave <jordan@openbsd.org>
Subject: MSI s260 ACPI

I have been experimenting on ACPI on my MSI s260 notebook.
The latest update to acpi code made an ACPI enabled kernel
not being able to boot. Below is a diff for aml_get_pciaddr
that fixes the boot problems for me.

Regarding the diff, the 'else' part is most probably still wrong.
I tried setting ctx to point to the node, but I got other crashes
and I do not pretend to understand the code and the mess that is acpi.

My main motivation for running with acpi enabled is to be able to
use my wireless lan adapter. When acpi is enabled, the hardware
switch assumes the last state it is set (which I can change in
linux or windows) on non acpi kernels, it defaults to 'off'.

On a related note, the hardware switch does not work, (i had
high hopes for the acpibtn driver though). Reading through the
specs and my dsdt listings I could not determine which device
to tweak, and or add to make it work. Any ideas would be appreciated.

In the dmesg, you will find that the acpitimer cant identify the
bus. I have added code to print the bus id but could not debug
it further.

the acpibat driver fails to report battery status (is it still dell-only?)
and the acpiac continues to report the AC is on when the power is plugged
off. sysctl.hw output is included below just in case ...

Finally, even with the latest (patched) code, the notebook
does not shut itself down. It halts and hangs there.

So, this summarizes all my acpi related adventures. :)

You will find the dmesg at the end. I have already sent acpi
dumps before. If you need anything just let me know.

Can

Index: dsdt.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
retrieving revision 1.29
diff -u -p -r1.29 dsdt.c
--- dsdt.c	2006/02/22 19:29:24	1.29
+++ dsdt.c	2006/02/23 06:14:24
@@ -1417,14 +1417,24 @@ aml_get_pciaddr(struct acpi_context *ctx
 	reg = ioaddr;
 	if ((val = aml_searchname(node, "_ADR")) != NULL) {
 		/* _ADR holds : */
-	  	ioaddr = aml_eparseint(ctx, AML_ANYINT);
+		if (val->value != NULL)
+			ioaddr = aml_val2int(ctx, val->value);
+		else
+			ioaddr = aml_eparseint(ctx, AML_ANYINT); /* XXX */
 		fn  = ioaddr & 0xFFFF;
 		dev = ioaddr >> 16;
+		dnprintf(20, "get_pciaddr (%s): fn: 0x%x, dev: 0x%x\n",
+			 node->name, fn, dev);
 	}
 	if ((val = aml_searchname(node, "_BBN")) != NULL) {
 		/* _BBN holds  */
-		ioaddr = aml_eparseint(ctx, AML_ANYINT);
+		if (val->value != NULL)
+			ioaddr = aml_val2int(ctx, val->value);
+		else
+			ioaddr = aml_eparseint(ctx, AML_ANYINT); /* XXX */
 		bus = ioaddr;
+		dnprintf(20, "get_pciaddr (%s): bus: 0x%x\n", node->name, bus);
+		
 	}
 	return ACPI_PCI_ADDR(bus, dev, fn, reg);
 }

========= sysctl hw ================

hw.machine=i386
hw.model=Intel(R) Pentium(R) M processor 1.73GHz ("GenuineIntel" 686-class)
hw.ncpu=1
hw.byteorder=1234
hw.physmem=1064738816
hw.usermem=1064308736
hw.pagesize=4096
hw.disknames=wd0,cd0
hw.diskcount=2
hw.sensors.0=acpiac0, power supply, indicator, On
hw.sensors.1=acpibat0, last full capacity, percent, 4294966.30%
hw.sensors.2=acpibat0, warning capacity, percent, 0.00%
hw.sensors.3=acpibat0, low capacity, percent, 0.00%
hw.sensors.4=acpibat0, voltage, OK, volts_dc, 4294.97 V
hw.sensors.5=acpibat0, state, OK, raw, 0
hw.sensors.6=acpibat0, rate, raw, 4294967295
hw.sensors.7=acpibat0, remaining capacity, percent, 4294966.30%
hw.sensors.8=acpibat0, current voltage, OK, volts_dc, 10.00 V
hw.cpuspeed=798
hw.setperf=0

========= dmesg ================

OpenBSD 3.9-beta (ACPI) #30: Thu Feb 23 08:07:37 EET 2006
    canacar@light.my.domain:/usr/src/sys/arch/i386/compile/ACPI
cpu0: Intel(R) Pentium(R) M processor 1.73GHz ("GenuineIntel" 686-class) 1.73 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2
cpu0: Enhanced SpeedStep 1729 MHz (1356 mV): speeds: 1729, 1596, 1463, 1330, 1197, 1064, 931, 798 MHz
real mem  = 1064738816 (1039784K)
avail mem = 964734976 (942124K)
using 4278 buffers containing 53338112 bytes (52088K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(00) BIOS, date 12/21/05, BIOS32 rev. 0 @ 0xf0010
pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf4410/288 (16 entries)
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82801FBM LPC" rev 0x00)
pcibios0: PCI bus #2 is the last bus
bios0: ROM list: 0xc0000/0xf600! 0xcf800/0x1000
acpi0 at mainbus0: rev 0\\_GPE._L05 exists
\\_GPE._L0B exists
gpe0 block len : 4
gpe0 block addr: 828
gpe0 block len : 4
gpe0 block addr: 828
gpe1 block len : 0
gpe1 block addr: 0
gpe1 block len : 0
gpe1 block addr: 0

acpi0: tables DSDT FACP APIC MCFG OEMB MCFG SSDT 
acpitimer0 at acpi0: can't identify bus (id: 251)
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
get_pciaddr (CBC2): fn: 0x0, dev: 0x5
get_pciaddr (CBC2): bus: 0x0
found hid device: PCI0 	device: PNP0A08
found hid device: MCH_ 	device: PNP0C01
found hid device: PIC_ 	device: PNP0000
found hid device: DMAD 	device: PNP0200
found hid device: TMR_ 	device: PNP0100
found hid device: RTC0 	device: PNP0B00
found hid device: PS2K 	device: PNP0303
found hid device: PS2M 	device: SYN1501
found hid device: SPKR 	device: PNP0800
found hid device: COPR 	device: PNP0C04
found hid device: RMSC 	device: PNP0C02
found hid device: FWH_ 	device: INT0800
found hid device: FWHE 	device: PNP0C02
found hid device: EC__ 	device: PNP0C09
found hid device: ADP1 	device: ACPI0003
acpiac0 at acpi0aml_register_notify: ADP1 ACPI0003 d04f2f40
: AC unit online
found hid device: BAT1 	device: PNP0C0A
acpibat0 at acpi0: BAT1: model: Wrong serial:   type: Wrong oem: Wrong
aml_register_notify: BAT1 PNP0C0A d04f3990
found hid device: OMSC 	device: PNP0C02
found hid device: PCIE 	device: PNP0C02
found hid device: RMEM 	device: PNP0C01
found hid device: PWRB 	device: PNP0C0C
acpibtn0 at acpi0: PWRB
aml_register_notify: PWRB PNP0C0C d04f3c24
found hid device: LNKA 	device: PNP0C0F
found hid device: LNKB 	device: PNP0C0F
found hid device: LNKC 	device: PNP0C0F
found hid device: LNKD 	device: PNP0C0F
found hid device: LNKE 	device: PNP0C0F
found hid device: LNKF 	device: PNP0C0F
found hid device: LNKG 	device: PNP0C0F
found hid device: LNKH 	device: PNP0C0F
found hid device: LID0 	device: PNP0C0D
acpibtn1 at acpi0acpibtn1: no _STA
: LID0
aml_register_notify: LID0 PNP0C0D d04f3c24
found hid device: SLPB 	device: PNP0C0E
acpibtn2 at acpi0acpibtn2: no _STA
: SLPB
aml_register_notify: SLPB PNP0C0E d04f3c24
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82915GM/PM/GMS Host" rev 0x04
vga1 at pci0 dev 2 function 0 "Intel 82915GM/GMS Video" rev 0x04: aperture at 0xfbe80000, size 0x10000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
"Intel 82915GM/GMS Video" rev 0x04 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x04: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x04: irq 5
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x04: irq 7
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 29 function 3 "Intel 82801FB USB" rev 0x04: irq 10
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x04: irq 11
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
ppb0 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xd4
pci1 at ppb0 bus 1
rl0 at pci1 dev 3 function 0 "Realtek 8139" rev 0x10: irq 5, address 00:13:d3:af:aa:92
rlphy0 at rl0 phy 0: RTL internal PHY
cbb0 at pci1 dev 5 function 0 vendor "O2 Micro", unknown product 0x7134 rev 0x21 (chipflags 2)cbb0: socket base address 0x3f800000
: intrpin A, intrtag 5
: irq 5
vendor "O2 Micro", unknown product 0x7120 (class system unknown subclass 0x05, rev 0x01) at pci1 dev 5 function 2 not configured
vendor "O2 Micro", unknown product 0x7130 (class bridge subclass miscellaneous, rev 0x01) at pci1 dev 5 function 3 not configured
vendor "O2 Micro", unknown product 0x00f7 (class serial bus subclass Firewire, rev 0x02) at pci1 dev 5 function 4 not configured
iwi0 at pci1 dev 9 function 0 "Intel PRO/Wireless 2200BG" rev 0x05: irq 4, address 00:15:00:23:48:0c
CardBus latency timer 0x40 (40020201)
PCI latency timer 0x40 (824000)
cbb0: O2Micro bridge
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
cbb0: cacheline 0x0 lattimer 0x40
cbb0: bhlc 0x824000 lscp 0x40020201
cardslot0 at cbb0 slot 0 flags 0
cardslot0 attaching CardBus bus...
cardbus0 at cardslot0: bus 2 device 0 cacheline 0x0, lattimer 0x40
cardslotattach: found cardbus on cardslot0
cardbusmatch: busname differs pcmcia <=> cardbus
pcmcia0 at cardslot0
cardslotattach: found 16-bit pcmcia bus
pccbb_pcmcia_card_detect
pccbbattach: found cardslot
auich0 at pci0 dev 30 function 2 "Intel 82801FB AC97" rev 0x04: irq 4, ICH6 AC97
ac97: codec id 0x414c4760 (Avance Logic ALC655)
audio0 at auich0
"Intel 82801FB Modem" rev 0x04 at pci0 dev 30 function 3 not configured
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FBM LPC" rev 0x04: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801FB IDE" rev 0x04: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: 
wd0: 16-sector PIO, LBA, 38154MB, 78140160 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0:  SCSI0 5/cdrom removable
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
cd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 disabled (no drives)
ichiic0 at pci0 dev 31 function 3 "Intel 82801FB SMBus" rev 0x04: irq 4
iic0 at ichiic0
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: 
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: using exception 16
biomask edfd netmask edfd ttymask ffff
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
slpbtn:n  pwrbtn:y
Enabling acpi interrupts...
sleep...
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
Ext2 fs: unsupported optional feature

(Comments are closed)


Comments
  1. By Anonymous Coward (80.108.115.184) on

    You're quite demanding. :) While I understand that you wish every bug report was as good and detailed as this one, please also understand that not every OpenBSD user - and therefor potential bug reporter - ist a programmer who can send a fix already.

    Regards,
    j.

    Comments
    1. By sng (12.18.141.172) on http://www.scarynetworkguy.net

      No not everybody can send diffs. But, and this is important, everybody can strive for that level of detail which is the *really* important thing here. Not just "My notebook doesn't shutdown". And if you are running OpenBSD you really should be able to figure out and report basic information from your dmesg. Also, to make this more general, you can/should read and report what your logs say. The diff is just bonus points.

      Comments
      1. By Janne Johansson (130.237.95.193) on www.inet6.se

        Half of the time when I try to make a bug report this good, I either
        find where *I* did wrong or where the fault is.
        That doesn't mean I can fix everything that comes my way, but my ratio
        of having errors which aren't real bugs is quite large, so while doing
        research like this I end up seeing where I thought/expected/did wrong
        and find a way to attack the problem from another angle.

        Comments
        1. By Anonymous Coward (202.6.138.33) on

          So right you are.

          This is not stressed enough... Why not?

  2. By Oliver (149.148.252.244) on

    Eventually, you'll get flamed for this bugreport 'cause dmesg shows this is not a GENERIC kernel.

    Comments
    1. By Archite (69.238.133.30) adam@akarsoft.com on akarsoft.com

      Yes, I guess it is foolish to use a non-generic kernel.... except for those whole part about creating fixes for acpi... Did you even read the article or just scroll down to the dmesg?

      Comments
      1. By Anonymous Coward (213.97.233.52) on

        Ouch, don't get upset, people.

        Sure a common user -or luser :P- should only report GENERIC dmesg messages, but when it comes to a person able to patch some straigh C code to make things work... Reporting his experience should be mandatory! IMHO :)

        Comments
        1. By Paladdin (213.97.233.52) on

          Sorry! Last comment was mine, I missed the name field... Blame on me! :)

    2. By Marco Peereboom (67.64.89.177) on

      There are a few things you are not getting. ACPI is disabled in GENERIC hence, you can't use GENERIC. Secondly if you looked at Can's email address you'd see that we trust him. I know that he is not going to push knobs or do other crazy stuff before sending the bug report. When we get report from the field with a non GENERIC kernel from somone we don't know it is a different story.

      While I am typing let me also comment on the sending a diff with a bug report. As it was mentioned earlier that was gravy. What makes this such a good report is the breaking down of steps on how he tested it and what the results where.

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]