Message ID | 152938828948.17797.2438243316611072486.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECF4D603B5 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 19 Jun 2018 06:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE4B228C15 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 19 Jun 2018 06:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C8128C34; Tue, 19 Jun 2018 06:14:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4E5028C15 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 19 Jun 2018 06:14:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D0576B0007; Tue, 19 Jun 2018 02:14:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 67E606B0008; Tue, 19 Jun 2018 02:14:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 520176B000A; Tue, 19 Jun 2018 02:14:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 0C7616B0007 for <linux-mm@kvack.org>; Tue, 19 Jun 2018 02:14:48 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id g5-v6so6052982pgv.12 for <linux-mm@kvack.org>; Mon, 18 Jun 2018 23:14:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:cc:date:message-id:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=TU9HKj0UMlf5kxOxBGQCgjLlYYMbRNVlq+QWo+qMXGo=; b=SjQqgnPouB3CpkOoGTPjETaEXvVSNJY9znCeHrZMsoKAwoY+n0VRP3EcILpwODLDBx HDCLfWqu2WYwVW5vuP+BigVtpCnLDH3pLcqfKn2wYfyeZ5p3JK39svUQmE1AD49/XQvT UpaqV5iyy7HCKqYYlk2vghM1Lk0Ati9STiY0buQA7ddSt7jIyTSx+ZyNFB9LfjhsOpiv eKbsm6n5tMaanLmkl7AiWfOsYEDfzIoF2k2r+f6IXE4B4jookgCtHkiPpvMScJ9In+HH WBrkkEvrLP+w4h0RqNsURsqyCrWPwm2svT37Clzg90iJJUmyrSSligj1zoKP1g87ESDq qxNw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: APt69E0/Hy8ZzxWuCsnELmKImqUlQa7XUTUCrR0AfpFnmDCxBFGvawN5 RC4PsoMJsT8a9Htafls3IZ5RODY6qRdpc8jhZ/tEslSlZ1hw5N+a1wlL885m1Chr18V9eqig4wB uspQb/E4wdcHArNgYcq7aNTprau3pAUJP/jmXNmk3gZpnucMrOBuMdvk8LvEl2JsrfA== X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr17507957pls.32.1529388887763; Mon, 18 Jun 2018 23:14:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLHKjW9eNE/4QK9/MTMQIEiV7HJJFEzkuov9U6UoXlm0Zbg/jnU4sZ8DlyVvsiOTEKzfbVs X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr17507922pls.32.1529388887057; Mon, 18 Jun 2018 23:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529388887; cv=none; d=google.com; s=arc-20160816; b=N9u0q1s3iD4nN/o+oOzyg/7UGUwpfQsEajZTrrq9xq+oCEem59kGKNFv0HATUSF/SV fEXuursX7q9VnVzMto+jIdvBJ3IbLb6j6cj2wM1+sxNDgtUEWfc9u+N/TP5NvZMwx1is OeJzaAiCgh2y4rPMlsnjud+XU/JzJ/n/6WSFGbIte7RowzOPTBto051BCNd7cZNRP57Z SBsXO4Y9eh4TaOyNTyyvEI0BK7wZHiDR4HEcHQ4PaSpSE4OMQFi6Wqbpb0oh98mFU3xM c9SCw/NMIjo1XAeplQjZBvGZo58/10qMLhqtJp7pgFbqsTYRA/FA+hvuolJZtMZiC4yj Qs8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:date:cc:to:from:subject :arc-authentication-results; bh=TU9HKj0UMlf5kxOxBGQCgjLlYYMbRNVlq+QWo+qMXGo=; b=RvpUV0YZPtF5pAZxUYDF0N5vIrPoUYcYollY7xUQBok9JmzUWZPDjOYL6aDyYISCHA Gp0jeJQA1Ymw8InoYVej0jL1FTVeHCDA12YP3A9niPy+RSZNCJbq0QCqIExRHlln1Ss/ 8I3COxEurrkOuzIVWFXHwjLXgLqRch6+xptqVYtRErDnRV++SmXgVcvqeFOPonm5aj57 WJksP+se9iDJGG6Ta9dYH+wYjldfptfRBTzz+CZRCnOSVK9kp/oW6Solmtd68L/Dtelq 8hyVd98lieodhZuSiFeGswXT89WaoJeWRBnlusCnyXd5uuANKucFBYRyuQdjbjeH3fu0 gszw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga07.intel.com (mga07.intel.com. [134.134.136.100]) by mx.google.com with ESMTPS id m14-v6si14217352pgc.361.2018.06.18.23.14.46 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 23:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.100 as permitted sender) client-ip=134.134.136.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 23:14:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,242,1526367600"; d="scan'208";a="51007287" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga006.jf.intel.com with ESMTP; 18 Jun 2018 23:14:46 -0700 Subject: [PATCH v3 2/8] mm, devm_memremap_pages: Kill mapping "System RAM" support From: Dan Williams <dan.j.williams@intel.com> To: akpm@linux-foundation.org Cc: Christoph Hellwig <hch@lst.de>, =?utf-8?b?SsOpcsO0bWU=?= Glisse <jglisse@redhat.com>, Logan Gunthorpe <logang@deltatee.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 18 Jun 2018 23:04:49 -0700 Message-ID: <152938828948.17797.2438243316611072486.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <152938827880.17797.439879736804291936.stgit@dwillia2-desk3.amr.corp.intel.com> References: <152938827880.17797.439879736804291936.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/kernel/memremap.c b/kernel/memremap.c index 4478e4688bb7..2d2c901cbe23 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -183,15 +183,12 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap) 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);
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. This has been broken since forever and there is no use case to map RAM in this way, so just kill the support and make it an explicit error. Cc: Christoph Hellwig <hch@lst.de> Cc: "Jérôme Glisse" <jglisse@redhat.com> Cc: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- kernel/memremap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)