From mboxrd@z Thu Jan 1 00:00:00 1970 From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni) Date: Tue, 29 Oct 2013 10:32:29 +0100 Subject: [PATCH 2/2] dma: mv_xor: Use high_base mmio where appropriate In-Reply-To: <20131029083407.GA2416@localhost> References: <1383000855-8377-1-git-send-email-ezequiel.garcia@free-electrons.com> <1383000855-8377-2-git-send-email-ezequiel.garcia@free-electrons.com> <20131029083407.GA2416@localhost> Message-ID: <20131029103229.5e095a24@skate> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Dan, Ezequiel, On Tue, 29 Oct 2013 05:34:08 -0300, Ezequiel Garcia wrote: > > On Mon, Oct 28, 2013 at 3:54 PM, Ezequiel Garcia > > wrote: > > > Despite requesting two memory resources, called 'base' and 'high_base', the > > > driver uses explicitly only the former. The latter is being used implicitly > > > by addressing at offset +0x200, which in practice accesses high_base. > > > > > > Instead of relying in such trick, let's define the registers with the > > > offset from high_base, and use high_base explicitly where appropriate. > > > > > > Signed-off-by: Ezequiel Garcia > > > --- > > > drivers/dma/mv_xor.c | 3 ++- > > > drivers/dma/mv_xor.h | 25 +++++++++++++------------ > > > 2 files changed, 15 insertions(+), 13 deletions(-) > > > > Since it's unused I'd prefer a patch that just deletes xor_high_base. > > > > It's wrongly *unused*, the mmio high_base is actually being used > implicitly by always addressing at an offset that addresses +200. > > Deleting high_base would actually make it worse, for that region > will no longer be ioremaped. Maybe the commit message is not clear > about it? I agree with Ezequiel, and I believe his patch is appropriate. The registers for the XOR engines are indeed split in two areas, so it makes sense to have this xor_base / xor_high_base split that reflects the register mapping passed from the Device Tree, and use this split in the macros used to access the registers. Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com