From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: David Howells In-Reply-To: References: <1514026525-32538-1-git-send-email-xieyisheng1@huawei.com> <20171223134831.GB10103@kroah.com> To: Arnd Bergmann Cc: dhowells@redhat.com, christophe.leroy@c-s.fr, Guenter Roeck , Greg KH , Yisheng Xie , Linux Kernel Mailing List , ysxie@foxmail.com, Ulf Hansson , linux-mmc , Boris Brezillon , Richard Weinberger , Marek Vasut , Cyrille Pitchen , linux-mtd , alsa-devel@alsa-project.org, Wim Van Sebroeck , linux-watchdog@vger.kernel.org, Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, Ralf Baechle , linux-mips@linux-mips.org, Liam Girdwood , Mark Brown , Thomas Gleixner , Jason Cooper , Marc Zyngier , Andy Shevchenko , industrypack-devel@lists.sourceforge.net, wg@grandegger.com, mkl@pengutronix.de, linux-can@vger.kernel.org, Mauro Carvalho Chehab , Linux Media Mailing List , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, Daniel Vetter , Jani Nikula , Sean Paul , David Airlie , dri-devel , Kalle Valo , linux-wireless , linux-spi , Tejun Heo , IDE-ML , Bjorn Helgaas , linux-pci , devel@driverdev.osuosl.org, Darren Hart , Andy Shevchenko , Platform Driver , Jakub Kicinski , David Miller , nios2-dev@lists.rocketboards.org, Networking , Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, Jiri Slaby Subject: Re: [PATCH v3 00/27] kill devm_ioremap_nocache MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 04 Jan 2018 14:52:54 +0000 Message-ID: <20289.1515077574@warthog.procyon.org.uk> List-ID: Arnd Bergmann wrote: > - mn10300 appears to be wrong, broken by David Howells in > commit 83c2dc15ce82 ("MN10300: Handle cacheable PCI regions > in pci_iomap()") for any driver calling ioremap() by to get uncached > memory, It's not clear what the right thing to do was, given that there's an ioremap() and an ioremap_uncached(). But the asb2305's pci_iomap() will use ioremap() (the cacheable window) if IORESOURCE_CACHEABLE is set, but IORESOURCE_IO is not and ioremap_uncached() otherwise. The other supported units don't have PCI buses. > if I understand the comment for commit 34f1bdee1910 ("mn10300: switch to > GENERIC_PCI_IOMAP") correctly: it seems that PCI addresses include the > 'uncached' bit by default to get the right behavior, but dropping that bit > breaks it. Not exactly. The CPU has a window in the range 0xa0000000-0xbfffffff which is an uncached view of its hardware buses. It has another window in the range 0x80000000-0x9fffffff which is a cached view of that region. These windows cannot be changed and addresses above 0x80000000 are statically mapped and are only accessible by the kernel (this is hardwired in the MMU). So the arch has two subwindows to the PCI bus, one cached and one uncached. These subwindows are further subdivided into ioport and iomem spaces, an SRAM and some control registers for the CPU-PCI bridge. David