From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698AbcAIC3l (ORCPT ); Fri, 8 Jan 2016 21:29:41 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:34986 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753659AbcAIC3j (ORCPT ); Fri, 8 Jan 2016 21:29:39 -0500 Date: Sat, 9 Jan 2016 02:12:04 +0000 (GMT) From: "Maciej W. Rozycki" To: =?ISO-8859-2?Q?Rafa=B3_Mi=B3ecki?= cc: Brian Norris , Javier Martinez Canillas , Linux Kernel Mailing List , Fengguang Wu , Michael Ellerman , Luis de Bethencourt , Jeremy Kerr , Neelesh Gupta , "linux-mtd@lists.infradead.org" , David Woodhouse , Cyril Bur Subject: Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR() In-Reply-To: Message-ID: References: <1444813494-14985-1-git-send-email-javier@osg.samsung.com> <20151104185341.GN7274@google.com> <20160107230513.GL109450@google.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Jan 2016, Rafał Miłecki wrote: > >> > This removes some (implicit) MIPS dependencies and makes the code more > >> > portable, whether we need it or not :) > >> > >> So now we have following forwardtrace: > >> devm_ioremap_nocache > >> ioremap_nocache > >> __ioremap_mode > >> __ioremap > >> CKSEG1ADDR > >> > >> It results in different address than KSEG0ADDR: > >> [ 1.339752] [bcm47xxsflash_bcma_probe] KSEG0ADDR(BCMA_SOC_FLASH2):9c000000 > >> [ 1.346848] [bcm47xxsflash_bcma_probe] devm_ioremap_nocache:bc000000 > >> > >> But it still works as expected! :) > >> [ 1.609426] 6 bcm47xxpart partitions found on MTD device bcm47xxsflash > >> [ 1.616169] Creating 6 MTD partitions on "bcm47xxsflash": > > > > It is a functional change though and I think the change from a cached to > > uncached mapping (i.e. from `ioremap' to `ioremap_nocache') has to be a > > separate patch, so that both changes can be reviewed independently. > > We didn't switch from 'ioremap' but from KSEG0ADDR. What exactly > should be a separated patch? See my other reply -- KSEG0ADDR (cached mapping) corresponds to `ioremap_cache', whereas `ioremap_nocache' (or its generic `ioremap_uc' alias) or plain `ioremap' correspond to KSEG1ADDR (uncached mapping). Consequently a change that switches from KSEG0ADDR to `ioremap_nocache' or `ioremap' includes a functional change along a build error (portability) fix. Therefore such a change has to be split into two, so that the functional change can be reviewed separately from the portability fix. Maciej