Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4992597imm; Tue, 21 Aug 2018 04:39:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyfj2RV4lUW1rFx5dHJfUmUc2y/cP9BuDXEDGp35bdEnYhw0dD4HEumM0CiD2nV27fnIlHV X-Received: by 2002:a63:e457:: with SMTP id i23-v6mr47381915pgk.127.1534851541318; Tue, 21 Aug 2018 04:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534851541; cv=none; d=google.com; s=arc-20160816; b=tR1XtY4KwU7nuiAkn6P9BGGmtavGCxhODM/nj9E9tG56AyAueGO4k+sNQ6swpTGi/R mcIeDTL6ET5+d2/gLQWigVrdaam3bCIp/aFw5ez4cbj82Xx5ml6nihOroHdxJXKxAOEz M+R/8g30SbiIIzkbq9iKXs6BS99wXM9J5iBSRlhrLCmZiBwx/PklOXuY/pp2Pq726cwn 7Zl2AziQkg7rF71gmvLbD1T1J7j/LCq81zSqNtMcHmwFs6CMqdnn8+Ls/oT7KEqNgywH 6PHqhz+B/K/ZmWc0vCeZccd7LdvoVNWMXrz9BFo9/GMdWtzcn4wGk8F4pDR+LT+eOFUo 5zPQ== 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:references:cc:to:subject:from:arc-authentication-results; bh=bQ1TucMJv3DNAygMGz04WHWWJ044Prf49byc/Pqkgmo=; b=E0NpS0qw/9Zsa1NnINzqu5bJmq7xqV2Jwu+MEZ+5lHoP3KuHkOPH1K5OgSdMK2tGqw 7qqaAg7ecPN5pDipF4960Ao8UkyU38XmfA/iST60Z5z/0XYAnF01EwjVMbDw1qMLeuhJ Bf7KnoeJcQb/rwlGjV5ed5pQJOf001S8ovHkYFW3WBhDj0oZjOT22HSSyhQmWfTlijby PJUReLrkaWbMcoMnCyVIzyG/KXiVG+W7EMyqcwZ61CoObMFfzYmwA5r0qUR2bkcPFECP qMK/d2gzJlE6WiLTFwpwhW9BUkH49zfj0K9kDcUjRhJQwl2eI7iSzLprItF8JPV6EDY2 4TCQ== 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 h35-v6si11520548pgh.297.2018.08.21.04.38.45; Tue, 21 Aug 2018 04:39:01 -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 S1726948AbeHUOYb (ORCPT + 99 others); Tue, 21 Aug 2018 10:24:31 -0400 Received: from smtp17.cstnet.cn ([159.226.251.17]:58407 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726590AbeHUOYb (ORCPT ); Tue, 21 Aug 2018 10:24:31 -0400 Received: from [172.20.20.131] (unknown [182.150.46.145]) by APP-09 (Coremail) with SMTP id swCowAB3XR248Xtb2uHsAg--.4257S2; Tue, 21 Aug 2018 19:04:25 +0800 (CST) From: Pu Wen Subject: Re: [PATCH v4 15/16] driver/edac: enable Hygon support to AMD64 EDAC driver To: Borislav Petkov Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com, pbonzini@redhat.com, mchehab@kernel.org, mikhail.jin@gmail.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-edac@vger.kernel.org References: <6275a5a0a0cfbd2c1abc09a5bb41caabecd02e27.1534599097.git.puwen@hygon.cn> <20180821081331.GC24940@nazgul.tnic> Message-ID: Date: Tue, 21 Aug 2018 19:04:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180821081331.GC24940@nazgul.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID: swCowAB3XR248Xtb2uHsAg--.4257S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KrW5Gr48ZF47GFy7XF47urg_yoW8Xw4kpr WDJr1S9r1kWF15Gw1vkw1UuFyrC3s7JFW3C345K3s5A3Z8ZF95Wry7t3yxur90kr95Ar42 yayvg3yUGa4YyaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvEb7Iv0xC_tr1lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWUJVW8JwA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVW8Jr0_Cr 1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwACI402YVCY1x02628vn2kIc2xK xwCYjI0SjxkI62AI1cAE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r 1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CE b7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0x vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI 42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWI evJa73UjIFyTuYvjxUz2-eUUUUU X-Originating-IP: [182.150.46.145] X-CM-SenderInfo: psxzv046klw03qof0z/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-08-21 16:13, Borislav Petkov wrote: >On Mon, Aug 20, 2018 at 12:14:58AM +0800, Pu Wen wrote: ... >> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c >> index 18aeabb..3cefb25 100644 >> --- a/drivers/edac/amd64_edac.c >> +++ b/drivers/edac/amd64_edac.c >> @@ -211,7 +211,8 @@ static int __set_scrub_rate(struct amd64_pvt *pvt, u32 new_bw, u32 min_rate) >> >> scrubval = scrubrates[i].scrubval; >> >> - if (pvt->fam == 0x17) { >> + if (pvt->fam == 0x17 || >> + (pvt->vendor == X86_VENDOR_HYGON && pvt->fam == 0x18)) { > >Didn't we say that AMD won't do family 0x18 so you don't need the vendor check? Hi Boris: Based on the feedback from Paolo Bonzini: "if the x86 maintainers prefer to have a new X86_VENDOR_* constant, I'd just ignore the fact that AMD will skip family 18h, and introduce vendor checks along the lines below. This has the advantage that it's not an issue if AMD ends up _not_ skipping family 18h." http://lkml.iu.edu/hypermail/linux/kernel/1807.3/06042.html and the suggestions from Michael Jin: "The condition case for family 18h and vendor Hygon looks better because it is more clear." http://lkml.iu.edu/hypermail/linux/kernel/1808.1/03232.html we reworked the patch. Sure, JV will negotiate with AMD and make sure only JV use family 18h and AMD won't use family 0x18h, which will make the patch tight and clear. What's the best way to adapt for EDAC driver? * To simplify the code based on AMD won't do family 0x18 and remove vendor checking. * Or add vendor checking in codes? Thanks, Pu Wen