On 2020/12/07 22:54, Scott Cheloha wrote:
> On Wed, Dec 02, 2020 at 11:43:32PM +0100, Mark Kettenis wrote:
> > > From: "Constantine A. Murenin" <[email protected]>
> > > Date: Wed, 2 Dec 2020 14:04:52 -0800
> > > 
> > > Not sure if you've seen it, but ipmi(4) has been disabled for over 12
> > > years, because it's broken on some machines, so, this code is not
> > > necessarily guaranteed to be correct as-is.
> > > 
> > > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/i386/conf/GENERIC#rev1.632
> > > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/amd64/conf/GENERIC#rev1.238
> > 
> > The driver is actually enabled on arm64.  And I'll probably enable it
> > on powerpc64 at some point.
> 
> kettenis@/sthen@:
> 
> In that case, could one or both of you test this diff?
> 
> I doubt anyone remembers why we spin until tsleep(9) returns
> EWOULDBLOCK.  If we can confirm that the driver still works with a 1ms
> block in this spot then that's good enough for me.
> 
> So, does this still work?
> 
> Index: ipmi.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ipmi.c,v
> retrieving revision 1.112
> diff -u -p -r1.112 ipmi.c
> --- ipmi.c    29 Mar 2020 09:31:10 -0000      1.112
> +++ ipmi.c    2 Dec 2020 20:31:57 -0000
> @@ -1497,7 +1497,8 @@ ipmi_poll_thread(void *arg)
>                       printf("%s: no SDRs IPMI disabled\n", DEVNAME(sc));
>                       goto done;
>               }
> -             while (tsleep(sc, PWAIT, "ipmirun", 1) != EWOULDBLOCK)
> +             while (tsleep_nsec(sc, PWAIT, "ipmirun",
> +                 MSEC_TO_NSEC(1)) != EWOULDBLOCK)
>                       continue;
>       }
>  

The machine I can test easily (for now, it is going away soon to replace
an APU that I'm having problems with..) is Supermicro A2SDI (X10 BMC
platform running recent firmware), which works fine:

# sysctl hw.sensors
hw.sensors.cpu0.temp0=26.00 degC
hw.sensors.ipmi0.temp0=25.00 degC (CPU Temp), OK
hw.sensors.ipmi0.temp1=17.00 degC (System Temp), OK
hw.sensors.ipmi0.temp2=24.00 degC (Peripheral Temp), OK
hw.sensors.ipmi0.fan0=4900 RPM (FANA), OK
hw.sensors.ipmi0.volt0=12.19 VDC (12V), OK
hw.sensors.ipmi0.volt1=5.00 VDC (5VCC), OK
hw.sensors.ipmi0.volt2=3.30 VDC (3.3VCC), OK
hw.sensors.ipmi0.volt3=3.15 VDC (VBAT), OK
hw.sensors.ipmi0.volt4=1.04 VDC (Vcpu), OK
hw.sensors.ipmi0.volt5=1.21 VDC (VDIMM), OK
hw.sensors.ipmi0.volt6=1.03 VDC (PVCCSRAM), OK
hw.sensors.ipmi0.volt7=1.04 VDC (P1V05_A), OK
hw.sensors.ipmi0.volt8=4.95 VDC (5VSB), OK
hw.sensors.ipmi0.volt9=3.28 VDC (3.3VSB), OK
hw.sensors.ipmi0.volt10=0.85 VDC (PVNN), OK
hw.sensors.ipmi0.volt11=2.68 VDC (PVPP), OK
hw.sensors.ipmi0.volt12=1.54 VDC (P1V538_A), OK
hw.sensors.ipmi0.volt13=1.21 VDC (1.2V BMC), OK
hw.sensors.ipmi0.volt14=1.27 VDC (PVCC_REF), OK
hw.sensors.ipmi0.indicator0=On (Chassis Intru), CRITICAL

# ipmitool fru
FRU Device Description : Builtin FRU Device (ID 0)
 Board Mfg Date        : Mon Jan  1 00:00:00 1996
 Board Mfg             : Supermicro
 Board Serial          :           
 Product Manufacturer  : Broadberry
 Product Serial        : BDxxxxxx

# dmesg
OpenBSD 6.8-current (GENERIC.MP) #0: Tue Dec  8 13:00:45 GMT 2020
    sthen@xxx:/sys/arch/amd64/compile/GENERIC.MP
