Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5680009imm; Wed, 12 Sep 2018 09:27:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZMWRn4jsNqRCMFwatSYr1jTFYca3/fGwSpsYwDbgCj3wNlpNZm3+S4SrChtBqcCuzhJxhI X-Received: by 2002:a62:938e:: with SMTP id r14-v6mr3332936pfk.55.1536769661755; Wed, 12 Sep 2018 09:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536769661; cv=none; d=google.com; s=arc-20160816; b=yqHCQimiMlKnY6dfPGVtDn4jVJQeCW9C/PjxC3sIwxRJwgEEBptz/ZrsTwlGIt8hpg sKJgyLE84JZngS9tRV1b0YZZXx6UnKe0XaewpsN84NAWHiV+8csZsnev80RaAmHCP7uB EkJ/b2nrUP13SqcIDNIxWzmfeyKya4if2cMARZa43BBBsjImXk/D5BDnEZV2AFW6gk+/ PJn6apmp13ND9Rw3cEpYlxf8x+V24zZrs6Sq9pynb9ekRi6GpjBLlVSqH+1ztFpLg2vW mXWUEWcCOlwj5f67obpjLArue6CQ6maJGteBXdlupq++hxREflvawlQ5gA6ZcNc/yjO4 yGpg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=DmmcSN2eOnG50qZ2+r69bBIK/t7NvH9+MB8KXCnT/o8=; b=zBnSSCAEgLxYBjelmBpeo+ySRauTp/6/EJc3Z4QD2fNhO4ABVAwN77GONdF6M+C//F LNvcpBiw2xVJGh5RaFSb6ZOwjkdMdpmCCOA+usHRkGLR+W4ms8kCXPsyjTYToj2jucso oHX6xA3WmizzHjm95NcC8EJEz90f1V1jowkCKl9Uy7lMH69fPp+TPY5E9inVTdI73fG4 7s/zNAus8AVNssZGiIz8NWthMYPmQRnTTohfNBYQ//tIKm/wYXeq0G648lSvWWj1gdUS T1u72Q4OWMpX2TgWoJgpJCazzPtzG5TOZ7WeKb7TSL5NaZ+mamGUTcm/kQIet3miqM/E p92w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="N2/qPHuu"; dkim=pass header.i=@codeaurora.org header.s=default header.b=KCvq4Lvb; 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 w5-v6si1345916plz.175.2018.09.12.09.27.21; Wed, 12 Sep 2018 09:27:41 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b="N2/qPHuu"; dkim=pass header.i=@codeaurora.org header.s=default header.b=KCvq4Lvb; 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 S1728137AbeILVbG (ORCPT + 99 others); Wed, 12 Sep 2018 17:31:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53528 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbeILVbG (ORCPT ); Wed, 12 Sep 2018 17:31:06 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2A2D060594; Wed, 12 Sep 2018 16:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536769549; bh=Hyz0pOHpYlkY/Vw4GcyWXk8H6I7s/HJkxPX5Si14ebE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=N2/qPHuumfFR4YCwfz9HGHFkZuEPNbUilXpZNCIOY4GN/jje5fMrowOHyemtjM2R4 DmfT9EmG1xpwRzcH7RhJp6KOjPPyQ7khQTirChI+8IK7Ha4iUSbzPugoNu08ceXVxH M9tcLXetdpwMrhxJrMMfz+L57DraEUrh4LwYn9zA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.60.81] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2B7A560213; Wed, 12 Sep 2018 16:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536769548; bh=Hyz0pOHpYlkY/Vw4GcyWXk8H6I7s/HJkxPX5Si14ebE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KCvq4LvbgrQLO0fV7tCJnManOgTqish+kIJ+Vf4F1/D1Bjxq1ySCW2yw6RSmSXaNA c1YpQfgqpI4mXRx+gdV9ZVpL6O+Hjar/Drk5Hkf2TC37csWcFXPliEMQUMJQx39l7t 9wgYC80jI1gJoKn649CSqNECIS+tl1DTe/fcL3/U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2B7A560213 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types To: Sudeep Holla Cc: Jeremy Linton , rjw@rjwysocki.net, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, vkilari@codeaurora.org References: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> <98e2e6fa-7256-b5ac-7d2e-42c858c6e57c@codeaurora.org> <2873c62f-1bf9-5aa0-b3a2-07980ef61d35@arm.com> <20180912161509.GA24181@e107155-lin> From: Jeffrey Hugo Message-ID: <960c5f0d-9494-9a87-2797-3f10fc140ab5@codeaurora.org> Date: Wed, 12 Sep 2018 10:25:47 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180912161509.GA24181@e107155-lin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/12/2018 10:15 AM, Sudeep Holla wrote: > On Wed, Sep 12, 2018 at 09:57:14AM -0600, Jeffrey Hugo wrote: >> On 9/12/2018 9:38 AM, Sudeep Holla wrote: >>> >>> >>> On 12/09/18 16:27, Sudeep Holla wrote: >>>> >>>> >>>> On 12/09/18 15:41, Jeffrey Hugo wrote: >>> >>> [...] >>> >>>>> >>>>> Correct.  However, what if you have a NOCACHE (not architecturally >>>>> specified), that is fully described in PPTT, as a non-unified cache >>>>> (data only)?  Unlikely?  Maybe.  Still seem possible though, therefore I >>>>> feel this assumption is suspect. >>>>> >>>> >>>> Yes, we have other issues if the architecturally not specified cache is >>>> not unified irrespective of what PPTT says. So we may need to review and >>>> see if that assumption is removed everywhere. >>>> >>>> Until then why can't a simple change fix the issue you have: >>>> >>>> -->8 >>>> >>>> diff --git i/drivers/acpi/pptt.c w/drivers/acpi/pptt.c >>>> index d1e26cb599bf..f74131201f5e 100644 >>>> --- i/drivers/acpi/pptt.c >>>> +++ w/drivers/acpi/pptt.c >>>> @@ -406,7 +406,8 @@ static void update_cache_properties(struct cacheinfo >>>> *this_leaf, >>>> * update the cache type as well. >>>> */ >>>> if (this_leaf->type == CACHE_TYPE_NOCACHE && >>>> - valid_flags == PPTT_CHECKED_ATTRIBUTES) >>>> + (valid_flags == PPTT_CHECKED_ATTRIBUTES || >>>> + found_cache->flags & ACPI_PPTT_CACHE_TYPE_VALID)) >>> >>> Looking at this again, if we are supporting just presence of cache type >>> and size(may be), then we can drop the whole valid_flags thing here. >>> >>>> this_leaf->type = CACHE_TYPE_UNIFIED; >>>> } >>>> >> >> Yes, this change fixes my usecase. I think it invalidates the comment, and >> really, the comment should probably mention that we assume unified type >> because there are other issues in supporting architecturally not specified >> inst/data only caches. >> > > Agreed. > >> Do you want a V2 with this? If so, do you want the fixes tag removed since >> you seem to view this as not a bug? >> > > Yes please, I am fine to retain fixes tag but that's my opinion. > >> I don't think I clearly understand the purpose of the valid flags, therefore >> I feel as though I'm not sure if it can be dropped or not. Is it fair to >> say that what the valid flags is accomplishing is identifying if we have a >> sufficient level of information to support this cache? If not, then should >> the cacheinfo driver not expose any sysfs information about the cache? >> > > I don't see the use of the flag if we *have to* support the case where > all the cache geometry is not present but just cache type (and maybe > size?) is present. If that's the case we can drop valid flags entirely. > I really don't like the idea of supporting that, but I don't have strong > reasons to defend my idea, so I am fine with that. > > Further, I think in your case with NOCACHE type set, sysfs dir shouldn't > have been created at the first place ideally. I think we need something > like below to fix that. > > -->8 > > diff --git i/drivers/base/cacheinfo.c w/drivers/base/cacheinfo.c > index 5d5b5988e88b..cf78fa6d470d 100644 > --- i/drivers/base/cacheinfo.c > +++ w/drivers/base/cacheinfo.c > @@ -615,6 +615,8 @@ static int cache_add_dev(unsigned int cpu) > this_leaf = this_cpu_ci->info_list + i; > if (this_leaf->disable_sysfs) > continue; > + if (this_leaf->type == CACHE_TYPE_NOCACHE) > + break; > cache_groups = cache_get_attribute_groups(this_leaf); > ci_dev = cpu_device_create(parent, this_leaf, cache_groups, > "index%1u", i); > Ok, let me test this out, and send out a v2. -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.