Re: [PATCH RFC v8 0/8] mfd: ls2kbmc: multiple fixes for this driver
From: Bartosz Golaszewski
Date: Mon Aug 10 2026 - 09:41:54 EST
On Mon, Aug 10, 2026 at 3:04 PM Miao Wang via B4 Relay
<devnull+shankerwangmiao.gmail.com@xxxxxxxxxx> wrote:
>
> Previously, the driver has been introduced to support the Loongson 2K
> BMC running on the Loongson Servers, which is essential to prevent
> the system from hanging when the BMC is being reset and the default
> efi-framebuffer is being used. However, there are some drawbacks in the
> driver.
>
> Firstly, the driver tries to read and write to the connected PCI-E host
> controller registers, assuming that the BMC is connected to LS7A PCI-E
> host controller. This assumption should be true for real products, but
> to prevent from accidentally reading and writing to the wrong PCI-E host
> controller, this driver should be modified to check this before
> accessing the registers.
>
> Secondly, the driver uses non-exported functions to tell the vt
> subsystem to redraw the screen, preventing the driver from being
> compiling as a module. This can be fixed by using the exported
> functions instead.
>
> Thirdly, the driver directly accesses the GPIO controller registers
> using hard-coded addresses, which might conflict with the loaded GPIO
> controller driver for the same GPIO controller. This is fixed in this
> series by using the GPIO subsystem APIs instead. To associate a GPIO pin
> with a certian PCI device, it should be declared in the firmware level,
> i.e. in the ACPI table or the device tree, and thus the firmware
> interface should be discussed and coordinated with Loongson personnels.
> Despite of this, the proposed solution in this series should be the
> minimum necessary change to express such association. Furthermore, the
> conventional GPIO pin number and the controller address are also
> provided, to be used as a fallback when the GPIO pin is not declared.
>
> Finally, there is a minor issue in the driver where it changes the
> mode string describing the screen resolution during probing, which
> prevents the device from being probed again if -EPROBE_DEFER is
> returned by the probe function.
>
> I have tested the changes in this series on a single-socket Loongson
> 3C6000 server with a Loongson 2K BMC, and the driver works as expected
> when the corresponding GPIO driver is additionally loaded.
>
> Signed-off-by: Miao Wang <shankerwangmiao@xxxxxxxxx>
> ---
> Changes in v8:
> - Address issues found by the Sashiko AI review bot
> - Fix the error path of the probe function, preventing unintentionally
> returning 0 on failure
> - Reorder the patches in the series to make the change to the Kconfig
> entry for ls2kbmc to be the last patch, to satisfy the AI bot's
> concern on failure to clean up when the driver is built as a module
> and is being removed.
> - Link to v7: https://lore.kernel.org/r/20260810-ls2kbmc-mod-v7-0-8aa0fb5a5462@xxxxxxxxx
>
Don't send several versions of the same big series within minutes of
each other. Give reviewers time to respond.
Bart