real mem = 8531894272 (8136MB)
avail mem = 8258015232 (7875MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0x7f0c3000 (32 entries)
bios0: vendor American Megatrends Inc. version "1.2" date 11/05/2019
bios0: Supermicro Super Server
acpi0 at bios0: ACPI 6.1
acpi0: sleep states S0 S4 S5
acpi0: tables DSDT FACP FPDT FIDT SPMI MCFG WDAT APIC BDAT HPET UEFI SSDT DMAR 
HEST BERT ERST EINJ WSMT
acpi0: wakeup devices XHC1(S4) OBL1(S4) LAN1(S4) PEX0(S4) LAN2(S4) LAN3(S4) 
PEX1(S4) PEX6(S4) PEX7(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 12 (boot processor)
cpu0: Intel(R) Atom(TM) CPU C3338 @ 1.50GHz, 2200.42 MHz, 06-5f-01
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SMEP,ERMS,MPX,RDSEED,SMAP,CLFLUSHOPT,PT,SHA,MD_CLEAR,IBRS,IBPB,STIBP,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 2MB 64b/line 16-way L2 cache
cpu0: cannot disable silicon debug
cpu0: smt 0, core 6, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 25MHz
cpu0: mwait min=64, max=64, C-substates=0.2.0.2, IBE
cpu1 at mainbus0: apid 24 (application processor)
cpu1: Intel(R) Atom(TM) CPU C3338 @ 1.50GHz, 2200.01 MHz, 06-5f-01
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SMEP,ERMS,MPX,RDSEED,SMAP,CLFLUSHOPT,PT,SHA,MD_CLEAR,IBRS,IBPB,STIBP,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu1: 2MB 64b/line 16-way L2 cache
cpu1: cannot disable silicon debug
cpu1: smt 0, core 12, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpihpet0 at acpi0: 23999999 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 4 (VRP0)
acpiprt2 at acpi0: bus -1 (PEX0)
acpiprt3 at acpi0: bus -1 (VRP2)
acpiprt4 at acpi0: bus 5 (VRP1)
acpiprt5 at acpi0: bus 1 (PEX1)
acpiprt6 at acpi0: bus -1 (PEX6)
acpiprt7 at acpi0: bus 2 (PEX7)
acpiprt8 at acpi0: bus 3 (BR28)
acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
"PNP0003" at acpi0 not configured
acpicmos0 at acpi0
ipmi0 at acpi0: version 2.0 interface KCS iobase 0xca2/2 spacing 1
"PNP0C33" at acpi0 not configured
acpicpu0 at acpi0: C2(10@50 mwait.1@0x21), C1(1000@1 mwait.1@0x1), PSS
acpicpu1 at acpi0: C2(10@50 mwait.1@0x21), C1(1000@1 mwait.1@0x1), PSS
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep 2200 MHz: speeds: 1501, 1500, 1400, 1300, 1200, 1100, 
1000, 900, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel C3000 Host" rev 0x11
pchb1 at pci0 dev 4 function 0 "Intel C3000 GLREG" rev 0x11
"Intel C3000 RCEC" rev 0x11 at pci0 dev 5 function 0 not configured
ppb0 at pci0 dev 10 function 0 "Intel C3000 PCIE" rev 0x11: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 17 function 0 "Intel C3000 PCIE" rev 0x11
pci2 at ppb1 bus 2
ppb2 at pci2 dev 0 function 0 "ASPEED Technology AST1150 PCI" rev 0x03
pci3 at ppb2 bus 3
"ASPEED Technology AST2000" rev 0x30 at pci3 dev 0 function 0 not configured
"Intel C3000 SMBus" rev 0x11 at pci0 dev 18 function 0 not configured
ahci0 at pci0 dev 19 function 0 "Intel C3000 AHCI" rev 0x11: msi, AHCI 1.3.1
scsibus1 at ahci0: 32 targets
ahci1 at pci0 dev 20 function 0 "Intel C3000 AHCI" rev 0x11: msi, AHCI 1.3.1
ahci1: port 6: 6.0Gb/s
scsibus2 at ahci1: 32 targets
sd0 at scsibus2 targ 6 lun 0: <ATA, KINGSTON SA400S3, 0309> naa.502b2a201d1c1b1a
sd0: 114473MB, 512 bytes/sector, 234441648 sectors, thin
xhci0 at pci0 dev 21 function 0 "Intel C3000 xHCI" rev 0x11: msi, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 
addr 1
ppb3 at pci0 dev 22 function 0 "Intel C3000 PCIE" rev 0x11
pci4 at ppb3 bus 4
ix0 at pci4 dev 0 function 0 "Intel X553 SGMII" rev 0x11, msix, 2 queues, 
address 3c:ec:ef:01:a6:e4
ix1 at pci4 dev 0 function 1 "Intel X553 SGMII" rev 0x11, msix, 2 queues, 
address 3c:ec:ef:01:a6:e5
ppb4 at pci0 dev 23 function 0 "Intel C3000 PCIE" rev 0x11
pci5 at ppb4 bus 5
ix2 at pci5 dev 0 function 0 "Intel X553 SGMII" rev 0x11, msix, 2 queues, 
address 3c:ec:ef:01:a6:e6
ix3 at pci5 dev 0 function 1 "Intel X553 SGMII" rev 0x11, msix, 2 queues, 
address 3c:ec:ef:01:a6:e7
"Intel C3000 ME HECI" rev 0x11 at pci0 dev 24 function 0 not configured
pcib0 at pci0 dev 31 function 0 "Intel C3000 LPC" rev 0x11
"Intel C3000 PMC" rev 0x11 at pci0 dev 31 function 2 not configured
"Intel C3000 SMBus" rev 0x11 at pci0 dev 31 function 4 not configured
"Intel C3000 SPI" rev 0x11 at pci0 dev 31 function 5 not configured
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb0 at mainbus0: 800x600, 32bpp
wsdisplay0 at efifb0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
uhub1 at uhub0 port 3 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" 
rev 2.00/32.98 addr 2
uhub2 at uhub1 port 1 configuration 1 interface 0 "ATEN International product 
0x7000" rev 2.00/0.00 addr 3
uhidev0 at uhub2 port 1 configuration 1 interface 0 "ATEN International product 
0x2419" rev 1.10/1.00 addr 4
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub2 port 1 configuration 1 interface 1 "ATEN International product 
0x2419" rev 1.10/1.00 addr 4
uhidev1: iclass 3/1
ums0 at uhidev1: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
uhub3 at uhub1 port 2 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" 
rev 2.00/32.98 addr 5
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (ad02ecfdebdcc1f0.a) swap on sd0b dump on sd0b

Reply via email to