Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbeAESEF (ORCPT + 1 other); Fri, 5 Jan 2018 13:04:05 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:51468 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbeAESEE (ORCPT ); Fri, 5 Jan 2018 13:04:04 -0500 Date: Fri, 05 Jan 2018 19:03:52 +0100 From: Paul Cercueil Subject: Re: [PATCH v5 13/15] MIPS: JZ4770: Workaround for corrupted DMA transfers To: PrasannaKumar Muralidharan Cc: Ralf Baechle , Maarten ter Huurne , devicetree@vger.kernel.org, open list , linux-mips@linux-mips.org, linux-clk@vger.kernel.org Message-Id: <1515175432.2058.0@smtp.crapouillou.net> In-Reply-To: References: <20180102150848.11314-1-paul@crapouillou.net> <20180102150848.11314-13-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi, Hi, >> [...] >> >> +/* >> + * We have seen MMC DMA transfers read corrupted data from SDRAM >> when a burst >> + * interval ends at physical address 0x10000000. To avoid this >> problem, we >> + * remove the final page of low memory from the memory map. >> + */ >> +void __init jz4770_reserve_unsafe_for_dma(void) >> +{ >> + int i; >> + >> + for (i = 0; i < boot_mem_map.nr_map; i++) { >> + struct boot_mem_map_entry *entry = boot_mem_map.map >> + i; >> + >> + if (entry->type != BOOT_MEM_RAM) >> + continue; >> + >> + if (entry->addr + entry->size != 0x10000000) >> + continue; >> + >> + entry->size -= PAGE_SIZE; >> + break; >> + } >> +} >> + > > Just a wild idea (probably bad too). Changing the memory node in the > device tree to skip this physical address would work I think. What is > your opinion about that? I guess it would work as well, but I don't think this fix should be in devicetree. -Paul