Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp546801rdb; Thu, 30 Nov 2023 11:23:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ2E2KPniln+elYRNI88raNn6VMcNJd139+EB/QnfUpP9GwezUesCHA/oeOCPNCn7Rqdqp X-Received: by 2002:a05:6830:2099:b0:6bb:1629:ab44 with SMTP id y25-20020a056830209900b006bb1629ab44mr598066otq.7.1701372230607; Thu, 30 Nov 2023 11:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701372230; cv=none; d=google.com; s=arc-20160816; b=SSZz2tuCNSL8EcQDtWAc5L2LIV6kHQ3kKcc2pZNs8eAxiwJmlv1xPgS3Bt3ogDLaKK XWIR7t6DmUFmlAwh/uWM8zoBU+6G8Al2qPboBVNYBYxI2ZFC8yOUsX0YZzSHRVLaODq9 2IeTSaxelP2+GOIKNcwhK5nAd/WJjhQ77xkNmw/QZe0cwtPBKpg4n4BmITFCgDI7wxgz 2c6Uc61pImy7UGogMbt4IitCcUw758lStFge6d5wSm5I3isHgkqrejhzA7RcmPrlJ8K1 6aAkh9mol6ASEpyFgEiOYebcbU/9Jadn2gvOLWtYZAr0J9/J6GTk9tj8RR5Xquna44XO lEgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Fj9LwkUMLktcGmbIvcEUHinCLTxcbae0H7updkxIKe8=; fh=qThSIRufdAcTXHIWmo+/3LGhqx2rE7BOIGxpM+Tyyp8=; b=ryj7UL1HFVrrSz1Ru1LanAPYTHLSK07p4VKZHRA6xQx7dI/+NxdIPsbuKxPOx5WrS3 ke22S/9zW0L5JNW5NsaPo6MI410DIzLFeO8g06CQ/9hQjcUl3lBDqixCuhTuP3r8QZR4 sg2cppgCbDLglHLdYr9YKQxZJzRe8UJANvuirvSszrEXqYJojBI9t/1dogTn0ctdFw0M BjW/tAnh74CK6T0bzC+GlQziz8YtjeGX5yXv/xp2lbvA4m5XkZmHfITKN89/O9OtbP+/ Di6qbA9I/vyEm0kaAa9t6eHbcr61OO25sqreb+q+kkBm+/Xv9votTw2wo80ucBrzn55V Sfew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q33-20020a635061000000b005c615702198si1916875pgl.703.2023.11.30.11.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D027782E297E; Thu, 30 Nov 2023 11:23:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376378AbjK3TX0 (ORCPT + 99 others); Thu, 30 Nov 2023 14:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376331AbjK3TXX (ORCPT ); Thu, 30 Nov 2023 14:23:23 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC14D40; Thu, 30 Nov 2023 11:23:28 -0800 (PST) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Sh5gp4CmFz6JB3w; Fri, 1 Dec 2023 03:23:02 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id BA18114058E; Fri, 1 Dec 2023 03:23:25 +0800 (CST) Received: from SecurePC30232.china.huawei.com (10.122.247.234) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 30 Nov 2023 19:23:24 +0000 From: To: , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 00/11] cxl: Add support for CXL feature commands, CXL device patrol scrub control and DDR5 ECS control features Date: Fri, 1 Dec 2023 03:23:02 +0800 Message-ID: <20231130192314.1220-1-shiju.jose@huawei.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.122.247.234] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:23:45 -0800 (PST) From: Shiju Jose 1. Add support for CXL feature mailbox commands. 2. Add CXL device scrub driver supporting patrol scrub control and DDR5 ECS control features. 3. Add scrub driver supports configuring memory scrubs in the system. 4. Add scrub attributes for DDR5 ECS control to the memory scrub driver. 5. Register CXL device patrol scrub and ECS with scrub control driver. 6. Add documentation for common attributes in the scrub configure driver. 7. Add documentation for CXL memory device scrub control attributes. Changes v3 -> v4: 1. Fixes for the warnings/errors reported by kernel test robot. 2. Add support for reading the 'enable' attribute of CXL patrol scrub. Changes v2 -> v3: 1. Changes for comments from Davidlohr, Thanks. - Updated cxl scrub kconfig - removed usage of the flag is_support_feature from the function cxl_mem_get_supported_feature_entry(). - corrected spelling error. - removed unnecessary debug message. - removed export feature commands to the userspace. 2. Possible fix for the warnings/errors reported by kernel test robot. 3. Add documentation for the common scrub configure atrributes. v1 -> v2: 1. Changes for comments from Dave Jiang, Thanks. - Split patches. - reversed xmas tree declarations. - declared flags as enums. - removed few unnecessary variable initializations. - replaced PTR_ERR_OR_ZERO() with IS_ERR() and PTR_ERR(). - add auto clean declarations. - replaced while loop with for loop. - Removed allocation from cxl_get_supported_features() and cxl_get_feature() and make change to take allocated memory pointer from the caller. - replaced if/else with switch case. - replaced sprintf() with sysfs_emit() in 2 places. - replaced goto label with return in few functions. 2. removed unused code for supported attributes from ecs. 3. Included following common patch for scrub configure driver to this series. "memory: scrub: Add scrub driver supports configuring memory scrubbers in the system" Shiju Jose (11): cxl/mbox: Add GET_SUPPORTED_FEATURES mailbox command cxl/mbox: Add GET_FEATURE mailbox command cxl/mbox: Add SET_FEATURE mailbox command cxl/memscrub: Add CXL device patrol scrub control feature cxl/memscrub: Add CXL device DDR5 ECS control feature memory: scrub: Add scrub driver supports configuring memory scrubs in the system cxl/memscrub: Register CXL device patrol scrub with scrub configure driver memory: scrub: Add scrub control attributes for the DDR5 ECS cxl/memscrub: Register CXL device DDR5 ECS with scrub configure driver memory: scrub: sysfs: Add Documentation for set of common scrub attributes cxl: scrub: sysfs: Add Documentation for CXL memory device scrub control attributes .../testing/sysfs-class-cxl-scrub-configure | 79 ++ .../ABI/testing/sysfs-class-scrub-configure | 82 ++ drivers/cxl/Kconfig | 23 + drivers/cxl/core/Makefile | 1 + drivers/cxl/core/mbox.c | 59 + drivers/cxl/core/memscrub.c | 1002 +++++++++++++++++ drivers/cxl/cxlmem.h | 120 ++ drivers/cxl/pci.c | 6 + drivers/memory/Kconfig | 1 + drivers/memory/Makefile | 1 + drivers/memory/scrub/Kconfig | 11 + drivers/memory/scrub/Makefile | 6 + drivers/memory/scrub/memory-scrub.c | 481 ++++++++ include/memory/memory-scrub.h | 90 ++ 14 files changed, 1962 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-cxl-scrub-configure create mode 100644 Documentation/ABI/testing/sysfs-class-scrub-configure create mode 100644 drivers/cxl/core/memscrub.c create mode 100644 drivers/memory/scrub/Kconfig create mode 100644 drivers/memory/scrub/Makefile create mode 100755 drivers/memory/scrub/memory-scrub.c create mode 100755 include/memory/memory-scrub.h -- 2.34.1