Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2662054imj; Mon, 11 Feb 2019 06:39:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IaDVS/2yfcvPkDrMzMDlkq8y9DDWf+St1IL71/DaTXEkhNKEfSMBf7FRrd0YmdEShOWhlo6 X-Received: by 2002:a63:fa58:: with SMTP id g24mr33331822pgk.390.1549895940644; Mon, 11 Feb 2019 06:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895940; cv=none; d=google.com; s=arc-20160816; b=vFS+xX8+xXF15ESMOdlRKs1WYHqNnp9wdsanAqh33Q/JvC3yKP1fdxUbHFL1K6b0zn H62hohXsgExVSWVnYJdKmEY2U6GwEKwlTs9I4oqEpMOMEOeXEr7AxX8pLcEr2eKWtSKO OxiaF3Ejh03JVUh5Qgcx343xQCFm7UbsTyx8/i9dABmKj0T4NRt9p+eD2lHaNF1GK0d+ 0xX7ZiVh/WG99SUN8vX0G6BCau2OT7q8qkF4QYZTo57PYCjI4+2PBQAu0eZBQfgQxerK 0rUD8S3NLv2MFTrJiklu8IYF05nr01z3RI1GlCCqN0V00BZiygeseZrOst1zxfc/s30q Gt/A== 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=pNaRXxlL25hJSrOmnTqPqRSLXZCsAFY26U43qwFnB34=; b=UpAleBzunLfGGR6+uE+UJoPlsvcLjQ0pTWld52a/v3kTDie82LP96KqKXNXwY4pl/0 IQaBsqDYv6SmR3XJOCviBb1U3MmBUaDeySli1Ze8IujlKTKB5jdfNU8Vbm8l/dxz9tRg 4imlWkPvVsUzi0P3liMM8kswjUkfPus6s9meGyh2QPMV4PQ1NNgomnpAfPBH3A/thZ8N LTaaLcJUTSkNFTn7uebp0MLDnqFECrtXWjo9/Uh26Q++poeJampTc7JrfRIcyt7N7q6c w4LknjrFj02VUiGKfjb2LBx3+fiX6cqBcY/uZPBrM8PV6D0OV3Y7icmSim78s6y3fiF4 rEfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="udYAv77/"; 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 y1si9921817plt.356.2019.02.11.06.38.44; Mon, 11 Feb 2019 06:39:00 -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="udYAv77/"; 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 S1731560AbfBKOhy (ORCPT + 99 others); Mon, 11 Feb 2019 09:37:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:47370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731538AbfBKOhv (ORCPT ); Mon, 11 Feb 2019 09:37:51 -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 325D62081B; Mon, 11 Feb 2019 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895870; bh=rTZyOjF9oNR4eKI2T/jpdjn7bgB3Jr+t9HIM2qEBaYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udYAv77/MJebCdLxJWBYFRerYpgM2F9U1iLP7EKlkDuV6Gb/MQSy5WzC4DGL7SMe3 E86vIhOL5+h7shHU3aRi8Qy00xRiunjTrsgE3Z5MTaaLuR9ApcXZHIgBPZn/BeGMEl 3rK52lRdvDS0KNbmc/31f/ivDEJ7bbfqUIA4OTkg= 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.20 351/352] cacheinfo: Keep the old value if of_property_read_u32 fails Date: Mon, 11 Feb 2019 15:19:38 +0100 Message-Id: <20190211141909.503574592@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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)