Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp650093imu; Fri, 11 Jan 2019 06:48:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4cnT5SbM4tIqn/3BZXYosz5ERnlocLLkOlVLf/szl6CoEEfu8t+z9SZYhzdxm61V8hWbET X-Received: by 2002:a63:f109:: with SMTP id f9mr3501230pgi.286.1547218127700; Fri, 11 Jan 2019 06:48:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547218127; cv=none; d=google.com; s=arc-20160816; b=qeP8MLcus6Zom0jDi2mrNCq30tdxPviZ6LCkUImZgW03ZB6yVHX8CkMwNnXubdr5/i wTpQ5YNKtCuTdrOsAuHdZA6vI9lW7cZREkIKC/PTp+a5GsrAuECNwckr4H9yXAtBbgLy gRA4XRMvOTqhuJL0YHtVf92uxJkyNFn+bILzmqLXT0lPDnqpBT2aDwDbk+lM6sqP8n/h n0Yqaonp9SvaTVxwS4gT5xXF3XJLLE9gwX/W4hTw3pSou45+S44H8XMqJYRTwKrVl3ya PyrJzIGUvPYXNKmYbdCuCk03BwQRrjBSHTTheQb5T9HL/5RFY9HvsNPvbvd67m/SKDZT HQNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OZBLOI96TILhS6aayplCbzW8I6xA4lz9HKb8WWMyH6o=; b=Xj7/vrySXnSpCqC34O0jaQKkaz0Gk4bUbREUJzc4IWZigjcO2oaGlgHoyhwqG0h7Xy LRRDaw8SxBLBfDS50MQ9ajASdjmiGvRXmv+Y6+YdksF/UCF1/RcmwEm57nneNjgsyVvO 87egOFutpNM6warsfUEGzcO7XSr1WOWjJF/VpUAGMiFyXiA5Uexq8gIWGZLLqVYepeN5 oSGFwCkUgbP2EstARbVWa1gFeODGDqQa8Ti+D6Dh5V+5sIuym7PMRwcPqzqlTap57Uza t/svROOFMp3fMmzts11BTQ4sgqSU+qQpShzrVvT8kz3pgX5kNatqgX9flmzKnI00zZfm NOmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yW49C5Vs; 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 z129si9033365pfz.13.2019.01.11.06.48.32; Fri, 11 Jan 2019 06:48:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yW49C5Vs; 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 S2391468AbfAKOqw (ORCPT + 99 others); Fri, 11 Jan 2019 09:46:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:35688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403847AbfAKOmy (ORCPT ); Fri, 11 Jan 2019 09:42:54 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 069DB206B6; Fri, 11 Jan 2019 14:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217773; bh=7EmfPWSimTsiKI1zRxMwWhmWQlWjgO1saFVhf8fow9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yW49C5VsKyE4Y7ZQrWtVSeCBVfAcPAxuhOIOaZGdvSUvFvTE+9SeyzPAyYDgZQUZs QhRDk2eADV/u7wmlIQUKQ29eQGXSKMDR+p7ZW/CEfjmHYgzpTMuMXCvNPipHk80zHS fj/X/iBWJnWQPaAnUujXKWcWROW8noVSwMgrY7gU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Williams , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Christoph Hellwig , Logan Gunthorpe , Balbir Singh , Michal Hocko , Andrew Morton , Linus Torvalds Subject: [PATCH 4.20 07/65] mm, devm_memremap_pages: kill mapping "System RAM" support Date: Fri, 11 Jan 2019 15:14:53 +0100 Message-Id: <20190111131057.211583604@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams commit 06489cfbd915ff36c8e36df27f1c2dc60f97ca56 upstream. Given the fact that devm_memremap_pages() requires a percpu_ref that is torn down by devm_memremap_pages_release() the current support for mapping RAM is broken. Support for remapping "System RAM" has been broken since the beginning and there is no existing user of this this code path, so just kill the support and make it an explicit error. This cleanup also simplifies a follow-on patch to fix the error path when setting a devm release action for devm_memremap_pages_release() fails. Link: http://lkml.kernel.org/r/154275557997.76910.14689813630968180480.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: "Jérôme Glisse" Reviewed-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Cc: Balbir Singh Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- kernel/memremap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -167,15 +167,12 @@ void *devm_memremap_pages(struct device is_ram = region_intersects(align_start, align_size, IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE); - if (is_ram == REGION_MIXED) { - WARN_ONCE(1, "%s attempted on mixed region %pr\n", - __func__, res); + if (is_ram != REGION_DISJOINT) { + WARN_ONCE(1, "%s attempted on %s region %pr\n", __func__, + is_ram == REGION_MIXED ? "mixed" : "ram", res); return ERR_PTR(-ENXIO); } - if (is_ram == REGION_INTERSECTS) - return __va(res->start); - if (!pgmap->ref) return ERR_PTR(-EINVAL);