From nobody Fri Dec 19 07:48:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1680EC6FA89 for ; Tue, 13 Sep 2022 14:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232481AbiIMOOI (ORCPT ); Tue, 13 Sep 2022 10:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbiIMONW (ORCPT ); Tue, 13 Sep 2022 10:13:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DBCD5FF57; Tue, 13 Sep 2022 07:10:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2E842B80F00; Tue, 13 Sep 2022 14:10:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DEB3C433D6; Tue, 13 Sep 2022 14:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078212; bh=WFPxjJ3eyAm8L+DfVYrI91L8V/mwV4VTHN3iIzxFqtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TteNBQSa/HtoleHoAqseEcR9bvP0P/hP+qjR9AhkTRAcsZhKjlE9+PIG8DdJjk6w4 M9Q1gHLw0nJPOSsDy8sflWiNukk+PMPSLHmOcWOI1rcALdweXoPT5QGb+sDKroK5b8 8KXnRChv8FZjNhUeBYWc1zz3nnN6W5eKktxqYpnk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Jani Nikula , Rodrigo Vivi Subject: [PATCH 5.19 055/192] drm/i915/bios: Copy the whole MIPI sequence block Date: Tue, 13 Sep 2022 16:02:41 +0200 Message-Id: <20220913140412.679956915@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ville Syrj=C3=A4l=C3=A4 commit edca5a2c373db61efa959307c13ed9156b1c14d9 upstream. Turns out the MIPI sequence block version number and new block size fields are considered part of the block header and are not included in the reported new block size field itself. Bump up the block size appropriately so that we'll copy over the last five bytes of the block as well. For this particular machine those last five bytes included parts of the GPIO op for the backlight on sequence, causing the backlight no longer to turn back on: Sequence 6 - MIPI_SEQ_BACKLIGHT_ON Delay: 20000 us - GPIO index 0, number 0, set 0 (0x00) + GPIO index 1, number 70, set 1 (0x01) Cc: stable@vger.kernel.org Fixes: e163cfb4c96d ("drm/i915/bios: Make copies of VBT data blocks") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6652 Signed-off-by: Ville Syrj=C3=A4l=C3=A4 Link: https://patchwork.freedesktop.org/patch/msgid/20220829135834.8585-1-v= ille.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit a06289f3f72431f3777af95ea1226b5b0abdc426) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_bios.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -478,6 +478,13 @@ init_bdb_block(struct drm_i915_private * =20 block_size =3D get_blocksize(block); =20 + /* + * Version number and new block size are considered + * part of the header for MIPI sequenece block v3+. + */ + if (section_id =3D=3D BDB_MIPI_SEQUENCE && *(const u8 *)block >=3D 3) + block_size +=3D 5; + entry =3D kzalloc(struct_size(entry, data, max(min_size, block_size) + 3), GFP_KERNEL); if (!entry) {