Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2961937rdb; Tue, 12 Sep 2023 19:02:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjvKDfkp9830SAPkCM8jmMhVdggvDN7uMcv84HdgZKyP1Kjy6c0K5etpR5wr9qsp6Xtk4W X-Received: by 2002:a05:6a20:7d85:b0:13a:12c2:359e with SMTP id v5-20020a056a207d8500b0013a12c2359emr1554202pzj.2.1694570555476; Tue, 12 Sep 2023 19:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694570555; cv=none; d=google.com; s=arc-20160816; b=c2DmBbjy5w3OXBstKsKfIxXXVXUv7YEBk0FQPhmIXh8C6zZnawei/upZjgQUKLKadL w0Sc+WysgYsqtGVfFCX+IE9/WMEv5YS6p9oNK9gDudcfyNT4PWkjma1FqH9ZHEoDQoWk 3+GlpGtX7NUEk6Q2giDXrFCzE1RfTgAgGc/L728L3LL/DtkKcmQTxtZNmqfsmj6fOR0c BwrvGY1CIXG8VC7qZjHXXzz3BoULhSrMguxZkSpmK/iiUwinar4MarKg8uM8oo+gkre6 8O23lGw2RqV35v8Ds8Fjd/Ss2lCHPrmGbRxW2HUj1nnnnlu9Bst/5vjuzoKPeR+hKLEr dt0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Txi23wRspyYUUUPE8k5xZ0QHxGCI9yeP3wIG0iIxIDc=; fh=TLdaYVTYpkOucWp2gi2TZIRkEiwPxZ330gpwGOOjymo=; b=c60wGEw0udJSQvQuz9f4nyiQTXMlt3yeKELY4r6OnVSDrtMBR99iLLkb2bo0jEmP3l 8cng9Wt/3CZSRm3jAnVMJmVvsHIHJP5EAMbvdN/U7yFOqH+AuXxTHILrrP5LiO1hNU+W unAiEImA8t39cVCTxSJhp4rTNAVAUu+4JHRC+7iiGCFPRyWLOq7gJcloktVqawkoG09c P0DI7AZ3LjSlSXEJCPXAKCw155lvX9WQQ78MfUaavXw3HG2r/y+nVxMe4Tmlci2OsBp7 4ejygwuwupCCigs+JRl5sHrX0Y+9lCwLe8dUAWhjAMCvizNLUF8uK8Np/QiyOmvyx434 2g1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TBTri2Oq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o14-20020a17090323ce00b001c3cbccf116si2931950plh.403.2023.09.12.19.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 19:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TBTri2Oq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4AFA880D2E49; Tue, 12 Sep 2023 17:06:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231474AbjIMAGp (ORCPT + 99 others); Tue, 12 Sep 2023 20:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbjIMAGp (ORCPT ); Tue, 12 Sep 2023 20:06:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF68C10E6 for ; Tue, 12 Sep 2023 17:06:40 -0700 (PDT) Received: from [192.168.2.112] (109-252-153-31.dynamic.spd-mgts.ru [109.252.153.31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 4C2166607186; Wed, 13 Sep 2023 01:06:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694563598; bh=RYQEfSbXS7icZ90VHcjg9Rfm4OG1Af8Gjmm95/x4NmU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TBTri2Oqslf+5RuTlsy+AOU7f92nLds/RoO7MtlBbljNEHWSpGQw9lGLPGPJzS/uB Q0d9tQ/H5E52iRMZlj7RsvCYBXPUIEDC29NZk5LINDnqVrsl6xNfpIc7iig0DLJD5i QKFP01nfkFNUqHH2kmbiTcXsyv3wAKAgyKiC9YIV/6wHDY4+F6t4hmi2PVMcLssoMa d1C8MWbcIkF82p7qRt3NJ9Vi4Dwtw13bFUTlSeAJdg4uC8JuYgeWJvVUaDDQ/TObnl 6orjtPjjg7C9zBFOV09qEbxQTc1VDxAwdfrNH+i9YCpTPhfUc/h6se3ZmKPCbVVMRu PB1hE4mk48WCA== Message-ID: Date: Wed, 13 Sep 2023 03:06:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v16 09/20] drm/shmem-helper: Remove obsoleted is_iomem test Content-Language: en-US To: Boris Brezillon Cc: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , =?UTF-8?Q?Christian_K=c3=b6nig?= , Qiang Yu , Steven Price , Emma Anholt , Melissa Wen , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org References: <20230903170736.513347-1-dmitry.osipenko@collabora.com> <20230903170736.513347-10-dmitry.osipenko@collabora.com> <20230905084611.6a404ff1@collabora.com> From: Dmitry Osipenko In-Reply-To: <20230905084611.6a404ff1@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 17:06:48 -0700 (PDT) X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 fry.vger.email On 9/5/23 09:46, Boris Brezillon wrote: > On Sun, 3 Sep 2023 20:07:25 +0300 > Dmitry Osipenko wrote: > >> Everything that uses the mapped buffer should be agnostic to is_iomem. >> The only reason for the is_iomem test is that we're setting shmem->vaddr >> to the returned map->vaddr. Now that the shmem->vaddr code is gone, remove >> the obsoleted is_iomem test to clean up the code. >> >> Suggested-by: Thomas Zimmermann >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/gpu/drm/drm_gem_shmem_helper.c | 6 ------ >> 1 file changed, 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c >> index 2b50d1a7f718..25e99468ced2 100644 >> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c >> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c >> @@ -317,12 +317,6 @@ int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, >> >> if (obj->import_attach) { >> ret = dma_buf_vmap(obj->import_attach->dmabuf, map); >> - if (!ret) { >> - if (drm_WARN_ON(obj->dev, map->is_iomem)) { >> - dma_buf_vunmap(obj->import_attach->dmabuf, map); >> - return -EIO; >> - } >> - } > > Given there's nothing to unroll for the dmabuf case, I think it'd be > good to return directly and skip all the error paths. It would also > allow you to get rid of one indentation level for the !dmabuf path. > > if (obj->import_attach) > return dma_buf_vmap(obj->import_attach->dmabuf, map); > > // non-dmabuf vmap logic here... There is a common error message there that uses the common ret. The error unwinding could be improved, but then it should be a separate patch as it's unrelated to the change made here. -- Best regards, Dmitry