From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.57.0 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793976073; b=asHRunAHG0cjsydE9qOFEVaTiWmNoCLu9oLWIGTv2ii/VSspFQoyiOQuuq6ZrQ0nu6bj vDvCej/5Mb2lrbWBCF4Ju6h5u/l8qHVE6TwPgt46zp4k3F23Mn9cy1yLyJAxrxWIrYG4X n8/+XDQ9Zz+aWy9vaessIuFrj89xZ7/CiV5UoxAmuE1vPLT6zkoYTVMbfDeXMOO48+jT6 pOxTl3Y1Mx0T3du3cVzJVg5DX24NdDVPNnZVh097oJcWCUQb4hPETuMGYPbgWDQJQyDk3 0ZrO5Vrq5TonBwvITiYZt5+ueExDQq+17bZshMCzyzjL7S5OGYtNDCHXuOTt2qaY2MQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793976073; h=DMARC-Filter:DKIM-Signature:Received:Received: Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject: From:To:References:In-Reply-To:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0: X-MS-Exchange-AntiSpam-MessageData-1:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=OAFtBVqEaQHB0SnWqZzXafwM38ikEVEqCMfPAMhAo6g=; b=REF9viswmDdc3c3i4s9Y3VdFtkbK2fKQJr+20dUcaYevkKDzIBqhV3eg9BcJwHutOGSr TvxbSvalRQPLWpTyOV5ElmCfqUQBuhxlRjhUBr1+Xbx5I+JwkHZU8xT08myJo1moFwiu5 ML7E7Y90Q/g1CmFv0NsmpU5DAUmRhPmu+G85pFTQsaAz7XIkQg8gG4A7MydJ/bVRULt1i hXMgFDsOXrGU2dbe0oDXAYwSxvJSKnGhC/RMqx+fJiapMP9TMRAdh/tk1yu/86Cr5QWE/ IptRJXDqKS9sYib7imYKlmj77cVwe3nK7V0ifpCa8rRKuIKZvAkd2NRNPXIBklCgn6g== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=YhrmGdLm; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.57.0 Received: from BN8PR05CU002.outbound.protection.outlook.com (mail-eastus2azon11011000.outbound.protection.outlook.com [52.101.57.0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7584606A326 for ; Fri, 6 Nov 2026 14:41:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D7584606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=YhrmGdLm ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LvzshjaVmdvVGpIjaalHeXtR8s4VhYB5RegRD37VWET1ohhT3MLQ1hArtlI78/E38lKlz8Z+1xF9UZdzgAdA+unUnIxOsXW5Qh1sQbe6teLSkZMychTtkRpvr6n3mFPCyQhLxIoRut5i7IB5aeekS1ucwZcJCGTNPH57GGF6ZErbYCfxGgSOhsY8mrpz+QJlMZcVsnocaHgj/emYB4iWFs4vfGQL+21E19TAuyGbOTrspn+zpoI+ds8SGP9+0zGPFtbztK7n/9JTluSIk/1CFT1fqzTQ1TuWbEd4nf6tuO50AiYmzWaeKQ6ogQQpFIIhgo+6I7expNiVB4s7IpAh2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OAFtBVqEaQHB0SnWqZzXafwM38ikEVEqCMfPAMhAo6g=; b=ihPpq77dOUDT3O1ZWfkA9Lk+azfzDYVIrE+XrPFZZpkVuo84xG6vO4VAaBq0Td7xgj4mfZfwfvmXc98KEYZnNOAKyW8efZaBjTxmvcyieOpsISEDIK7hHncIaqm8nzCDxswYKFPrFC16f6y+XxgD2N2qzbqRRIlzlZUoFBE2TVsX8RMpemAd0ebPXlCKgDbmHfpZBlJIR0PGWz/ZVUwupZeSAccZTGtCQRa8ILZf38fgQw80au+CajK1qNiwK5FKKxZeVLOKHXr8ZTztmrj+eXGOf3Z3af8Hix8DIIaQa/tJfDNr6iJP3WL7+LW23MoHRA1zbpHbeVh2+1b/WkoLYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OAFtBVqEaQHB0SnWqZzXafwM38ikEVEqCMfPAMhAo6g=; b=YhrmGdLm1zga6dRe+HyDpfZQmV4hqji5ZWlyMEcaKojoxwPwronxx+W/EwJPVDT2+eRNJ+j/nw3yXloqxIIwowS78pr5BIMSIes/hz8IFpBJ4vQVlBmBElLiBOsdMTU1owMbwgXFkumpOqhVXVoKBQsM9fqwSoV6myx9IqWkHEtA5uRceZ7kZgWG+r5zVePA5OGgfWyJz3usAlqsTR81z/1+TfawcNd44qz/+yY6vkpOUx3ll4ZfahBhs62TozAm2GyDQkQ9I8mG9DRi4c1CKNg+H9Lh0tpDBjALgd//3G1fU3/JePY5pXcw2zu2yGGl/jQZc5HF5m4Hb096ymLlsg== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) by PH7PR12MB7138.namprd12.prod.outlook.com (2603:10b6:510:1ee::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.592.11; Fri, 6 Nov 2026 14:41:08 +0000 Received: from MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1]) by MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1%5]) with mapi id 15.21.0592.007; Fri, 6 Nov 2026 14:41:08 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 06 Nov 2026 23:41:05 +0900 Message-Id: Cc: "Dave Airlie via B4 Relay" , "Andreas Hindborg" , "FUJITA Tomonori" , "Gary Guo" , "Alice Ryhl" , "Danilo Krummrich" , "Daniel Almeida" , , Subject: Re: [PATCH v4 2/2] gpu: nova-core: add support for GPU timer block. (v4) From: "Alexandre Courbot" To: "David Airlie" References: <20261105-nova-timer-v4-0-45a7c121d4de@redhat.com> <20261105-nova-timer-v4-2-45a7c121d4de@redhat.com> In-Reply-To: X-ClientProxiedBy: TY4P286CA0040.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:2b2::19) To MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR12MB6873:EE_|PH7PR12MB7138:EE_ X-MS-Office365-Filtering-Correlation-Id: 49a29128-3252-460d-0dd5-08df3c13fe6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|7416014|366016|10070799003|1800799024|22082099003|18002099003|10067099003|4143699003|11063799006|5023799004|261102123227099003|261026140227099003|261028144727099003|261026121527099003|261021135927099003|261021121427099003|261022105027099003|261022075727099003|56012099006; X-Microsoft-Antispam-Message-Info: 2ez386X4PCqFAMPc7NAS0q5U9SA7QoId5NZ7X2WLoHG4VGyz/dTaHwzsPG1gyKvowCS5U1bt1VFz6lRm8SJoQd98Nbzl/iEJayQvKS4V3VNMZ6sbE6sVmFp0Cz68aBrabbj93z5+fhsbgXwJxXZRO3Gy2Ak128O/qiL/TAc2qUTJYqLuyJYNXaK4zjna1VB7BDUtFrsH2AKmoiBTXIDvgwcHmdx9LOCWqn+YQORYtcYBIaf3iB0Re+MNMxEgDxho45iftT2xMjMS1dWON12KEUqoEpwHwhnpQ3oabexlHzUVr2DLcTRLYk/i5oKruE1+RXeM+MuPYfMBmrEZHYJwysKqRqn+jB+6kxR0mq/U7j6T9m+l5h8j8ejMCXWQdw6plnhLYR2auc1Dan7E9VtCieNcx3AZFjVcTx6hzvXVBFM+sHua1J76/nclzcpD8vXRjZPKdjCtR3V/PI66/YKKF4lXL7WdHn87bohy1tzD1W0XI5iYVNBKhV3iKt+D2gxCR2+6gblMht/pgkjLfrJ5BzM357S0//onzcKwjc8yzg7KgtF2MLnwOVlyhIL4mbMMYyZ2oQCkYAcemXjX5hBJJykUdWjhNUd6UPRygEhPgE7EApqfVZ7ebqSEi6b737Qeg+7WXMYxmaI2jyWIIwjaAQzJMToLLJcGwz/d5plKSrI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB6873.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(366016)(10070799003)(1800799024)(22082099003)(18002099003)(10067099003)(4143699003)(11063799006)(5023799004)(261102123227099003)(261026140227099003)(261028144727099003)(261026121527099003)(261021135927099003)(261021121427099003)(261022105027099003)(261022075727099003)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TituOEkwY0ZCdGlkMndrdWlqZU56L2VGWGlxaUhFaE5BWW5BNnhLT2Z2c3RD?= =?utf-8?B?ME85R2VUWkRRbUlNUVRHNjZlUldaZExrbWVJVHIrMGp4ZE9QZDdaR2ZkR3ll?= =?utf-8?B?cG5DU2FLM05DS09KWFVScnJMbVVHTlFnN29wUzcvaWo5LzVheldIS1lKdEFN?= =?utf-8?B?U3A2WklKdUlZN3lncnRzWEFsb1AzTHNsUlh0YXBXU2gyamhlN0RaVnBBRzRN?= =?utf-8?B?akU3S1JSamhkVThFQTlScWt1Q1ZzZlZ3eEtITHN4Z0NqUUpyYUpaUXVKWHNL?= =?utf-8?B?aWhUdkZTNWpsUTFlUWNBbEY5UmM0aW0yK0RXeVV5MnR3eHcyb3ZBUEVqU2Zq?= =?utf-8?B?VGFjdTA3SEJGRi9YT3dM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= =?utf-8?B?YWlZTjN5TmprUlVwVkRuVVBwSHdHQnZacE82Z3d1c2RTbW1MbHkzbGlYc3pY?= =?utf-8?B?WkdDZSthQzg3ZS8va0pwNkl4UnkwRUdoT0pwL0RkbmJ4R2JOOEdwWm1uanpw?= =?utf-8?B?S0Y3TU9uQmJvcEQ4cDJHczhkNjY1WGlRaStGTFI1OHFrZzVOL1FjbTJ5SjFD?= =?utf-8?Q?Z29N5lmO6kaUELNzQZeResdz29L4UYkXcQdi/b81ciW+Y?= X-MS-Exchange-AntiSpam-MessageData-1: Xi1B2tx0/QMRUQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49a29128-3252-460d-0dd5-08df3c13fe6e X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB6873.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2026 14:41:08.2283 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +durxcF1drg0hqesx2yCCGXRy5b80Eh3uxKkFloEqrOFI5wP6cZT6RonEZyb2QoemHlt+/llt9f9eLMn3AilcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7138 On Fri Nov 6, 2026 at 2:31 PM JST, David Airlie wrote: <...> > I've done nearly everything you requested for v5. Thanks, took a quick look at it. It's getting late so I'll do a more in-depth review tomorrow. > > I've just stored Chipset in there, is it worth storing hal? It might > happen later I suppose if needed, but for this I just rederive hal for > the one entrypoint. Storing the hal is technically better, because in `is_bug_3957833_affected` you need to handle the case where `fsp_hal` returns `None`, even though we have already assessed that the HAL existed in `Fsp::new`. So it's just a dead branch that can be avoided by storing a reference to the HAL instead of the Chipset. If you do that, `FspHal` will need to require `Send + Sync`, but that won't create any issue. Now in practice, `is_bug_3957833_affected` is only ever called once, so it makes little difference. But I expect the FSP HAL will expand further, so storing it will definitely become the long-term design. > >> Maybe also explain that this can program some timer-related registers, >> otherwise the name `init` isn't justified for someone who believes that >> this just returns the time without any side-effect. > > I used setup, I don't have a good name. > > The main thing is I didn't use the NSEC_SHIFT thing, but just write > nsec_hi and lo wrappers that hardcode the values since to me it looks > cleaner than trying to infer that from the register definitions, > especially since I don't see a good way of doing it for nsec_hi. I Ah yeah, I saw that you used a helper function that is used by both sets of timer registers. In this case it is not obvious which one should provide the constant. In this context I guess we can go with it because this is only used locally, and `Bounded` will throw a build error if the number of bits don't match, but generally speaking I would like to avoid repeating Nouveau's pattern of producing literal values out of a hat and use the defined constants whenever possible, as they act as documentation on top of preventing mistakes. > remove all falling from these paths and just went with truncation > because that is what actually makes sense. Do we understand what happens if we truncate though? > > nsec_lo/hi are now used in the register from_nsec for both tu102 and > gh100 registers. > >> I'd ignore Sashiko's suggestion as it looks like it is trying to >> reconcile the code against the comment instead of the other way around. > > I just fixed things to truncate and used wrapping_sub, to be honest > being careful here is probably the wrong answer, my local review bot > pointed out some wierdness can occur in 2043 with the current scheme, > so let's just keep it simple, wrapping subtract, and feed the result > to the hardware which is what the other driver does and what nouveau > did. The other drivers do what they do, but here again do we understand what happens when we write a wrapped value into the timer registers? > >> >> Once we have moved the timer read loop into its own method, I guess the >> remainder can be nicely folded into `init` directly, and we don't need >> `timer_time` anymore? > > I didn't do this, I think resume support might need to program this > also, and it didn't look very clean. No problem, especially if this is expected to be used later.