Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1427212ybl; Sat, 10 Aug 2019 03:29:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGMdpc4148nWOpWQnSidmqNPFpSUGgpkvMW23UY5JgLnx/xqzuKLMQ4OrrcpDeed78uMvu X-Received: by 2002:a63:f048:: with SMTP id s8mr21012247pgj.26.1565432959272; Sat, 10 Aug 2019 03:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565432959; cv=none; d=google.com; s=arc-20160816; b=qwJfrlsjDpcYlYa1gr+jFu33LoACr4gDGrCopLBLwlMCWXYxbZ9RUH7vyN9Dnku79u knf2ZZgLPubKyZECk8zotM7Xu24FjoEMICTKSnuFHry/a5i5bSAQj+/eOrNIAFUSRaPG n47rMY17FhHKJ2/HFopQDOp2l7Xb4tA3U+VnGFtbpSacW5wOSO5DDqW3WV/n5q2OC2SZ bQI46iQmMtimEb1900bbIR9MgN/D3ZD31b8JgJYbWlCYhAx2jcBb6al5R7DTLOuHn6i6 okSuKf+JljC6a1X6+/yQzCFiDWFp3Ic4tZh+wRDmK20AhSYeVNHLm31u9cCkjW3RiTd0 kPNA== 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:dkim-signature; bh=KlWmJ/XZlWJnVQ3DuZFsqlb7tqR57nj8nY1TzMTzeEM=; b=jykOBmcJPHJvqtPdukGpoeHlVVlGF/LBWRgbViDgxwu8PeS43eAYHTyWPRElNLQghO 4ef4pn95qtq3SpdsKx+RiNuSU90mK+h+2Cj//RU1xrg5uV79F2FhA+5H9lHXcfFyVbrw I/4tPacspYVzrtQlECSpekgu6Usf/fwz2x5qN9KhZSQDcaA9meu7cH+igTrexga9pYos YhdT8dw3u8vS9HzwyJ6Xp5+T+JFtXbAVrMG8YSupNv6lyKtUKXkEz+0aVo5clKtgmDYO opr+hheESTPyaZxAWE7LR4qdu1/lkafZzZl3zBYSqY7KLfGu1w/HVVCLGoWqOUAZODCR iPvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nPLGPNaw; 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 t18si51091522plo.328.2019.08.10.03.29.01; Sat, 10 Aug 2019 03:29:19 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nPLGPNaw; 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 S1726100AbfHJK20 (ORCPT + 99 others); Sat, 10 Aug 2019 06:28:26 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57488 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbfHJK20 (ORCPT ); Sat, 10 Aug 2019 06:28:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KlWmJ/XZlWJnVQ3DuZFsqlb7tqR57nj8nY1TzMTzeEM=; b=nPLGPNawWzHcQsB51+cwTAmSS 7bkh38dfmYxojbWyaH8qidZdKJ2NKuXJILM2kRfEirMXVr0JP0rLj2ZzVgPdHhelWnYSiBme1DFs4 GnH29JnYdE5I2r/VPybHKjnjCe0r21JY/OW1dQG8CykvZSksrvPFfQdKDgKONZNHYtM1/UtZX9q88 dinPcPx0X30dwBipYzIoaLt1azYQLIkeK5Tkr/n2BTv7e7qUo7EgLuY2XEKn7OIN0EFsHT7QIL0U+ 6wd19ZnlbbpFvqCSn/394XFEEnYfLFVGaCiqrvy3RBBXsjQ6wj10O7nOqNmGtyWbU7OiR5fhUo3qx gEyVVMZBg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hwObc-0008Cz-I6; Sat, 10 Aug 2019 10:28:12 +0000 Date: Sat, 10 Aug 2019 03:28:12 -0700 From: Christoph Hellwig To: Arnd Bergmann Cc: Tony Lindgren , Aaro Koskinen , Alan Stern , Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Linus Walleij , linux-usb@vger.kernel.org, Russell King , linux-kernel@vger.kernel.org, Tomi Valkeinen , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 03/22] ARM: omap1: move omap15xx local bus handling to usb.c Message-ID: <20190810102812.GA25939@infradead.org> References: <20190808212234.2213262-1-arnd@arndb.de> <20190808212234.2213262-4-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190808212234.2213262-4-arnd@arndb.de> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for doing this! The odd platforms have always been very confusing. > diff --git a/arch/arm/mach-omap1/include/mach/omap1510.h b/arch/arm/mach-omap1/include/mach/omap1510.h > index 3d235244bf5c..7af9c0c7c5ab 100644 > --- a/arch/arm/mach-omap1/include/mach/omap1510.h > +++ b/arch/arm/mach-omap1/include/mach/omap1510.h > @@ -159,4 +159,3 @@ > #define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23) > > #endif /* __ASM_ARCH_OMAP15XX_H */ > - Spurious whitespace change? > diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c > index d8e9bbda8f7b..740c876ae46b 100644 > --- a/arch/arm/mach-omap1/usb.c > +++ b/arch/arm/mach-omap1/usb.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > > #include > > @@ -127,6 +128,7 @@ omap_otg_init(struct omap_usb_config *config) > > syscon &= ~HST_IDLE_EN; > ohci_device->dev.platform_data = config; > + > status = platform_device_register(ohci_device); Same here. > +#define OMAP1510_LB_OFFSET UL(0x30000000) > +#define OMAP1510_LB_DMA_PFN_OFFSET ((OMAP1510_LB_OFFSET - PAGE_OFFSET) >> PAGE_SHIFT) Overly long line. > +/* > + * OMAP-1510 specific Local Bus clock on/off > + */ > +static int omap_1510_local_bus_power(int on) > +{ > + if (on) { > + omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL); > + udelay(200); > + } else { > + omap_writel(0, OMAP1510_LB_MMU_CTL); > + } > + > + return 0; > +} The caller never checks the const return value, and on is always true as well. In fact it seems like omap_1510_local_bus_power and omap_1510_local_bus_init could probably just be merged into the caller. > + > +/* > + * OMAP-1510 specific Local Bus initialization > + * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE. > + * See also arch/mach-omap/memory.h for __virt_to_dma() and > + * __dma_to_virt() which need to match with the physical > + * Local Bus address below. I think that NOTE is out of date, as __virt_to_dma and __dma_to_virt don't exist anymore. > +static int omap_1510_local_bus_init(void) > +{ > + unsigned int tlb; > + unsigned long lbaddr, physaddr; > + > + omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, > + OMAP1510_LB_CLOCK_DIV); > + > + /* Configure the Local Bus MMU table */ > + for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) { > + lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET; > + physaddr = tlb * 0x00100000 + PHYS_OFFSET; > + omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H); > + omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, > + OMAP1510_LB_MMU_CAM_L); > + omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H); > + omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L); Another > 80 chars line. > + omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK); > + omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB); > + } > + > + /* Enable the walking table */ > + omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL); One more. > + udelay(200); > + > + return 0; The return value is ignored.