Hi, > 2026年7月8日 21:14,Xi Ruoyao <[email protected]> 写道: > > On Wed, 2026-07-08 at 05:16 +0800, Miao Wang via B4 Relay wrote: >> From: Miao Wang <[email protected]> >> >> The reset event of BMC is captured through GPIO. However, this driver >> bypasses the GPIO framework and directly accesses the GPIO controller >> through the fixed address. When the same GPIO controller is also >> exposed through ACPI and probed by the corresponding GPIO driver, >> there would be a conflict between the two drivers. >> >> This patch will try to find the GPIO through declared GPIO pin in the >> _CRS resources of the ACPI node. If no such delaration is found, the >> driver will fall back to search for the correct GPIO controller and pin >> according to the fixed address and pin number. A possible DSDT >> declaration for the GPIO pin might be as follows: >> >> Device (BMC0) { >> Name (_ADR, ...) // Match the PCI address of the BMC device >> // \_SB.GPO1 is the ACPI path of the GPIO controller >> Name (_CRS, ResourceTemplate () { >> GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0, >> "\\_SB.GPO1", 0) { >> 14 // 14 is the GPIO pin number >> } >> } > > I think this is a proposal without real implementation yet? If so... > > /* snip */ > >> + adev = to_acpi_device_node(fwnode); >> + if (!adev) >> + goto out; >> + >> + INIT_LIST_HEAD(&resource_list); >> + >> + ret = acpi_dev_get_memory_resources(adev, &resource_list); >> + if (ret < 0) >> + goto out; >> + rentry = list_first_entry_or_null(&resource_list, struct resource_entry, >> node); >> + if (!rentry) >> + goto free_resource_list; >> + if (rentry->res->start == start_addr) >> + found = 1; >> + >> +free_resource_list: >> + acpi_dev_free_resource_list(&resource_list); > > ... consider adding a _DSD method to label (like "bmc-reset") the GPIO > for the proposed BMC0 device so you can use devm_gpiod_get to get the > GPIO, instead of using the hand-brew code to parse the ACPI node. > See > https://www.kernel.org/doc/html/latest/firmware-guide/acpi/gpio-properties.html.
Yes, it is a proposal. GpioInt() in the _CRS() should be at least required to associate the BMC device to the GPIO pin. Having a _DSD might be better to label the gpio pin with human readable label. I however don't think _DSD is important because there is only one pin needed, and devm_gpiod_get_index can be used to obtain the gpio line description using the index in _CRS() > > Combining this with Bartosz's comment, the logic would be like: > > if (missing the ACPI node) > assign a swnode to label "gpio14" as "bmc-reset"; I'll further look into whether swnode can be used. > gpio_desc = devm_gpiod_get(&dev, "bmc-reset", GPIOD_IN); > > And such a proposal will need to be discussed with Loongson. Yes I know > people may hate the "control" from the vendor, but having some > effectively dead code (i.e. supporting some non-exist firmware) in the > kernel is worse. I'm open with such discussions. Cheers, Miao Wang _______________________________________________ Openipmi-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openipmi-developer
