Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2752614rdb; Wed, 4 Oct 2023 10:18:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEEagmcfOzVBJO82dc0ekoqjpuUwNycLj3GF+QqsD44yDRFfRuZVT17Fbv/xbXtUhaVA5x X-Received: by 2002:a17:90a:540e:b0:279:104e:1779 with SMTP id z14-20020a17090a540e00b00279104e1779mr2838025pjh.16.1696439883852; Wed, 04 Oct 2023 10:18:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696439883; cv=pass; d=google.com; s=arc-20160816; b=k+ug+UhJWSDWsbgwCm35iXpI1PYzVIgLmBS4g1Ldcmwf3boGwv537tDtA8ckDn23Ds XULFd8A82wcPkWWoseDHLJXkahVPMzpsz2SzkI8dPH2It6nJVi4I2aqiGbKv4A87hahs 5ASRD8X2vkLKHCPVWlgH8geBODropSjv1cLBjY9j+SuUuvfJKLsLJ2qy/IwYhVNVzmi6 i3GAdtgllLop60bAgCzyHV/ufDKy6i4W1a7FYvbLBiTMuykLB/3+jJ/r9S5dYR5/eMON GPVagrqHqfOkK6/lbEpugvV+Z9wWMAslJVE1JQz2V6d0CcADMLDCjiDXX0CGgHWDWfO2 Pi5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=ED3WJACXf10ehvHcD1LImmTP1REgtaTe89/DJlrkQ+0=; fh=/oo44GXum09YD0dTIWz+asMId1dw6mrUGGkk/+GeWuI=; b=F2ZD8G5TirQcWxGcfhBALoy+NNMZ5pbwwaagu0Y570VqMNTp3WygKvL7cEA6+yL7DE jLDN5+CL8DqQk61ZeFEuAYdAnkDRi8RgjCKrkKqqC35L0Q9UKahvEC2bkI7uSBGMDUG8 dQiphmnNjZgJdfQr1kYSRQYEAfvEleH2nBRXFLv/JzNEMn+ubCMv+pgo9hoh4Bvszupu JlV+jVeQTqZOIC2oK/glbeoQoVKgKnQXWiJuOhp6Cj31hQOxDMrwQV7D7FReuJEu9euK 6A1LGvVW0A9tr5OYm42spARXwuYwIyx0kn06J+FqhBNTFrMvfD4EeLWsrTBkVFabbPPT dg+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=KOlKGxPe; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id my12-20020a17090b4c8c00b002791bfc67bdsi2010393pjb.41.2023.10.04.10.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=KOlKGxPe; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 2F89181B4AEA; Wed, 4 Oct 2023 10:18:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243663AbjJDRRd (ORCPT + 99 others); Wed, 4 Oct 2023 13:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243651AbjJDRRd (ORCPT ); Wed, 4 Oct 2023 13:17:33 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D4AB8 for ; Wed, 4 Oct 2023 10:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQceNfMfWErQV3L8CSlC6gX7Nz7BCKRUeeNBjLP/gr9UdciDpNdMy+H6FlrNVAIlJRCc7Pl3+KKd5Fk237zF9lSsZ9H84pbwxQB8EsNoX3TqtjEhvOtUhRem3YxpBw9AaU8tYZTGG6gI5XpDhwYNQp8dDUocLR/kTG1HbU1qOZNvEkDutm6+xBf7hPyjqxnRiXGPPtOkY+nT3umwgehdfr+Q4/KfsM5JtZUEOkBTx20BRLGhIwqwCoYEY3Nms4L+Xc9humWjno77DAiIqfuBv/1Q57Osgx8TiIPvp+jizArhbbj5e0JwYKTlboKQag3hov4Ufv16EqyIguhWrKIqWQ== 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=ED3WJACXf10ehvHcD1LImmTP1REgtaTe89/DJlrkQ+0=; b=I7pBoBr61CaFj4bx0BdiDHzROm4+zmEQoryRUQzupk8ccSaVnmHAQZXrtdbL7HpCKZ6JsdTkZTfCRKwvKagXP2Fr2Jouv9UoakD0TwIT2au1j50TpH6l926jedSoeMTjplS8IlmLVtWJ4I8nWehmmyN+jGCa0lbDpRuze8sSg4JJvRX/8gkWnIaXCdsdxkYUIAoEP3TwVHo+5emTUGVm4EVdOJtQPfe5YyALWivFVzzQOS1Tjcz6V959d0rGfFPGIIB8KydRL6rV9uotT8j1mzsPEBJGZbLvEoY2EeD4f/KuyQLo8LFzpTqkEicUpSmnAhUmerIxBtqPxrv8j4jkHA== 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=ED3WJACXf10ehvHcD1LImmTP1REgtaTe89/DJlrkQ+0=; b=KOlKGxPetKI5Q4x5wIA0oe8DFxiiT5XpksGSQIC1CjNQZK0hCin8ENhceqbA9wFt2sLBHaexeS6Kyy3EdWEHYnQhWtOKdIc5itcLbP0XtPbN9pUuHOuk/ajNfAfryFA/EJWt7CcZYQOOetSSC3i0qETYOnf/SLlqF+n8RTcCjbA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB6000.namprd12.prod.outlook.com (2603:10b6:510:1dc::15) by PH0PR12MB7079.namprd12.prod.outlook.com (2603:10b6:510:21d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.27; Wed, 4 Oct 2023 17:17:23 +0000 Received: from PH7PR12MB6000.namprd12.prod.outlook.com ([fe80::65a:db41:7713:c60f]) by PH7PR12MB6000.namprd12.prod.outlook.com ([fe80::65a:db41:7713:c60f%5]) with mapi id 15.20.6838.029; Wed, 4 Oct 2023 17:17:22 +0000 Message-ID: <0d546c7c-2302-8d51-e37d-da47d9f5a39f@amd.com> Date: Wed, 4 Oct 2023 22:47:10 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 2/2] drm/amdkfd: get doorbell's absolute offset based on the db size To: Felix Kuehling , Arvind Yadav , Christian.Koenig@amd.com, alexander.deucher@amd.com, shashank.sharma@amd.com, Mukul.Joshi@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20231004161652.3082-1-Arvind.Yadav@amd.com> <20231004161652.3082-3-Arvind.Yadav@amd.com> Content-Language: en-US From: "Yadav, Arvind" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MA0PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ac::7) To PH7PR12MB6000.namprd12.prod.outlook.com (2603:10b6:510:1dc::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB6000:EE_|PH0PR12MB7079:EE_ X-MS-Office365-Filtering-Correlation-Id: 15f8f0ff-6354-482b-8871-08dbc4fdc5a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yo9HWra0sgkkWODCIVMBKANZmY+i42j6CWa87PHUC9yPGm9+JBIdnn57M3io1OeC9qSyOLWafU9+QIqhN7O/v/21VjIgeJNoaoOR5ae9T3ww3UmaLzbd3NtJkMX/9wLdhPb/KNJGv4sBS3dXJR11DOVE+6hs+Kh13/D/0wlXV0tzQpioNA7ZCXK5bJLWynr4ZvAQpTvCvBNkosAnkHbMtJZpoRXsr3kjTlyGewM/JnAVPSV0IgC51vtHKbwjfqd2hJcIaNO89tReXlyjCX9nkOXOrgt2qDgrVKTQpqTewP0xqUQl3nr8rnAhe3FlaMZNCiHEz5cfwsRnkHE8dwzz74Zu3QtcSRRLCU7Hyxp/0wpSpxNYlb6/bl3Zh/pVoxaVq5cCB90dQ9/5dgVGtA9exBDVD6nSN8AfanToHzeRdXdsTJY6Lo/ODhi7YtRGmU54nr7tgN4qxBpuf1dBnl0a4ZvhZ3AJShTP4EqtmTPSIyheLM+ydLJPy/5yGey6YUmYDbkN2bXAOHZwUPpQ4t9t332Xc6zZTOyoc6qPTRwppEdjxwwxeRvo8aefPtj/kIKPfr01nTaivLHUaAwI7NamzTddAKbB74aQQBfheWhOVu79dR5rMniiTLXyOz/gRyjuzBiN6Ejdg8TJMTDqFyUimw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB6000.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(136003)(376002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6506007)(53546011)(83380400001)(31696002)(2616005)(4326008)(6512007)(8936002)(6486002)(6666004)(478600001)(26005)(8676002)(316002)(2906002)(5660300002)(66946007)(66476007)(110136005)(41300700001)(66556008)(38100700002)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y3E0emhKb2pNM0J4U2JkUFBzdGYyOHJDQWo3c204ZE9hUCtMd24yb2VWZE43?= =?utf-8?B?bVpBQi9nbUNSZUM1TC9Ma2F2bkFxMXpqb1g0TGd4d0ovenJjUFc0dmw3NnhF?= =?utf-8?B?TDVLb0NrNS9JVTExZmRsOE8zWWdyZmZvTW5ieG04TGlqSUNXUGlMVDM2REFP?= =?utf-8?B?OEdIcHg4bDJabmlQbEhhajBjNmFnTEN0STlEREdrUTBEU0FNQzFjNDA3Mndk?= =?utf-8?B?NWsrdVYwSk1rNTVnd1h5LzYzek45Qm1ra0hWSDUwaTgrSFFh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pialJkY3dFalFIT2doYTNmV0Y0WmNPSGdxU2F2RHBhZlArS3grUFRnWGZ3?= =?utf-8?Q?fybOPxh8n+tcqWam2641jnphj?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15f8f0ff-6354-482b-8871-08dbc4fdc5a9 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB6000.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:17:22.8636 (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: of09ZgVkw6+1WQgAm++mebaljxYMMfQE483+i92/XYKXirVfjXXEXsssxJIvCZWkMf8GJIh5A6T0bDukewW7RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7079 X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:18:01 -0700 (PDT) On 10/4/2023 10:29 PM, Felix Kuehling wrote: > > On 2023-10-04 12:16, Arvind Yadav wrote: >> This patch is to align the absolute doorbell offset >> based on the doorbell's size. So that doorbell offset >> will be aligned for both 32 bit and 64 bit. >> >> v2: >> - Addressed the review comment from Felix. >> v3: >> - Adding doorbell_size as parameter to get db absolute offset. >> >> Cc: Christian Koenig >> Cc: Alex Deucher >> Signed-off-by: Shashank Sharma >> Signed-off-by: Arvind Yadav > > The final result looks good to me. But please squash the two patches > into one. The first patch on its own breaks the build, and that's > something we don't want to commit to the branch history as it makes > tracking regressions (e.g. with git bisect) very hard or impossible. > > More nit-picks inline. Sure, we can have one patch. > > >> --- >>   .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c   |  6 +++++- >>   drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c           | 13 +++++++++++-- >>   .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c  |  4 +++- >>   3 files changed, 19 insertions(+), 4 deletions(-) >> >> 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..690ff131fe4b 100644 >> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c >> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c >> @@ -346,6 +346,7 @@ static int allocate_doorbell(struct >> qcm_process_device *qpd, >>                    uint32_t const *restore_id) >>   { >>       struct kfd_node *dev = qpd->dqm->dev; >> +    uint32_t doorbell_size; >>         if (!KFD_IS_SOC15(dev)) { >>           /* On pre-SOC15 chips we need to use the queue ID to >> @@ -405,9 +406,12 @@ static int allocate_doorbell(struct >> qcm_process_device *qpd, >>           } >>       } >>   +    doorbell_size = dev->kfd->device_info.doorbell_size; >> + >>       q->properties.doorbell_off = >> amdgpu_doorbell_index_on_bar(dev->adev, >>                                     qpd->proc_doorbells, >> -                                  q->doorbell_id); >> +                                  q->doorbell_id, >> +                                  doorbell_size); > > You don't need a local variable for doorbell size that's only used > once. Just pass dev->kfd->device_info.doorbell_size directly. > I have used local variable to make the code cleaner but I will remove local variable. > >>       return 0; >>   } >>   diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c >> b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c >> index 7b38537c7c99..59dd76c4b138 100644 >> --- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c >> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c >> @@ -161,7 +161,10 @@ void __iomem *kfd_get_kernel_doorbell(struct >> kfd_dev *kfd, >>       if (inx >= KFD_MAX_NUM_OF_QUEUES_PER_PROCESS) >>           return NULL; >>   -    *doorbell_off = amdgpu_doorbell_index_on_bar(kfd->adev, >> kfd->doorbells, inx); >> +    *doorbell_off = amdgpu_doorbell_index_on_bar(kfd->adev, >> +                             kfd->doorbells, >> +                             inx, >> + kfd->device_info.doorbell_size); >>       inx *= 2; >>         pr_debug("Get kernel queue doorbell\n" >> @@ -233,6 +236,7 @@ phys_addr_t kfd_get_process_doorbells(struct >> kfd_process_device *pdd) >>   { >>       struct amdgpu_device *adev = pdd->dev->adev; >>       uint32_t first_db_index; >> +    uint32_t doorbell_size; >>         if (!pdd->qpd.proc_doorbells) { >>           if (kfd_alloc_process_doorbells(pdd->dev->kfd, pdd)) >> @@ -240,7 +244,12 @@ phys_addr_t kfd_get_process_doorbells(struct >> kfd_process_device *pdd) >>               return 0; >>       } >>   -    first_db_index = amdgpu_doorbell_index_on_bar(adev, >> pdd->qpd.proc_doorbells, 0); >> +    doorbell_size = pdd->dev->kfd->device_info.doorbell_size; >> + >> +    first_db_index = amdgpu_doorbell_index_on_bar(adev, >> +                              pdd->qpd.proc_doorbells, >> +                              0, >> +                              doorbell_size); > > Same as above, no local variable needed. Noted, > > >>       return adev->doorbell.base + first_db_index * sizeof(uint32_t); >>   } >>   diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c >> b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c >> index adb5e4bdc0b2..010cd8e8e6a1 100644 >> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c >> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c >> @@ -375,9 +375,11 @@ int pqm_create_queue(struct >> process_queue_manager *pqm, >>            * relative doorbell index = Absolute doorbell index - >>            * absolute index of first doorbell in the page. >>            */ >> +        uint32_t doorbell_size = >> pdd->dev->kfd->device_info.doorbell_size; >>           uint32_t first_db_index = >> amdgpu_doorbell_index_on_bar(pdd->dev->adev, >> pdd->qpd.proc_doorbells, >> -                                       0); >> +                                       0, >> +                                       doorbell_size); > > No local variable needed. > Noted, Thanks ~Arvind > Regards, >   Felix > > >>             *p_doorbell_offset_in_process = (q->properties.doorbell_off >>                           - first_db_index) * sizeof(uint32_t);