From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbeAWM6L convert rfc822-to-8bit (ORCPT ); Tue, 23 Jan 2018 07:58:11 -0500 Received: from ozlabs.org ([103.22.144.67]:46965 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbeAWM6J (ORCPT ); Tue, 23 Jan 2018 07:58:09 -0500 From: Michael Ellerman To: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , linux-kernel@vger.kernel.org Cc: Tom Lendacky , Brijesh Singh , devicetree@vger.kernel.org, Albert Herranz , Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , linux-gpio@vger.kernel.org, Thomas Gleixner , Borislav Petkov , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 1/6] resource: Extend the PPC32 reserved memory hack In-Reply-To: <20180122050411.32460-2-j.neuschaefer@gmx.net> References: <20180122050411.32460-1-j.neuschaefer@gmx.net> <20180122050411.32460-2-j.neuschaefer@gmx.net> Date: Tue, 23 Jan 2018 23:58:06 +1100 Message-ID: <871sigwx41.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jonathan Neuschäfer writes: > On the Nintendo Wii, there are two ranges of physical memory, and MMIO > in between, but Linux on ppc32 doesn't support discontiguous memory. > Therefore a hack was introduced in commit c5df7f775148 ("powerpc: allow > ioremap within reserved memory regions") and commit de32400dd26e ("wii: > use both mem1 and mem2 as ram"): > > - Treat the area from the start of the first memory area (MEM1) to the > end of the second (MEM2) as one big memory area, but mark the part > that doesn't belong to MEM1 or MEM2 as reserved. > - Only on the Wii, allow ioremap to be used on reserved memory. > > This hack, however, doesn't account for the "resource"-based API in > kernel/resource.c, because __request_region performs its own checks. > > Extend the hack to kernel/resource.c, to allow more drivers to allocate > their MMIO regions on the Wii. Hi Jonathan, Sorry but I can't merge a hack like this in generic code. Has anyone looked at adding proper discontig mem support to PPC32? Or can we punch a hole in the resource in the right place? Maybe from add_system_ram_resources() ? cheers