Received: by 10.192.165.156 with SMTP id m28csp231165imm; Tue, 17 Apr 2018 09:11:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+MUqRYQxZso5Xvenh4UlLPoppnndC4yiIv6EIlNCrAH9GIn99/oSMDz30FcJxQThHuYx+z X-Received: by 10.101.65.130 with SMTP id a2mr2261262pgq.72.1523981519128; Tue, 17 Apr 2018 09:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981519; cv=none; d=google.com; s=arc-20160816; b=n5K5aJ+aPh0vYuDHgag1EDKHRkwlBsyrL4E2Z8qNo5c6QASvIVg71W6oRdeuAEBU6N PQmPabpMo/dgqax3LU2kbCi+vWVGHF0xyJ8v7Z/PEKl9dQorYnlAMwSqG/UpiXV3nhiH iYmKANpSmb5aYymfxaJVJ47Qolsq0fVT0+DW9m6PYh4HvrFk7xaP3UO0k6UzlFVfcIBT 2jaVS7xbUDr7Rsl0jy6AK2tifBerqYZG4N+Sho7YDEd0FGkt2vWf3ZVm+LKGpcDxW+Wj OPK9KVWtFO/Nu7JyRcbXUI08AozhPu6pFwLjHO9HoKAVXueXWkLvDRDTH3WsqeqqBP2G 26TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uhWWYePmNX/RmUD1xaOlWNBPi2oIwJ4UXfPY5aKnouI=; b=dYdiCwEU6xQ3x0jeY4DIYXKvy4TosBwBP/K9cx0TT/3AfuBULS9iaMzo+Sa7C6UN0R 6tECPy/hJ4qA0jSgnwhthngm+LnnwBb99d5hcK6b+CJ98ydCrXozZq+EIz79Mf/JMaiF LHsKeW4+K4KctlLt3VxtEL0Hrq0f7PZDa70L2bicypZ/9tLxCwRbqiFsH+zcrao+FpKl Bk7xujLXrjAauAvfJkPJzq0nviqBkfIyM5pc73+3C+6Z1nW7Vnc6EBCpPY2GI31JWLxO F8KBse96G7KrtYIFdCqRJkz2/Y/wkwVXB38eC7GUNUnI4TRT+yNPFzOQW+OjqcmB7Pdy X56w== 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 g15-v6si1670648pln.526.2018.04.17.09.11.44; Tue, 17 Apr 2018 09:11:59 -0700 (PDT) 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 S1755808AbeDQQKS (ORCPT + 99 others); Tue, 17 Apr 2018 12:10:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36354 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbeDQQKP (ORCPT ); Tue, 17 Apr 2018 12:10:15 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1DF6CD0B; Tue, 17 Apr 2018 16:10:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Jiang , Dan Williams Subject: [PATCH 4.9 54/66] nfit: fix region registration vs block-data-window ranges Date: Tue, 17 Apr 2018 17:59:27 +0200 Message-Id: <20180417155648.232411368@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155645.868055442@linuxfoundation.org> References: <20180417155645.868055442@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams commit 8d0d8ed3356aa9ed43b819aaedd39b08ca453007 upstream. Commit 1cf03c00e7c1 "nfit: scrub and register regions in a workqueue" mistakenly attempts to register a region per BLK aperture. There is nothing to register for individual apertures as they belong as a set to a BLK aperture group that are registered with a corresponding DIMM-control-region. Filter them for registration to prevent some needless devm_kzalloc() allocations. Cc: Fixes: 1cf03c00e7c1 ("nfit: scrub and register regions in a workqueue") Reviewed-by: Dave Jiang Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/nfit/core.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2547,15 +2547,21 @@ static void acpi_nfit_scrub(struct work_ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc) { struct nfit_spa *nfit_spa; - int rc; - list_for_each_entry(nfit_spa, &acpi_desc->spas, list) - if (nfit_spa_type(nfit_spa->spa) == NFIT_SPA_DCR) { - /* BLK regions don't need to wait for ars results */ - rc = acpi_nfit_register_region(acpi_desc, nfit_spa); - if (rc) - return rc; - } + list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { + int rc, type = nfit_spa_type(nfit_spa->spa); + + /* PMEM and VMEM will be registered by the ARS workqueue */ + if (type == NFIT_SPA_PM || type == NFIT_SPA_VOLATILE) + continue; + /* BLK apertures belong to BLK region registration below */ + if (type == NFIT_SPA_BDW) + continue; + /* BLK regions don't need to wait for ARS results */ + rc = acpi_nfit_register_region(acpi_desc, nfit_spa); + if (rc) + return rc; + } queue_work(nfit_wq, &acpi_desc->work); return 0;