From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4399C433EF for ; Mon, 11 Apr 2022 10:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MRgjEP35xtHTh7Ef/lZ3J9rfIw4X76L0zQEHs+oJSs4=; b=3glSoJOWnGCwSA FQZP8nRzys4Nzq22wwh8iKKVUNCSE2u6jVFBzNKkvWbfsOa/BtPHUxWp86L36VgQgFGwtMknmWe+X nWJAyfkqqaII5m5UyIHZXfES5M5rIf4lYKufzB7A8yWQZ3mtlluiCum2kDM0TS1Ri/XoJIejv7mR0 t4twXBPUkiSvZfz3UK66fG3czmySjLj0N+qdoCDBFeFd2mLhqFKvZsa3qCJWb+KyGVQsWKblzHw6B u+39YFJ6qealxyj/ldQfVBlci4DpA8aOVNXwePfkQQkzD/3Ry2gX5md9Ob8Ng9kJNbXDuzrcsnlyx FdWXf1cw6wgM0ga+ORlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndrbb-008UP6-BE; Mon, 11 Apr 2022 10:49:11 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndrao-008U6d-N9 for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2022 10:48:24 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 368DD61512; Mon, 11 Apr 2022 10:48:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD17CC385A3; Mon, 11 Apr 2022 10:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649674101; bh=ZUdz7fw+5Vlb3RKQ1h6dy1j8KMKHNLEbcvkUQ62y9dU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MvHNM0g3lXNBE9kUihn7J/tLkDXOJDj5L3QqW1SCSCqaklApC1LDaHpZmmMCQ8kJ7 +m1XpCKi8FZdg+ja3B68s8m0RXwy6Qs6kkkMvUTkpQ0NW8ltkHV549/JqD6SbGphs1 aLXW1cVnF0rfODlnxPGPJl89d6CHXzs/ZsAI1Y3avgER5guSg0r4hGzKKnMD78KHgE 63v8O6X+jGnBdEEjfMGWVNm3EQn2IAJTBnudZQg2qN0j9TfRevTwJdBM5XLzL/r3np qTJaCbBdwMm54Vp8TWzwTxoTaN/PsdoxEeXRDf43TXSG/4PkbQbVzasJTRR7OqrrDT zoEDcewEIyy9A== Date: Mon, 11 Apr 2022 16:18:16 +0530 From: Vinod Koul To: Kevin Groeneveld Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Robin Gong , Lucas Stach , 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 Message-ID: References: <20220410223118.15086-1-kgroeneveld@lenbrook.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220410223118.15086-1-kgroeneveld@lenbrook.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_034822_872220_A56BF944 X-CRM114-Status: GOOD ( 18.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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