the latest modification of src/sys/dev/hotplug.c (1) changes hotplug(4)
behaviour concerning devices that are attached before the hotplug device
is opened (by hotplugd(8), for example). such devices are ignored in
hotplug.c by hotplug_put_event because of !evqueue (line 92 in -current). 

since the commit messages says nothing about behaviour change I suggest
the following patch to restore the old behaviour:


Index: hotplug.c
===================================================================
RCS file: /cvs/src/sys/dev/hotplug.c,v
retrieving revision 1.10
diff -u -r1.10 hotplug.c
--- hotplug.c   2 Dec 2010 04:12:35 -0000       1.10
+++ hotplug.c   11 Dec 2010 19:00:09 -0000
@@ -90,7 +90,8 @@
                return (1);
        }
        if (!evqueue)
-               return (1);
+               evqueue = malloc(sizeof(*he) * HOTPLUG_MAXEVENTS, M_DEVBUF, \
+                   M_WAITOK);
 
        evqueue[evqueue_head] = *he;
        evqueue_head = EVQUEUE_NEXT(evqueue_head);


yes, the malloc thing is now done in hotplug_put_event() as well as
hotplugopen(), but this well reflects reality: hotplug can be opened
first and hotplug can receive an event first. 

the message below went to misc@, no responses.

(1)
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/hotplug.c.diff?r1=1.9;r2=1.10
by tedu, ``make hotplug queue dynamic, allowing us to increase size
without waste. ok deraadt kettenis miod''

