Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp879005imu; Fri, 11 Jan 2019 10:38:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6cCRVQhlzdyXXhevwp7BfzlakwajJRexcChcll6GaAqz7DlcenMGUi8tlUTee/2rNMoep6 X-Received: by 2002:a62:4c5:: with SMTP id 188mr15923188pfe.130.1547231910100; Fri, 11 Jan 2019 10:38:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547231910; cv=none; d=google.com; s=arc-20160816; b=EMmirhn7i+O+x1QswPYo+H4H0jW+2j5hyu5KWOBimRICsvZx+t15hYUE98Lg8+0UHE wZVa6TYNFe5xAQe4N9MmRoAuSUbverbxMc+KqIpW59gK0te/pIq5iv1Gn+up3Xb8k0ZN ckP7gRHYlXzFvMdmYJMuTRW2WGnXn76+a0AeAv+rKcjJ0fvtwBR3rxn9ibU0TKmbdsFh o6nHexgN0FT8mg/qCrarpwxojwFvkxYrimvtlDiFQbDGlPz+rR/ban3x3hVCR28Fq6tA TRUipc79xCVhhOSRds5ItR8c9JgppQFuxEdQVYpsAyRNeATH+HIQOsedCpXMKWKEuX3p iWDw== 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=FM9OCjigp4Dlezc0u0aBqQMDJYWMaXxqX/YmmknQwxQ=; b=RjN6z2/8xPpMpzsL+9A2oZxxOTC2fkF4XqoE1jUVvZdc+KXh0wEa8n9GS9WwJmE9aE dIjBUY/fbsTMPaPQgdTTt76hPxsZIhX825rmbK91JZbr5pM54ATQzyxjlBuwrYkcczXS 9cen8ZWMLtd44qAUoB9Z8W5oXnVBpUfDgqkcQZdwIDXwz4Fyilt5uYvOGcxlAcCZQtyo hEWsoy2+2KKFIGYwOOc+b3xX2SuyUnJhAca4Bn2jhoobXGIKca/Qax4d49c9Ttf3e0t6 N6/8P0mP40z0/5YRIpH17kfKatXLWWi5sU+pWqlq9AlcW7sS99VQE1Vr1MbNCPTmqaOT yE3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lxe2Lgo4; 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 k2si15804289pgh.63.2019.01.11.10.38.14; Fri, 11 Jan 2019 10:38:30 -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=lxe2Lgo4; 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 S1731563AbfAKOTM (ORCPT + 99 others); Fri, 11 Jan 2019 09:19:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:35870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729812AbfAKOTI (ORCPT ); Fri, 11 Jan 2019 09:19:08 -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 A1EAD21783; Fri, 11 Jan 2019 14:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216348; bh=MXcrlELUPTIodr0e286UIRdOoZOZqFzOEtrHirFXDY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxe2Lgo4ndnM2kasY8sYte2bJTi/T6sSQMo1HM5Q6qsMKYJdRGS6Dq5hBWnHWObVN ocB5pwlt4dDoKZY6K01xSOmQU+vjQeBzQigmQA9VzSMDz2I5YQFIiWDtKCUSxKn3W0 m5xYJT2erXPiUkyICHhu0itvKXgji9bty2pPQp0o= 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.4 67/88] mm, devm_memremap_pages: kill mapping "System RAM" support Date: Fri, 11 Jan 2019 15:08:36 +0100 Message-Id: <20190111131057.258741581@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@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.4-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 @@ -171,15 +171,12 @@ void *devm_memremap_pages(struct device struct page_map *page_map; int error, nid; - 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); - page_map = devres_alloc_node(devm_memremap_pages_release, sizeof(*page_map), GFP_KERNEL, dev_to_node(dev)); if (!page_map)