Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2677996imj; Mon, 11 Feb 2019 06:54:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCtH7KWOjB4L8uhU5GFyUFpkaoQvcco8+pFu7UMplFvl6IXbmkLhMmw0QcgMw6Zt9HO8jq X-Received: by 2002:a63:a41:: with SMTP id z1mr28934404pgk.117.1549896896825; Mon, 11 Feb 2019 06:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896896; cv=none; d=google.com; s=arc-20160816; b=HfFiZQ1US84NFyl1/eFRCwxyiSokXKGlPxnE814Bz/9OE4UNPH50pU4v3pkaL6hsse YU7bxOvdHbZT3tfrki6rzjoBiraHm4kgx5RP9AUk1T4Hqj4qaz3gzCTfSeh9hDNcyzCn XwaupboKLWpqNzqGtjQdjcj3T/OW8PiYPfXdEuj4L6BQRJPiWvHc41ymPO3QFheXwQMC emfl/HHRQcgTHMvrYpBc038EGHZezuYT5LtIN2pNuhlVdkIRUYIdldf/EoAM0WR2I+cW tm+VKoxdV1SI03od6/GFdif2uSibxlseZxq921oapQ40UYjCTG7yhoJff+qKpHqWkQs2 bWGw== 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=I928SfBZROahxFHOF1w4DD5V32pbS8efg/Laqbons/0=; b=C3nR2KXHFgEIZkUTipHxNZ1oyWZjvEWl0aHAFbg0ELIj2yIqVf5E71nsRnHSx+O8jM vhcC70TCtL1H9LBMcvF58GEnqwnkDoN+GeshMu3MQabP29XcIEq05uU2lFtMa3lF1xth MbWBshibvzFJVFuF1FyZJJ1349uuFWXYb0Md8TC9cemp6P0R6MhORXhOft7j8SHTrW4h TjcnurVkRlVUvarkAlgFduVghx+tIHHBXil3q9vaMtBic/Dtg2D54XzcbAgbSfrs1SFP 6UD0G9c2yaV08fRsRhA1alNHFvZgbRCoZ2XzXlp2IdRglqVPG5GtEVAY9faw3PwP7KkK pjIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XahRh13a; 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 g8si9317165pgb.128.2019.02.11.06.54.40; Mon, 11 Feb 2019 06:54:56 -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=XahRh13a; 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 S2388680AbfBKOxp (ORCPT + 99 others); Mon, 11 Feb 2019 09:53:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:40112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387780AbfBKOxh (ORCPT ); Mon, 11 Feb 2019 09:53:37 -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 F0C2220700; Mon, 11 Feb 2019 14:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896816; bh=kOOuDYxLlLuHkGpwAxNoAzS/LbcpM4yvs8HpCFSIufQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XahRh13aqdJcp13ZRjGVzqKr8K0d2QD4IXzqPW74lscjsaBzYtTOb6pcK4ADJSfJf yRi8pb0RX9JDEqWEgX35aziXJezJaZNle8BYtIjqpHptZ9bmfjhjyhqUJ3ry7WzgmZ m6aZ7QlgMnDru3OI1kS4GgK9Rh37XHYSNS2BKuf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huacai Chen , Sudeep Holla Subject: [PATCH 4.19 311/313] cacheinfo: Keep the old value if of_property_read_u32 fails Date: Mon, 11 Feb 2019 15:19:51 +0100 Message-Id: <20190211141913.562283614@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huacai Chen commit 3a34c986324c07dde32903f7bb262e6138e77c2a upstream. Commit 448a5a552f336bd7b847b1951 ("drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number") makes cache size and number_of_sets be 0 if DT doesn't provide there values. I think this is unreasonable so make them keep the old values, which is the same as old kernels. Fixes: 448a5a552f33 ("drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number") Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen Reviewed-by: Sudeep Holla Signed-off-by: Greg Kroah-Hartman --- drivers/base/cacheinfo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -79,8 +79,7 @@ static void cache_size(struct cacheinfo ct_idx = get_cacheinfo_idx(this_leaf->type); propname = cache_type_info[ct_idx].size_prop; - if (of_property_read_u32(np, propname, &this_leaf->size)) - this_leaf->size = 0; + of_property_read_u32(np, propname, &this_leaf->size); } /* not cache_line_size() because that's a macro in include/linux/cache.h */ @@ -114,8 +113,7 @@ static void cache_nr_sets(struct cachein ct_idx = get_cacheinfo_idx(this_leaf->type); propname = cache_type_info[ct_idx].nr_sets_prop; - if (of_property_read_u32(np, propname, &this_leaf->number_of_sets)) - this_leaf->number_of_sets = 0; + of_property_read_u32(np, propname, &this_leaf->number_of_sets); } static void cache_associativity(struct cacheinfo *this_leaf)