mcmer-open...@tor.at (MERIGHI Marcus), 2010.12.09 (Thu) 11:33 (CET):
> for quite some time and until recently (1) hotplugd(8) used to pick up
> devices (2) that were attached before boot once it started. this behaviour
> has ceased with a snapshot just fetched (``OpenBSD 4.8-current (GENERIC)
> #512: Tue Dec  7 23:06:47 MST 2010'').
> has anyone else noticed the different behaviour?
> if this is confirmed, is it a bug or a feature? :-)
> 
> bye and thanks in advance, 
> 
> marcus
> 
> (1) recently is hard to define in that case since I was running a
> patched kernel until today. last but one snapshot I downloaded (and
> still have) at 2010-12-01 (``OpenBSD 4.8-current (GENERIC) #502: Tue Nov
> 30 15:05:27 MST 2010''). I dimly remember the change was
> already there but could test if need be. before that I still got ``OpenBSD
> 4.8-current (GENERIC) #495: Mon Nov 22 11:31:16 MST 2010'' and if my
> memory serves right hotplugd was picking up the devices at that time. 
> 
> (2) devices I tested with: ``ath0 at cardbus0'', ``ubt0 at uhub1''.
> 
> OpenBSD 4.8-current (GENERIC) #512: Tue Dec  7 23:06:47 MST 2010
>     dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
> cpu0: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz ("GenuineIntel" 686-class) 
> 2 GHz
> cpu0: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID,xTPR
> real mem  = 1072721920 (1023MB)
> avail mem = 1045118976 (996MB)
> mainbus0 at root
> bios0 at mainbus0: AT/286+ BIOS, date 06/12/03, BIOS32 rev. 0 @ 0xfd7e0, 
> SMBIOS rev. 2.31 @ 0xe0010 (48 entries)
> bios0: vendor IBM version "1IET66WW (2.05 )" date 06/12/2003
> bios0: IBM 2366EG9
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP SSDT ECDT TCPA BOOT
> acpi0: wakeup devices LID_(S3) SLPB(S3) UART(S3) PCI0(S4) PCI1(S4) DOCK(S4) 
> USB0(S3) USB1(S3) USB2(S3) AC97(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpiec0 at acpi0
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (AGP_)
> acpiprt2 at acpi0: bus 2 (PCI1)
> acpicpu0 at acpi0: C3, C2, FVS, 2000, 1200 MHz
> acpipwrres0 at acpi0: PUBS
> acpitz0 at acpi0: critical temperature 94 degC
> acpibtn0 at acpi0: LID_
> acpibtn1 at acpi0: SLPB
> acpibat0 at acpi0: BAT0 model "IBM-COMPATIBLE" serial 20884 type LION oem "GW"
> acpibat1 at acpi0: BAT1 not present
> acpiac0 at acpi0: AC unit online
> acpithinkpad0 at acpi0
> acpidock0 at acpi0: DOCK not docked (0)
> bios0: ROM list: 0xc0000/0x10000 0xdc000/0x4000! 0xe0000/0x10000
> cpu0 at mainbus0: (uniprocessor)
> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> pchb0 at pci0 dev 0 function 0 "Intel 82845 Host" rev 0x04
> intelagp0 at pchb0
> agp0 at intelagp0: aperture at 0xe0000000, size 0x4000000
> ppb0 at pci0 dev 1 function 0 "Intel 82845 AGP" rev 0x04
> pci1 at ppb0 bus 1
> vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility M7" rev 0x00
> wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
> wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
> radeondrm0 at vga1: irq 11
> drm0 at radeondrm0
> uhci0 at pci0 dev 29 function 0 "Intel 82801CA/CAM USB" rev 0x02: irq 11
> uhci1 at pci0 dev 29 function 1 "Intel 82801CA/CAM USB" rev 0x02: irq 11
> uhci2 at pci0 dev 29 function 2 "Intel 82801CA/CAM USB" rev 0x02: irq 11
> ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x42
> pci2 at ppb1 bus 2
> mem address conflict 0x50000000/0x1000
> mem address conflict 0x51000000/0x1000
> cbb0 at pci2 dev 0 function 0 "TI PCI1520 CardBus" rev 0x01: irq 11
> cbb1 at pci2 dev 0 function 1 "TI PCI1520 CardBus" rev 0x01: irq 11
> fxp0 at pci2 dev 8 function 0 "Intel PRO/100 VE" rev 0x42, i82562: irq 11, 
> address 00:09:6b:3f:67:a8
> inphy0 at fxp0 phy 1: i82562ET 10/100 PHY, rev. 0
> cardslot0 at cbb0 slot 0 flags 0
> cardbus0 at cardslot0: bus 3 device 0 cacheline 0x8, lattimer 0xb0
> pcmcia0 at cardslot0
> cardslot1 at cbb1 slot 1 flags 0
> cardbus1 at cardslot1: bus 6 device 0 cacheline 0x8, lattimer 0xb0
> pcmcia1 at cardslot1
> ichpcib0 at pci0 dev 31 function 0 "Intel 82801CAM LPC" rev 0x02
> pciide0 at pci0 dev 31 function 1 "Intel 82801CAM IDE" rev 0x02: DMA, channel 
> 0 configured to compatibility, channel 1 configured to compatibility
> wd0 at pciide0 channel 0 drive 0: <WDC WD3200BEVE-00A0HT0>
> wd0: 16-sector PIO, LBA48, 305245MB, 625142448 sectors
> wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
> wd1 at pciide0 channel 1 drive 0: <WDC WD1600BEVE-00WZT0>
> wd1: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
> wd1(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 5
> ichiic0 at pci0 dev 31 function 3 "Intel 82801CA/CAM SMBus" rev 0x02: irq 11
> iic0 at ichiic0
> auich0 at pci0 dev 31 function 5 "Intel 82801CA/CAM AC97" rev 0x02: irq 11, 
> ICH3 AC97
> ac97: codec id 0x41445348 (Analog Devices AD1881A)
> ac97: codec features headphone, Analog Devices Phat Stereo
> audio0 at auich0
> usb0 at uhci0: USB revision 1.0
> uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> usb1 at uhci1: USB revision 1.0
> uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> usb2 at uhci2: USB revision 1.0
> uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> isa0 at ichpcib0
> isadma0 at isa0
> com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
> 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
> spkr0 at pcppi0
> npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
> biomask eded netmask eded ttymask ffff
> mtrr: Pentium Pro MTRR support
> ath0 at cardbus0 dev 0 function 0 "Atheros AR5212" rev 0x01: irq 11
> ath0: AR5213A 5.9 phy 4.3 rf2112a 4.6, FCC2A*, address 00:0f:b5:64:0c:53
> ubt0 at uhub1 port 2 "Cambridge Silicon Radio Bluetooth" rev 2.00/31.64 addr 2
> vscsi0 at root
> scsibus0 at vscsi0: 256 targets
> softraid0 at root
> root on wd0a swap on wd0b dump on wd0b

Reply via email to