All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Radosław Biernacki" <rad@semihalf.com>,
	"Souza, Jose" <jose.souza@intel.com>
Cc: "Lee\, Shawn C" <shawn.c.lee@intel.com>,
	"lma\@semihalf.com" <lma@semihalf.com>,
	"dri-devel\@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"joonas.lahtinen\@linux.intel.com"
	<joonas.lahtinen@linux.intel.com>,
	"intel-gfx\@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"upstream\@semihalf.com" <upstream@semihalf.com>
Subject: Re: [Intel-gfx] [PATCH v1] drm/i915/bdb: Fix version check
Date: Tue, 21 Sep 2021 13:27:32 +0300	[thread overview]
Message-ID: <87bl4mte97.fsf@intel.com> (raw)
In-Reply-To: <CAOs-w0J8pd-CE1iu1Bpy-3R20sxa=AJuSQwiRkyrFz0TFLBL4Q@mail.gmail.com>

On Tue, 21 Sep 2021, Radosław Biernacki <rad@semihalf.com> wrote:
> - dropping stable
>
> ...
>
>> > diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > index 330077c2e588..fff456bf8783 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > +++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > @@ -814,6 +814,11 @@ struct lfp_brightness_level {
>> >       u16 reserved;
>> >  } __packed;
>> >
>> > +/*
>> > + * Changing struct bdb_lfp_backlight_data might affect its
>> > + * size comparation to the value hold in BDB.
>> > + * (e.g. in parse_lfp_backlight())
>> > + */
>>
>> This is true for all the blocks so I don't think we need this comment.
>
> Lack of such comment was probable cause of this overlook.
> As this is an example of the consequence (bricking platforms dependent
> on mentioned conditions) IMO we need some comment here, or this will
> probably happen again.

The whole file is full of __packed structs with the sole purpose of
parsing VBT data in memory. People are generally well aware of the
consequences of changing the size, and this is the only such mistake I
can recall.

BR,
Jani.


>
>
>>
>> >  struct bdb_lfp_backlight_data {
>> >       u8 entry_size;
>> >       struct lfp_backlight_data_entry data[16];
>>

-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Radosław Biernacki" <rad@semihalf.com>,
	"Souza, Jose" <jose.souza@intel.com>
Cc: "Lee\, Shawn C" <shawn.c.lee@intel.com>,
	"lma\@semihalf.com" <lma@semihalf.com>,
	"dri-devel\@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"joonas.lahtinen\@linux.intel.com"
	<joonas.lahtinen@linux.intel.com>,
	"intel-gfx\@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"upstream\@semihalf.com" <upstream@semihalf.com>
Subject: Re: [PATCH v1] drm/i915/bdb: Fix version check
Date: Tue, 21 Sep 2021 13:27:32 +0300	[thread overview]
Message-ID: <87bl4mte97.fsf@intel.com> (raw)
In-Reply-To: <CAOs-w0J8pd-CE1iu1Bpy-3R20sxa=AJuSQwiRkyrFz0TFLBL4Q@mail.gmail.com>

On Tue, 21 Sep 2021, Radosław Biernacki <rad@semihalf.com> wrote:
> - dropping stable
>
> ...
>
>> > diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > index 330077c2e588..fff456bf8783 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > +++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
>> > @@ -814,6 +814,11 @@ struct lfp_brightness_level {
>> >       u16 reserved;
>> >  } __packed;
>> >
>> > +/*
>> > + * Changing struct bdb_lfp_backlight_data might affect its
>> > + * size comparation to the value hold in BDB.
>> > + * (e.g. in parse_lfp_backlight())
>> > + */
>>
>> This is true for all the blocks so I don't think we need this comment.
>
> Lack of such comment was probable cause of this overlook.
> As this is an example of the consequence (bricking platforms dependent
> on mentioned conditions) IMO we need some comment here, or this will
> probably happen again.

The whole file is full of __packed structs with the sole purpose of
parsing VBT data in memory. People are generally well aware of the
consequences of changing the size, and this is the only such mistake I
can recall.

BR,
Jani.


>
>
>>
>> >  struct bdb_lfp_backlight_data {
>> >       u8 entry_size;
>> >       struct lfp_backlight_data_entry data[16];
>>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2021-09-21 10:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 14:11 [Intel-gfx] [PATCH v1] drm/i915/bdb: Fix version check Lukasz Majczak
2021-09-20 14:11 ` Lukasz Majczak
2021-09-20 16:55 ` [Intel-gfx] " Jani Nikula
2021-09-20 16:55   ` Jani Nikula
2021-09-20 20:47 ` [Intel-gfx] " Souza, Jose
2021-09-20 20:47   ` Souza, Jose
2021-09-21  9:01   ` [Intel-gfx] " Lukasz Majczak
2021-09-21  9:01     ` Lukasz Majczak
2021-09-21 10:15   ` [Intel-gfx] " Radosław Biernacki
2021-09-21 10:15     ` Radosław Biernacki
2021-09-21 10:27     ` Jani Nikula [this message]
2021-09-21 10:27       ` Jani Nikula
2021-09-20 21:57 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork

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=87bl4mte97.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=jose.souza@intel.com \
    --cc=lma@semihalf.com \
    --cc=rad@semihalf.com \
    --cc=shawn.c.lee@intel.com \
    --cc=upstream@semihalf.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.