Received: by 10.192.165.148 with SMTP id m20csp351300imm; Wed, 2 May 2018 01:08:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6TF8ocbTBZi7fzOw7lfKP7t+dShEGM1XeVO2Nl4bQH05JBSNmAgVqj0e3S8T3aa7KB6bl X-Received: by 2002:a17:902:a986:: with SMTP id bh6-v6mr13203566plb.245.1525248495719; Wed, 02 May 2018 01:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525248495; cv=none; d=google.com; s=arc-20160816; b=SxdPMf5yEYmvAJLGzpW+0mg8tFZhdrGuUJiCz1bAfJ8ZEykVAwFAdJ+6XlJMhjE7JP WQPfJg2IcxkDLjci53s4m8/ARZu9EFfCBV2Ck1FPI/UVDpLY+nKakZ9wo5+c7lamBD9K 2daTHaAqsk15NZc9k5TlikeVh67xIbrgLqvBSt59PvfgnWHGjOddHw0RrBfQ+el4jToS 44J5BHV6LSMQ3059o4Xb0+viJXUG74L8m7pK17kd0SQGHdf1SbOsd+aGZW9m/XhY6zN8 ZHYE+qdnP/8ZaY1+TICrtSDahBc641GogNczipsz0hpF7wCDEqmHJOtR0iyXqiOUuPI2 txDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=d+4I+UhH6klwSCXZh0Um1M4hQ8JC/B0ljM4vNQtnaiE=; b=IAgumwmsoBHo9MUVwiDadzjv/V8O+lgX2IKXx1zbzYPRSG0r0nNOlo+jK/InGxTxLw ayMm6qv8Q+ynRCcfIaz1QzgJfRNxmNaKSsd2qFXpfiSIxG8rGLVQ8m4BK1kgn1ttI9X2 JmAxvuhtUgXGfIOapQMa50KwWb/rhAEhmZEoEpEsoo5n035G6Ctnva6FfDB4LFEUPc0W tG4VGsJnGT4uMM29av3gSZjUBcu8FLlz85XWGxLVEhV5Hhv15ujgUmaB9f2RY5hgc3kk iUgInOWQKlHo9OBgmm6qJNG2Ixq0mSopDasJUSaCoiTF9jV7Xmi7lb4TiOsXmtHaKyuc L3DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j123si10906089pfg.156.2018.05.02.01.08.01; Wed, 02 May 2018 01:08:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbeEBIGm (ORCPT + 99 others); Wed, 2 May 2018 04:06:42 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:48490 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbeEBIGj (ORCPT ); Wed, 2 May 2018 04:06:39 -0400 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990404AbeEBIGhPmv6U (ORCPT ); Wed, 2 May 2018 10:06:37 +0200 Date: Wed, 2 May 2018 10:06:36 +0200 From: Ladislav Michl To: Boris Brezillon Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Boris Brezillon , Peter Ujfalusi , Roger Quadros , Aaro Koskinen , Tony Lindgren , "H. Nikolaus Schaller" , Andreas Kemnade Subject: Re: [PATCH v2] mtd: onenand: omap2: Disable DMA for HIGHMEM buffers Message-ID: <20180502080636.GA2124@lenoch> References: <20180416065256.GA24455@lenoch> <20180420220134.3021860f@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180420220134.3021860f@bbrezillon> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, (and apologies for delay) On Fri, Apr 20, 2018 at 10:01:34PM +0200, Boris Brezillon wrote: > Hi Ladislav, > > On Mon, 16 Apr 2018 08:52:59 +0200 > Ladislav Michl wrote: > > > dma_map_single doesn't get the proper DMA address for vmalloced area, > > That's not true, it returns the right DMA (physical) address, it's just > that: To be honest I used log message from commit dcf08227e964 which is dealing with the same issue. > 1/ the memory location is not necessarily physically contiguous > 2/ in case your arch is VIVT ot VIPT, there may be several entries in > the cache pointing to the same physical location, and the cache > maintenance operations done by dma_map_single() will only operate on > one of these entries. Well, there are few things suspicious here: DMA is used to transfer data to system memory from bufferram which is 3kB in size. Nikolaus reported Internal error: Oops: 805 [#1] PREEMPT SMP ARM PC is at v7_dma_inv_range+0x30/0x48 LR is at dma_cache_maint_page+0xd0/0xe0 but I do not see how could it happen if it would be caused by 1/ or 2/ above. Cache issue would cause data inconsistencies which should be caught by upper MTD layers. And given that replacing dma_map_single with dma_map_page done in first version of patch also fixed oops, it is not caused by 1/ CPU is OMAP3630 based on Cortex-A8, D-cache is often described as PIPT but seems to be VIPT with built-in alias detection mechanism - anyone with better knowledge will eventually correct me, thank you. > > so disable DMA in this case. > > > > The fix looks good though. Can you rephrase your commit message to make > it clearer. Sure, I'd like to, but I do not know what's root cause yet :) > Thanks, > > Boris Best regards, ladis