Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1966722imm; Fri, 7 Sep 2018 08:48:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYP7on1nUdwBiba+4bYb1QD9nkp4ftBmy4f3/hV8Seqzp2U1EDTHq96M8V42Us6jE/ML6UH X-Received: by 2002:a63:7557:: with SMTP id f23-v6mr8844656pgn.135.1536335338542; Fri, 07 Sep 2018 08:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536335338; cv=none; d=google.com; s=arc-20160816; b=QlWRRMSn15yg3/acipDX/yADEzbhAeAZhsG9ilwTKNK2nxntqmikUUPzvk1RzHQToJ v1RwaEHjcNCEtETWzqD77PjP3VG04LVqJbbX/K+USU/d+7VHeX8ZBFhtO4uP6yPq2Aii uQYVnl9fjKs8OE2DpwMsKzrpOlInjwelIepxwszLgryq18tFzRSY0KL+SKk9vfI7zC8N TyxG0Aq+F/31MYxdrV5b/hMHSniG9hmhV0zBImg+8qtMwCuVowRX9Tm1xvyCnhZN9wCx yoLZZgRjCJg939sb83bhoOwxQOZ7MSJ7RqWZQRhTr1+kFXwVdPqa3nvt6utTfeMd7/zo /+Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Z0evgYeo5X3sJ0ABpw9Rh8HyzhNeb4D+zN5TZKbuCeE=; b=liF3y92Mulj9bKA7C+HDB8S4qu/uvim1qRs4jUkm2OvaNMLToGkhKGrDIu8cnWupZW R13vfCXrKeytHCddirHLKypavb26s1J5jsyoXsJGL6LycR44hoMgDIBT/7RkStGshvMs 5FZnbYmx94NYkzT+/8TO6uy1g0EY5ijFVv+s+m5FShqaN09T/saWVzIvE4tZndr/6QnF eilQ31NgQRhLhDksCeMgRghkC/bDVSWOC3qDR+L+FgpX5FmvdFFrjPN6q8rYz4nUaz6u 7p96ZiF9YiETFERLtMVWnzdbqgfiElzjLVJhNyusCklWAI+N7dDWWulHv4s+INDwSKQm RFGw== 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 c12-v6si8442893plz.456.2018.09.07.08.48.43; Fri, 07 Sep 2018 08:48:58 -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 S1728338AbeIGSzB (ORCPT + 99 others); Fri, 7 Sep 2018 14:55:01 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:38550 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727601AbeIGSzB (ORCPT ); Fri, 7 Sep 2018 14:55:01 -0400 Received: by mail-qt0-f195.google.com with SMTP id x7-v6so16342047qtk.5; Fri, 07 Sep 2018 07:13:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z0evgYeo5X3sJ0ABpw9Rh8HyzhNeb4D+zN5TZKbuCeE=; b=fOVGbWiyKd8zEv37aSvPfI4BUtC3DsBlSMLHcciBfzcwAn6UgeWd8Ly/lAAxoZv8Jn 7iq2A/+XUL3ePT4Af1O4XdgKkul4uFvi2cm1K8uYWEbW6FfnKNtMss9KSlWlhIYK8zQy QsVsfMcUyu6NDTwIwf6X6h7tv3+Nzy7XAiIq8heDHilgWmC6jTAHONmZzB1dRW+DQCdD Y7IWkN9x4SjmtQeZmT4vqZkrZ4b6BTC77ZanUz9PkWb6Ne7kLa+PYKdopRITdHup0aue xM3SXjQO6GbyJBLQvxTZ0Jofj6BwrVUJNkktvYUESlXNWKLpT/FGqPbrAM5LnshDselw gsqg== X-Gm-Message-State: APzg51D3tyzcYF6zdCX7BqCQKaCZUTPokQ2gWUoTq5CweHPQSh8DQRdd IZLLo4xWihMRxXwFnBxeJR10k4Aua1mEcuQMILo= X-Received: by 2002:a0c:8b67:: with SMTP id d39-v6mr5764154qvc.180.1536329631727; Fri, 07 Sep 2018 07:13:51 -0700 (PDT) MIME-Version: 1.0 References: <16105a3e54f1c4bb65a5ec81d77af7c176e705c6.1536138304.git.ren_guo@c-sky.com> <20180907030447.GA10434@guoren-Inspiron-7460> <20180907125536.GA2308@guoren> In-Reply-To: <20180907125536.GA2308@guoren> From: Arnd Bergmann Date: Fri, 7 Sep 2018 16:13:35 +0200 Message-ID: Subject: Re: [PATCH V3 06/26] csky: Cache and TLB routines To: Guo Ren Cc: linux-arch , Linux Kernel Mailing List , Thomas Gleixner , Daniel Lezcano , Jason Cooper , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, Thomas Petazzoni , wbx@uclibc-ng.org, Greentime Hu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 7, 2018 at 2:55 PM Guo Ren wrote: > > On Fri, Sep 07, 2018 at 10:14:38AM +0200, Arnd Bergmann wrote: > > On Fri, Sep 7, 2018 at 5:04 AM Guo Ren wrote: > > > On Thu, Sep 06, 2018 at 04:31:16PM +0200, Arnd Bergmann wrote: > > Similarly, an MMIO read may be used to see if a DMA has completed > > and the device register tells you that the DMA has left the device, > > but without a barrier, the CPU may have prefetched the DMA > > data while waiting for the MMIO-read to complete. The __io_ar() > > barrier() in asm-generic/io.h prevents the compiler from reordering > > the two reads, but if an weakly ordered read (in coherent DMA buffer) > > can bypass a strongly ordered read (MMIO), then it's still still > > broken. > __io_ar() barrier()? not rmb() ?! I've defined the rmb in asm/barrier, So > I got rmb() here not barrier(). > > Only __io_br() is barrier(). Ah right, I misremembered the defaults. It's probably ok then. > > > > - How does endianess work? Are there any buses that flip bytes around > > > > when running big-endian, or do you always do that in software? > > > Currently we only support little-endian and soc will follow it. > > > > Ok, that makes it easier. If you think that you won't even need big-endian > > support in the long run, you could also remove your asm/byteorder.h > > header. If you're not sure, it doesn't hurt to keep it of course. > Em... I'm not sure, so let me keep it for a while. Ok. I think overall the trend is to be little-endian only for most architectures: powerpc64 moved from big-endian only to little-endian by default, ARM rarely uses big-endian (basically only for legacy applications ported from BE MIPS or ppc), and all new architectures we added in the last years are little-endian (OpenRISC being the main exception). Arnd