Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3299179rdh; Thu, 28 Sep 2023 08:00:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQM8w/4ZeJKdRnNuCsPJ+AQjaOXN2AVEaNXfUaVOPd+7Iq4CHGzVXQ+rPsB+BnyHEUHUpR X-Received: by 2002:a05:6870:a2c9:b0:1d6:b7aa:c6ed with SMTP id w9-20020a056870a2c900b001d6b7aac6edmr1256775oak.56.1695913241371; Thu, 28 Sep 2023 08:00:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695913241; cv=pass; d=google.com; s=arc-20160816; b=c0r/7tB66FxHP1zDEt6XMnuMBZnCvpWIXNmZQomBcpr8RSkIU3vof04GntDIbpeYt/ 3bP/9yfppZLM49tUacJGPO8mtnjWlyz7/LB2s0QSTHlMz5f1ne5dv+d+RvQuXLE6e0Ce NKfp1J7P2vrSRI9pvjT96XasFQ7o/CYjWFQYYsv55Dflu2RpT5GPQyJKys5SuX1lb6aq OQsJOry9ZMplgLk/5hS0CoaIy1gI7JmiVS7nHGL8GbnEaRvoWAClMNhMP6hxP0IJrgtd 8Fee9FyvGmveHfR5Q080gbeg+PwPT9Y+VsZNxStritUT2T8QoHPuCJX7BDMJg8c7lrGA jZJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=coL7RUfS8sMy70WefR4M5Sy2YIbfcNEYcGImBuWMpS8=; fh=ay2M3ioaqOwwrS5OY1CvUKcgO9QZSdOXrxpSTc1vX2w=; b=H+Ii+dv+o0OoDOtKbtyVtd3nt9MKwUfPFGSYDs0cWdyAdE7lTAH/Z9bCJRUkMkC5q0 aQ3XLPBw03p40AUkW/12FfYlFQTpHU/RFuBAUcJKR9a9mOrUlv3UDwdg98RMch7pw6MO PAatFKdcjv6ewQTFKhv5s1dRYLoL4ARqOK5cVxeSVNRoaj7zb9j1DYHq71NE09R0B/2W vmWC/Mx83w1lk4LUEnxN9V3K6UiR57GZ7J1ODGxCm6h2f99WzRHqXG1cq5DqAWyB0cQ/ xUbxJ4C/kU4qEmOzV/xp+/FBMenx6LoxDwMLzSPHVBvYuuzEOgzkG8hJuBepyfDoITY8 vWFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HKvsOdmL; 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:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j13-20020a63cf0d000000b0057821ea0674si8195163pgg.812.2023.09.28.08.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 08:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HKvsOdmL; 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:1 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 morse.vger.email (Postfix) with ESMTP id 02E1180A52BE; Thu, 28 Sep 2023 02:55:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbjI1Jzt (ORCPT + 99 others); Thu, 28 Sep 2023 05:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbjI1Jzq (ORCPT ); Thu, 28 Sep 2023 05:55:46 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB3C0122 for ; Thu, 28 Sep 2023 02:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QHujYAuLqXemt5Xh9HgfOLuxXnNv0V6b2uV4eeHeTkN0GXrp6AtQ9994N0yOnIx0/YGb71j/g6STERRL/x0BrKjK7yrCk0JGRfMuGOh9BpLz0U0HsV2S4AtLypOAQlyucePTx4o9SFFq/kf/V24K2Vbq5QL1e+/Kh8yzR+FtYh8v0GeR9JFeZ68cAnVAdTrzn519olG+BJt2HnvxQH7muPURx1QeeyhZREeARGIgT4FLHDlfPw43Ra0tbBhIxLgSzNS/li+NO8eEjoyZMCyPiE9PtkSZNHYSQ6jdR+ClL9u/59TBmuHEyt48MF9iWUU7zlfryHqK+PKsBquHs5oApw== 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=coL7RUfS8sMy70WefR4M5Sy2YIbfcNEYcGImBuWMpS8=; b=KC+mIgoiWYmJvjnO8MiW2NQmfyeZdPCmnjToAt28osNbOqB4eA8BuQJR0kMp0zww8Ntgs/BTiS/n7upWA8LCEVq/CKXDkQkTGDyvKbGvkU1Nl64gl3bVHsttocnGNrt6LgPvT/bxLjRgLmuMhFtiENSRKzhDHuFF2a6NO0ZX1wJxzUv0yBz8ja1UhVgDUYqV0oPXY3wXHNTBPYEAO7Lr2p3j3ynTqFgwLPoh8637B1QtqmHqxQjBV7ChBQYe9RfWMqyU1NX67HpBDa5gr0mTexZOVgaIKb7vOJs3LiVfzlAxc7BiMrh4zVCIiKM834HNzvA4bFE3Slql4LjXNup1cQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com 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 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=coL7RUfS8sMy70WefR4M5Sy2YIbfcNEYcGImBuWMpS8=; b=HKvsOdmLfswh/cbqUU+J79/5w3Pr5ETmZFgGXBRZeslcK/IB+GqtOdDzoRGR6rkSHuh8WOAMeSKaQPrHBFiJPoFvw39RyalITcFi0alh0h/O9JJmj8DZFgKUccl3gCKpal3Tui3D8GCqQqvSoI3n/q48Oe3oRAm4QdnyxLNDWro= Received: from SJ0PR05CA0030.namprd05.prod.outlook.com (2603:10b6:a03:33b::35) by MW5PR12MB5621.namprd12.prod.outlook.com (2603:10b6:303:193::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Thu, 28 Sep 2023 09:55:38 +0000 Received: from CO1PEPF000044F2.namprd05.prod.outlook.com (2603:10b6:a03:33b:cafe::bd) by SJ0PR05CA0030.outlook.office365.com (2603:10b6:a03:33b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.12 via Frontend Transport; Thu, 28 Sep 2023 09:55:38 +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 CO1PEPF000044F2.mail.protection.outlook.com (10.167.241.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Thu, 28 Sep 2023 09:55:37 +0000 Received: from rtg-Artic.amd.com (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.27; Thu, 28 Sep 2023 04:55:07 -0500 From: Arvind Yadav To: , , , , , , , CC: , , , Arvind Yadav , Christian Koenig Subject: [PATCH v2 1/1] drm/amdkfd: Fix unaligned doorbell absolute offset for gfx8 Date: Thu, 28 Sep 2023 15:24:27 +0530 Message-ID: <20230928095427.4337-2-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928095427.4337-1-Arvind.Yadav@amd.com> References: <20230928095427.4337-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F2:EE_|MW5PR12MB5621:EE_ X-MS-Office365-Filtering-Correlation-Id: 8be95dfb-3f69-4a60-8698-08dbc0091147 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mOhFXgFIE97bwJHTjFM5cc1ZYZ3NXoLmvpVODqIItJMHbdDEDNC9Wp6IqDnMwoXYszX8Vy5POXIM5FZCofFiONdIeZK3+PR/AKN+zELSDqEsCgliQiXBsWqoiK3yGcnBIavMWqJKzMzOEyMbDp0kUuEFyF7DCJljAdnzJowTw6SygIw8V/S4szZAkWTxKxqb/Bhee2cPv5NofdH41u2SfTRR1FieRwkHdIyjsW3ucXR23UQejDj3xtfjk7kA+ytds7vR/X+Oy1ZaRXHuZO5R6cw0fVDMoTWM3BaSytpbYlhzHj4UIgZgScgmU5k9cN+EOAyvBzUG5rGkPjT0pY8pofazjHSJZFxsZN7xnrk5jSEg78WtJf0D5C9zsuUVq6H3Jv8dyB+bM54oNxIsQhYrcRso52dKNftsZcE7V+1haZopsPFrS1/buFmH2YxvWQbaRu6vJV/XjwLV14JIQDBHlbcKSaTWRaoEWzvACt9C9EB5VvO0OO2c35O4d2aDnBSAboiMcik+d/XtI72Ul/e/H0UmJsUHHntTfMyj0vrQMoWe+n48z/I8F21li6yU5X9tn0LF0ZSbtmY0/DiMc6PIcWoY8bsb7UKw2uiKHh4lyn1vkwM6ze+r9KUEMpvsL5/bf1KHh6wniaBu2pblVdOvuD+fAgQV1ePkXVZgymtg1+p4xHp1tCtPPGZ7JLBkfxsDysoW1g7whsn5DzDkgCrhQOsGC7sytj0MP3WtkGTlVVc9ucFEOkp//FSN0bnAgQ9D6KsuaOX6qq6owcb74r7wWg== 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)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(82310400011)(46966006)(36840700001)(40470700004)(7696005)(478600001)(5660300002)(86362001)(40480700001)(70586007)(316002)(41300700001)(6666004)(54906003)(110136005)(70206006)(356005)(2616005)(82740400003)(8936002)(26005)(81166007)(16526019)(426003)(36756003)(36860700001)(336012)(47076005)(83380400001)(8676002)(1076003)(2906002)(4326008)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 09:55:37.8633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8be95dfb-3f69-4a60-8698-08dbc0091147 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: CO1PEPF000044F2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5621 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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, 28 Sep 2023 02:55:56 -0700 (PDT) This patch is to adjust the absolute doorbell offset against the doorbell id considering the doorbell size of 32/64 bit. v2: - Addressed the review comment from Felix. Cc: Christian Koenig Cc: Alex Deucher Signed-off-by: Shashank Sharma Signed-off-by: Arvind Yadav --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 0d3d538b64eb..c54c4392d26e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -407,7 +407,14 @@ static int allocate_doorbell(struct qcm_process_device *qpd, q->properties.doorbell_off = amdgpu_doorbell_index_on_bar(dev->adev, qpd->proc_doorbells, - q->doorbell_id); + 0); + + /* Adjust the absolute doorbell offset against the doorbell id considering + * the doorbell size of 32/64 bit. + */ + q->properties.doorbell_off += q->doorbell_id * + dev->kfd->device_info.doorbell_size / 4; + return 0; } -- 2.34.1