From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBosdOxSHn/tnu/rjUPFPka6ySbpMKWpKWaSrX0ryRmKF68SWLPtJEyjq7A5yNQ1/pP4dn4Y9 ARC-Seal: i=1; a=rsa-sha256; t=1515077595; cv=none; d=google.com; s=arc-20160816; b=UXtZWRf4ADOGOECAZjPF1AS9N7icKPsanUsBnQCFqYp38vXExPb70cDkCP7z2bdDsZ j+81lV4v7ST/ruG4olsorhJV/dfiT2CPf/PpybhdpYrywvTUthE1BGdMajo/j1vrzh3i mwQLF8m9jx+riPpoSyDk7l+9ykuOnYi34Rx3MDup0V5VSJGdS2m334KGsaFgp3d4q1Pv lk9HCJeRf7Hx5PRDNi7su1GKx7JgGBCi7UbRMLOPU53Kf9LNQ69ldEnab9KiqzJr5Kbz 0+Hxrke4CH296nSt2ErX/lgQQcVfi7CATJjsrVangZ+ez6paH9XVG1E2F8nhX8hHvDD9 krXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:subject:cc:to:references :in-reply-to:from:organization:arc-authentication-results; bh=wKYfqzVVrvKSQFRG1vF9B9pDrwwMIBDJZ9xqucuzExc=; b=gnT42tpAksVoHtp43nUSdDFZgtvgF9KHsMudx0kGPSOSpUqo981IoPnA4YhCCwZZYB QJ6NefaepTGuBAHwEjjM4s37vXCkOwrfbPviIvZfvWB5MzIDXTqRUlhSv6MD56HLPCk3 kwnCCfB5Hx9hxX6jeXJiZov0V4T32bnK7JKPkrAPpRUDiJsi6U9PJZzJWyqJwjLLMGva 8n9daoVzxxq4f1bqNN8XhEKagmWXPJ9Lr/fH2KQB8I7Y+kTZOOyerTnofrFKwReduozD Q9qSokLe7QzXVOtddLGZWnmPEAgDHv9dc/1EYg2R4nNDHStBc4yGvPm5/dHDf+EfsZVm mzKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dhowells@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of dhowells@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 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" Content-ID: <20288.1515077574.1@warthog.procyon.org.uk> Date: Thu, 04 Jan 2018 14:52:54 +0000 Message-ID: <20289.1515077574@warthog.procyon.org.uk> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1587572489007126740?= X-GMAIL-MSGID: =?utf-8?q?1588674004817399994?= X-Mailing-List: linux-kernel@vger.kernel.org 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