From patchwork Wed Nov 22 19:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brett Creeley X-Patchwork-Id: 16957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1565665vqb; Wed, 22 Nov 2023 11:38:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcV8y5yyOIvGGjfcOHkZHhCMf1W08GF3wVQe+ftbir2qKyYIiinLDUjy7OE8CPhh1RQ5Ez X-Received: by 2002:a05:6808:1524:b0:3ab:84f0:b49d with SMTP id u36-20020a056808152400b003ab84f0b49dmr4335708oiw.3.1700681888865; Wed, 22 Nov 2023 11:38:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700681888; cv=pass; d=google.com; s=arc-20160816; b=L5cCu2WdOCVIM6cc0pcziOaZwOonJyj+h5sBP+zRrWmdH68a8Q4xATlWPOsgI3MxCx SoDlQbXi8AusRHZfYukcg+qPeUajrv5Dj7VIlnl1GZuu30Zh5unGF77lUKSeqetVBwq0 W/q/F8XTdenNZb3oyX/813NrcTOEowUvNH0+g5t3F77oQZ+VntABE8P8YNhYuC/7YDAN i/j6+vRFmD4orlUcVnmKckQ/JudXQNRJFawoWaviHOuJgBHyzijFhxcTV2dq/mlonaIu jtbLWZel5jL/SpDJOh20ssgOxhunP1ioFjTmfhG8sxsrRkxwlItVpfMjUXAvlbGXr5YH t4vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=kmF0om9zYBwVM59etenXl2X+XseBqdAxdMopiVpHAnw=; fh=JXZ0TW43EdnVFwbt5vXVEauRHba7vUgLs8JGIigqe/A=; b=0q9WbJSlz2aMBX/o9hMCuVm3Apg4/7CPvZTLjfTuBeoN2JaINCmK7l0bzC7COzISAs itAYuGdRoMfg2HLHNJ3KdutcYwEp9sYy7XOWeU0ww2bDOBXtYwKTHd0On/G7Bi65DYhs qJHXuJFgafiJJ5u2Zvbd7z+ByVtQ+pgpw6tUo5fw/7pBUVdGPD3r05tUi0oi7/3EE/UN uDK6rn0JAy3B/SFFqxtAqs8xRsIsXa/dkOvsWT2FtyTgtSGzhDbD52XLC6Yb+bmsvKHM cR91p+4YPxeIPkBg/Xh7qTmZLF8rbL1cut/BOqd6j4wAHibB2euSl/XKAnz1HdNW0sis pMaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=kJk93R2p; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d18-20020a631d12000000b005b96e63bc5esi102319pgd.631.2023.11.22.11.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:38:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=kJk93R2p; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 52940819DFCC; Wed, 22 Nov 2023 11:37:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344629AbjKVThX (ORCPT + 99 others); Wed, 22 Nov 2023 14:37:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344538AbjKVThL (ORCPT ); Wed, 22 Nov 2023 14:37:11 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2048.outbound.protection.outlook.com [40.107.243.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50475D53; Wed, 22 Nov 2023 11:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFKyYYJuxGrkN7SqlQWMI/+F4dkHrWor4fd96GzcIm45c4kwEtZRmX6g6OEsmPoZZSCHi/rllgEoLfoTPsba4Qt3pLvZhZiUmG5aSrDt2oYnv5g8OlkAfXQnXb/2TJq85CEVUmPCzpOqI4S8289+IkrjxKgj3l7wF7Y2Cz8AhvVuEcoCYIz87LtGQPgE6WiUezU9xIfnWnCbgKX3EPZRpm5KhmSv+77lbd7nIOfHoRS3GZOKIIcqZ2eH/DT5pDJMsWF8NVi+w06DLGHdv12gY/w9bzhQArmHqlC1FB3ce+ixNfkiwlo8PNALm8NLJz2IVRtID72AMxGMWbMs/mjnAg== 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=kmF0om9zYBwVM59etenXl2X+XseBqdAxdMopiVpHAnw=; b=NeVn/HOSnP52h/+p/8whZyX8EuHo0tgONduzoPLRqHQmz+Yn4a2gjgbFwmj+l6o0IXbzO6dzCZ3CawF73gqQyf3ZcYQQXIcwkNEoeFGX6nJ9ayEi1ZK2r2OvZ/mjByA/inlJwuRucxPAlJjxVHiRcfK6sptO4DOc9ZTMabcuN5BoDn2f60WBxmooIKk6/koBR2fePh4HlQvhwCAhN65UOnwW+qrOBzRb+7Ro3J8d6C3Fj2ikJR3oc4ytd7GI3sLYSa29s4YSVdaEIC+d1rc3UUyI0IP+SQpb3K+U8N++MKCuxJ3pZZkjHY8ElLPysi6uLR46owbXeD0E7L+fhKgp+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=kmF0om9zYBwVM59etenXl2X+XseBqdAxdMopiVpHAnw=; b=kJk93R2pSsS/Mr8wJFoiOcmgS2KBNqnnS+x4gDG51f9T/AxkRpqB+Tq1QqVVbSfI1LepHtLu4FKkIQQi6otRRfd1SWjQg9awZ14pKept8fJRBUJjBQcOxkteTGr6jas8JL8rBlOIaoqvb9fMw6k6Pu94+/PK1llrFE6nE52Z3OA= Received: from BY5PR16CA0011.namprd16.prod.outlook.com (2603:10b6:a03:1a0::24) by SA0PR12MB4351.namprd12.prod.outlook.com (2603:10b6:806:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 19:37:00 +0000 Received: from MWH0EPF000989EC.namprd02.prod.outlook.com (2603:10b6:a03:1a0:cafe::84) by BY5PR16CA0011.outlook.office365.com (2603:10b6:a03:1a0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18 via Frontend Transport; Wed, 22 Nov 2023 19:37:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000989EC.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Wed, 22 Nov 2023 19:37:00 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 22 Nov 2023 13:36:54 -0600 From: Brett Creeley To: , , , , , , , CC: , Subject: [PATCH vfio 0/2] hisi_acc_vfio_pci: locking updates Date: Wed, 22 Nov 2023 11:36:32 -0800 Message-ID: <20231122193634.27250-1-brett.creeley@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EC:EE_|SA0PR12MB4351:EE_ X-MS-Office365-Filtering-Correlation-Id: a9226c59-114c-4272-2f0b-08dbeb92656e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BQT96WrgB69m2zaLkxGYthRON0lt/xLVeblZoqxN0tChSCUM0h+OEycgshKRk/dd5bZO6K45ykRpUIyrFzD8i5a2bdX6Yx+e6Ok8Eb/LA0XuDkeMEr+FNKQJgom5SS1AMXMk0aOKThUeNbbnx+5+IblJfqTniVY9XLLrs5R/q1joCqYzUuOKuHfNeg3D6Ooe57vliqiQ4IAJ3uAIZ3XPoerngmU5rA5IFshukizypiStyu1wbV3aDDh+y3Xw6ujJSkH1SK6yxqYT+TMYaQfD31GILLZ3Gp9Qk9K+5VWWviVwACFRaW9X8CJtIbNhqIySgtFifhKun9DVumk8+d8xrDaApKaBKTm7/JIiGYYej5w59F4qkgthzWGCj6p3e5r+I3PtrSljeDXXiirAoks5MQNTYs/X/cbE1fNCdBsWvtZZ2+WprRvN8lOnznMFNnZ3sD7xY0ophloeQcBQuGpKPX135YlVVB3l9ZeOatqt7BkhoBzElZSdGMOuQh5n23LBl34Hw+U6KeocqotHmarLqklLeP6ZJJLas2dBdT7zDmLudCvlHABmg0qfl2IuJDBZJiA3wainEQCX4ErKgcfv5K8K0SwzAe/tg2RMcjCSFgQbR0inp+GJ/v/mDKTCjdDyN+w3z2Ujjy+60kyh77998T7xiVMViflnTAD7uTXCfET9kuFoPtDZ6r8UWL9Gbkorv9ZWx5nI5P/Eokb7/UbTNprp9dX7MmLnDxvNsTnZt7xlKR1rg8z9KD95eV4vJm8TApX6fNKUZLFiXP3mIw3B9w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(396003)(136003)(230922051799003)(451199024)(186009)(64100799003)(82310400011)(1800799012)(46966006)(36840700001)(40470700004)(40460700003)(1076003)(16526019)(36860700001)(336012)(26005)(83380400001)(2616005)(6666004)(8676002)(47076005)(4326008)(8936002)(41300700001)(2906002)(44832011)(4744005)(5660300002)(15650500001)(966005)(478600001)(316002)(426003)(54906003)(110136005)(70206006)(70586007)(86362001)(82740400003)(36756003)(81166007)(356005)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 19:37:00.0810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9226c59-114c-4272-2f0b-08dbeb92656e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989EC.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4351 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 11:37:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783294212493141166 X-GMAIL-MSGID: 1783294212493141166 The vfio/pds series for locking updates/fixes in the following link made some changes that can also be done for other vendor's vfio drivers. Specifically, changing the reset lock from a spinlock to mutex and also calling mutex_destroy() in the vfio device release callback. https://lore.kernel.org/kvm/20231122192532.25791-1-brett.creeley@amd.com/ So, this series makes these changes in order to remain separate from the vfio/pds series linked above. Note, that I don't have the required hardware to test on this vendor's hardware, so help would be appreciated. Brett Creeley (2): hisi_acc_vfio_pci: Change reset_lock to mutex_lock hisi_acc_vfio_pci: Destroy the [state|reset]_mutex on release .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 25 +++++++++++++------ .../vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 3 +-- 2 files changed, 19 insertions(+), 9 deletions(-)