Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3709431ybv; Mon, 10 Feb 2020 05:06:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzTf4IwsaGmyc+50jxhi1uGDjOsS/SM66e2UHfjXNQjg8VQW1EYfE1le2Q9t2FL9YoLfjQJ X-Received: by 2002:a9d:aea:: with SMTP id 97mr962364otq.51.1581340011103; Mon, 10 Feb 2020 05:06:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340011; cv=none; d=google.com; s=arc-20160816; b=A0nXl2CKp0017K/UWX+zrrqcCiQVhBkBBeKIF28s9y6kBL70O1Z6LkNhLIXoDiRcJI FChvpgTd7ihwKbnL0350wsB4F7jI8ZVP79NLKO9htTiynEdgr5q03LOGV1j9ynEeH/51 NubbHJRE3/BEIQEOxN0FckNrjaBldcOXCF8Mt9CsKrlKKUX5bLk6wShX5myZrOG/4hYy BdUW1r+SEREI6c4G4EN6JlgwTekMYhwrKGznB9ouh4HxrN63VU8K0vkpuaNngPfsV6Ty vOJiLQm4EzfESTAo/ijzECeVB2xR9s/867Nj56SImUQQuuVdOj7Hd1fqoPtXpvk74faE QJ4w== 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=nwHwP21ReqPvRKDGMtvpUrbqhO9FVNsaSJPD4W5bRTU=; b=OfssSjG5mgnNoZ5WtU25ggxsgtkpMHBGC+1wNzfU80ug/unlufjQ/jk1Xlt5iixQBp vWTD3qbYv8cwpKBiEbOL6KZLngUa7tqRXAqGfhAtks82Kyw0OvYVI61Fuy4FwJTM4pel kLXFKY0MCr4cQtiu4h90ulvTltmLun8NXwcwJEObw/0kXZEk5GDtzR+w4BYoelq7CXEW i722Urql1WjmxTnJVgNdos/XIkgbOl+Xfs0jwPteMkHPoTZATrXgiSye7FUoPgdososZ RW+F7yWqaEZMyGM1hVykHmY6Pl9YmtRCzAGWnXveOsHD/ko9eZuEKpw+HZPVmzX7J89r W/Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h6Fn7kPD; 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 w17si146309oiw.127.2020.02.10.05.06.39; Mon, 10 Feb 2020 05:06:51 -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=h6Fn7kPD; 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 S1730674AbgBJNGe (ORCPT + 99 others); Mon, 10 Feb 2020 08:06:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:38622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728957AbgBJMjx (ORCPT ); Mon, 10 Feb 2020 07:39:53 -0500 Received: from localhost (unknown [209.37.97.194]) (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 21D8B2467D; Mon, 10 Feb 2020 12:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338393; bh=hyCUUI8joFIvHEQJsxnmkQakhTurpsrLw3aw+EtS1Ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6Fn7kPD+UnOyVZRvh3qXiDkdznx+b1SwvsVQy3WbiDP7C8NRd6J5GYn4SsVpk0V/ ZkNmzlIOfKIEDTI4nc2BNLPq1Vj9GkKXCej8lcMFO1p5BLjehKpN4mrvtp8kEFP8ms D2/Ja3d+qxzXoBXz1D6/CEKxtD7yId4IPaCs9DJw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pingfan Liu , Michael Ellerman Subject: [PATCH 5.5 086/367] powerpc/pseries: Advance pfn if section is not present in lmb_is_removable() Date: Mon, 10 Feb 2020 04:29:59 -0800 Message-Id: <20200210122432.297488666@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Pingfan Liu commit fbee6ba2dca30d302efe6bddb3a886f5e964a257 upstream. In lmb_is_removable(), if a section is not present, it should continue to test the rest of the sections in the block. But the current code fails to do so. Fixes: 51925fb3c5c9 ("powerpc/pseries: Implement memory hotplug remove in the kernel") Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Pingfan Liu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1578632042-12415-1-git-send-email-kernelfans@gmail.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/hotplug-memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -360,8 +360,10 @@ static bool lmb_is_removable(struct drme for (i = 0; i < scns_per_block; i++) { pfn = PFN_DOWN(phys_addr); - if (!pfn_present(pfn)) + if (!pfn_present(pfn)) { + phys_addr += MIN_MEMORY_BLOCK_SIZE; continue; + } rc = rc && is_mem_section_removable(pfn, PAGES_PER_SECTION); phys_addr += MIN_MEMORY_BLOCK_SIZE;