From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966833AbcHBNsQ (ORCPT ); Tue, 2 Aug 2016 09:48:16 -0400 Received: from pegasos-out.vodafone.de ([80.84.1.38]:35172 "EHLO pegasos-out.vodafone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966732AbcHBNrY (ORCPT ); Tue, 2 Aug 2016 09:47:24 -0400 X-Spam-Flag: NO X-Spam-Score: -0.045 Authentication-Results: rohrpostix1.prod.vfnet.de (amavisd-new); dkim=pass header.i=@vodafone.de X-DKIM: OpenDKIM Filter v2.6.8 pegasos-out.vodafone.de 3F1BE261AAF Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementation To: =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , "Deucher, Alexander" , "'Sean Paul'" , Wei Yongjun References: <1469722697-15220-1-git-send-email-weiyj.lk@gmail.com> Cc: "Jiang, Sonny" , "Zhou, Jammy" , Linux Kernel Mailing List , dri-devel , "Nath, Arindam" , "Liu, Leo" , "Koenig, Christian" , "Liu, Monk" From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Tue, 2 Aug 2016 15:37:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 01.08.2016 um 14:16 schrieb Nicolai Hähnle: > On 29.07.2016 20:38, Deucher, Alexander wrote: >>> -----Original Message----- >>> From: Sean Paul [mailto:seanpaul@google.com] >>> Sent: Friday, July 29, 2016 3:35 PM >>> To: Wei Yongjun >>> Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, >>> Sonny; Liu, Leo; >>> Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; >>> dri-devel; >>> Linux Kernel Mailing List >>> Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than >>> duplicating its implementation >>> >>> On Thu, Jul 28, 2016 at 12:18 PM, Wei Yongjun >>> wrote: >>>> Use kmemdup rather than duplicating its implementation. >>>> >>>> Generated by: scripts/coccinelle/api/memdup.cocci >>>> >>>> Signed-off-by: Wei Yongjun >>> >>> >>> Thanks for the patch. I'll apply this to -misc once the merge window >>> is closed. >>> >>> Acked-by: Sean Paul >> >> Unless you've already applied this to the misc tree, I'd prefer to >> take it via the amdgpu tree. > > I recall Christian NAKing an almost identical patch some time ago. > Something about needing memcpy_fromio()? > > Yup, it's here: https://lkml.org/lkml/2016/5/19/235 Yes, exactly. We need memcpy_fromio() and memcpy_toio() in the suspend/resume functions instead of memcpy. I just didn't had time to test that yet (and that was unfortunately a few month ago already). So please drop this patch, Christian. > > Cheers, > Nicolai > >> >> Alex >> >>> >>> >>>> --- >>>> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- >>>> 1 file changed, 1 insertion(+), 3 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >>>> index a46a64c..b779b5f 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >>>> @@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device >>> *adev) >>>> size = amdgpu_bo_size(adev->uvd.vcpu_bo); >>>> ptr = adev->uvd.cpu_addr; >>>> >>>> - adev->uvd.saved_bo = kmalloc(size, GFP_KERNEL); >>>> + adev->uvd.saved_bo = kmemdup(ptr, size, GFP_KERNEL); >>>> if (!adev->uvd.saved_bo) >>>> return -ENOMEM; >>>> >>>> - memcpy(adev->uvd.saved_bo, ptr, size); >>>> - >>>> return 0; >>>> } >>>> >>>> >>>> >>>> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel >> > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel