problem with attaching device to LPC bus

karu.pruun karu.pruun at
Tue Aug 23 06:23:12 PDT 2016


This is a newbie question: I am trying to write a simple DragonFly kernel
module for the gmux device that is attached to the LPC bus. Probing works
fine but I am stuck with the attachment routine: I can't allocate IO ports
for the device.

The device shows up in the device tree but is not attached:

# devinfo -rv | grep GMUX:

unknown pnpinfo _HID=APP000B _UID=0 at handle=\_SB_.PCI0.LPCB.GMUX

I looked up acpi tables (acpidump etc), the IO resources for GMUX seem to
be there:

--- ---
    Scope (\_SB.PCI0.LPCB)
        Device (GMUX)
            Name (_HID, EisaId ("APP000B"))  // _HID: Hardware ID
            Name (_CID, "gmux")  // _CID: Compatible ID
            Name (_STA, 0x0B)  // _STA: Status
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource
                IO (Decode16,
                    0x0700,             // Range Minimum
                    0x07FF,             // Range Maximum
                    0x01,               // Alignment
                    0xFF,               // Length
--- ---

Also, looking devinfo -rv shows that the range 0x0700 to 0x07FF has been
set aside by the kernel:

# devinfo -u

. . .
I/O ports:
    . . .
    0x400 - 0x1fff (root0)
    . . .

So am I right supposing that bus_alloc_resource_any should be able to claim
the range 0x700 to 0x7FF for the gmux device? At the moment, trying to
allocate IO ports with bus_alloc_resource returns NULL.

I wonder if anyone has suggestions about what has gone wrong or where to
dig further? I attach the code.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmux_off_acpi.c
Type: text/x-csrc
Size: 2481 bytes
Desc: not available
URL: <>

More information about the Kernel mailing list