Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp515811lqh; Thu, 28 Mar 2024 08:23:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVF3PRaA1OgAgFHyZi0gulsPujC6YpE4jo4J/uoabWRzjGOAUkR6b3d0hhSGikz95lgYdAoZ0VEE1jKCPWR7j1AsIbMG2VnLCervU4ezA== X-Google-Smtp-Source: AGHT+IEV6ZZJp9HBfksEqxwEBv8wJq69geoHP2vZ36uwkOznBF1NFw7+jbfDJI+Fri3IChzaMU4y X-Received: by 2002:a05:6a20:3087:b0:1a3:c3a9:53b7 with SMTP id 7-20020a056a20308700b001a3c3a953b7mr2620197pzn.55.1711639439021; Thu, 28 Mar 2024 08:23:59 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q24-20020a63d618000000b005f056691192si1605721pgg.528.2024.03.28.08.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 08:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123148-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="0UY7/iBw"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-123148-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123148-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 39B872951C2 for ; Thu, 28 Mar 2024 15:23:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 541B312F398; Thu, 28 Mar 2024 15:23:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="0UY7/iBw" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2073.outbound.protection.outlook.com [40.107.101.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ACB883A1C; Thu, 28 Mar 2024 15:23:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.73 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711639430; cv=fail; b=DTCThtIBv4/+dTFEWWnP38WNVYuY1U/W8Jex3SJSQNhzJLVWWgLdQtpvu8TQvKgMazNgCCyWIHXkHdSSAWeWjejbizu+tDtWHpjRXOe3d4vKoE6nAzbprHN2+dsgKIT2EJBWO/Z1gs4BHdQrmzVDukWPclyh6Ls63Lk8QA3nqdo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711639430; c=relaxed/simple; bh=eg9z9FlPwWIyPLSfNVOgcFRlrrr5PQsu7PXQ7zpQdqA=; h=Message-ID:Date:Cc:Subject:To:References:From:In-Reply-To: Content-Type:MIME-Version; b=m+U76ww3SXsn/1i4aCk3yBHoMvEqEa2zion0TUNdDifbfqUQYgIpeP9H4QMBUnHASJxI61NXS2OqT1ugj06N4Y/0clSWowZJeRwgxNsU6KSbI/CVjMhjuV2Y1+V173n+r7N56w+yGzMv9lg+4e/Q/QxjWVgmpZJMR37xbNS22og= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=0UY7/iBw; arc=fail smtp.client-ip=40.107.101.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcayof/77NFYdvGlMLNV0Q73wIDd0T9fEBYJesuxQ+dZv+tQCAPwH1NLKmjShJnd8rq5Wz4bvarVeeAUfUwgNb3LdosMkbX5nbiJiqy4vvIZKFahHBunJRLdLIpreiG7SeYCWf4F2c0PhKDqBVVC4xh8MNFJyneBG35+RJyfJPvbiaPs6+i9jhtoZuyQqUMRTELeOSu22vNGlJJS9dWHZsCQ7rCfycMLnMD59uDPnlPVW999FP0Kk4Jydu5jvt+3t4XPwV7xWbF0dMWTTcGSB5fTrM5ePkMUB+ZqRU8LoKRbR2ol2d6QGMEw413qfqt8yqxxqQb48aHx6nMKiIO4SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pEfXySuwTdOLIgv3Kn/rdQcMtjZuP4sP3SGzGbfpAro=; b=mgfjj2q5JPZSv8NJs7DqGY7yw394S7lYAopC1pw1iDk47dDLH4zoy8NL1fxXhZaLMzZjUiTZRQDzgwy+2yGCDqSlEk3CjfcKP4aFtvqbJvPVuaJoEozhP9c4opk9nIHfEKCqdwoCvdsloQ9g+tgTfTYjYKPqlcSyjGT4XsOi10TgPPpZnxFCgQCkqftU/cKw4ywixrAJOVtWLpcQC3SCAWLNiOY8eZ+J/FmfnxQX4Be2RyuKxTBPm3eSEM9gdxWTl7DWvnlwd1pfFDnhbaabkS5YRE+HNZ2V0dYVYLaEIWwY+y41mPcjaBPM07n78wSHBfK4TufxdtPBkNInWyiX4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pEfXySuwTdOLIgv3Kn/rdQcMtjZuP4sP3SGzGbfpAro=; b=0UY7/iBw/9DdRKmK7a99vTvhIXYGuW8trZlE/GLwgsR82uoyyZXB6DHcg4tUxxt1ovNNQVl+rUOhSLp1cOlk54eCOc8355Ba1t1t3tjYn+4lwD0fChQ0cbz2NG3tJnNMcqftNQqkAYqQF6ddtKfEBua7l6HG2HLzJ4NyKjs5w/8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB3109.namprd12.prod.outlook.com (2603:10b6:a03:db::17) by DM6PR12MB4076.namprd12.prod.outlook.com (2603:10b6:5:213::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Thu, 28 Mar 2024 15:23:46 +0000 Received: from BYAPR12MB3109.namprd12.prod.outlook.com ([fe80::b2b4:a3f1:a86:d6bd]) by BYAPR12MB3109.namprd12.prod.outlook.com ([fe80::b2b4:a3f1:a86:d6bd%5]) with mapi id 15.20.7409.028; Thu, 28 Mar 2024 15:23:46 +0000 Message-ID: <71d41ec9-17ed-442f-8d68-a6cb9bcbb4b0@amd.com> Date: Thu, 28 Mar 2024 11:23:38 -0400 User-Agent: Mozilla Thunderbird Cc: yazen.ghannam@amd.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, david@redhat.com, Vilas.Sridharan@amd.com, leo.duran@amd.com, rientjes@google.com, jiaqiyan@google.com, tony.luck@intel.com, Jon.Grimm@amd.com, dave.hansen@linux.intel.com, rafael@kernel.org, lenb@kernel.org, naoya.horiguchi@nec.com, james.morse@arm.com, jthoughton@google.com, somasundaram.a@hpe.com, erdemaktas@google.com, pgonda@google.com, duenwen@google.com, mike.malvestuto@intel.com, gthelen@google.com, wschwartz@amperecomputing.com, dferguson@amperecomputing.com, tanxiaofei@huawei.com, prime.zeng@hisilicon.com, kangkang.shen@futurewei.com, wanghuiqiang@huawei.com, linuxarm@huawei.com Subject: Re: [RFC PATCH v7 12/12] memory: RAS2: Add memory RAS2 driver To: shiju.jose@huawei.com, linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, dan.j.williams@intel.com, dave@stgolabs.net, jonathan.cameron@huawei.com, dave.jiang@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com References: <20240223143723.1574-1-shiju.jose@huawei.com> <20240223143723.1574-13-shiju.jose@huawei.com> Content-Language: en-US From: Yazen Ghannam In-Reply-To: <20240223143723.1574-13-shiju.jose@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BN0PR03CA0016.namprd03.prod.outlook.com (2603:10b6:408:e6::21) To BYAPR12MB3109.namprd12.prod.outlook.com (2603:10b6:a03:db::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3109:EE_|DM6PR12MB4076:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d0a7ba7-9954-4727-c834-08dc4f3b0ec8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +UoNphMplPg2CG01laOq2FKVqNqjMD5g9dOL4zPgDTVz9jDNvb+5w1dmRcP03XYAf3TfNNh/w2HpYyGxI4aKPr3IJEqyD8l7HJRbP0DwZauUOoODHYpWbJQZTt/TXxI7Lr8Pw1AWGcpqIInhd155FAseN0+VI2OGXJXCiZlSdwE7EeNMlWZOPXUz2W9NxxCMQ2PiCo1/qqqUzJkfXZ6KOyS7bNivmVhoUkPO0RIFFzrmUxDOEv2k/6X3XERJa7ivj+TKU2n+schQae0EZcDiQfxsprAlXLx13uexx4VH+AMQnWdVIFHidt9AefXfOQVtwnd64UWnA2Beh7wSnQ/Hwdy3TkYQW39oPOz8+rSLl3/4HkYPjpm7Hd2leFldVwO+Xm7oSpWkYUKhdRnrhUe6DXyNxo/2i5S0aqyLLoUP9SEsJefGnAfRU+XD+v35TWaA7jCw8WCcg29Bqu56ioEEmjQSl1MTNxN1M3YSiX8woxOQd8VIO9tzQs/ZZEg7Xyij1D1zjSWQbdvexOHxhqrXxkrNS/2LT0F6Ounf1iEoxb+KWWZZi2aYK1//F21ny2030CM08QDdScy20Fghk2EYB7g+Nop/WgUWqXNqUq8uDC1uAyB/4rGI8UVVPEtvcZhGtOVhVdjKQ1QYpoj1Ypn5klEW0l9cjyN2doBkKX5gRAiiK64XPZoEHPMc95nrCvdkbRD3Cko9kYS+MAIdQOZ4jw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3109.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(7416005)(376005)(366007)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UUt2S2l1ak9FZUpPVlUxOHVBOEwxMktlK211SC9yUmZjREY5RkplTXhNS0Nx?= =?utf-8?B?M1VUVW5BZEJnS0hEbXpRdzFyK3lsNkgvemptWTRpVyt4RDFIb09Gdk5CbmRl?= =?utf-8?B?eCtSbnduSFVHVzJ4ZXc5aW1sV0ozbmZaK3pSV1Y1R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MEM2RkhIdzJEbkh2TkRMMXVWK3I1ckZYdTBu?= =?utf-8?B?N3BxcHYwYVdjbVU5ejBjdXZTVENiaURjYnB2TDkwVjF3UUJMOVdZNWxZWlJD?= =?utf-8?B?YVpyRE5hUUVyT3ZJVHpTTFljS3l3N3FZV1p2QkNFWDZIelExQkhocGxKekIr?= =?utf-8?Q?EplYsj+hSJ9LsOWkTEAOS6sh8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d0a7ba7-9954-4727-c834-08dc4f3b0ec8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3109.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 15:23:45.9083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eTRTkkTcfKInFLKtq0xfZtBR5mMN8bLub66IgWwurrYzdgPelaFY78Hd8cQXmQ7yA7V0S3GYxmTL6AhG3U+rSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4076 On 2/23/2024 9:37 AM, shiju.jose@huawei.com wrote: > From: Shiju Jose > > Memory RAS2 driver binds to the platform device add by the ACPI RAS2 > driver. > Driver registers the PCC channel for communicating with the ACPI compliant > platform that contains RAS2 command support in the hardware. > > Add interface functions to support configuring the parameters of HW patrol > scrubs in the system, which exposed to the kernel via the RAS2 and PCC, > using the RAS2 commands. > > Add support for RAS2 platform devices to register with scrub subsystem > driver. This enables user to configure the parameters of HW patrol scrubs, > which exposed to the kernel via the RAS2 table, through the scrub sysfs > attributes. > > Open Question: > Sysfs scrub control attribute "enable_background_scrub" is added for RAS2, > based on the feedback from Bill Schwartz on v4 to enable/disable the background_scrubbing in the platform as defined in the > “Configure Scrub Parameters [INPUT]“ field in RAS2 Table 5.87: Parameter Block > Structure for PATROL_SCRUB. > Is it a right approach to support "enable_background_scrub" in the sysfs > scrub control? > > Signed-off-by: Shiju Jose > --- > drivers/memory/Kconfig | 14 ++ > drivers/memory/Makefile | 2 + > drivers/memory/ras2.c | 364 +++++++++++++++++++++++++++++++++++ > drivers/memory/ras2_common.c | 282 +++++++++++++++++++++++++++ > include/memory/ras2.h | 88 +++++++++ > 5 files changed, 750 insertions(+) > create mode 100644 drivers/memory/ras2.c > create mode 100644 drivers/memory/ras2_common.c > create mode 100755 include/memory/ras2.h > Sorry if this was already covered, but why not put the common scrub and ras2 changes under /drivers/ras/? Thanks, Yazen