Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6282376rwl; Wed, 22 Mar 2023 08:39:13 -0700 (PDT) X-Google-Smtp-Source: AK7set8JD2/ZBCjnBlLaU9iTs6hF+DEP2WN1bBOJcmTbaTH2M5FFlOVQjJx49j2v8naTwHjGEPh4 X-Received: by 2002:aa7:d547:0:b0:4fc:eee9:417 with SMTP id u7-20020aa7d547000000b004fceee90417mr7548163edr.18.1679499552950; Wed, 22 Mar 2023 08:39:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679499552; cv=pass; d=google.com; s=arc-20160816; b=oXyXrXwNwRUrjcabxgPIcKW5CzLnn9WfzbOLFmnXyqPoVu+atqlf5VQpICEk59h9BP idbZCsp98UPmOyXjtAsGpERp+zdQP0FGW16L99KIdpfC/DRPD6wReXEQB2LUzsz6qHmh O56uS0UTTHHfnR9o/RhEuYU0FNLU0kHoo3qTo9kGOMI9HmGzyTRF0Ba0raJlQx1/oe4S g98XTLMSGMd7qHt+hy64xuTQA0gtl7FkbheYHVha4gHgf4XeffHJD2lJ4j/YTi8giwac I0tWs82OeOMdPVmtg/nGw1fyNdSB6uqA186eMK2rUZhKpnioPlBd82FPLz+KrmAQION6 MaxA== 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=JZXsEuX0cCOW5oVUDIvRe16T0Z/s1mj1ALP5wCx7aas=; b=MfihllstF/zidLQQ0l5Cz+2fFUm9Ego3hgE0DbV/bNlb/PrLr1VdBtdbF0V3dOCSCR BivImvy/RODkpQlrth0JLB0zSdh3CfWWzJYPeomQUwRUgdfPANj3BIpP5ifxOxbSrisN Zpw+M4R3O+lPSAL39dsvhF0kOzK0h9ec3m6ZYvDT/T83xKmDzmYhkv8rNCAsfFOLsZ6x Mtj6MG4hSWBiEYfi7k4gD7K7qNMPGF0cp3ywdCVG9NxOfcdyliSx7ajQkguprYVaSBtj to7xNXdcelwDwYXtyuIDCOvcO2p8FBgRzZoz+YfkkIA2f2xKALwRH4oa17SrG2+QUPc0 tfnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=sBwr481x; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020a056402515500b00501dc7c4093si5182687edd.44.2023.03.22.08.38.48; Wed, 22 Mar 2023 08:39:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=sBwr481x; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbjCVPOh (ORCPT + 99 others); Wed, 22 Mar 2023 11:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbjCVPOf (ORCPT ); Wed, 22 Mar 2023 11:14:35 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2079.outbound.protection.outlook.com [40.107.101.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53C81E1C1; Wed, 22 Mar 2023 08:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WeN2CN2XLAAUf7MuX8HzU22cCAQpw4tpsUADB2XDZBegMuFPVEYyD4D+9VaGEUaNmTcdTdK937NLWNtNfDQQfHanrbioDV+wz6P8zvu5e/01jQiKZq+SrnTtKGoQOxVXBlAIEqSk0FXBMHXQIyBHkqAVVdulV5c8k1389BK6bIJw6HjYou7PvGJeWtPsYZv08AkkX9n2Uv7h4ZcqfRgwF9dEA74pDYcwfFg1/H57yo3U5+gLE12h0YqFiwK3PRUn5fal6FZVREFGcshqXniJgWAzM2J0rv5E7DMPsBT4XEiQF495XiGbJ1Ao+q4v2VZeQlgOTqJrxXIMT1RJ3UIr3Q== 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=JZXsEuX0cCOW5oVUDIvRe16T0Z/s1mj1ALP5wCx7aas=; b=U+wrVPsiyxPitT0BVr9tPJZvFRkmxC7n1aTJYZSOUcw0uyUx48xTyO+T9MORmYjbbaqTAALCM5H++7lu/OfrGH8Ph8fpgUIfykFwlvCW77Vp8+FmCo12FJsxirTyHMcqmIBITXWQP4kY0T8NtVb0ct+D6Rlk3jPsuwznko6vhKLMkm5SmxdUOlF5wzH9FhjGtHs3smpDRvgtrr1osUXdZLeZOjbUszEwWwNnEqu/AZBcA9oVvnm3xzima3yRWzkRF+0qWbdlo9sca0FCnZDkAY6RNIcpNZfxJpxCxL8Biv1yeMPj4dE3cRa0hoTTEtqVWYXtpHlE4gTfyzBA6yDF2Q== 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=JZXsEuX0cCOW5oVUDIvRe16T0Z/s1mj1ALP5wCx7aas=; b=sBwr481xHYb39Gxy/uzhdoRcWsrsCPf54uAosLYWv2NLjazqc0mkjKdFIuIXL1KRKxk5Rw1qAfmOmkK7W3VHFvwnwnoblAWTXLBZLD8AggpjsntRtUuadCglwdb5VCkl1UClyYytgh85ThMT576i2A8ddrRiO4/NNzsngnI3KbI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) by DM4PR12MB7646.namprd12.prod.outlook.com (2603:10b6:8:106::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 15:14:31 +0000 Received: from DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::cdcb:a816:4bc3:a83f]) by DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::cdcb:a816:4bc3:a83f%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 15:14:31 +0000 Message-ID: Date: Wed, 22 Mar 2023 11:15:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] drm/amd/display: Slightly optimize dm_dmub_outbox1_low_irq() To: Christophe JAILLET , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, aurabindo.pillai@amd.com, roman.li@amd.com, hersenxs.wu@amd.com, stylon.wang@amd.com Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Hamza Mahfooz In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQXPR0101CA0056.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:14::33) To DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB6280:EE_|DM4PR12MB7646:EE_ X-MS-Office365-Filtering-Correlation-Id: a7ef6c1c-bcae-4fe8-9368-08db2ae822a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +zSzXiuIxMxxQzqL7LELXvIRBRw5WWrW+VlrOcw471DeyQ9yZq5iC+KTdIgOum+BDYkK+JL0YRvYcqZXLQT1ITM5EnGrNztRsg0eqPl80BxKyS16NxApE4Wqj3tpf0J1zIQ48X5WddOu6PV8AIefzGZJCnmQsFWn3E6S46XhIXiGtlVN1XxvP/lT0sDmkh9lhGxdEW+2a3+XrKBU/LnjzvPoeTo5gcKr3DSPIQIILtGcPlflkgtppspslgkp99FbvZ2D+2KYZGyuooT5D3/rxuv2kyJQiD+MTDL3dQhsqHjLH0Vr6yH+1D4CA+rYRNpjy3Em5Ppl+d4/pYpSj9CZ9J3A4E5wRHu42SK3TqimAxNeoxfx30dUoKx5I3a/2TAksUdBaV7Mzm4xD6jhdqdKvtdArfFy3s9v2UO3wQhEG+jiwRBxW/Uow96L1sMPL8hbrYGpyc/2cy/5m3ig6nSOKdR9g3SCfljtL/14/ecukhL84M+Ony9be9YPS0Hj+3V/aca76kQ2ibfqyqfFel4NbvjNXIxyEbdX80WTC6gQYHUNhl/TUU2zw+mPGqEP8kPLMkkFq5eB9zUIUxYzDtt6kDJeePM7odylmLP1+n+BqXlnjNuzoWE1+xLbmWY0cuGRD9x0AOwC5d0UeNGPnvN52rz6RDueI76R892AhbbS/Vn0VH/NmPsaSMgyuXYFGysQCtVNvC4SOWC744MFaqIfolooSLkO+KOvw0dt8bAwrA5GxwPGk0SCr1zJppn+/B5k X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB6280.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(366004)(136003)(39860400002)(346002)(396003)(451199018)(86362001)(31696002)(36756003)(83380400001)(66556008)(316002)(4326008)(478600001)(8676002)(6636002)(66476007)(66946007)(6512007)(186003)(26005)(2616005)(53546011)(31686004)(6506007)(6666004)(921005)(6486002)(38100700002)(5660300002)(8936002)(41300700001)(44832011)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T1NERUgxUGpRcXJ4U016N1M3NXRHeW1iN0ZiSm9PSzdEUjEzZGZlTkoxR3R6?= =?utf-8?B?WUdDK0dvNEo1a3R1VExkQjlNZDdGUlFYOUJLcWVDN3pIUWh3WldBaUhCeHc1?= =?utf-8?B?ZEFpUlphNWprSmVCczMzc0ozUnNDK1l3L3pEQmM5REYycXhrai9RbGdOVzky?= =?utf-8?B?ZmhhZlliYjUzTkZCaWtIdUlxOTI3TDZCVEJHYlZIbHp6azcrNnBINlYrU1dN?= =?utf-8?B?bllYZE1aVkRzU3pLSFhIYUg5WTEyYVYwc1Fmakc2V2x0ZlpuZTBvZ0Z6aHkv?= =?utf-8?B?MGp5ampnUi9LendLclJ3djNXcklWU0FBTGpTZ2VYKzQ4K0V1Mm8wY2NDR3BL?= =?utf-8?B?c1R4MGhBTWgreXVaWWV3OEJLZDVyeHltMTFTa2lBSDhGWHlPZndKN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e8-9368-08db2ae822a9 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB6280.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 15:14:30.8044 (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: fm1AsHV5ckNOmcEVHQtDouN35Tybi8t3WGdVl3eKMcImVjYrdXja0Elw26H2OUCJYms5ZWw4kRSMfSx1jJ28Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7646 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=unavailable 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 On 3/21/23 13:58, Christophe JAILLET wrote: > A kzalloc()+memcpy() can be optimized in a single kmemdup(). > This saves a few cycles because some memory doesn't need to be zeroed. > > Signed-off-by: Christophe JAILLET Applied, thanks! > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > index 5bac5781a06b..57a5fbdab890 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -820,15 +820,14 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params) > DRM_ERROR("Failed to allocate dmub_hpd_wrk"); > return; > } > - dmub_hpd_wrk->dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_ATOMIC); > + dmub_hpd_wrk->dmub_notify = kmemdup(¬ify, sizeof(struct dmub_notification), > + GFP_ATOMIC); > if (!dmub_hpd_wrk->dmub_notify) { > kfree(dmub_hpd_wrk); > DRM_ERROR("Failed to allocate dmub_hpd_wrk->dmub_notify"); > return; > } > INIT_WORK(&dmub_hpd_wrk->handle_hpd_work, dm_handle_hpd_work); > - if (dmub_hpd_wrk->dmub_notify) > - memcpy(dmub_hpd_wrk->dmub_notify, ¬ify, sizeof(struct dmub_notification)); > dmub_hpd_wrk->adev = adev; > if (notify.type == DMUB_NOTIFICATION_HPD) { > plink = adev->dm.dc->links[notify.link_index]; -- Hamza