Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2053256imu; Thu, 10 Jan 2019 07:32:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Gtf67vBUPVzQRYe0FLKlSPNz1gIAdQP2sJMrHfCAO6Oui83iTIcYu/NhnHNBTbFlINtLm X-Received: by 2002:a63:7512:: with SMTP id q18mr8990101pgc.231.1547134336534; Thu, 10 Jan 2019 07:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547134336; cv=none; d=google.com; s=arc-20160816; b=BohWtk5tJ5924OfcPG/QmN3aD0lQZ8Vfyoyu4RB+3hud3PGgtAyDjbXXY84UQf4VYq QUAx2CRFwp/jyMyDpCanID4tEjzH6mdcpkrhqIW2zHmthd2A7XZDuuVAWtuSffZu9wmx 8fg9uiZKjErtFwfl5EYqmJDAuhU1BW7ttDClUdhii5J3evwNlFbpNJfyXWcarHJJxQ+J Ml56kdAyo1jBqhlM8n1fu2lOXZXdEnTr93WudMpanDDpkQgvSGf/9rw9zYaqtaWJRWEy godlag91BK5jdvJ70tL9DItCs/2QDnvzNMuo4v7XDo26AP8UVuoYU5m6z04vMKt63k/5 KvEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=u3sUVqjTYuEfZ0fP3fDZdC4uatcDiO5RYNUqGo1Ojjs=; b=TdpgoVxArcMSic1iev7yG0MmTak/86Mq8smRykReLJ3c08B6ZKHSKravFkoYiTaQ+c F0wrujfUknnCkNj3psYnQUds2zsbXZXd+ypceAG5vZs7ig4c13sgMyXrTAVBzuf4yUS5 MchzVVCiZMpoLjfBQSbQkMZopCl1RF0tdTZMmbCjzcB+W+CttsMcFZGMxsDY4fNzszAp r8O2gekoLC1O1Q+zUbco1b8ghYbAx1AmSRT3pQUlzvsGw+1r6a8B+Eqidhtof+ohH3qk NZJmyBTe3FT02TJlvHY/2UxZeHodozPk4O2S1/Gy0alRVEyTR1VNLC87Gf0MsMdhT4mC j8dw== 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 j24si4760222pgh.362.2019.01.10.07.32.01; Thu, 10 Jan 2019 07:32:16 -0800 (PST) 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 S1729709AbfAJP3H (ORCPT + 99 others); Thu, 10 Jan 2019 10:29:07 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:35246 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729143AbfAJP3H (ORCPT ); Thu, 10 Jan 2019 10:29:07 -0500 Received: (qmail 2331 invoked by uid 2102); 10 Jan 2019 10:29:06 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Jan 2019 10:29:06 -0500 Date: Thu, 10 Jan 2019 10:29:06 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ran Wang cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/3] usb: ehci: fsl: Update register accessing for arm/arm64 platforms In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Jan 2019, Ran Wang wrote: > Hi Alan, > > > -----Original Message----- > > From: Alan Stern > > Sent: Wednesday, January 09, 2019 23:14 > > To: Ran Wang > > Cc: Greg Kroah-Hartman ; linux- > > usb@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: RE: [PATCH 2/3] usb: ehci: fsl: Update register accessing for > > arm/arm64 platforms > > > > On Wed, 9 Jan 2019, Ran Wang wrote: > > > > > > Why do you change this writel() into iowrite32be() but leave other > > > > instances of writel() unchanged? Was this a mistake? > > > > > > Yes, I didn't notice there are other writel() used in this file. > > > However, as I know, on both powerpc and arm SoC, EHCI FSL IP's memory > > > mapped register block is always Big-endian, so I'd like to replace all > > > writel() with iowrite32be() in this file. Is it necessary? > > > > > > Or I just replace them with ehci_writel() and select > > CONFIG_USB_EHCI_BIG_ENDIAN_MMIO? > > > > That should work okay. ehci_fsl_setup() sets ehci->big_endian_desc and > > ehci->big_endian_mmio according to the platform data, so you just have > > to make sure the platform data is initialized correctly. > > > OK, so I should not change writel() into iowrite32be() at that > place you mentioned, and still using iowrite32be()/ioread32be() to replace > clrsetbits_be32(), am I right? Actually, I think it would be good to use ehci_writel() and ehci_readl() everywhere except in fsl_ehci_drv_probe(). But if you prefer to use iowrite32be() and ioread32be() instead, that's probably okay. (However, it won't work if anyone ever produces a little-endian version of the IP.) Alan Stern