Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp184531lqg; Fri, 1 Mar 2024 01:54:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuTRn03WQhKjI8M7Y+NbSkWbiI0CKO6KXOYpU/APdk8WOF+71QsWN/QOu201QVxsodPLSzKFKwM6kQCId0l7m8p80LhI/Wf02gmKI4dQ== X-Google-Smtp-Source: AGHT+IHEh3Ry/JAlzWVhg34IiiMJkQW4iWLRhh4UEm9EurLu/BbmEDi1eQn1IcK4ksJ7/z7wuquW X-Received: by 2002:ac8:7e8f:0:b0:42e:b75c:e179 with SMTP id w15-20020ac87e8f000000b0042eb75ce179mr1467947qtj.27.1709286866013; Fri, 01 Mar 2024 01:54:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709286866; cv=pass; d=google.com; s=arc-20160816; b=jzNprFD5qDqG9mZEbzUIywW1b9ovKuQTT7zhL6Z4dwzvHCR9ywTRY7vTekINJRDfSE TQDTlb5bvDIkhXbB6oQIavaBRzuVFsa4bmcha0WNJhYjOcg0VKsZdWlP4yiOXOqQEblu G9Zlk2h/bN1h/Fi9CDqkj4lCIYYKGADnaOhrXj6zFYOmWDmOXSmDSeykEfop/cQqx6LO BCejPBY+4C73+EuaHKwowp5buvUAfg4+odpiyyLtYJb/NPrg0ZEcjyqdWw70EXFYwvRr JtlXnaKyEk5wIr4hprk4TNnyWjNNC0NDi4hBaOOYX9WbZYgK49R62ylkwjZ1EyU6pFaj EQDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bs+bGHzHMYL/338SX/K5MzlkAEy0y9kD3aqdeFvqn+o=; fh=Jm+vRGnpDp7K3/4PlVpRvIcQxzgjOIbFY1/IeKHq0W0=; b=UW08KDvf9vgZ08haGXb0D/puMtNyrBoLO3NgdfgNybtQdVt+ZorEO93J6rXMqCDhBS kCdG/xgoZkHyBBYAS413TofPvFrQiwYZPmG13L5ZEquiOY01U6jNT/BsgKAS4RmHcMgJ B78Zb0XL/AGKOONr3eN/dUhawRpmXmF5UF+haRhftHFB4dTlo5fSlOd0Ze0bFOHYjq+L WmUykFlNNMu5of3BHrzkGoXqav8AFJgfKoZHI1kA9JI1p2Gs3yt/+bXKTz9Eb7eyQGpG OlIMq9AvYNQc5c8TcnPGanNQDbaY9C7vb/WfhvMWaXAZxSZV2bQPGWXcAVoCNfoDfZm8 OkXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tGYVJO92; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-88205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vu28-20020a05620a561c00b00787804868d7si3225046qkn.494.2024.03.01.01.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:54:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tGYVJO92; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-88205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B53E81C20E8C for ; Fri, 1 Mar 2024 09:54:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB22A6A8D5; Fri, 1 Mar 2024 09:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="tGYVJO92" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81B3B6995C; Fri, 1 Mar 2024 09:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709286852; cv=none; b=fiU4vVEMu8MsjLtvCYKpFA9XZRzZUGw3mSYtrTv1VFKBa2E2qKsVewV9b5haqStScpsebPAM3MtuOyFdYB6elPNmIdHs9blfJHXAGnWXvBdzTyRdVDOVJ+Iy9pYgo7rXljEKwPP1CwNqcn/1hls2D86THnMdtayk81p0ApAl5RM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709286852; c=relaxed/simple; bh=TvOeS+gkrSoRl27YcSo8vGBcXBu+FwFHZ14acWBgVEc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cgRzOrfu0EKTSUaKCX11jXs5K9MLZAFmC+Za+AyxHUJ9KGj3LmXx2cgJ/3Px2+bJHqMWgXXVZT3eYXv7F0rcZ6mOAfLpdHqAs1BOxZ53cqmaH6ON5RjVHMCtDvZg8IXwwOV9Yp8dFeUlOSMls5HA7G7/iJGOXZhr3RVUNvuFLTw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=tGYVJO92; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709286847; bh=TvOeS+gkrSoRl27YcSo8vGBcXBu+FwFHZ14acWBgVEc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tGYVJO92s/E6trrtTDfgT+rP/d8KDOX34glXLf4m+QrACnCjhGQFkS61NSd/RtYCF 8pQV8vHl1BXN0RvsMg20mMlWgowlIXj4u7OaTaG5W5WBm4xBzQOyWiTS/ZmEIdcZIZ /+EpvaJqbevyu6cTOK43M1ChP0zaLSdLHXL3nZvaOeIRj2IVPFRBn0Z0ZFzW+19ZPw pER4iNs+324frTCLttf+rGsb4BQYYGSwDk/pdPgbJjmNbhEIdNNJH/GuvALrLSwOdN A9wYGh9bD/PdgMGUgx9Jbp4prk+iLBBgeN2RVHdE4PCbrMj76auO5kMYxihIwy1IL9 xGyZBwAfYDT7w== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sebastianfricke) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 788D737820C2; Fri, 1 Mar 2024 09:54:07 +0000 (UTC) Date: Fri, 1 Mar 2024 10:54:06 +0100 From: Sebastian Fricke To: AngeloGioacchino Del Regno Cc: Yunfei Dong =?utf-8?B?KOiRo+S6kemjnik=?= , "nhebert@chromium.org" , "benjamin.gaignard@collabora.com" , "nfraprado@collabora.com" , "nicolas.dufresne@collabora.com" , "hverkuil-cisco@xs4all.nl" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "frkoenig@chromium.org" , "stevecho@chromium.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , "daniel@ffwll.ch" , Project_Global_Chrome_Upstream_Group , "hsinyi@chromium.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] media: mediatek: vcodec: support 36bit physical address Message-ID: <20240301095406.4xu2fadgwgswn6jj@basti-XPS-13-9310> References: <20240301020126.11539-1-yunfei.dong@mediatek.com> <7de218a7-680f-40a8-a002-d6a2c87f53ee@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7de218a7-680f-40a8-a002-d6a2c87f53ee@collabora.com> Hey Yunfei, On 01.03.2024 10:36, AngeloGioacchino Del Regno wrote: >Il 01/03/24 10:23, Yunfei Dong (董云飞) ha scritto: >>Hi AngeloGioacchino, >> >>Thanks for you reviewing. >>On Fri, 2024-03-01 at 10:03 +0100, AngeloGioacchino Del Regno wrote: >>>Il 01/03/24 03:01, Yunfei Dong ha scritto: >>>>The physical address is beyond 32bit for mt8188 platform, need >>>>to change the type from unsigned int to unsigned long in case of >>>>the high bit missing. >>>> >>>>Signed-off-by: Yunfei Dong >>>>--- >>>> .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 >>>>++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>>diff --git >>>>a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_ >>>>lat_if.c >>>>b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_ >>>>lat_if.c >>>>index cf48d09b78d7..85df3e7c2983 100644 >>>>--- >>>>a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_ >>>>lat_if.c >>>>+++ >>>>b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_ >>>>lat_if.c >>>>@@ -1074,7 +1074,7 @@ static int >>>>vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>>>*inst >>>> unsigned int mi_row; >>>> unsigned int mi_col; >>>> unsigned int offset; >>>>- unsigned int pa; >>>>+ unsigned long pa; >>> >>>If you used the right type from the beginning, you wouldn't have to >>>fix that ;-) >>> >>Yes, you are right, thanks for your remind. >>>Is there any reason why you didn't - and still don't use the >>>`phys_addr_t` type >>>for the `pa` member? >>> >>pa is also iova, dma address. Change it to dma_addr_t looks much >>better. >> > >Ok, dma_addr_t looks good as well. Ah alright, disregard my comment about unsigned long vs u64 then, but please have a look at the other casts in the driver as well as you currently cast to either: - u64 - uint64_t - unsigned long Greetings, Sebastian > >Cheers! > >>I will change it in next patch. >>>Cheers, >>>Angelo >>> >>Best Regards, >>Yunfei Dong >>>> unsigned int size; >>>> struct vdec_vp9_slice_tiles *tiles; >>>> unsigned char *pos; >>>>@@ -1109,7 +1109,7 @@ static int >>>>vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>>>*inst >>>> pos = va + offset; >>>> end = va + bs->size; >>>> /* truncated */ >>>>- pa = (unsigned int)bs->dma_addr + offset; >>>>+ pa = (unsigned long)bs->dma_addr + offset; >>>> tb = instance->tile.va; >>>> for (i = 0; i < rows; i++) { >>>> for (j = 0; j < cols; j++) { >>> >>> > >