Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1105927lqm; Thu, 2 May 2024 05:41:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMruFzMIoN4nrqjk3BGARk4/ZRZyYTiniNvk5HS/qmjlCaqhJYF3btWIijfBHYPCXEyQO4Wn4dXMxb51OCeINskilX4mA/Q+INGYu08g== X-Google-Smtp-Source: AGHT+IEBj1wq0aZVeKi5qscTZMXtYWWSjL9UC7cNU67knzFzdVh/r4/XIihB/qolnFL208Q6zL7W X-Received: by 2002:a05:6808:8d0:b0:3c8:4aff:b4f3 with SMTP id k16-20020a05680808d000b003c84affb4f3mr5712684oij.43.1714653679758; Thu, 02 May 2024 05:41:19 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p9-20020a05621421e900b006a0cd2a8adesi811562qvj.527.2024.05.02.05.41.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 05:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=XnNXNUHA; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-166465-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6B9701C22042 for ; Thu, 2 May 2024 12:41:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1167823CB; Thu, 2 May 2024 12:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="XnNXNUHA" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) (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 B7C2062171; Thu, 2 May 2024 12:41:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.68 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714653672; cv=fail; b=jFel/pllcufEgILi8VpThXKUmfeb8fU/zxMOZwmztp1vyeAbzwC4LJjd3wfb6/Ar9a35bKcjJxVdnIwk2y0WaVshq3jZ+gI+0QLALGgwf+MQNRNOluqoaNXfc0gDy/haPBRoCiQA1Xfw1LdHik9qTgy6nJTWhxHXtYu9pq5o3KM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714653672; c=relaxed/simple; bh=VtY19T6MiaeMlVqXhFhraqN2XKdXspB6Jl0fpVG7HOg=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=D4xd03hiRfg2LOuJiQnFUyibSUjsx843Luijc4yXWGJTLBRP4TCCg7F2/DAlfVbykCBVQtF2A+qlWDy4Vx/PvOAbRmUBcjtXsQtQx43EiSItvWuaDZvSGqOMuJ1HZGIbWU4p0dCeJDOrW3jsg2Uh6167ykzOQoAfT728harSvX8= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=XnNXNUHA; arc=fail smtp.client-ip=40.107.244.68 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LXmXDiflWZ37cTgdybzGlsDHA3Q2TuQdLDKRuFbjkWUpdOyvfsxDeB/Ke86VcsLEBcMyzUFVp2Jm/mNOyAHNnAK9DWTt3FBTxEsxv+9AOtc2h+qbZqkmxPfq+8KEh8Ysx9jmtH06KeYRbUKBnVUOM7SAS+VqOS5SrndpZpscK2TmGvOl7BbDM6zWO87H2hhvy/y5G51VZH3zZAcBcre7fLRgNBqFndJ7DR3xCzF8mkxDthPYbNNqN6wmsmvIEGNnXSIcpkEks2vFmgD7QoHP/Z6KqWeSsaXk75WW9hbS3OYjhgrL7wYLGNbZu3xV47N2AGxZ8UlKTXALRq79lnqG8Q== 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=bGBW06E1bK66d7SVTEMDUBfUy5xHLPWst8EsMNKip4I=; b=Y5Ai5reTIK4x+IG8fXCct+YG3IvMhXKpRKBSrfWU555d85+bm0aT5KcwZpNc4b6ZVZdiv+IeVqGHYk9PZEGhA/BCrfbWuJ4b1eykwJ9q0BA2BfI8G+xcdTY+dsuIMD6l2xbOKAnVGFFCHqaCXvFRJ/rF4O7VfINGYKkq70U/DUDsgNaxU3+nVKRArGodqwBrwgKozcuj4fNmVoH9ieXJdJTuyKTN3jF8XIv6xF2UdVf3i6kx+6DnzANdIYvPi3zBR2OS3b+2X6c1ArW7BjXMaSNeAsXsqSIp+Uz72i7VZVSTFYzsmehdkXo2vxrT8u0mpdH2y+Eey9fV3xQUXed4Eg== 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=bGBW06E1bK66d7SVTEMDUBfUy5xHLPWst8EsMNKip4I=; b=XnNXNUHAOn/25QcNz2eOW8oBzmQTIx0oZFzPEb1Mr6/iBjQFm5klj841F5wPyHT61oAxpu8gzBLu3oHrXxuvQHSn1vxHwqbzQizXYqbUxEwLCnVCf+jCfK9/3ZRPnpA1G9eyjgGNUUjHgiWCl5NjYZVNmhfSAotGjPMaAoaE8NXxjKtZZHJZbkx+PnJ2pESfC8NWaTib1ZcozqlZiGnLQ4GgTeN2oE063TY4mL1dQWNJUJs+ubFhyqxqKBhqalv62tWqj+qf0ZQGONY0zZnZH1Fyqy5AwuD9CQfIoJcnUJ8r3QzESdKcNGHWY2GBOhKPyoGfw40iyElomuZvzanT9A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by MN2PR12MB4485.namprd12.prod.outlook.com (2603:10b6:208:269::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Thu, 2 May 2024 12:41:06 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e%3]) with mapi id 15.20.7544.029; Thu, 2 May 2024 12:41:05 +0000 Date: Thu, 2 May 2024 09:41:03 -0300 From: Jason Gunthorpe To: Nicolin Chen Cc: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, thierry.reding@gmail.com, vdumpa@nvidia.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH v6 5/6] iommu/arm-smmu-v3: Add in-kernel support for NVIDIA Tegra241 (Grace) CMDQV Message-ID: <20240502124103.GA3341011@nvidia.com> References: <63414546b1eafdf8032ac1b95ea514da6d206d63.1714451595.git.nicolinc@nvidia.com> <20240430163545.GS941030@nvidia.com> <20240501130042.GC941030@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BYAPR04CA0012.namprd04.prod.outlook.com (2603:10b6:a03:40::25) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) 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: DM6PR12MB3849:EE_|MN2PR12MB4485:EE_ X-MS-Office365-Filtering-Correlation-Id: b45d34d5-e3ed-4c78-3708-08dc6aa52250 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?L+7USZU7Hye6SWmTNB84ga/tJX4Kc5M9UBk6OwAZ2SnuV2tgjdWWzIoBa7DW?= =?us-ascii?Q?Yn32JahkH+7VNJG811OoyqiCceS2pZghOGTZjQUKn8jcuxxFUTQoh61CP+UR?= =?us-ascii?Q?8iOoxkJqVFowcjOtf5YlM6OjKqGjqlc6a0EVF2wjogDHkH9jA8Zz7x4s4PP9?= =?us-ascii?Q?eVOsnYYmItKScFyJQAe08N7UxwO44Ov3Yxec8KXEaw9LcPi947zMafhBGJxx?= =?us-ascii?Q?6B1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CFM?= =?us-ascii?Q?y9j7jft3wE6gJ/FWIku4CSgBXiVwg/gGssAeozTYofIaHffdTBcyDGP7/T6H?= =?us-ascii?Q?WsTzFAP6tFsnTd2SwwNbrsbSmID3mfZKMQmYPCpQgCfltjKE2DX0GlhyG8jo?= =?us-ascii?Q?tqkDan5zy6yApALf9nF56PAsf/v+Wq5v1XLAN9KFcw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LlqlVI9emcXs+wZivqymU4KrLicfyR43lnMuv79Vud0gO+DJbW7TUxLP1NoR?= =?us-ascii?Q?prTfwq7a+o5BO1iJA5jKB5klDpM9NrPECJKh7pvkDG4bhFMrtZx5XlnlfJC2?= =?us-ascii?Q?U1fz6ZgdzevfCdYdfCvuQV+YG2eJVJswGBLpd1+mepxDpoV2sLeGXxAByxYA?= =?us-ascii?Q?68kS5HKmCgCQfv7BFEZfhQllNyS21osb3h4B9Bn8kIqfeAXTKQ2ixe+6xDN9?= =?us-ascii?Q?KTh6ABVIAhPI5VgvJMsMseQfpypEtAVpl2cji9nsaCI1Xf7Sr11v823+no+F?= =?us-ascii?Q?lfHH/ppt2+NrwpGfzyFzH9JqeX79iRCVyj92rekC7hY69F8ChX48ZU3OIo9l?= =?us-ascii?Q?wKr8ej89jtglzDnmzZn32Z6KfxfEHl/J3Z+sL6KDg/icKNkeEOCNELLiPBlZ?= =?us-ascii?Q?3SPDtRncL7JGBy+H2vHxmDCtittI24e5XLrH4wGwEnpDTc0hdv5juAY/sNAf?= =?us-ascii?Q?Up9YUQ5y2PPzQAW3jdXquA3/IVV4GRwn3Z4o74BifUEapd1YNba9056UZC7j?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aULtuwZI6OcWoQitzqypNQuLCS709AsT?= =?us-ascii?Q?WIuwDFPZOXVoiPKgSRYyomAWKu5yPl/5X1/fCb0I6d0YSu/wHISfKeJrECaU?= =?us-ascii?Q?+U+dm+f+yX38nElnvIIzEmtXkEtcanpaZe+KZ3rkj1oSoJzjyibrXjkmdSoa?= =?us-ascii?Q?KebM20sbZmb2E8CScZQXDzyka3tF9IhCNufMvdHC?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b45d34d5-e3ed-4c78-3708-08dc6aa52250 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 12:41:05.9108 (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: rjxqldUZ3yhYAttK4WE8WRXb7yxC2kJvjZFJ6aQqMHFHbKaQw7rboEJ6DtF+B+yN X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4485 On Wed, May 01, 2024 at 10:43:39AM -0700, Nicolin Chen wrote: > > It doesn't fix any real race, I'm not sure what this is supposed to be > > doing. The cmdq becomes broken and you get an ISR, so before the ISR > > it will still post but get stuck, during the ISR it will avoid > > posting, and after it will go back to posting? > > > > Why? Just always post to the Q and let the ISR fix it? > > Yes, we could do so. I was thinking of the worst case by giving > the guest OS a chance to continue (though in a slower mode), if > something unrecoverable happens to the VINTF/VCMDQ part. Does that happn? The stuck vcmdq will have stuck entries on it no matter what, can we actually fully recover from that? Ie re-issue the commands on another queue? > > So just don't use it. There is no value if the places where it should > > work automatically are not functioning. > > I thought devm could work when rmmod too, not only when the probe > fails.. It is limited to cases when the probing driver of the passed struct device unbinds, including probe failure. Jason