Re: [PATCH v5 3/3] drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support
From: Wojciech Dubowik
Date: Mon Jul 20 2026 - 02:43:20 EST
On Fri, Jul 17, 2026 at 10:49:19PM +0200, Luca Ceresoli wrote:
> On Fri, 17 Jul 2026 13:50:01 +0200, Wojciech Dubowik <wojciech.dubowik@xxxxxx> wrote:
Hello Luca,
>
> Hello,
>
> >
> > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> > index f8a786953526..df44df2e872a 100644
> > --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> > @@ -845,6 +863,19 @@ static int sn65dsi83_parse_lvds_endpoint(struct sn65dsi83 *ctx, int channel)
> > else
> > return -EINVAL;
> >
> > + ret_data = of_property_read_u32_array(endpoint, "data-lanes", data_lanes,
> > + ARRAY_SIZE(data_lanes));
> > + if (!ret_data) {
> > + if (memcmp(data_lanes,
> > + supported_data_lane_mapping[LANE_MAPPING_REVERSE],
> > + ARRAY_SIZE(data_lanes)) == 0)
>
> Did you have a look at this sashiko report? It seems valid:
> | sashiko-bot@xxxxxxxxxx <sashiko-bot@xxxxxxxxxx>:
> |
> | [Severity: Medium]
> | Does this code compare the entire array? memcmp() expects the length in
> | bytes, but ARRAY_SIZE(data_lanes) evaluates to 4 (the number of elements).
> |
> | Because data_lanes is an array of u32, checking only 4 bytes means only
> | the first element is compared. Should this be using sizeof(data_lanes)
> | instead?
> |
> | via: https://patch.msgid.link/20260717115630.C58A61F000E9@xxxxxxxxxxxxxxx
>
> > + ctx->lvds_reverse_lanes_conf[channel] = true;
> > + else if (memcmp(data_lanes,
> > + supported_data_lane_mapping[LANE_MAPPING_NORMAL],
> > + ARRAY_SIZE(data_lanes)) != 0)
>
My stupid copy/paste error. I don't know how I have missed it. It has passed
my basic testing as it compares only firs lane. I will fix it in v6.
Regards,
Wojtek
> Same here.
>
> Otherwise looks good.
>
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>