Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp256184pxa; Thu, 27 Aug 2020 01:04:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFLEJDuToQaLsInV7efLSm/CHxRgTLz+MmfHM6uZ2RvLzlPAY6SRr+jSGHRbLa2QLPNVfK X-Received: by 2002:a17:906:2f17:: with SMTP id v23mr19174455eji.343.1598515471557; Thu, 27 Aug 2020 01:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598515471; cv=none; d=google.com; s=arc-20160816; b=eIxS3utbb2ce++GppYiK977nIxqOLMftd/PtkURIfKroQaPDDs6zM/2dugjC3j8F9f mWII+xPuDpngC2wbjX9H06VGbtXEgAXfn4gEn29E8uQWMXKFlPhz7jCn5uNaKfIA857n VzywTZ001i3NZWIYgl+PvNoKSAXvUsfBLewV/5RoolbxCCqjWiZTPQR/NxsoVPJ5Kczw 2LXUa2r07Ig+Od6UVxN23YBf4dOGZRXibZaKBO8o28u20jx+cEKPjAjjKJjuJfovaz2n zaJ4j+SFXmns+P1kqFTTeq/KCYnrGe2RnaFcoQriP4br5qUJl9ZpvKTKiQ5F9TX/YxRm L3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Vj19NV1qkFG0rtXxq27yXhnYLAirZ83Bs4WJzrRXmdM=; b=ff0zpUVpu5Xi6uxcfGSeeFS++DZ/bK+Xxg8XqrJ6MxQq9NPIoiSbdBcFk69VAE3XkF HhV1JRcnG8SqrkYZlg98IXBdsAXcDtlTxCFJKU9jvO8gSQZYFpfM8Y7tcQ6gJzHfTwdL xN6dGf0I5z7l8yBJYiKjOp9miWfQq6uP4XWfrQ5ho7/hsMXMyEedemfASyvSQyCvY4ne GAelIqLUJHvsUqanJzNG5Ppw4OKDExIbfQ2hHEsccQFGmp0HzYwlNbUyFF4K/3N3/YT+ xCqfK0ry92nXCDYkcVEHAs2PHhbixwkq5VoK1i5WS90Pz+KjoGxNmoYlt7kcioe4n7W/ FppA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si1025243edy.172.2020.08.27.01.04.08; Thu, 27 Aug 2020 01:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbgH0IDW (ORCPT + 99 others); Thu, 27 Aug 2020 04:03:22 -0400 Received: from mail.loongson.cn ([114.242.206.163]:48450 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726851AbgH0IDQ (ORCPT ); Thu, 27 Aug 2020 04:03:16 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxr928aEdfv4kOAA--.81S2; Thu, 27 Aug 2020 16:03:09 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs Date: Thu, 27 Aug 2020 16:03:08 +0800 Message-Id: <1598515388-3604-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Dxr928aEdfv4kOAA--.81S2 X-Coremail-Antispam: 1UD129KBjvJXoW7CF45trW3tryfKryfuw45ZFb_yoW8Jw13pr 4UuanIgwnrKw12gay5Zan7Xw45Grn5ua9rWayUG3W5Aw45Z3s5XanrZFn8tr1fXrnIka47 XayxKr47Za4qkaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkm14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r43 MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUb6wCDUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the user's manual chapter 8.2.1 of Loongson 3A2000 CPU [1] and 3A3000 CPU [2], we should take some event IDs such as 274, 358, 359 and 360 as valid in the check condition, otherwise they are recognized as "not supported", fix it. [1] http://www.loongson.cn/uploadfile/cpu/3A2000/Loongson3A2000_user2.pdf [2] http://www.loongson.cn/uploadfile/cpu/3A3000/Loongson3A3000_3B3000user2.pdf Fixes: e9dfbaaeef1c ("MIPS: perf: Add hardware perf events support for new Loongson-3") Signed-off-by: Tiezhu Yang --- arch/mips/kernel/perf_event_mipsxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index efce5de..011eb6bb 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c @@ -1898,8 +1898,8 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config) (base_id >= 64 && base_id < 90) || (base_id >= 128 && base_id < 164) || (base_id >= 192 && base_id < 200) || - (base_id >= 256 && base_id < 274) || - (base_id >= 320 && base_id < 358) || + (base_id >= 256 && base_id < 275) || + (base_id >= 320 && base_id < 361) || (base_id >= 384 && base_id < 574)) break; -- 2.1.0