From: Miao Wang via B4 Relay <devnull+shankerwangmiao.gmail.com@kernel.org>
To: Binbin Zhou <zhoubinbin@loongson.cn>,
Chong Qiao <qiaochong@loongson.cn>, Lee Jones <lee@kernel.org>,
Huacai Chen <chenhuacai@kernel.org>,
Corey Minyard <corey@minyard.net>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>
Cc: Xi Ruoyao <xry111@xry111.site>, WANG Xuerui <kernel@xen0n.name>,
Yinbo Zhu <zhuyinbo@loongson.cn>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
mfd@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org,
openipmi-developer@lists.sourceforge.net,
Miao Wang <shankerwangmiao@gmail.com>
Subject: [PATCH RFC v5 0/7] mfd: ls2kbmc: multiple fixes for this driver
Date: Tue, 04 Aug 2026 00:55:48 +0800 [thread overview]
Message-ID: <20260804-ls2kbmc-mod-v5-0-e6bc5cdd9a93@gmail.com> (raw)
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. However, legacy GPIO
APIs have to be used in this fixed to correctly request a GPIO
descriptor from the GPIO subsystem, which might be further discussed
to find a better solution.
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@gmail.com>
---
Changes in v5:
- Address issues found by the Sashiko AI review bot
- Maintain the compatibility with possible unexpected mode string when
parsing, although such mode string is actually not expected, to
satisfy the AI bot's concern.
- Add a comment to point out that the adjustment of the Kconfig entry
for ls2kbmc is in the following patch, to satisfy the AI bot's
concern.
- Link to v4: https://lore.kernel.org/r/20260731-ls2kbmc-mod-v4-0-d201502ba239@gmail.com
Changes in v4:
- Use a better way to get the GPIO device fwnode.
- Add a comment to describe a problem found by AI bot which is actually
intended.
- Link to v3: https://lore.kernel.org/r/20260710-ls2kbmc-mod-v3-0-ef718636e78e@gmail.com
Changes in v3:
- Check the return value of devm_add_action_or_reset when registering
the cleanup hook of the work queue
- Use swnode to create the link between the device to the GPIO chip,
and prevent borrowing the legacy GPIO APIs
- Link to v2: https://lore.kernel.org/r/20260708-ls2kbmc-mod-v2-0-2afdd1741766@gmail.com
Changes in v2:
- Several fixes suggested by the Sashiko AI review bot
- Add a cleanup function for the wq on removal of the device
- Relax the reverse dependency from CONFIG_IPMI_LS2K to
CONFIG_MFD_LS2K_BMC_CORE to allow the driver to be built as a module
- Link to v1: https://lore.kernel.org/r/20260708-ls2kbmc-mod-v1-0-c344bf5defa3@gmail.com
---
Miao Wang (7):
mfd: ls2kbmc: Make a copy when parsing mode string
mfd: ls2kbmc: Sanity check for the connected pci port
mfd: ls2kbmc: Redraw using exported functions
mfd: ls2kbmc: Cancel the work queue on removal
ipmi: ls2k: Relax the dependency to its mfd driver
mfd: ls2kbmc: Able to be compiled as a module
mfd: ls2kbmc: Capture the reset event of BMC through GPIO
drivers/char/ipmi/Kconfig | 2 +-
drivers/mfd/Kconfig | 2 +-
drivers/mfd/ls2k-bmc-core.c | 246 ++++++++++++++++++++++++++++++++++----------
3 files changed, 192 insertions(+), 58 deletions(-)
---
base-commit: 11028ab62899e4191e074ee364c712b77823a9c4
change-id: 20260626-ls2kbmc-mod-5209193009b2
Best regards,
--
Miao Wang <shankerwangmiao@gmail.com>
next reply other threads:[~2026-08-03 16:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 16:55 Miao Wang via B4 Relay [this message]
2026-08-03 16:55 ` [PATCH RFC v5 1/7] mfd: ls2kbmc: Make a copy when parsing mode string Miao Wang via B4 Relay
2026-08-03 16:55 ` [PATCH RFC v5 2/7] mfd: ls2kbmc: Sanity check for the connected pci port Miao Wang via B4 Relay
2026-08-03 16:55 ` [PATCH RFC v5 3/7] mfd: ls2kbmc: Redraw using exported functions Miao Wang via B4 Relay
2026-08-03 16:55 ` [PATCH RFC v5 4/7] mfd: ls2kbmc: Cancel the work queue on removal Miao Wang via B4 Relay
2026-08-03 16:55 ` [PATCH RFC v5 5/7] ipmi: ls2k: Relax the dependency to its mfd driver Miao Wang via B4 Relay
2026-08-03 20:46 ` Corey Minyard
2026-08-04 9:40 ` Miao Wang
2026-08-04 11:39 ` Corey Minyard
2026-08-04 12:27 ` Miao Wang
2026-08-04 13:56 ` Corey Minyard
2026-08-03 16:55 ` [PATCH RFC v5 6/7] mfd: ls2kbmc: Able to be compiled as a module Miao Wang via B4 Relay
2026-08-03 16:55 ` [PATCH RFC v5 7/7] mfd: ls2kbmc: Capture the reset event of BMC through GPIO Miao Wang via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804-ls2kbmc-mod-v5-0-e6bc5cdd9a93@gmail.com \
--to=devnull+shankerwangmiao.gmail.com@kernel.org \
--cc=brgl@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=corey@minyard.net \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=lee@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=qiaochong@loongson.cn \
--cc=shankerwangmiao@gmail.com \
--cc=xry111@xry111.site \
--cc=zhoubinbin@loongson.cn \
--cc=zhuyinbo@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox