* [PATCH 00/12] PHY: MediaTek DP PHY refactor and MT8196 eDP
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 UTC (permalink / raw)
To: chunfeng.yun
Cc: vkoul, neil.armstrong, robh, krzk+dt, conor+dt, matthias.bgg,
angelogioacchino.delregno, chunkuang.hu, p.zabel, justin.yeh,
linux-arm-kernel, linux-mediatek, linux-phy, devicetree,
linux-kernel, dri-devel, kernel
This series performs major refactoring on the MediaTek DisplayPort PHY
driver, makes it probe with devicetree instead of getting registered
by the mtk_dp DRM driver, adds power_on/off() callbacks, and honors
the phy configure opts' set_lanes and set_voltages for, respectively,
varying the number of lanes and setting the voltage pre-emphasis and
swing on the PHY, for each lane.
This driver now also properly gets the PHY (EYE) Calibration Data from
NVMEM (eFuse array) if provided, instead of getting it (improperly)
injected by the mtk_dp driver.
Additionally, all of the driving parameters calculations and most of
the other register definitions were refactored to greatly enhance the
human readability of this code.
As a last step, this also transfers the register offsets for both the
digital and analog phy registers in arrays assigned to soc specific
data, in an effort to both introduce support for new minor revisions
of the MediaTek DisplayPort PHY and to have a clearer view of the
register related differences between those (for example, it is easily
understandable that the analog part remained exactly the same between
MT8195 and MT8196, but the digital part gets a slight update).
Speaking of which, as a last step, this also adds support for the
MT8196 SoC (and its derivatives), which uses this PHY only for its
Embedded DisplayPort (eDP) IP (spoiler: the DP one seems to be way
too different and requiring an entirely new PHY driver).
In this state, this driver can also easily support the MT8189 SoC
with a few lines of code: even though I do have clean code to add
support for this one, I was not (*yet*) able to test it on upstream
based kernels, and for this reason I decided to leave that one out
for now (but it's coming later for sure).
NOTE!
Despite all the apparently breaking changes in the refactoring, full
compatibility with older MTK_DP driver and with old devicetrees was
retained and carefully tested on multiple platforms!
P.S.: I am aware of the BUILD_DRIVING_PARAM_0( 0, 2, 4, 7) checkpatch
warning and I didn't fix it in bigger favor of human readability.
AngeloGioacchino Del Regno (12):
dt-bindings: phy: Document MT8195 and MT8196 DisplayPort PHYs
phy: phy-mtk-dp: Rename regs to regmap in struct mtk_dp_phy
phy: phy-mtk-dp: Allow probing with devicetree match
phy: phy-mtk-dp: Migrate register offsets to SoC specific pdata
phy: phy-mtk-dp: Implement power_on and power_off PHY callbacks
phy: phy-mtk-dp: Support set_lanes in configure and properly cleanup
phy: phy-mtk-dp: Support setting volt swing and preemphasis values
phy: phy-mtk-dp: Add support for digital and analog calibration
phy: phy-mtk-dp: Rewrite and document default driving param macros
phy: phy-mtk-dp: Add bitrate register val definitions to SoC data
phy: phy-mtk-dp: Add PHYD Lane EN register mask to SoC data
phy: phy-mtk-dp: Add support for MT8196 eDP PHY
.../bindings/phy/mediatek,mt8195-dp-phy.yaml | 77 ++
drivers/phy/mediatek/phy-mtk-dp.c | 828 ++++++++++++++++--
2 files changed, 808 insertions(+), 97 deletions(-)
create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt8195-dp-phy.yaml
--
2.54.0
^ permalink raw reply
* [PATCH 03/11] drm/mediatek: mtk_dp: Fix hdmi codec and phy driver unregistration
From: AngeloGioacchino Del Regno @ 2026-07-01 12:20 UTC (permalink / raw)
To: chunkuang.hu
Cc: p.zabel, airlied, simona, maarten.lankhorst, mripard, tzimmermann,
robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
jitao.shi, granquet, rex-bc.chen, dmitry.osipenko, ck.hu,
amergnat, justin.yeh, jason-jh.lin, dri-devel, linux-mediatek,
devicetree, linux-kernel, linux-arm-kernel, kernel
In-Reply-To: <20260701122024.19557-1-angelogioacchino.delregno@collabora.com>
During probe, this driver is registering two platform devices: one
for the HDMI Codec driver and one for the DisplayPort PHY driver.
In the probe function, none of the error cases are unregistering
any of the two platform devices and this may cause registration
of multiple instances of those in case this driver returns one or
more probe deferral(s) in the "wrong" spots.
In order to fix this, add devm actions to unregister those and
remove the manual calls to platform_device_unregister in the
mtk_dp_remove() function, as those would otherwise be redundant.
Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195")
Fixes: caf2ae486742 ("drm/mediatek: dp: Add support for embedded DisplayPort aux-bus")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/gpu/drm/mediatek/mtk_dp.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index eefbc7e0f9c8..2c738c16dafa 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2670,6 +2670,13 @@ static const struct hdmi_codec_ops mtk_dp_audio_codec_ops = {
.hook_plugged_cb = mtk_dp_audio_hook_plugged_cb,
};
+static void mtk_dp_unregister_pdevs(void *data)
+{
+ struct platform_device *ext_pdev = data;
+
+ platform_device_unregister(ext_pdev);
+}
+
static int mtk_dp_register_audio_driver(struct device *dev)
{
struct mtk_dp *mtk_dp = dev_get_drvdata(dev);
@@ -2680,18 +2687,29 @@ static int mtk_dp_register_audio_driver(struct device *dev)
.data = mtk_dp,
.no_capture_mute = 1,
};
+ int ret;
mtk_dp->audio_pdev = platform_device_register_data(dev,
HDMI_CODEC_DRV_NAME,
PLATFORM_DEVID_AUTO,
&codec_data,
sizeof(codec_data));
- return PTR_ERR_OR_ZERO(mtk_dp->audio_pdev);
+ if (IS_ERR(mtk_dp->audio_pdev))
+ return PTR_ERR(mtk_dp->audio_pdev);
+
+ ret = devm_add_action_or_reset(dev, mtk_dp_unregister_pdevs, mtk_dp->phy_dev);
+ if (ret) {
+ platform_device_unregister(mtk_dp->audio_pdev);
+ return dev_err_probe(dev, ret,
+ "Failed to add codec unregister devm action");
+ }
+ return 0;
}
static int mtk_dp_register_phy(struct mtk_dp *mtk_dp)
{
struct device *dev = mtk_dp->dev;
+ int ret;
mtk_dp->phy_dev = platform_device_register_data(dev, "mediatek-dp-phy",
PLATFORM_DEVID_AUTO,
@@ -2701,6 +2719,13 @@ static int mtk_dp_register_phy(struct mtk_dp *mtk_dp)
return dev_err_probe(dev, PTR_ERR(mtk_dp->phy_dev),
"Failed to create device mediatek-dp-phy\n");
+ ret = devm_add_action_or_reset(dev, mtk_dp_unregister_pdevs, mtk_dp->phy_dev);
+ if (ret) {
+ platform_device_unregister(mtk_dp->phy_dev);
+ return dev_err_probe(dev, ret,
+ "Failed to add phy unregister devm action");
+ }
+
mtk_dp_get_calibration_data(mtk_dp);
mtk_dp->phy = devm_phy_get(&mtk_dp->phy_dev->dev, "dp");
@@ -2870,9 +2895,6 @@ static void mtk_dp_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
if (mtk_dp->data->bridge_type != DRM_MODE_CONNECTOR_eDP)
timer_delete_sync(&mtk_dp->debounce_timer);
- platform_device_unregister(mtk_dp->phy_dev);
- if (mtk_dp->audio_pdev)
- platform_device_unregister(mtk_dp->audio_pdev);
}
#ifdef CONFIG_PM_SLEEP
--
2.54.0
^ permalink raw reply related
* Re: [PATCH RFC v5 00/12] ZTE zx297520v3 clock bindings and driver
From: Stefan Dösinger @ 2026-07-01 17:22 UTC (permalink / raw)
To: Conor Dooley
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Philipp Zabel, Brian Masney, linux-clk, devicetree,
linux-kernel, linux-arm-kernel
In-Reply-To: <20260629-unwelcome-raking-3df3d8ff0422@spud>
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
Am Montag, 29. Juni 2026, 18:49:08 Ostafrikanische Zeit schrieb Conor Dooley:
> Bindings seem fine to me, I'll be happy to give you some r-b tags when
> you go non-RFC. To be frank, I think you should drop them as you've got
> no significant questions here I think and you'll be taken a bt more
> seriously.
Thanks for all the advice so far!
Here's one more binding related question: Philipp's request to give the PHY
reset its own reset ID means I need a node and driver to consume that reset.
My question is if it should be another MFD subdevice of topcrm or not. I am
leaning towards not:
usb_phy: phy@2 {
compatible = "zte,zx29-usb2-phy";
interrupts = <GIC_SPI 42 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 43
IRQ_TYPE_EDGE_RISING>;
interrupt-names = "powerup", "powerdown";
syscon = <&topcrm 0x84 0x2>;
resets = <&topcrm ZX297520V3_USB_PHY_RESET>;
reset-names = "phy";
#phy-cells = <0>;
};
usb0: usb@1500000 {
compatible = "snps,dwc2";
reg = <0x01500000 0x1000>;
...
phys = <&usb_phy>;
phy-names = "usb2-phy";
};
I am not aware of any IO region to configure the PHY, although one may exist.
topcrm + 0x84 has two status bits reporting if USB and HSIC are powered and
out of reset. Nevertheless, the PHY feels distinct enough from topcrm that it
should have its own binding. The phy driver would merely deassert the reset
and wait for the ready bit and maybe in the future do something useful with
the connect/disconnect IRQs.
Interestingly the USB IO region is actually downstream of the AHB bus and
matrix controller, but it has its clocks and resets in topcrm. I suspect the
purpose of this setup is to allow wake-by-USB IRQs while shutting down the
main data path.
Cheers,
Stefan
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
^ permalink raw reply
* Re: [PATCH] drm/mxsfb/lcdif: don't hide lcdif_attach_bridge() deferral messages
From: Luca Ceresoli @ 2026-07-01 17:19 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Luca Ceresoli
Cc: Hui Pu, Ian Ray, Thomas Petazzoni, dri-devel, imx,
linux-arm-kernel, linux-kernel
In-Reply-To: <20260619-drm-lcdif-deferral-msg-v1-1-ce2392dca985@bootlin.com>
On Fri, 19 Jun 2026 09:02:13 +0200, Luca Ceresoli wrote:
> lcdif_attach_bridge() uses dev_err_probe() on all its error returns to
> store a specific deferral message.
>
> However its caller lcdif_load() calls dev_err_probe() again on error,
> overwriting the specific deferral messages with a unique, unavoidably
> generic, message.
>
> [...]
Applied, thanks!
[1/1] drm/mxsfb/lcdif: don't hide lcdif_attach_bridge() deferral messages
commit: cff96362794a5c1f3adb013b4a46c7233149a629
Best regards,
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* [PATCH 06/42] drm/mediatek: Use hashtable for components discovery and registration
From: AngeloGioacchino Del Regno @ 2026-07-01 12:20 UTC (permalink / raw)
To: chunkuang.hu
Cc: p.zabel, airlied, simona, maarten.lankhorst, mripard, tzimmermann,
robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, justin.yeh, jason-jh.lin, kernel
In-Reply-To: <20260701122057.19648-1-angelogioacchino.delregno@collabora.com>
As a preparation for refactoring the concept of hardware component
identification, search, and final usage, remove the ddp_comp array
of components and replace it with a hashtable, indexed by ID.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/gpu/drm/mediatek/mtk_crtc.c | 44 ++++++++++++++++-------
drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 48 ++++++++++++++++++-------
drivers/gpu/drm/mediatek/mtk_ddp_comp.h | 23 +++++++++++-
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++--
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 2 +-
5 files changed, 94 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
index f39f197057a7..3f4d6ab1bfc2 100644
--- a/drivers/gpu/drm/mediatek/mtk_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
@@ -725,8 +725,12 @@ static void mtk_crtc_update_output(struct drm_crtc *crtc,
crtc_state->connectors_changed, encoder_mask, crtc_index);
for (i = 0; i < mtk_crtc->num_conn_routes; i++) {
- unsigned int comp_id = mtk_crtc->conn_routes[i].route_ddp;
- struct mtk_ddp_comp *comp = &priv->ddp_comp[comp_id];
+ const struct mtk_drm_route *conn_route = &mtk_crtc->conn_routes[i];
+ struct mtk_ddp_comp *comp;
+
+ comp = mtk_ddp_comp_find_by_id(&priv->hlist, conn_route->route_ddp);
+ if (!comp)
+ continue;
if (comp->encoder_index >= 0 &&
(encoder_mask & BIT(comp->encoder_index))) {
@@ -1028,10 +1032,11 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
{
struct mtk_drm_private *priv = drm_dev->dev_private;
struct device *dev = drm_dev->dev;
+ struct mtk_ddp_comp *dma_comp;
struct mtk_crtc *mtk_crtc;
unsigned int num_comp_planes = 0;
int ret;
- int i;
+ int i, j;
bool has_ctm = false;
uint gamma_lut_size = 0;
struct drm_crtc *tmp;
@@ -1051,7 +1056,7 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
struct mtk_ddp_comp *comp;
node = priv->comp_node[comp_id];
- comp = &priv->ddp_comp[comp_id];
+ comp = mtk_ddp_comp_find_by_id(&priv->hlist, comp_id);
/* Not all drm components have a DTS device node, such as ovl_adaptor,
* which is the drm bring up sub driver
@@ -1063,7 +1068,7 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
return 0;
}
- if (!comp->dev) {
+ if (!comp || !comp->dev) {
dev_err(dev, "Component %pOF not initialized\n", node);
return -ENODEV;
}
@@ -1089,12 +1094,17 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
return ret;
}
- for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
+ for (i = 0, j = 0; i < mtk_crtc->ddp_comp_nr; i++, j++) {
unsigned int comp_id = path[i];
struct mtk_ddp_comp *comp;
- comp = &priv->ddp_comp[comp_id];
- mtk_crtc->ddp_comp[i] = comp;
+ comp = mtk_ddp_comp_find_by_id(&priv->hlist, comp_id);
+ if (!comp) {
+ j--;
+ dev_dbg(dev, "Cannot find component %d.\n", comp_id);
+ continue;
+ }
+ mtk_crtc->ddp_comp[j] = comp;
if (comp->funcs) {
if (comp->funcs->gamma_set && comp->funcs->gamma_get_lut_size) {
@@ -1131,7 +1141,14 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
* In the case of ovl_adaptor sub driver, it needs to use the
* dma_dev_get function to get representative dma dev.
*/
- mtk_crtc->dma_dev = mtk_ddp_comp_dma_dev_get(&priv->ddp_comp[path[0]]);
+ dma_comp = mtk_ddp_comp_find_by_id(&priv->hlist, path[0]);
+ if (dma_comp == NULL) {
+ dev_err(dev, "Could not find appropriate DMA device!\n");
+ return -EINVAL;
+ }
+
+ mtk_crtc->dma_dev = mtk_ddp_comp_dma_dev_get(dma_comp);
+ dev_dbg(dev, "Using DMA device %pOF\n", mtk_crtc->dma_dev->of_node);
ret = mtk_crtc_init(drm_dev, mtk_crtc, crtc_i);
if (ret < 0)
@@ -1188,17 +1205,18 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
for (i = 0; i < num_conn_routes; i++) {
unsigned int comp_id = conn_routes[i].route_ddp;
struct device_node *node = priv->comp_node[comp_id];
- struct mtk_ddp_comp *comp = &priv->ddp_comp[comp_id];
+ struct mtk_ddp_comp *comp = mtk_ddp_comp_find_by_id(&priv->hlist, comp_id);
- if (!comp->dev) {
+ if (!comp || !comp->dev) {
dev_dbg(dev, "comp_id:%d, Component %pOF not initialized\n",
comp_id, node);
/* mark encoder_index to -1, if route comp device is not enabled */
- comp->encoder_index = -1;
+ if (comp)
+ comp->encoder_index = -1;
continue;
}
- mtk_ddp_comp_encoder_index_set(&priv->ddp_comp[comp_id]);
+ mtk_ddp_comp_encoder_index_set(comp);
}
mtk_crtc->num_conn_routes = num_conn_routes;
diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
index a6c1815ffa39..d716fd9f8a70 100644
--- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
+++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
@@ -480,10 +480,24 @@ static const struct mtk_ddp_comp_match mtk_ddp_matches[DDP_COMPONENT_DRM_ID_MAX]
[DDP_COMPONENT_WDMA1] = { MTK_DISP_WDMA, 1, &ddp_wdma },
};
+static bool mtk_ddp_find_comp_dev_in_table(const struct mtk_drm_comp_list *hlist,
+ const unsigned int comp_id,
+ struct device *dev)
+{
+ struct mtk_ddp_comp *ddp_comp;
+
+ hash_for_each_possible(hlist->ddp_list, ddp_comp, lnode, comp_id) {
+ if (ddp_comp->dev == dev)
+ return true;
+ }
+
+ return false;
+}
+
static bool mtk_ddp_comp_find(struct device *dev,
const unsigned int *path,
unsigned int path_len,
- struct mtk_ddp_comp *ddp_comp)
+ const struct mtk_drm_comp_list *hlist)
{
unsigned int i;
@@ -491,7 +505,7 @@ static bool mtk_ddp_comp_find(struct device *dev,
return false;
for (i = 0U; i < path_len; i++)
- if (dev == ddp_comp[path[i]].dev)
+ if (mtk_ddp_find_comp_dev_in_table(hlist, path[i], dev))
return true;
return false;
@@ -500,7 +514,7 @@ static bool mtk_ddp_comp_find(struct device *dev,
static int mtk_ddp_comp_find_in_route(struct device *dev,
const struct mtk_drm_route *routes,
unsigned int num_routes,
- struct mtk_ddp_comp *ddp_comp)
+ const struct mtk_drm_comp_list *hlist)
{
unsigned int i;
@@ -508,7 +522,7 @@ static int mtk_ddp_comp_find_in_route(struct device *dev,
return -EINVAL;
for (i = 0; i < num_routes; i++)
- if (dev == ddp_comp[routes[i].route_ddp].dev)
+ if (mtk_ddp_find_comp_dev_in_table(hlist, routes[i].route_ddp, dev))
return BIT(routes[i].crtc_id);
return -ENODEV;
@@ -566,7 +580,7 @@ int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev)
priv_n->comp_node)) {
if (mtk_ddp_comp_find(dev, data->main_path,
data->main_len,
- priv_n->ddp_comp))
+ &priv_n->hlist))
return BIT(i);
i++;
}
@@ -575,7 +589,7 @@ int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev)
priv_n->comp_node)) {
if (mtk_ddp_comp_find(dev, data->ext_path,
data->ext_len,
- priv_n->ddp_comp))
+ &priv_n->hlist))
return BIT(i);
i++;
}
@@ -584,7 +598,7 @@ int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev)
priv_n->comp_node)) {
if (mtk_ddp_comp_find(dev, data->third_path,
data->third_len,
- priv_n->ddp_comp))
+ &priv_n->hlist))
return BIT(i);
i++;
}
@@ -593,7 +607,7 @@ int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev)
ret = mtk_ddp_comp_find_in_route(dev,
private->data->conn_routes,
private->data->num_conn_routes,
- private->ddp_comp);
+ &private->hlist);
if (ret < 0)
DRM_INFO("Failed to find comp in ddp table, ret = %d\n", ret);
@@ -615,10 +629,12 @@ static void mtk_ddp_comp_clk_put(void *_clk)
clk_put(clk);
}
-int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_ddp_comp *comp,
+int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
+ struct mtk_drm_comp_list *hlist,
unsigned int comp_id)
{
struct platform_device *comp_pdev;
+ struct mtk_ddp_comp *comp;
enum mtk_ddp_comp_type type;
struct mtk_ddp_comp_dev *priv;
int ret;
@@ -626,6 +642,10 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_d
if (comp_id >= DDP_COMPONENT_DRM_ID_MAX)
return -EINVAL;
+ comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
+ if (!comp)
+ return -ENOMEM;
+
type = mtk_ddp_matches[comp_id].type;
comp->id = comp_id;
@@ -633,8 +653,10 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_d
/* Not all drm components have a DTS device node, such as ovl_adaptor,
* which is the drm bring up sub driver
*/
- if (!node)
- return 0;
+ if (!node) {
+ comp->dev = dev;
+ goto end;
+ }
comp_pdev = of_find_device_by_node(node);
if (!comp_pdev) {
@@ -662,7 +684,7 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_d
type == MTK_DISP_DPI ||
type == MTK_DISP_DP_INTF ||
type == MTK_DISP_DSI)
- return 0;
+ goto end;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -687,6 +709,8 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, struct mtk_d
#endif
platform_set_drvdata(comp_pdev, priv);
+end:
+ hash_add(hlist->ddp_list, &comp->lnode, comp->id);
return 0;
}
diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
index bbc66072fe6b..4203eecb2a7b 100644
--- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
@@ -6,6 +6,7 @@
#ifndef MTK_DDP_COMP_H
#define MTK_DDP_COMP_H
+#include <linux/hashtable.h>
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <linux/soc/mediatek/mtk-cmdq.h>
@@ -24,6 +25,11 @@ struct drm_dsc_config;
struct mtk_ddp_comp;
struct cmdq_pkt;
+
+struct mtk_drm_comp_list {
+ DECLARE_HASHTABLE(ddp_list, 8);
+};
+
struct mtk_ddp_comp_funcs {
int (*power_on)(struct device *dev);
void (*power_off)(struct device *dev);
@@ -75,6 +81,8 @@ struct mtk_ddp_comp {
unsigned int id;
int encoder_index;
const struct mtk_ddp_comp_funcs *funcs;
+
+ struct hlist_node lnode;
};
static inline int mtk_ddp_comp_power_on(struct mtk_ddp_comp *comp)
@@ -331,10 +339,23 @@ static inline void mtk_ddp_comp_encoder_index_set(struct mtk_ddp_comp *comp)
comp->encoder_index = (int)comp->funcs->encoder_index(comp->dev);
}
+static inline struct mtk_ddp_comp
+*mtk_ddp_comp_find_by_id(struct mtk_drm_comp_list *hlist,
+ const unsigned int id)
+{
+ struct mtk_ddp_comp *ddp_comp;
+
+ hash_for_each_possible(hlist->ddp_list, ddp_comp, lnode, id)
+ return ddp_comp;
+
+ return NULL;
+}
+
int mtk_ddp_comp_get_id(struct device_node *node,
enum mtk_ddp_comp_type comp_type);
int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev);
-int mtk_ddp_comp_init(struct device *dev, struct device_node *comp_node, struct mtk_ddp_comp *comp,
+int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
+ struct mtk_drm_comp_list *hlist,
unsigned int comp_id);
enum mtk_ddp_comp_type mtk_ddp_comp_get_type(unsigned int comp_id);
void mtk_ddp_write(struct cmdq_pkt *cmdq_pkt, unsigned int value,
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 9c6dfc1e384b..e956e1966b86 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -1086,6 +1086,8 @@ static int mtk_drm_probe(struct platform_device *pdev)
if (!mtk_drm_data)
return -EINVAL;
+ hash_init(private->hlist.ddp_list);
+
/* Try to build the display pipeline from devicetree graphs */
if (of_graph_is_present(phandle)) {
dev_dbg(dev, "Building display pipeline for MMSYS %u\n",
@@ -1116,8 +1118,7 @@ static int mtk_drm_probe(struct platform_device *pdev)
PLATFORM_DEVID_AUTO,
(void *)private->mmsys_dev,
sizeof(*private->mmsys_dev));
- private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR].dev = &ovl_adaptor->dev;
- mtk_ddp_comp_init(dev, NULL, &private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR],
+ mtk_ddp_comp_init(&ovl_adaptor->dev, NULL, &private->hlist,
DDP_COMPONENT_DRM_OVL_ADAPTOR);
component_match_add(dev, &match, compare_dev, &ovl_adaptor->dev);
}
@@ -1185,7 +1186,7 @@ static int mtk_drm_probe(struct platform_device *pdev)
node);
}
- ret = mtk_ddp_comp_init(dev, node, &private->ddp_comp[comp_id], comp_id);
+ ret = mtk_ddp_comp_init(dev, node, &private->hlist, comp_id);
if (ret) {
of_node_put(node);
goto err_node;
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.h b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
index 8b5c51d93f72..a171126d580e 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
@@ -60,8 +60,8 @@ struct mtk_drm_private {
struct device_node *mutex_node;
struct device *mutex_dev;
struct device *mmsys_dev;
+ struct mtk_drm_comp_list hlist;
struct device_node *comp_node[DDP_COMPONENT_DRM_ID_MAX];
- struct mtk_ddp_comp ddp_comp[DDP_COMPONENT_DRM_ID_MAX];
struct mtk_mmsys_driver_data *data;
struct drm_atomic_commit *suspend_state;
unsigned int mbox_index;
--
2.54.0
^ permalink raw reply related
* Re: [for-next][PATCH 04/15] tracepoint: Add lockdep rcu_is_watching() check to trace_##name##_enabled()
From: Steven Rostedt @ 2026-07-01 17:11 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: David Carlier, linux-kernel, Masami Hiramatsu, Mark Rutland,
Mathieu Desnoyers, Andrew Morton, Vineeth Pillai (Google),
Peter Zijlstra, Linux ARM, Linux-Renesas
In-Reply-To: <CAMuHMdUdsTHCMnitVEHdZvRFe9xgmLLTjSr=QqvOi0dxFjkTEA@mail.gmail.com>
On Wed, 1 Jul 2026 11:24:31 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Thanks, it does not trigger with the commit reverted and the "echo 1 > ...".
Ah found the issue;
#define trace(point, args) \
do { \
if (trace_##point##_enabled()) { \
bool exit_rcu = false; \
if (in_nmi()) \
break; \
if (!IS_ENABLED(CONFIG_TINY_RCU) && \
is_idle_task(current)) { \
ct_irq_enter(); \
exit_rcu = true; \
} \
trace_##point(args); \
if (exit_rcu) \
ct_irq_exit(); \
} \
} while (0)
#endif
The code within the enabled() call checks if RCU is watching, and if
not, it makes it watch. So yeah, this is a special case.
The following patch should fix the issue:
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 4a0c36f40fe2..e0d838c9ce93 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -292,13 +292,18 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
{ \
} \
static inline bool \
+ __trace_##name##_enabled(void) \
+ { \
+ return static_branch_unlikely(&__tracepoint_##name.key);\
+ } \
+ static inline bool \
trace_##name##_enabled(void) \
{ \
if (IS_ENABLED(CONFIG_LOCKDEP)) { \
WARN_ONCE(!rcu_is_watching(), \
"RCU not watching for tracepoint"); \
} \
- return static_branch_unlikely(&__tracepoint_##name.key);\
+ return __trace_##name##_enabled(); \
}
#define __DECLARE_TRACE(name, proto, args, cond, data_proto) \
@@ -457,6 +462,11 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
{ \
} \
static inline bool \
+ __trace_##name##_enabled(void) \
+ { \
+ return false; \
+ } \
+ static inline bool \
trace_##name##_enabled(void) \
{ \
return false; \
diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c
index 0c42b15c3800..b63e3558948f 100644
--- a/kernel/trace/trace_preemptirq.c
+++ b/kernel/trace/trace_preemptirq.c
@@ -30,7 +30,7 @@
#else
#define trace(point, args) \
do { \
- if (trace_##point##_enabled()) { \
+ if (__trace_##point##_enabled()) { \
bool exit_rcu = false; \
if (in_nmi()) \
break; \
^ permalink raw reply related
* [PATCH 2/7] arm64: dts: mediatek: mt8173: Add and use UART AP_DMA controller
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 UTC (permalink / raw)
To: linux-mediatek
Cc: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, kernel, justin.yeh
In-Reply-To: <20260701121929.19374-1-angelogioacchino.delregno@collabora.com>
This SoC has a DMA controller (AP_DMA) that provides one channel
for each data direction (transmit and receive) for all of the
UART controllers in the SoC.
In order to increase the efficiency of data TX/RX over the UART
controllers, add the UART DMA controller and assign the right
channels to each of the four UART controllers.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 27 ++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 81ddb4eec48e..43159ae6da8f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -673,6 +673,25 @@ gic: interrupt-controller@10221000 {
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ apdma: dma-controller@11000300 {
+ compatible = "mediatek,mt8173-uart-dma", "mediatek,mt6577-uart-dma";
+ reg = <0 0x11000300 0 0x80>, <0 0x11000380 0 0x80>,
+ <0 0x11000400 0 0x80>, <0 0x11000480 0 0x80>,
+ <0 0x11000500 0 0x80>, <0 0x11000580 0 0x80>,
+ <0 0x11000600 0 0x80>, <0 0x11000680 0 0x80>;
+ interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 97 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 99 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 100 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 101 IRQ_TYPE_LEVEL_LOW>,
+ <GIC_SPI 100 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&pericfg CLK_PERI_AP_DMA>;
+ #dma-cells = <1>;
+ dma-requests = <8>;
+ };
+
auxadc: auxadc@11001000 {
compatible = "mediatek,mt8173-auxadc";
reg = <0 0x11001000 0 0x1000>;
@@ -688,6 +707,8 @@ uart0: serial@11002000 {
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART0_SEL>, <&pericfg CLK_PERI_UART0>;
clock-names = "baud", "bus";
+ dmas = <&apdma 0>, <&apdma 1>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -698,6 +719,8 @@ uart1: serial@11003000 {
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART1_SEL>, <&pericfg CLK_PERI_UART1>;
clock-names = "baud", "bus";
+ dmas = <&apdma 2>, <&apdma 3>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -708,6 +731,8 @@ uart2: serial@11004000 {
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART2_SEL>, <&pericfg CLK_PERI_UART2>;
clock-names = "baud", "bus";
+ dmas = <&apdma 4>, <&apdma 5>;
+ dma-names = "tx", "rx";
status = "disabled";
};
@@ -718,6 +743,8 @@ uart3: serial@11005000 {
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART3_SEL>, <&pericfg CLK_PERI_UART3>;
clock-names = "baud", "bus";
+ dmas = <&apdma 6>, <&apdma 7>;
+ dma-names = "tx", "rx";
status = "disabled";
};
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] arm64/sysreg: Fix BWE field encoding in ID_AA64DFR2_EL1
From: Oliver Upton @ 2026-07-01 17:09 UTC (permalink / raw)
To: Jia He
Cc: Catalin Marinas, Will Deacon, Marc Zyngier, linux-arm-kernel,
Lorenzo Pieralisi, Mark Brown, Sascha Bischoff, Fuad Tabba,
Anshuman Khandual, linux-kernel, Bin Guo
In-Reply-To: <20260630222347.1449737-1-justin.he@arm.com>
On Tue, Jun 30, 2026 at 10:23:47PM +0000, Jia He wrote:
> Commit 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> encodes the FEAT_BWE2 value of the BWE field as '0b0002'. Binary
> literals only accept the digits 0 and 1, so the intended value is 2,
> i.e. 0b0010.
>
> The macro generated by gen-sysreg.awk currently expands to
> #define ID_AA64DFR2_EL1_BWE_FEAT_BWE2 UL(0b0002)
> is not legal C and would fail to compile if any in-tree code referenced
> it. At present no caller uses this enum value, so the kernel still
> builds cleanly, but the bug is latent.
>
> Fix the typo by using the correct binary literal 0b0010.
>
> Cc: Bin Guo <guobin@linux.alibaba.com>
> Fixes: 93d7356e4b30 ("arm64: sysreg: Describe ID_AA64DFR2_EL1 fields")
> Signed-off-by: Jia He <justin.he@arm.com>
> Reviewed-by: Mark Brown <broonie@kernel.org>
Hah, I screwed that up pretty good!
Reviewed-by: Oliver Upton <oupton@kernel.org>
> ---
> arch/arm64/tools/sysreg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
> index bc1788b1662b..7cb61aca3797 100644
> --- a/arch/arm64/tools/sysreg
> +++ b/arch/arm64/tools/sysreg
> @@ -1806,7 +1806,7 @@ Res0 15:8
> UnsignedEnum 7:4 BWE
> 0b0000 NI
> 0b0001 FEAT_BWE
> - 0b0002 FEAT_BWE2
> + 0b0010 FEAT_BWE2
> EndEnum
> UnsignedEnum 3:0 STEP
> 0b0000 NI
> --
> 2.34.1
>
^ permalink raw reply
* Re: [PATCH 1/3] dt-bindings: rtc: Add sii,wakealarm-output-pin property for S35390A
From: Markus Probst @ 2026-07-01 17:08 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Uwe Kleine-König, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, linux-arm-kernel, linux-rtc, devicetree,
linux-kernel
In-Reply-To: <20260701164821b7492eac@mail.local>
[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]
On Wed, 2026-07-01 at 18:48 +0200, Alexandre Belloni wrote:
> On 01/07/2026 16:43:07+0000, Markus Probst wrote:
> > On Wed, 2026-07-01 at 17:14 +0200, Krzysztof Kozlowski wrote:
> > > On 01/07/2026 15:25, Markus Probst wrote:
> > > > > > +
> > > > > > +maintainers:
> > > > > > + - Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > > >
> > > > > This should be someone caring about this hardware.
> > > > He does have the majority of commits on this driver (excluding merge
> > > > commits and commits not exclusive to this driver), although most of
> > > > them are pretty tiny.
> > > >
> > > > Who would you suggest instead?
> > >
> > > Someone adding features for this driver, maybe driver maintainers. But
> > > if Alexandre is fine, you can leave him.
> > >
> > > > >
> > > > > > +
> > > > > > +description:
> > > > > > + The S-35390A is a CMOS 2-wire real-time clock IC which operates with the
> > > > > > + very low current consumption in the wide range of operation voltage.
> > > > > > +
> > > > > > +allOf:
> > > > > > + - $ref: rtc.yaml#
> > > > > > +
> > > > > > +properties:
> > > > > > + compatible:
> > > > > > + const: sii,s35390a
> > > > > > +
> > > > > > + reg:
> > > > > > + maxItems: 1
> > > > > > +
> > > > > > + sii,wakealarm-output-pin:
> > > > > > + $ref: /schemas/types.yaml#/definitions/uint32
> > > > > > + enum: [1, 2]
> > > > > > + description: |
> > > > > > + The output pin to wake up the system.
> > > > > > + Default will use the output pin for interrupt signal 2.
> > > > > > + <S35390A_OUTPUT_PIN_INT1> : Output pin for interrupt signal 1
> > > > > > + <S35390A_OUTPUT_PIN_INT2> : Output pin for interrupt signal 2
> > > > >
> > > > > Does that mean device generates the interrupts?
> > > > Yes.
> > > >
> > >
> > >
> > > Then I think you miss interrupts property.
> > From what I can tell the line is used to generate a system wakeup
> > event.
> >
> > There would be no obvious benefit of connecting it to an interrupt
> > controller, so this property would be obsolete?
> >
>
> Then you need proper wakeup-source support
Wouldn't that break existing devicetrees?
The current driver allows to wake up the system, even without
having wakeup-source set.
As an example: arch/arm/boot/dts/marvell/kirkwood-ts219.dtsi
Thanks
- Markus Probst
>
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
^ permalink raw reply
* Re: [PATCH v3 1/2] dt-bindings: arm: fsl: add compatible for new Skov I.MX8MP variant
From: Conor Dooley @ 2026-07-01 17:07 UTC (permalink / raw)
To: Steffen Trumtrar
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
devicetree, linux-kernel, imx, linux-arm-kernel
In-Reply-To: <20260701-v7-0-topic-imx8mp-skov-dts-jutouch-7inch-v3-1-d74f7e3f8293@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* [PATCH 04/11] drm/mediatek: mtk_dp: Clarify SMC eDP/DP video unmute commands
From: AngeloGioacchino Del Regno @ 2026-07-01 12:20 UTC (permalink / raw)
To: chunkuang.hu
Cc: p.zabel, airlied, simona, maarten.lankhorst, mripard, tzimmermann,
robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
jitao.shi, granquet, rex-bc.chen, dmitry.osipenko, ck.hu,
amergnat, justin.yeh, jason-jh.lin, dri-devel, linux-mediatek,
devicetree, linux-kernel, linux-arm-kernel, kernel
In-Reply-To: <20260701122024.19557-1-angelogioacchino.delregno@collabora.com>
The eDP/DP video unmute commands are not expressed as bits:
instead, in the firmware, those are defined as incremental
unsigned integer numbers: use the correct representation of
those to improve readability.
This commit brings no functional changes.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/gpu/drm/mediatek/mtk_dp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 2c738c16dafa..f551c4543f4e 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -36,8 +36,8 @@
#include "mtk_dp_reg.h"
#define MTK_DP_SIP_CONTROL_AARCH32 MTK_SIP_SMC_CMD(0x523)
-#define MTK_DP_SIP_ATF_EDP_VIDEO_UNMUTE (BIT(0) | BIT(5))
-#define MTK_DP_SIP_ATF_VIDEO_UNMUTE BIT(5)
+#define MTK_DP_SIP_ATF_EDP_VIDEO_UNMUTE 33
+#define MTK_DP_SIP_ATF_VIDEO_UNMUTE 32
#define MTK_DP_THREAD_CABLE_STATE_CHG BIT(0)
#define MTK_DP_THREAD_HPD_EVENT BIT(1)
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] dt-bindings: mmc: mtk-sd: Document extra clocks for MT8189
From: Conor Dooley @ 2026-07-01 17:03 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Chaotian Jing, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Wenbin Mei, kernel, Krzysztof Kozlowski, linux-mmc, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260701-mt8189-mmc-dt-bindings-fix-v1-1-e75f241a275b@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
On Wed, Jul 01, 2026 at 04:44:26PM +0200, Louis-Alexis Eyraud wrote:
> MT8189 SoC MMC Controller IP has 4 additional clocks.
I think "additional" is slightly confusing wording here, since you go on
to permit 6 not 11 (the binding already allows 7).
Not a big deak though,
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* [PATCH 01/11] dt-bindings: display: mediatek: dp: Deprecate nvmem efuse data
From: AngeloGioacchino Del Regno @ 2026-07-01 12:20 UTC (permalink / raw)
To: chunkuang.hu
Cc: p.zabel, airlied, simona, maarten.lankhorst, mripard, tzimmermann,
robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
jitao.shi, granquet, rex-bc.chen, dmitry.osipenko, ck.hu,
amergnat, justin.yeh, jason-jh.lin, dri-devel, linux-mediatek,
devicetree, linux-kernel, linux-arm-kernel, kernel
In-Reply-To: <20260701122024.19557-1-angelogioacchino.delregno@collabora.com>
Deprecate nvmem-cells and nvmem-cell-names and clarify their
purpose, as those are for PHY calibration data, not for the DP
IP itself, and that data shall go in the PHY binding instead.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
.../devicetree/bindings/display/mediatek/mediatek,dp.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
index 8f4bd9fb560b..980f76667ada 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
@@ -30,10 +30,12 @@ properties:
maxItems: 1
nvmem-cells:
+ deprecated: true
maxItems: 1
- description: efuse data for display port calibration
+ description: efuse data for display port phy calibration
nvmem-cell-names:
+ deprecated: true
const: dp_calibration_data
power-domains:
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] dt-bindings: mfd: mediatek,mt8195-scpsys: Add support for MT8189 SoC
From: Conor Dooley @ 2026-07-01 17:00 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Matthias Brugger, AngeloGioacchino Del Regno, kernel, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <20260701-mt8189-dt-bindings-scpsys-v1-1-2c04f0fda1b7@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* Re: [PATCH] dt-bindings: phy: mediatek,tphy: Add support for MT8189 SoC
From: Conor Dooley @ 2026-07-01 16:59 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Chunfeng Yun, Vinod Koul, Neil Armstrong, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, kernel, linux-arm-kernel,
linux-mediatek, linux-phy, devicetree, linux-kernel
In-Reply-To: <20260701-mt8189-dt-bindings-tphy-v1-1-5848a2be8303@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* Re: [PATCH] dt-bindings: dma: mediatek,uart-dma: add support for MT8189 SoC
From: Conor Dooley @ 2026-07-01 16:59 UTC (permalink / raw)
To: Louis-Alexis Eyraud
Cc: Sean Wang, Vinod Koul, Frank Li, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Long Cheng, kernel, dmaengine, linux-arm-kernel, linux-mediatek,
devicetree, linux-kernel
In-Reply-To: <20260701-mt8189-dt-bindings-uart-dma-v1-1-c7106216a40d@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* [PATCH 02/12] phy: phy-mtk-dp: Rename regs to regmap in struct mtk_dp_phy
From: AngeloGioacchino Del Regno @ 2026-07-01 12:19 UTC (permalink / raw)
To: chunfeng.yun
Cc: vkoul, neil.armstrong, robh, krzk+dt, conor+dt, matthias.bgg,
angelogioacchino.delregno, chunkuang.hu, p.zabel, justin.yeh,
linux-arm-kernel, linux-mediatek, linux-phy, devicetree,
linux-kernel, dri-devel, kernel
In-Reply-To: <20260701122008.19509-1-angelogioacchino.delregno@collabora.com>
In preparation to perform further cleanups and to extend the
driver to support more SoCs, rename the `regs` member to `regmap`
to improve readability, as this is a common name across many
kernel drivers for a struct regmap.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/phy/mediatek/phy-mtk-dp.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c
index d7024a144335..bf7b3a95e72d 100644
--- a/drivers/phy/mediatek/phy-mtk-dp.c
+++ b/drivers/phy/mediatek/phy-mtk-dp.c
@@ -79,7 +79,7 @@
XTP_LN_TX_LCTXCP1_SW3_PRE0_DEFAULT)
struct mtk_dp_phy {
- struct regmap *regs;
+ struct regmap *regmap;
};
static int mtk_dp_phy_init(struct phy *phy)
@@ -94,13 +94,13 @@ static int mtk_dp_phy_init(struct phy *phy)
DRIVING_PARAM_8_DEFAULT
};
- regmap_bulk_write(dp_phy->regs, MTK_DP_LANE0_DRIVING_PARAM_3,
+ regmap_bulk_write(dp_phy->regmap, MTK_DP_LANE0_DRIVING_PARAM_3,
driving_params, ARRAY_SIZE(driving_params));
- regmap_bulk_write(dp_phy->regs, MTK_DP_LANE1_DRIVING_PARAM_3,
+ regmap_bulk_write(dp_phy->regmap, MTK_DP_LANE1_DRIVING_PARAM_3,
driving_params, ARRAY_SIZE(driving_params));
- regmap_bulk_write(dp_phy->regs, MTK_DP_LANE2_DRIVING_PARAM_3,
+ regmap_bulk_write(dp_phy->regmap, MTK_DP_LANE2_DRIVING_PARAM_3,
driving_params, ARRAY_SIZE(driving_params));
- regmap_bulk_write(dp_phy->regs, MTK_DP_LANE3_DRIVING_PARAM_3,
+ regmap_bulk_write(dp_phy->regmap, MTK_DP_LANE3_DRIVING_PARAM_3,
driving_params, ARRAY_SIZE(driving_params));
return 0;
@@ -131,10 +131,10 @@ static int mtk_dp_phy_configure(struct phy *phy, union phy_configure_opts *opts)
val = BIT_RATE_HBR3;
break;
}
- regmap_write(dp_phy->regs, MTK_DP_PHY_DIG_BIT_RATE, val);
+ regmap_write(dp_phy->regmap, MTK_DP_PHY_DIG_BIT_RATE, val);
}
- regmap_update_bits(dp_phy->regs, MTK_DP_PHY_DIG_PLL_CTL_1,
+ regmap_update_bits(dp_phy->regmap, MTK_DP_PHY_DIG_PLL_CTL_1,
TPLL_SSC_EN, opts->dp.ssc ? TPLL_SSC_EN : 0);
return 0;
@@ -144,10 +144,10 @@ static int mtk_dp_phy_reset(struct phy *phy)
{
struct mtk_dp_phy *dp_phy = phy_get_drvdata(phy);
- regmap_update_bits(dp_phy->regs, MTK_DP_PHY_DIG_SW_RST,
+ regmap_update_bits(dp_phy->regmap, MTK_DP_PHY_DIG_SW_RST,
DP_GLB_SW_RST_PHYD, 0);
usleep_range(50, 200);
- regmap_update_bits(dp_phy->regs, MTK_DP_PHY_DIG_SW_RST,
+ regmap_update_bits(dp_phy->regmap, MTK_DP_PHY_DIG_SW_RST,
DP_GLB_SW_RST_PHYD, 1);
return 0;
@@ -176,7 +176,7 @@ static int mtk_dp_phy_probe(struct platform_device *pdev)
if (!dp_phy)
return -ENOMEM;
- dp_phy->regs = regs;
+ dp_phy->regmap = regs;
phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops);
if (IS_ERR(phy))
return dev_err_probe(dev, PTR_ERR(phy),
--
2.54.0
^ permalink raw reply related
* Re: [PATCH v3 1/3] KVM: arm64: skip pKVM cache flushes for non cacheable mappings
From: Bradley Morgan @ 2026-07-01 16:57 UTC (permalink / raw)
To: Leonardo Bras
Cc: Marc Zyngier, Oliver Upton, Fuad Tabba, Joey Gouly, Steffen Eiden,
Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
Quentin Perret, Vincent Donnefort, Gavin Shan, Alexandru Elisei,
linux-arm-kernel, kvmarm, linux-kernel
In-Reply-To: <akVGxdakrVYp8kho@LeoBrasDK>
On July 1, 2026 5:56:37 PM GMT+01:00, Leonardo Bras <leo.bras@arm.com>
wrote:
>On Wed, Jul 01, 2026 at 05:54:40PM +0100, Bradley Morgan wrote:
>> On July 1, 2026 5:53:34 PM GMT+01:00, Leonardo Bras <leo.bras@arm.com>
>> wrote:
>> >On Wed, Jul 01, 2026 at 05:40:46PM +0100, Bradley Morgan wrote:
>> >> On July 1, 2026 5:05:53 PM GMT+01:00, Leonardo Bras
><leo.bras@arm.com>
>> >> wrote:
>> >> >On Wed, Jun 24, 2026 at 04:00:26PM +0000, Bradley Morgan wrote:
>> >> >> pKVM keeps its own mapping list for stage 2 operations. Its flush
>> >path
>> >> >> uses that list directly, so it lost the PTE attribute check done
>by
>> >the
>> >> >> generic stage 2 walker.
>> >> >>
>> >> >> Record whether a mapping is cacheable and skip cache maintenance
>for
>> >> >> mappings that are not cacheable.
>> >> >>
>> >> >> Fixes: e912efed485a ("KVM: arm64: Introduce the EL1 pKVM MMU")
>> >> >> Signed-off-by: Bradley Morgan <include@grrlz.net>
>> >> >> ---
>> >> >> arch/arm64/kvm/pkvm.c | 51
>> >++++++++++++++++++++++++++++++++++---------
>> >> >> 1 file changed, 41 insertions(+), 10 deletions(-)
>> >> >>
>> >> >> diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c
>> >> >> index 428723b1b0f5..ca6e823028c2 100644
>> >> >> --- a/arch/arm64/kvm/pkvm.c
>> >> >> +++ b/arch/arm64/kvm/pkvm.c
>> >> >> @@ -302,9 +302,32 @@ static u64 __pkvm_mapping_start(struct
>> >pkvm_mapping
>> >> >*m)
>> >> >> return m->gfn * PAGE_SIZE;
>> >> >> }
>> >> >>
>> >> >> +#define PKVM_MAPPING_NR_PAGES_MASK GENMASK_ULL(47, 0)
>> >> >> +#define PKVM_MAPPING_CACHEABLE BIT_ULL(48)
>> >> >
>> >> >Out of curiosity here, why do you choose to use bit 48 here instead
>of,
>> >> >let's say, bit 63?
>> >> >
>> >> >(I know it makes absolutely no difference to inner working here, as
>> >there
>> >> >should probably not be 2^48 pages in one mapping.)
>> >> >
>> >> >Thanks!
>> >> >Leo
>> >>
>> >>
>> >> sup Leo, here's a quote from maz
>> >
>> >Hi Bradley,
>> >
>> >>
>> >> "This thing is already big enough, let's not add a bool right in the
>> >> middle (use pahole to find out why this is bad).
>> >
>> >I suppose you proposed to add a bool into a struct, maybe?
>> >It would screw the struct alignment.
>>
>> yep, crappy old me
>>
>
>Hah, you were probably focused on the big picture.
>
>>
>> >> Given that nr_pages
>> >> is for a range, and that the minimum page size uses 12 bits, the
>> >> largest number of pages you can have here is 56-12=48 bit wide.
>That's
>> >> another 16 bits worth of flags you can use."
>> >
>> >Humm, makes sense.
>> >And since he mentions 16 bits worth of flags, you start by using the
>48th
>> >bit. Ok, got your rationale.
>> >
>> >(I would possibly start with the 63, though, but that's more on
>personal
>> >taste)
>>
>> 48 won't make the world blow up :)
>
>yeap,
Would you like to be CCed on v4 or nahhhh?
>>
>> >>
>> >> this should just clarify things, any questions, feel more than free
>to
>> >ask!
>> >>
>> >> (btw V4 is coming soon)
>> >
>> >Thanks!
>> >Leo
>> >
>> >>
>> >> >> +
>> >> >> +static u64 pkvm_mapping_nr_pages(struct pkvm_mapping *m)
>> >> >> +{
>> >> >> + return m->nr_pages & PKVM_MAPPING_NR_PAGES_MASK;
>> >> >> +}
>> >> >> +
>> >> >> +static bool pkvm_mapping_is_cacheable(struct pkvm_mapping *m)
>> >> >> +{
>> >> >> + return m->nr_pages & PKVM_MAPPING_CACHEABLE;
>> >> >> +}
>> >> >> +
>> >> >> +static void pkvm_mapping_set_nr_pages(struct pkvm_mapping *m, u64
>> >> >nr_pages,
>> >> >> + bool cacheable)
>> >> >> +{
>> >> >> + WARN_ON_ONCE(nr_pages & ~PKVM_MAPPING_NR_PAGES_MASK);
>> >> >> +
>> >> >> + m->nr_pages = nr_pages & PKVM_MAPPING_NR_PAGES_MASK;
>> >> >> + if (cacheable)
>> >> >> + m->nr_pages |= PKVM_MAPPING_CACHEABLE;
>> >> >> +}
>> >> >> +
>> >> >> static u64 __pkvm_mapping_end(struct pkvm_mapping *m)
>> >> >> {
>> >> >> - return (m->gfn + m->nr_pages) * PAGE_SIZE - 1;
>> >> >> + return (m->gfn + pkvm_mapping_nr_pages(m)) * PAGE_SIZE - 1;
>> >> >> }
>> >> >>
>> >> >> INTERVAL_TREE_DEFINE(struct pkvm_mapping, node, u64,
>__subtree_last,
>> >> >> @@ -350,7 +373,7 @@ static int
>__pkvm_pgtable_stage2_reclaim(struct
>> >> >kvm_pgtable *pgt, u64 start, u64
>> >> >> continue;
>> >> >>
>> >> >> page = pfn_to_page(mapping->pfn);
>> >> >> - WARN_ON_ONCE(mapping->nr_pages != 1);
>> >> >> + WARN_ON_ONCE(pkvm_mapping_nr_pages(mapping) != 1);
>> >> >> unpin_user_pages_dirty_lock(&page, 1, true);
>> >> >> account_locked_vm(kvm->mm, 1, false);
>> >> >> pkvm_mapping_remove(mapping, &pgt->pkvm_mappings);
>> >> >> @@ -369,7 +392,7 @@ static int
>__pkvm_pgtable_stage2_unshare(struct
>> >> >kvm_pgtable *pgt, u64 start, u64
>> >> >>
>> >> >> for_each_mapping_in_range_safe(pgt, start, end, mapping) {
>> >> >> ret = kvm_call_hyp_nvhe(__pkvm_host_unshare_guest, handle, mapping->gfn,
>> >> >> - mapping->nr_pages);
>> >> >> + pkvm_mapping_nr_pages(mapping));
>> >> >> if (WARN_ON(ret))
>> >> >> return ret;
>> >> >> pkvm_mapping_remove(mapping, &pgt->pkvm_mappings);
>> >> >> @@ -448,7 +471,7 @@ int pkvm_pgtable_stage2_map(struct kvm_pgtable
>> >*pgt,
>> >> >u64 addr, u64 size,
>> >> >> * permission faults are handled in the relax_perms() path.
>> >> >> */
>> >> >> if (mapping) {
>> >> >> - if (size == (mapping->nr_pages * PAGE_SIZE))
>> >> >> + if (size == (pkvm_mapping_nr_pages(mapping) * PAGE_SIZE))
>> >> >> return -EAGAIN;
>> >> >>
>> >> >> /*
>> >> >> @@ -472,7 +495,9 @@ int pkvm_pgtable_stage2_map(struct kvm_pgtable
>> >*pgt,
>> >> >u64 addr, u64 size,
>> >> >> swap(mapping, cache->mapping);
>> >> >> mapping->gfn = gfn;
>> >> >> mapping->pfn = pfn;
>> >> >> - mapping->nr_pages = size / PAGE_SIZE;
>> >> >> + pkvm_mapping_set_nr_pages(mapping, size / PAGE_SIZE,
>> >> >> + !(prot & (KVM_PGTABLE_PROT_DEVICE |
>> >> >> + KVM_PGTABLE_PROT_NORMAL_NC)));
>> >> >> pkvm_mapping_insert(mapping, &pgt->pkvm_mappings);
>> >> >>
>> >> >> return ret;
>> >> >> @@ -503,7 +528,7 @@ int pkvm_pgtable_stage2_wrprotect(struct
>> >kvm_pgtable
>> >> >*pgt, u64 addr, u64 size)
>> >> >> lockdep_assert_held(&kvm->mmu_lock);
>> >> >> for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping) {
>> >> >> ret = kvm_call_hyp_nvhe(__pkvm_host_wrprotect_guest, handle, mapping->gfn,
>> >> >> - mapping->nr_pages);
>> >> >> + pkvm_mapping_nr_pages(mapping));
>> >> >> if (WARN_ON(ret))
>> >> >> break;
>> >> >> }
>> >> >> @@ -517,9 +542,13 @@ int pkvm_pgtable_stage2_flush(struct
>kvm_pgtable
>> >> >*pgt, u64 addr, u64 size)
>> >> >> struct pkvm_mapping *mapping;
>> >> >>
>> >> >> lockdep_assert_held(&kvm->mmu_lock);
>> >> >> - for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping)
>> >> >> + for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping) {
>> >> >> + if (!pkvm_mapping_is_cacheable(mapping))
>> >> >> + continue;
>> >> >> +
>> >> >> __clean_dcache_guest_page(pfn_to_kaddr(mapping->pfn),
>> >> >> - PAGE_SIZE * mapping->nr_pages);
>> >> >> + PAGE_SIZE * pkvm_mapping_nr_pages(mapping));
>> >> >> + }
>> >> >>
>> >> >> return 0;
>> >> >> }
>> >> >> @@ -536,8 +565,10 @@ bool
>pkvm_pgtable_stage2_test_clear_young(struct
>> >> >kvm_pgtable *pgt, u64 addr, u64
>> >> >>
>> >> >> lockdep_assert_held(&kvm->mmu_lock);
>> >> >> for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping)
>> >> >> - young |= kvm_call_hyp_nvhe(__pkvm_host_test_clear_young_guest, handle, mapping->gfn,
>> >> >> - mapping->nr_pages, mkold);
>> >> >> + young |= kvm_call_hyp_nvhe(__pkvm_host_test_clear_young_guest,
>> >> >> + handle, mapping->gfn,
>> >> >> + pkvm_mapping_nr_pages(mapping),
>> >> >> + mkold);
>> >> >>
>> >> >> return young;
>> >> >> }
>> >> >> --
>> >> >> 2.53.0
>> >> >>
>> >> >
>> >>
>> >> Thanks!
>> >
>>
>> Thanks!
>
>Thanks!
>
Thanks!
^ permalink raw reply
* [PATCH 5/5] gpio: nomadik: drop "chip registered" log on probe success
From: Théo Lebrun @ 2026-07-01 16:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
In-Reply-To: <20260701-gpio-nomadik-silent-v1-0-644d10316cef@bootlin.com>
Successful driver probing should be silent. Drop unconditional
dev_info() call that is done at nmk_gpio_probe() exit.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/gpio/gpio-nomadik.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 1ee46f59d708..244331f468cc 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -712,8 +712,6 @@ static int nmk_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, nmk_chip);
- dev_info(dev, "chip registered\n");
-
return 0;
}
--
2.55.0
^ permalink raw reply related
* [PATCH 3/5] gpio: nomadik: drop duplicate probe error line
From: Théo Lebrun @ 2026-07-01 16:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
In-Reply-To: <20260701-gpio-nomadik-silent-v1-0-644d10316cef@bootlin.com>
Now that all error codepaths in nmk_gpio_populate_chip() log an error,
drop dev_err() call that is made on nmk_gpio_populate_chip() failure.
Current boot log:
[ 0.544230] nomadik-gpio 1400000.gpio: failed getting reset control: -EPROBE_DEFER
[ 0.544274] nomadik-gpio 1400000.gpio: could not populate nmk chip struct
The second line is always redundant (or is logged when we shouldn't log,
like ioremap or alloc failures).
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/gpio/gpio-nomadik.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 4a7db282bad8..eba095eeb3d6 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -651,10 +651,8 @@ static int nmk_gpio_probe(struct platform_device *pdev)
int ret;
nmk_chip = nmk_gpio_populate_chip(dev_fwnode(dev), pdev);
- if (IS_ERR(nmk_chip)) {
- dev_err(dev, "could not populate nmk chip struct\n");
+ if (IS_ERR(nmk_chip))
return PTR_ERR(nmk_chip);
- }
supports_sleepmode =
device_property_read_bool(dev, "st,supports-sleepmode");
--
2.55.0
^ permalink raw reply related
* [PATCH 4/5] gpio: nomadik: use dev_err_probe()
From: Théo Lebrun @ 2026-07-01 16:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
In-Reply-To: <20260701-gpio-nomadik-silent-v1-0-644d10316cef@bootlin.com>
gpio-nomadik depends on a few resources. In one case the reset is taking
time to show up leading to a boot log containing:
[ 0.544230] nomadik-gpio 1400000.gpio: failed getting reset control: -EPROBE_DEFER
Fix by replacing all dev_err() calls that might be made at probe with
dev_err_probe().
On nomadik platforms, the nmk_gpio_populate_chip() log calls might
attach their reasons to the gpio or pinctrl device depending on boot
order.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/gpio/gpio-nomadik.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index eba095eeb3d6..1ee46f59d708 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -520,21 +520,22 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
gpio_dev = bus_find_device_by_fwnode(&platform_bus_type, fwnode);
if (!gpio_dev) {
- dev_err(dev, "populate \"%pfwP\": device not found\n", fwnode);
- return ERR_PTR(-ENODEV);
+ ret = -ENODEV;
+ dev_err_probe(dev, ret, "populate \"%pfwP\": device not found\n", fwnode);
+ return ERR_PTR(ret);
}
gpio_pdev = to_platform_device(gpio_dev);
if (device_property_read_u32(gpio_dev, "gpio-bank", &id)) {
- dev_err(dev, "populate: gpio-bank property not found\n");
ret = -EINVAL;
+ dev_err_probe(dev, ret, "populate: gpio-bank property not found\n");
goto err_put_pdev;
}
#ifdef CONFIG_PINCTRL_NOMADIK
if (id >= ARRAY_SIZE(nmk_gpio_chips)) {
- dev_err(dev, "populate: invalid id: %u\n", id);
ret = -EINVAL;
+ dev_err_probe(dev, ret, "populate: invalid id: %u\n", id);
goto err_put_pdev;
}
/* Already populated? */
@@ -578,7 +579,7 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
clk = clk_get_optional(gpio_dev, NULL);
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
- dev_err(dev, "failed getting clock: %d\n", ret);
+ dev_err_probe(dev, ret, "failed getting clock\n");
goto err_put_pdev;
}
clk_prepare(clk);
@@ -587,8 +588,8 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
/* NOTE: do not use devm_ here! */
reset = reset_control_get_optional_shared(gpio_dev, NULL);
if (IS_ERR(reset)) {
- dev_err(dev, "failed getting reset control: %pe\n", reset);
ret = PTR_ERR(reset);
+ dev_err_probe(dev, ret, "failed getting reset control\n");
goto err_unprepare_clk;
}
@@ -599,7 +600,7 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
*/
ret = reset_control_deassert(reset);
if (ret) {
- dev_err(dev, "failed reset deassert: %d\n", ret);
+ dev_err_probe(dev, ret, "failed reset deassert\n");
goto err_put_reset;
}
@@ -695,7 +696,7 @@ static int nmk_gpio_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, irq, nmk_gpio_irq_handler, IRQF_SHARED,
dev_name(dev), nmk_chip);
if (ret) {
- dev_err(dev, "failed requesting IRQ\n");
+ dev_err_probe(dev, ret, "failed requesting IRQ\n");
return ret;
}
--
2.55.0
^ permalink raw reply related
* [PATCH 1/5] gpio: nomadik: convert nmk_gpio_populate_chip() to goto cleanup
From: Théo Lebrun @ 2026-07-01 16:56 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
In-Reply-To: <20260701-gpio-nomadik-silent-v1-0-644d10316cef@bootlin.com>
Remove duplicate teardown code that is found in all error if
statements. Replace by goto-based cleanup labels.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/gpio/gpio-nomadik.c | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index e22b713166d7..f25f251f4757 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -527,15 +527,15 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
if (device_property_read_u32(gpio_dev, "gpio-bank", &id)) {
dev_err(dev, "populate: gpio-bank property not found\n");
- platform_device_put(gpio_pdev);
- return ERR_PTR(-EINVAL);
+ ret = -EINVAL;
+ goto err_put_pdev;
}
#ifdef CONFIG_PINCTRL_NOMADIK
if (id >= ARRAY_SIZE(nmk_gpio_chips)) {
dev_err(dev, "populate: invalid id: %u\n", id);
- platform_device_put(gpio_pdev);
- return ERR_PTR(-EINVAL);
+ ret = -EINVAL;
+ goto err_put_pdev;
}
/* Already populated? */
nmk_chip = nmk_gpio_chips[id];
@@ -547,8 +547,8 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
nmk_chip = devm_kzalloc(dev, sizeof(*nmk_chip), GFP_KERNEL);
if (!nmk_chip) {
- platform_device_put(gpio_pdev);
- return ERR_PTR(-ENOMEM);
+ ret = -ENOMEM;
+ goto err_put_pdev;
}
if (device_property_read_u32(gpio_dev, "ngpios", &ngpio)) {
@@ -569,16 +569,16 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) {
- platform_device_put(gpio_pdev);
- return ERR_CAST(base);
+ ret = PTR_ERR(base);
+ goto err_put_pdev;
}
nmk_chip->addr = base;
/* NOTE: do not use devm_ here! */
clk = clk_get_optional(gpio_dev, NULL);
if (IS_ERR(clk)) {
- platform_device_put(gpio_pdev);
- return ERR_CAST(clk);
+ ret = PTR_ERR(clk);
+ goto err_put_pdev;
}
clk_prepare(clk);
nmk_chip->clk = clk;
@@ -586,12 +586,9 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
/* NOTE: do not use devm_ here! */
reset = reset_control_get_optional_shared(gpio_dev, NULL);
if (IS_ERR(reset)) {
- clk_unprepare(clk);
- clk_put(clk);
- platform_device_put(gpio_pdev);
- dev_err(dev, "failed getting reset control: %pe\n",
- reset);
- return ERR_CAST(reset);
+ dev_err(dev, "failed getting reset control: %pe\n", reset);
+ ret = PTR_ERR(reset);
+ goto err_unprepare_clk;
}
/*
@@ -601,18 +598,23 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
*/
ret = reset_control_deassert(reset);
if (ret) {
- reset_control_put(reset);
- clk_unprepare(clk);
- clk_put(clk);
- platform_device_put(gpio_pdev);
dev_err(dev, "failed reset deassert: %d\n", ret);
- return ERR_PTR(ret);
+ goto err_put_reset;
}
#ifdef CONFIG_PINCTRL_NOMADIK
nmk_gpio_chips[id] = nmk_chip;
#endif
return nmk_chip;
+
+err_put_reset:
+ reset_control_put(reset);
+err_unprepare_clk:
+ clk_unprepare(clk);
+ clk_put(clk);
+err_put_pdev:
+ platform_device_put(gpio_pdev);
+ return ERR_PTR(ret);
}
static void nmk_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
--
2.55.0
^ permalink raw reply related
* [PATCH 2/5] gpio: nomadik: add missing dev_err() call on chip populate failure
From: Théo Lebrun @ 2026-07-01 16:56 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
In-Reply-To: <20260701-gpio-nomadik-silent-v1-0-644d10316cef@bootlin.com>
All error paths of nmk_gpio_populate_chip() lead to logging errors but
this one (ignoring the alloc or ioremap failures that must not log).
Add the single missing dev_err() call.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/gpio/gpio-nomadik.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index f25f251f4757..4a7db282bad8 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -578,6 +578,7 @@ struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
clk = clk_get_optional(gpio_dev, NULL);
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
+ dev_err(dev, "failed getting clock: %d\n", ret);
goto err_put_pdev;
}
clk_prepare(clk);
--
2.55.0
^ permalink raw reply related
* [PATCH 0/5] gpio: nomadik: silence boot log
From: Théo Lebrun @ 2026-07-01 16:56 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Philipp Zabel
Cc: Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, linux-arm-kernel, linux-gpio,
linux-kernel, Théo Lebrun
Currently, on EyeQ5, we might get those error logs:
[ 0.544230] nomadik-gpio 1400000.gpio: failed getting reset control: -EPROBE_DEFER
[ 0.544274] nomadik-gpio 1400000.gpio: could not populate nmk chip struct
Then on successful probe we get:
[ 0.976838] nomadik-gpio 1400000.gpio: chip registered
First line is because we don't use the appropriate dev_err_probe()
helper. Second line is redundant to populate chip dev_err() calls and
shall be dropped. Third line should be dropped.
That's done in patches 3+4+5. Patches 1+2 prepare the terrain.
Have a nice day,
Théo
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
Théo Lebrun (5):
gpio: nomadik: convert nmk_gpio_populate_chip() to goto cleanup
gpio: nomadik: add missing dev_err() call on chip populate failure
gpio: nomadik: drop duplicate probe error line
gpio: nomadik: use dev_err_probe()
gpio: nomadik: drop "chip registered" log on probe success
drivers/gpio/gpio-nomadik.c | 64 ++++++++++++++++++++++-----------------------
1 file changed, 32 insertions(+), 32 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260701-gpio-nomadik-silent-678abaee1e3e
Best regards,
--
Théo Lebrun <theo.lebrun@bootlin.com>
^ permalink raw reply
* Re: [PATCH v3 1/3] KVM: arm64: skip pKVM cache flushes for non cacheable mappings
From: Leonardo Bras @ 2026-07-01 16:56 UTC (permalink / raw)
To: Bradley Morgan
Cc: Leonardo Bras, Marc Zyngier, Oliver Upton, Fuad Tabba, Joey Gouly,
Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
Will Deacon, Quentin Perret, Vincent Donnefort, Gavin Shan,
Alexandru Elisei, linux-arm-kernel, kvmarm, linux-kernel
In-Reply-To: <EB48DA64-1E2E-4D8C-8F8A-ED6257AD93E9@grrlz.net>
On Wed, Jul 01, 2026 at 05:54:40PM +0100, Bradley Morgan wrote:
> On July 1, 2026 5:53:34 PM GMT+01:00, Leonardo Bras <leo.bras@arm.com>
> wrote:
> >On Wed, Jul 01, 2026 at 05:40:46PM +0100, Bradley Morgan wrote:
> >> On July 1, 2026 5:05:53 PM GMT+01:00, Leonardo Bras <leo.bras@arm.com>
> >> wrote:
> >> >On Wed, Jun 24, 2026 at 04:00:26PM +0000, Bradley Morgan wrote:
> >> >> pKVM keeps its own mapping list for stage 2 operations. Its flush
> >path
> >> >> uses that list directly, so it lost the PTE attribute check done by
> >the
> >> >> generic stage 2 walker.
> >> >>
> >> >> Record whether a mapping is cacheable and skip cache maintenance for
> >> >> mappings that are not cacheable.
> >> >>
> >> >> Fixes: e912efed485a ("KVM: arm64: Introduce the EL1 pKVM MMU")
> >> >> Signed-off-by: Bradley Morgan <include@grrlz.net>
> >> >> ---
> >> >> arch/arm64/kvm/pkvm.c | 51
> >++++++++++++++++++++++++++++++++++---------
> >> >> 1 file changed, 41 insertions(+), 10 deletions(-)
> >> >>
> >> >> diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c
> >> >> index 428723b1b0f5..ca6e823028c2 100644
> >> >> --- a/arch/arm64/kvm/pkvm.c
> >> >> +++ b/arch/arm64/kvm/pkvm.c
> >> >> @@ -302,9 +302,32 @@ static u64 __pkvm_mapping_start(struct
> >pkvm_mapping
> >> >*m)
> >> >> return m->gfn * PAGE_SIZE;
> >> >> }
> >> >>
> >> >> +#define PKVM_MAPPING_NR_PAGES_MASK GENMASK_ULL(47, 0)
> >> >> +#define PKVM_MAPPING_CACHEABLE BIT_ULL(48)
> >> >
> >> >Out of curiosity here, why do you choose to use bit 48 here instead of,
> >> >let's say, bit 63?
> >> >
> >> >(I know it makes absolutely no difference to inner working here, as
> >there
> >> >should probably not be 2^48 pages in one mapping.)
> >> >
> >> >Thanks!
> >> >Leo
> >>
> >>
> >> sup Leo, here's a quote from maz
> >
> >Hi Bradley,
> >
> >>
> >> "This thing is already big enough, let's not add a bool right in the
> >> middle (use pahole to find out why this is bad).
> >
> >I suppose you proposed to add a bool into a struct, maybe?
> >It would screw the struct alignment.
>
> yep, crappy old me
>
Hah, you were probably focused on the big picture.
>
> >> Given that nr_pages
> >> is for a range, and that the minimum page size uses 12 bits, the
> >> largest number of pages you can have here is 56-12=48 bit wide. That's
> >> another 16 bits worth of flags you can use."
> >
> >Humm, makes sense.
> >And since he mentions 16 bits worth of flags, you start by using the 48th
> >bit. Ok, got your rationale.
> >
> >(I would possibly start with the 63, though, but that's more on personal
> >taste)
>
> 48 won't make the world blow up :)
yeap,
>
> >>
> >> this should just clarify things, any questions, feel more than free to
> >ask!
> >>
> >> (btw V4 is coming soon)
> >
> >Thanks!
> >Leo
> >
> >>
> >> >> +
> >> >> +static u64 pkvm_mapping_nr_pages(struct pkvm_mapping *m)
> >> >> +{
> >> >> + return m->nr_pages & PKVM_MAPPING_NR_PAGES_MASK;
> >> >> +}
> >> >> +
> >> >> +static bool pkvm_mapping_is_cacheable(struct pkvm_mapping *m)
> >> >> +{
> >> >> + return m->nr_pages & PKVM_MAPPING_CACHEABLE;
> >> >> +}
> >> >> +
> >> >> +static void pkvm_mapping_set_nr_pages(struct pkvm_mapping *m, u64
> >> >nr_pages,
> >> >> + bool cacheable)
> >> >> +{
> >> >> + WARN_ON_ONCE(nr_pages & ~PKVM_MAPPING_NR_PAGES_MASK);
> >> >> +
> >> >> + m->nr_pages = nr_pages & PKVM_MAPPING_NR_PAGES_MASK;
> >> >> + if (cacheable)
> >> >> + m->nr_pages |= PKVM_MAPPING_CACHEABLE;
> >> >> +}
> >> >> +
> >> >> static u64 __pkvm_mapping_end(struct pkvm_mapping *m)
> >> >> {
> >> >> - return (m->gfn + m->nr_pages) * PAGE_SIZE - 1;
> >> >> + return (m->gfn + pkvm_mapping_nr_pages(m)) * PAGE_SIZE - 1;
> >> >> }
> >> >>
> >> >> INTERVAL_TREE_DEFINE(struct pkvm_mapping, node, u64, __subtree_last,
> >> >> @@ -350,7 +373,7 @@ static int __pkvm_pgtable_stage2_reclaim(struct
> >> >kvm_pgtable *pgt, u64 start, u64
> >> >> continue;
> >> >>
> >> >> page = pfn_to_page(mapping->pfn);
> >> >> - WARN_ON_ONCE(mapping->nr_pages != 1);
> >> >> + WARN_ON_ONCE(pkvm_mapping_nr_pages(mapping) != 1);
> >> >> unpin_user_pages_dirty_lock(&page, 1, true);
> >> >> account_locked_vm(kvm->mm, 1, false);
> >> >> pkvm_mapping_remove(mapping, &pgt->pkvm_mappings);
> >> >> @@ -369,7 +392,7 @@ static int __pkvm_pgtable_stage2_unshare(struct
> >> >kvm_pgtable *pgt, u64 start, u64
> >> >>
> >> >> for_each_mapping_in_range_safe(pgt, start, end, mapping) {
> >> >> ret = kvm_call_hyp_nvhe(__pkvm_host_unshare_guest, handle, mapping->gfn,
> >> >> - mapping->nr_pages);
> >> >> + pkvm_mapping_nr_pages(mapping));
> >> >> if (WARN_ON(ret))
> >> >> return ret;
> >> >> pkvm_mapping_remove(mapping, &pgt->pkvm_mappings);
> >> >> @@ -448,7 +471,7 @@ int pkvm_pgtable_stage2_map(struct kvm_pgtable
> >*pgt,
> >> >u64 addr, u64 size,
> >> >> * permission faults are handled in the relax_perms() path.
> >> >> */
> >> >> if (mapping) {
> >> >> - if (size == (mapping->nr_pages * PAGE_SIZE))
> >> >> + if (size == (pkvm_mapping_nr_pages(mapping) * PAGE_SIZE))
> >> >> return -EAGAIN;
> >> >>
> >> >> /*
> >> >> @@ -472,7 +495,9 @@ int pkvm_pgtable_stage2_map(struct kvm_pgtable
> >*pgt,
> >> >u64 addr, u64 size,
> >> >> swap(mapping, cache->mapping);
> >> >> mapping->gfn = gfn;
> >> >> mapping->pfn = pfn;
> >> >> - mapping->nr_pages = size / PAGE_SIZE;
> >> >> + pkvm_mapping_set_nr_pages(mapping, size / PAGE_SIZE,
> >> >> + !(prot & (KVM_PGTABLE_PROT_DEVICE |
> >> >> + KVM_PGTABLE_PROT_NORMAL_NC)));
> >> >> pkvm_mapping_insert(mapping, &pgt->pkvm_mappings);
> >> >>
> >> >> return ret;
> >> >> @@ -503,7 +528,7 @@ int pkvm_pgtable_stage2_wrprotect(struct
> >kvm_pgtable
> >> >*pgt, u64 addr, u64 size)
> >> >> lockdep_assert_held(&kvm->mmu_lock);
> >> >> for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping) {
> >> >> ret = kvm_call_hyp_nvhe(__pkvm_host_wrprotect_guest, handle, mapping->gfn,
> >> >> - mapping->nr_pages);
> >> >> + pkvm_mapping_nr_pages(mapping));
> >> >> if (WARN_ON(ret))
> >> >> break;
> >> >> }
> >> >> @@ -517,9 +542,13 @@ int pkvm_pgtable_stage2_flush(struct kvm_pgtable
> >> >*pgt, u64 addr, u64 size)
> >> >> struct pkvm_mapping *mapping;
> >> >>
> >> >> lockdep_assert_held(&kvm->mmu_lock);
> >> >> - for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping)
> >> >> + for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping) {
> >> >> + if (!pkvm_mapping_is_cacheable(mapping))
> >> >> + continue;
> >> >> +
> >> >> __clean_dcache_guest_page(pfn_to_kaddr(mapping->pfn),
> >> >> - PAGE_SIZE * mapping->nr_pages);
> >> >> + PAGE_SIZE * pkvm_mapping_nr_pages(mapping));
> >> >> + }
> >> >>
> >> >> return 0;
> >> >> }
> >> >> @@ -536,8 +565,10 @@ bool pkvm_pgtable_stage2_test_clear_young(struct
> >> >kvm_pgtable *pgt, u64 addr, u64
> >> >>
> >> >> lockdep_assert_held(&kvm->mmu_lock);
> >> >> for_each_mapping_in_range_safe(pgt, addr, addr + size, mapping)
> >> >> - young |= kvm_call_hyp_nvhe(__pkvm_host_test_clear_young_guest, handle, mapping->gfn,
> >> >> - mapping->nr_pages, mkold);
> >> >> + young |= kvm_call_hyp_nvhe(__pkvm_host_test_clear_young_guest,
> >> >> + handle, mapping->gfn,
> >> >> + pkvm_mapping_nr_pages(mapping),
> >> >> + mkold);
> >> >>
> >> >> return young;
> >> >> }
> >> >> --
> >> >> 2.53.0
> >> >>
> >> >
> >>
> >> Thanks!
> >
>
> Thanks!
Thanks!
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox