public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Robin Gong <yibin.gong@nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dmaengine: imx-sdma: fix init of uart scripts
Date: Mon, 11 Apr 2022 16:18:16 +0530	[thread overview]
Message-ID: <YlQHcAwd1DUGJGgz@matsya> (raw)
In-Reply-To: <20220410223118.15086-1-kgroeneveld@lenbrook.com>

On 10-04-22, 18:31, Kevin Groeneveld wrote:
> Commit b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") broke
> uart rx on imx5 when using sdma firmware from older Freescale 2.6.35
> kernel. In this case reading addr->uartXX_2_mcu_addr was going out of
> bounds of the firmware memory and corrupting the uart script addresses.
> 
> Simply adding a bounds check before accessing addr->uartXX_2_mcu_addr
> does not work as the uartXX_2_mcu_addr members are now beyond the size
> of the older firmware and the uart addresses would never be populated
> in that case. There are other ways to fix this but overall the logic
> seems clearer to me to revert the uartXX_2_mcu_ram_addr structure
> entries back to uartXX_2_mcu_addr, change the newer entries to
> uartXX_2_mcu_rom_addr and update the logic accordingly.
> 
> I have tested this patch on:
> 1. An i.MX53 system with sdma firmware from Freescale 2.6.35 kernel.
>    Without this patch uart rx is broken in this scenario, with the
>    patch uart rx is restored.
> 2. An i.MX6D system with no external sdma firmware. uart is okay with
>    or without this patch.
> 3. An i.MX8MM system using current sdma-imx7d.bin firmware from
>    linux-firmware. uart is okay with or without this patch and I
>    confirmed the rom version of the uart script is being used which was
>    the intention and reason for commit b98ce2f4e32b ("dmaengine:
>    imx-sdma: add uart rom script") in the first place.

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-04-11 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 22:31 [PATCH v2] dmaengine: imx-sdma: fix init of uart scripts Kevin Groeneveld
2022-04-11 10:48 ` Vinod Koul [this message]

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=YlQHcAwd1DUGJGgz@matsya \
    --to=vkoul@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kgroeneveld@lenbrook.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=yibin.gong@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox