Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp123453iob; Tue, 17 May 2022 21:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrCaQ6Si9pId3lLwmFtjcWQwRSLtdjjAXIG+YPW1dqbQn8cA3MrqlRdGvqtvbYVv9Wa4rX X-Received: by 2002:a17:90a:4a03:b0:1df:4583:cb26 with SMTP id e3-20020a17090a4a0300b001df4583cb26mr15816069pjh.173.1652846450570; Tue, 17 May 2022 21:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652846450; cv=none; d=google.com; s=arc-20160816; b=X8XOtAOrjtssLdcpmSOXBIpkhga6NHcQb6GJ44FrVJiNpxaudnbCOJyf/iK319pRr6 6NqaiLJDF/WXOEBdrSdm0tXC38TVjJk3zHgY+Y5L7vFGGhnMGmhW+pE3BmOLgPogv0X2 aykdt+vcpicCYgRwOjgtkWWh4mTpinNg2XGasifgEjQC68elQ1c5AGA1jd3ZZiS5ZoHr jxg4uaxjblyVYXE/xxbfsJhUVmjMHk9grQhIa38V664aI82SNEzW5xXzsSViNcDD+H9w KpVwb1Dn/ccBaZ8L663txY7IQK5Gz3ZQ5cnMvKEAH7u2Uc/kZXji7jiqru+7Zkg1CHwl IThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ume0/+SZoFFON8dc+uE515Wu0Ph4fGUZ38Tn0hMV9MM=; b=xL9t7LWdH/51YNKkxw3+4FAyLPhhKNiuq+SWO7Cxnx71ryULqpbKUe8iDjsYV3uvRl T8NBRdqLFexiiUIqU66B78Z3x0acZFHnZz7phbz9RZ2e1JeuvXVBTT/zc5fWpNJ3pX4y 8Jbgp9i7/5Ax98/K1PAu6bk/EHHoqqKnLIPoIJcbJQhmnn+mtJ/wM0USJqCXZ9xDVE1z DlsKKe6hLoAWROtOVqPCx0v+LZh99LPJW9bO172a8olBA/OV0SXOaRniDqmeExpHaDHe 9yzmkJnzYcm40cTuPiaPH/Qj9qdOUKhFGwtmPA9aE7Cxvu2b2jjmjP5ssLOE1Eia+WpZ /35A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=HyAewg8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y65-20020a633244000000b003c6e6ccb295si1082841pgy.624.2022.05.17.21.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=HyAewg8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CF5A26574; Tue, 17 May 2022 20:37:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352827AbiEQUDM (ORCPT + 99 others); Tue, 17 May 2022 16:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345642AbiEQUDJ (ORCPT ); Tue, 17 May 2022 16:03:09 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1408343499 for ; Tue, 17 May 2022 13:03:07 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id q10so122225oia.9 for ; Tue, 17 May 2022 13:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ume0/+SZoFFON8dc+uE515Wu0Ph4fGUZ38Tn0hMV9MM=; b=HyAewg8gxIOA2pd/BFLiNGcS7NiS5LwNVEPsXhAaFyAlQdl9eTkItVKwfAf77I2vUY pVs7DhVb9DJf/o/q0SmfIVnBm1ZrEjN2cpGqsABTfMPkBngFX6e+7RTp2JolNY3o18F1 78ynrzkGIz7P34UOYlN8Ac4pqeo0s6VR+hVxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ume0/+SZoFFON8dc+uE515Wu0Ph4fGUZ38Tn0hMV9MM=; b=lPr1nQlokLDYUNY3DFzxRUp+N2F8FV8rVHTsuSB7AOhBdAsT1M1RAtPKqvRfSektRk qZbS3czmzc1t+Q6oXw+wXf7bHyRnf4e2BeaGvVJAsQJgSqlCxfzMStHgg/kAmTZOJX6c Q0WMSxTbWSA/klHGRL4Gcmpvl0r6/0v1tAuSe6t8UDgPbx6jQTLX7ibaj1KMnemckeuG 9dXKnyneZ7tXHrSSQuekrcsmcXP3bLEh4vMnq43OkjWp0o3lrNpAfHRbZbHEXpwMgJE1 A7IJlNQkA2DRgKLWm/WpGTTtUBz+Y9yz7BSLvuHPL7wwKgGyBhs8LmcOQ04O6GAyxuJP Gaig== X-Gm-Message-State: AOAM531vXi0AYJ8g97jot60EvmZlRFQOtmnbnrwsKOS7MVQwbNoijDXR xfN9mHo/1C+iEmIyguYuP2vbwA== X-Received: by 2002:a05:6808:2108:b0:326:51c9:73a2 with SMTP id r8-20020a056808210800b0032651c973a2mr11187694oiw.175.1652817787190; Tue, 17 May 2022 13:03:07 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id k22-20020a056870959600b000e686d1386asm241432oao.4.2022.05.17.13.03.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 13:03:06 -0700 (PDT) Subject: Re: [PATCH V5 0/3] Add unit test module for AMD P-State driver To: Huang Rui , "Meng, Li (Jassmine)" Cc: "linux-pm@vger.kernel.org" , "Rafael J . Wysocki" , "Fontenot, Nathan" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Su, Jinzhou (Joe)" , "Yuan, Perry" , "Du, Xiaojian" , Viresh Kumar , Borislav Petkov , "linux-kernel@vger.kernel.org" , Shuah Khan References: <20220505022913.329259-1-li.meng@amd.com> <615adab4-515c-7d61-5662-bd342b759d6d@linuxfoundation.org> From: Shuah Khan Message-ID: <27434868-1d0f-4493-3265-bea4e1dc8494@linuxfoundation.org> Date: Tue, 17 May 2022 14:03:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <615adab4-515c-7d61-5662-bd342b759d6d@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/17/22 8:45 AM, Shuah Khan wrote: > On 5/5/22 12:41 AM, Huang Rui wrote: >> On Thu, May 05, 2022 at 10:29:10AM +0800, Meng, Li (Jassmine) wrote: >>> Hi all: >>> >>> AMD P-State unit test(amd-pstate-ut) is a kernel module for testing >>> the functions of amd-pstate driver. >>> It could import as a module to launch some test tasks. >>> 1) It can help all users to verify their processor support (SBIOS/ >>> Firmware or Hardware). >>> 2) Kernel can have a basic function test to avoid the kernel regression >>> during the update. >>> 3) We can introduce more functional or performance tests to align the >>> together, it will benefit power and performance scale optimization. >>> >>> We upstream out AMD P-state driver into Linux kernel and use this unit >>> test module to verify the required conditions and basic functions of >>> amd-pstate before integration test. >>> >>> We use test module in the kselftest frameworks to implement it. >>> We create amd-pstate-ut module and tie it into kselftest. >>> >>> For example: The test case aput_acpi_cpc is used to check whether the >>> _CPC object is exist in SBIOS. >>> The amd-pstate initialization will fail if the _CPC in ACPI SBIOS is not >>> existed at the detected processor, so it is a necessary condition. >>> >>> At present, it only implements the basic framework and some simple test >>> cases. >>> >>> TODO : 1) we will add more test cases to improve the depth and coverage of >>> the test. >>> >>> Please check the documentation amd-pstate.rst for details of the test steps. >>> >>> See patch series in below git repo: >>> V1: https://lore.kernel.org/linux-pm/20220323071502.2674156-1-li.meng@amd.com/ >>> V2: https://lore.kernel.org/lkml/20220413090510.4039589-1-li.meng@amd.com/ >>> V3: https://lore.kernel.org/lkml/20220421074152.599419-1-li.meng@amd.com/ >>> V4: https://lore.kernel.org/lkml/20220427135315.3447550-1-li.meng@amd.com/ >>> > >>> Changes from V4 -> V5: >>> - selftests: amd-pstate: >>> - - add print the current scaling_driver. >>> - - add amd-pstate-ut.ko into TEST_GEN_FILES. >>> - - move "insmod/rmmod amd-pstate-ut.ko" stuff into script amd_pstate_ut.sh >>> - - add a check of read back from X86_FEATURE_CPPC in get_shared_mem(). >>> - Documentation: amd-pstate: >>> - - delete the test step about insmod/rmmod amd-pstate-ut.ko >>> >>> Thanks, >>> Jasmine >>> > > Sorry for the delay on this. I will review the series in the next couple > of days. > > Did you consider using KUnit for this? I think asked that question when > reviewing the previous version. > I reviewed the patches and the test driver amd-pstate-ut doesn't belong under selftests. I would recommend the following approach: - add this test driver under drivers/cpufreq - KUnit is a better fit for this unit test driver unless you want to be able to run this without KUnit configured - add the test script under selftests - the script then can load the test driver and run tests and unload the driver. thanks, -- Shuah