Received: by 10.223.176.46 with SMTP id f43csp4384430wra; Tue, 23 Jan 2018 08:39:52 -0800 (PST) X-Google-Smtp-Source: AH8x2264EZFtYCk4+jObYW+BG3GGh0Kxh6mIiQNcLBwqOB009/bI5AviLT6Ui2Xi3YUOwpEnfgV1 X-Received: by 10.36.129.130 with SMTP id q124mr4361954itd.24.1516725592608; Tue, 23 Jan 2018 08:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516725592; cv=none; d=google.com; s=arc-20160816; b=C9iJXNsTjVS6GNUqtM9wYiNe5LKHTokBs5wxrsWSagxfJkvk/TJlV2quG0u3G47iUc POH0Z+ZmXBC5SVwH2S641R0s53EWDKuSyb1OiucEzb9mPt0yPtkRK/F5fcFrk3hWyIkL 99BTtY0D1NKmmQ194al98UZyXJERNPMbkJwrjJJvauB3lKWr60S9ckMGuMJV/qirmR5V S4Esqc95hpLdJetYU0z7DDMeMVyRwYscSqlXsSQ5D21N0CHXndHzb7KH0ntiPgAxMaBs EJxhuiwLnl9oJWgXMRQp/+JpsRpc4Gark+zZ8/GeRyiwaVk8yq12r6JK6vf1PP8z+yxk yHbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ruNzCRksb+ek9dk3oKcOR5D9pOo9m7j4t3oBE9e+Qwc=; b=kI0cQJbp97+8yTpAMiOrt2Q2c2ueWgc/BUiO3JuQ74Rq7y1dSQ7ZvZLlr/MjmK9wO/ +v91ghYE8eHGICNQolpqwfkv5HGN4u2ZoXcTxWPEAJ+oKjhOY807KrSfPbxXOfY93MK6 ZJ17E9H1YvvpFnyND8K4xTnfvLjoH3JX1t38n7blYffN9cZV0zn35QgflcKAtrkYFMQI k5pOxCz4VC/fsn4KLWyGwKDMa/13DIvuBS+rcWouSnILT4b162lf6Hs/ElrHMRiLbI1b G35RhTJQVxA9WCBu6FlzAczO8CvwK4+PPnpjkE/a1Gb9iGXkbcX7d2KVH0gcyCgq/aEZ /uxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n93si15673479ioe.108.2018.01.23.08.39.39; Tue, 23 Jan 2018 08:39:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbeAWQiB (ORCPT + 99 others); Tue, 23 Jan 2018 11:38:01 -0500 Received: from mout.gmx.net ([212.227.15.19]:51431 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbeAWQh4 (ORCPT ); Tue, 23 Jan 2018 11:37:56 -0500 Received: from latitude ([88.153.6.18]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MKqOW-1ee1Zt0VIe-0001rW; Tue, 23 Jan 2018 17:37:41 +0100 Date: Tue, 23 Jan 2018 17:37:39 +0100 From: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= To: Michael Ellerman Cc: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , linux-kernel@vger.kernel.org, Tom Lendacky , Brijesh Singh , devicetree@vger.kernel.org, Albert Herranz , 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 Message-ID: <20180123163739.2sxhzavghzgbjw4c@latitude> References: <20180122050411.32460-1-j.neuschaefer@gmx.net> <20180122050411.32460-2-j.neuschaefer@gmx.net> <871sigwx41.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n5tgjbf2wsepvrep" Content-Disposition: inline In-Reply-To: <871sigwx41.fsf@concordia.ellerman.id.au> User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K0:J9JCREYFWnR45y5MlOoaAWRUKI088zdA2WFidS26m6yhLbrPbA6 13JBjno3M9p1vJbzipsb4XHN2AoglyQRPSxdTrvnu13j/2e7ubrR7bEyDGA9z61HyXc0lOV v3gnki1s6LldxNY3zddfSApXyC/BejWH41bHhBDobNU/SVCktgvvoLTxd59cMiv7Rh0C1Bc cRT1v+sJgMJUpnNHr1Hrg== X-UI-Out-Filterresults: notjunk:1;V01:K0:1vgXG6YuxI4=:dVJAkDxRbyAmX+reFUaNcL Cmijydg+eyoIMnfO2yyWhZ/XOirROQK5dJbAa52YjcHTVn05ErE2v7aZHccN2AvD0QuorG6RN tyFsREE8QlwmFXzUGLiWMA/ulfQLjt0jzNEf2a254I+cBc7cnhs3XL1NLEFK8hZvx9dytOLTe eVauXfproB/6RgoxsIUNzJIqKzpK4dVzLnqAxImr4ES2K6NqBAFLlJbfmaEcLLc7qoXUrG4nl TLlu2oUzzQVt4hteHRbWjuXmxiEgk6kD2KVHq9lf7zYRQzIPMsjqNQ5RPX0kjSaSWbgXXIsq8 t0uGv2Ph1ZoKn4b9S0To5v3U8l12Wi/UEhr26DnhRAZ+ek6AbZh1bhJz8Flb8MSnniIdvXlG9 GDSm+98XwzOZwcdESae/qk/D0J4q9+Ev5F8Ncn/RDjhRMcX2ZGLMY/s4l2CtXA4mdWDSEdfmu 7d9hMrp/3CLFkSDMw1/oA2Fuj4reUXP/bfbm9D+L1+9iBJkFNYZGcGtsAyw5ZnYU4BPLCOEvJ h2vZOTMB2ODWe5Vxm07ij/Ps5RFPFaFuD5nxZqk4lRCj1CY5f8aT9wRRgbjR8lyKj0rup9h0z aKUcbGw/GTqEDJRw6lxzMJhia/Vs8gE/0xh5rdN4BcH97wa12mLSG1ejn4WET+85Z2l9PYKo/ aR1TKJBFb5SdIUYPLsHL3XLXo4CN3AQ72lNg3MjOAdXEz8Lz+0pEKeRxt/5A8mEdgQuyFY/hB 7SeRc30BVFoawkyE9cekeXS+0ZNVcL4CBSTW26epooOhHVp4VUhxLsqZ9suoanv7TIfFPRTKa lhlp9X034psTZH+N05TiKWLHCD+ag== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --n5tgjbf2wsepvrep Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2018 at 11:58:06PM +1100, Michael Ellerman wrote: > Jonathan Neusch=C3=A4fer writes: >=20 > > 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. >=20 > Hi Jonathan, >=20 > Sorry but I can't merge a hack like this in generic code. Makes sense. > Has anyone looked at adding proper discontig mem support to PPC32? I'm not aware of any such effort. Do you have any pointer on how to implement discontiguous memory support? CONFIG_ARCH_SPARSEMEM_ENABLE seems relevant. > Or can we punch a hole in the resource in the right place? Maybe from > add_system_ram_resources() ? Not sure. add_system_ram_resources would need the original memblock table, which is overwritten in wii_memory_fixups, if I read the code correctly. If a proper solution doesn't take an overwhelming amount of work, I'd prefer a proper solution. Thanks, Jonathan Neusch=C3=A4fer --n5tgjbf2wsepvrep Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJaZ2TMAAoJEAgwRJqO81/b6P8P/2PFc+LvG2SE+jjBkkkikVEx Q27V5EieuGFEovgphDam8xDGVHC63KjH7PhjaxiFW6WU6fY7mV0zWw0SeFYX4amu 85CI3UrBEyUhfN/Xq6ZyP6ua3U6AoJ3Hmm/vZ/be7UDYpF4QGq2UPR4JV0s/HQi9 PPUm4QAgN1XGsXdlkOTTuLu12nOqIQ5N1J2bqoZZ2/vxqbFxStTlorNFSqPvW4up wzVcsbAE39A8eeFWCKFftcYnrRD0zHtLcj+9ERgs/DWmSL5x9w4lduS0lIfLjJ2A DV7KLjCXc2VvM06TZzIb3bZqdGR90M/2ixbDWtkUTtATt12G5WQ+V6yQtZ8o6r41 gGQ4+AAYojHU9mclui2DXzan8aaJVmNqpgpf1BPvu0zN5fAwnvQTwybtIXwq9nLJ adta96ympBAHZiVpDrZMMG74jfqcv7EJimv5VPdzhuclIJQ8+qW4fn65FmWsJDsT 98CV5oDS1OkM2p8w8AZOEa85KC5sGaSWMQCa2DeJ/jvnZ9iVQDmAqpfYNl2ohQT+ y3ogKgZ5YHgibINEN0865NeQkKlxHAynQLRfzXvIW1tg0e67ZTe9FxwpbMcyBdN9 IwIXxCLuKO1c6i5euFNjrfv5NnAQID3ESGKvj580p7CNGxI+RkcY6588cwvTmAfM 2rRFPDVXTriiAGuxYVI8 =c+mt -----END PGP SIGNATURE----- --n5tgjbf2wsepvrep--