From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA78918654 for ; Wed, 20 Sep 2023 11:48:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CFC7C433C7; Wed, 20 Sep 2023 11:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695210496; bh=PG6nDG4Y/ud0dPYJpDpoZNJjceS++oTpu7wRcnKfLgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7H7B3ADql/5hkZjtrKekoze0J83P/Q1c2wkXsl+KhDlMr/uiSimnVlZauS+RrJAN +UN/wciLnj/tE2BhNesvcTeyNujMeXJGO1owK6ePBDGOzLXAo/uStkOn4w1awB7QyJ MPWMWEr4Z3f2c2TOjQLe8Pk2hJh1eHzZWh4GawHc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marek Vasut , Jagan Teki , Sasha Levin Subject: [PATCH 6.5 066/211] drm: bridge: samsung-dsim: Drain command transfer FIFO before transfer Date: Wed, 20 Sep 2023 13:28:30 +0200 Message-ID: <20230920112847.819689875@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112845.859868994@linuxfoundation.org> References: <20230920112845.859868994@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek Vasut [ Upstream commit 14806c6415820b1c4bc317655c40784d050a2edb ] Wait until the command transfer FIFO is empty before loading in the next command. The previous behavior where the code waited until command transfer FIFO was not full suffered from transfer corruption, where the last command in the FIFO could be overwritten in case the FIFO indicates not full, but also does not have enough space to store another transfer yet. Signed-off-by: Marek Vasut Reviewed-by: Jagan Teki Tested-by: Jagan Teki # imx8mm-icore Link: https://patchwork.freedesktop.org/patch/msgid/20230615201511.565923-1-marex@denx.de Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 73ec60757dbcb..9e253af69c7a1 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1009,7 +1009,7 @@ static int samsung_dsim_wait_for_hdr_fifo(struct samsung_dsim *dsi) do { u32 reg = samsung_dsim_read(dsi, DSIM_FIFOCTRL_REG); - if (!(reg & DSIM_SFR_HEADER_FULL)) + if (reg & DSIM_SFR_HEADER_EMPTY) return 0; if (!cond_resched()) -- 2.40.1