Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1335991imm; Wed, 17 Oct 2018 18:23:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV63VuUmo6dv+amUO7vafIWTWN+7jO5QFlT3RFv3/cPeKsl+dFTaTbDHe5Cl7lGKFd3gXEiQi X-Received: by 2002:a63:2c0e:: with SMTP id s14-v6mr5406011pgs.70.1539825784273; Wed, 17 Oct 2018 18:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539825784; cv=none; d=google.com; s=arc-20160816; b=zhsqFl4tlYU8mY1dTY5flkLtJncq+yut0ixzYIPEQ9DOwcFNtxCwKEbJ0T5zSa1gEm ojjSNkrlK//2vH4IvZXcnwEIgw32BR0/9TNHrSaR5dIf5OXjpq9bSSJNXGpouQtlem4y HVypTGTLih4JMY3t9zmeZ/CrWffrBYfA9bxM/mi58jqiJYlgcRV/rb35iW1vpPKCjtue vwoELAUcatTM+fcnIAynGPA00gV+U1ZBBQmjkdxRIKrLQ5cUQQYCPY8Je6ixxCpo8DPz y9Kv8ZUfWnOc/pLNN6QRRswNl7ZhspuGeEoLFtmxyPZQLq5ojBnhwAhhjSkq9ijS7h5Z TLwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=sjdNWVFJTGVBaq920sxl0SGbKsYcBJUkUutUCpRY/yw=; b=J2UKIVLANLFvsyGIm5F8XDtepBrfcwNkkvA8wM5ROViq7bLT9lFsjpGJ+yZPnCM6AY sl6f9MtUb7/bGS0qVZWfJUmkdiWwRttYYBmGfy4FPr2YXqbDoj/hWuL+wldW29X+eovt jXIxzziE3kakWbHg6dHo8DhUmSnV2lu3P5siRGTK+pL72ke2+0V/H6+j/AFXeSeF66A3 PyFT1LaxX/m9o39pN/c329csQT8QkC5c1qxv3Et+bRPCXcPCZfZEDi+YorduD8+yOQ7F TwGHRfZWNARie1PyJiKSTWpexlH43P0k1plthbftVH1rSJ5yzTVDP+qgshhcIzPQeZPZ NyLw== 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 j24-v6si17441293pff.42.2018.10.17.18.22.47; Wed, 17 Oct 2018 18:23:04 -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 S1727205AbeJRJUw (ORCPT + 99 others); Thu, 18 Oct 2018 05:20:52 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:47034 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbeJRJUw (ORCPT ); Thu, 18 Oct 2018 05:20:52 -0400 Received: by mail-io1-f65.google.com with SMTP id t7-v6so20013083ioj.13 for ; Wed, 17 Oct 2018 18:22:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sjdNWVFJTGVBaq920sxl0SGbKsYcBJUkUutUCpRY/yw=; b=F7E3j8hvn0StGUT6Q1HnZTTTDXyaQ4O3yXFlNJb02xJk3QF7DBgq7Rght/+05VJPxM vYBGiep9coSgo2BV5WlmS61HMvL3VPh8fQe5A/eOSIWggpyu5JFQrk8F9byNXfz8k2ru tjf+jV583PUEjM0dH6uG0I8fb/wVi3gS+sL0oMiUmkRWa/tiSgMo6B4OJXVaLHWVPqZS SHqDR+eiKnntGjwkaVDF4iIzgg/HA2m1N5tj2aNN1uPqxkhIazfg1Ev19LeMU1n8gVuU PZaRFqiXEgYno6ZK3L7tdi+CecI4kqea4yWgBBNqcAF7pdFSRhTpQjRCDNZtEfbluuor pBOw== X-Gm-Message-State: ABuFfogeD6ykGMG2SQ2n3sG/o1o5cFmiyju6VlCqUdLa0fnWbEW6mSw6 fX2mRKVa0A4k36mzJ6f+900e4XdIu48M78OACqc= X-Received: by 2002:a6b:3b54:: with SMTP id i81-v6mr19110679ioa.133.1539825746113; Wed, 17 Oct 2018 18:22:26 -0700 (PDT) MIME-Version: 1.0 References: <1539739563-1886-1-git-send-email-chenhc@lemote.com> <20181017093540.GB16320@e107155-lin> In-Reply-To: <20181017093540.GB16320@e107155-lin> From: Huacai Chen Date: Thu, 18 Oct 2018 09:28:11 +0800 Message-ID: Subject: Re: [PATCH] cacheinfo: Keep the old value if of_property_read_u32 fails To: Sudeep Holla Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , LKML , zhangfx , wu zhangjin 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 Hi, Sudeep, Please see this call-graph: static int detect_cache_attributes(unsigned int cpu) .... ret = populate_cache_leaves(cpu); .... ret = cache_shared_cpu_map_setup(cpu); --> cache_setup_of_node() --> cache_of_set_props() --> cache_size()/cache_nr_sets populate_cache_leaves() is arch-specific, All archs except arm64 have provide initial values to cacheinfo:size and cacheinfo:number_of_sets. Related files: arch/nds32/kernel/cacheinfo.c arch/riscv/kernel/cacheinfo.c arch/s390/kernel/cache.c arch/mips/kernel/cacheinfo.c arch/x86/kernel/cpu/cacheinfo.c Regards, Huacai On Wed, Oct 17, 2018 at 5:35 PM Sudeep Holla wrote: > > On Wed, Oct 17, 2018 at 09:26:03AM +0800, Huacai Chen wrote: > > 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. > > > > What old values does the kernel have ? Which architecture are you referring ? > If DT doesn't have entry then we can't expose sysfs, hence 0. > Please provide more details on the issue you are seeing. > > -- > Regards, > Sudeep