Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1370405
| Path | csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Brian Norris <computersforpeace@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2] mtd: bcm47xxsflash: use ioremap_cache() instead of KSEG0ADDR() |
| Date | Mon, 04 Apr 2016 09:20:02 +0200 |
| Message-ID | <rk6XM-82e-5@gated-at.bofh.it> (permalink) |
| References | <qRJHA-3tz-15@gated-at.bofh.it> <r6ohS-1Wt-73@gated-at.bofh.it> <r98JA-6FF-15@gated-at.bofh.it> <re0Lo-4Z2-17@gated-at.bofh.it> |
| X-Original-To | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=0nhnD+gssGo/MCJvb66RSI2EAvJr3h93CcZS6tcD1vA=; b=YMRn0fzoZ+LfMBp5KSFhSMf4lEJwTY4n3SAd0oD5zER5ZtUuU5t7dEMf/gnlIfar3G by6Zzr/wciBTbnghYj1pynGgB6WoFhVs0s+hr/yKLdvdkUcSdMUvxp/gNJIzXmCn/HiT 4Vh9U+I9L2AxnyQ6dOiN4YaCeSVM7ZTD2j/dUWnAkPBY/v7OTHBqQrNIinnmzsPjCeou EOT6dUekV/L1b2kY4ESMhWmyoQ4EdO3/xlsEMCY9QMq7FcZ7udXTdNAuLMpvA2aEWTaB tHS3Z8VTsn3l4DvEedMIqS8Dy/KNdZ43OihbyhlbOKPtGj+meh9jH6gP1mVHmpi3r/BZ OFBQ== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=0nhnD+gssGo/MCJvb66RSI2EAvJr3h93CcZS6tcD1vA=; b=bo3JUhVCiHWcFTYPYkwEedIBvtllaOgmjPHfPeHDAQWJUM4nHWbi1AjDJh/4T6cDaQ 49cJIfshDhEH6XqYuH/DhLRSozIyiL97b2sGiHgRf6t78/B2RmXMhOnorysnhIL/Wt42 2Q/oBQ2IPIYfn6E8VgwhgabuusG5hpQJkgqdy2BFjSvotuKtZqIV85C+LVEs+PqpLfAw Usuo8tPSd4LCp3VKOMDAiWBAiXdV4pWajw4dAivrJ+v8AbXK4Jh//wjw2nAgS0U4vp1E TAnXkSkJRj63LYQ3KcMTp7nKcBrDt42Kv0ol53NXuqePBstriDNRI2eMrbvc5joeRC3R mNZA== |
| X-Gm-Message-State | AD7BkJKZ877C4HNtfUrL0B9M3DsWjcB6JuKAaPYxCQcgC3Aj0L2CqzZrvE1Xmsm/fqD0Lw== |
| X-Received | by 10.98.18.212 with SMTP id 81mr18617311pfs.104.1459753802116; Mon, 04 Apr 2016 00:10:02 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Disposition | inline |
| Content-Transfer-Encoding | 8bit |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 52 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Rafał Miłecki <zajec5@gmail.com>, linux-mtd@lists.infradead.org, "Maciej W. Rozycki" <macro@linux-mips.org>, Javier Martinez Canillas <javier@osg.samsung.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Fengguang Wu <fengguang.wu@intel.com>, Michael Ellerman <mpe@ellerman.id.au>, Luis de Bethencourt <luisbg@osg.samsung.com>, Jeremy Kerr <jk@ozlabs.org>, Neelesh Gupta <neelegup@linux.vnet.ibm.com>, David Woodhouse <dwmw2@infradead.org>, Cyril Bur <cyrilbur@gmail.com>, Ralf Baechle <ralf@linux-mips.org>, Hauke Mehrtens <hauke@hauke-m.de>, Dan Williams <dan.j.williams@intel.com> |
| X-Original-Date | Mon, 4 Apr 2016 00:09:58 -0700 |
| X-Original-Message-ID | <20160404070958.GF13995@localhost> |
| X-Original-References | <1452991370-20121-1-git-send-email-zajec5@gmail.com> <1456483828-5583-1-git-send-email-zajec5@gmail.com> <20160305005459.GH55664@google.com> <CAKv+Gu8UAugShB0jR_D_2kqwbPsG6KTSaha9auUTC_QgfCry3Q@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1370405 |
Show key headers only | View raw
On Fri, Mar 18, 2016 at 12:22:05PM +0100, Ard Biesheuvel wrote:
> On 5 March 2016 at 01:54, Brian Norris <computersforpeace@gmail.com> wrote:
> > + others
> >
> > On Fri, Feb 26, 2016 at 11:50:28AM +0100, Rafał Miłecki wrote:
> >> From: Brian Norris <computersforpeace@gmail.com>
> >>
> >> Using KSEG0ADDR makes code highly MIPS dependent and not portable.
> >> Thanks to the fix a68f376 ("MIPS: io.h: Define `ioremap_cache'") we can
> >> use ioremap_cache which is generic and supported on MIPS as well now.
> >>
> >> KSEG0ADDR was translating 0x1c000000 into 0x9c000000. With ioremap_cache
> >> we use MIPS's __ioremap (and then remap_area_pages). This results in
> >> different address (e.g. 0xc0080000) but it still should be cached as
> >> expected and it was successfully tested with BCM47186B0.
> >>
> >> Other than that drivers/bcma/driver_chipcommon_sflash.c nicely setups a
> >> struct resource for access window, but we wren't using it. Use it now
> >> and drop duplicated info.
> >>
> >> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> >> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> >> ---
> >> V2:
> >> 1) Use ioremap_cache as we already have commit a68f376 in l2-mtd
> >> 2) Add iounmap to the error path
> >> 3) Update commit message
> >
> > Hmm, I'm a bit out of the loop on some things here, but it looks like
> > ioremap_cache() is going away. See kernel/memremap.c:
> >
> > /* temporary while we convert existing ioremap_cache users to memremap */
> > __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
> >
> > Are we supposed to move to using memremap() here? (If so,
> > devm_memremap() can help us.)
> >
>
> I don't think that ioremap_cache() necessarily has to go away, but
> what we do need to address is its abuse to map things like firmware
> tables that reside in normal memory that may not be owned/tracked by
> the kernel. So for that case, we now have memremap() which should just
> give you a mapping of the requested region, either via the linear
> mapping if it happens to be mapped already, or via the vmalloc region
> if it is highmem or otherwise unavailable directly.
>
> However, memory mapped NOR flash remains a special case, since the
> __iomem annotation may or may not be appropriate depending on context
> (i.e., reads and writes may both have either memory or strongly
> ordered semantics)
OK, pushed to l2-mtd.git.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH V2] mtd: bcm47xxsflash: use ioremap_cache() instead of KSEG0ADDR() Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-03-18 12:30 +0100 Re: [PATCH V2] mtd: bcm47xxsflash: use ioremap_cache() instead of KSEG0ADDR() Brian Norris <computersforpeace@gmail.com> - 2016-04-04 09:20 +0200
csiph-web