Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp183887lqg; Fri, 1 Mar 2024 01:52:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVyZVCLJPl9lawKxs/cQ9FWyh5N2PHCmN17XzDfm9Qc67TPyZNNbgX8eBoDsaoY5eqeicH6TVWXIphEnjVCSkvClI49PmSuOKCq3FndGg== X-Google-Smtp-Source: AGHT+IH/+NN/yTdHkEw/0G9RmUF3wM6bElV0rWjNNAPwcSyB5fCPaC6iY64/i0zbiOgxMQuJwUvO X-Received: by 2002:a05:6808:2114:b0:3c1:beb0:a395 with SMTP id r20-20020a056808211400b003c1beb0a395mr1399613oiw.4.1709286752553; Fri, 01 Mar 2024 01:52:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709286752; cv=pass; d=google.com; s=arc-20160816; b=f4loRJKBQILAaKtgWgLvCCYjl+aDhHQEUZNqp79GJL6SjH7lsIr2mhGBLMBgr5/gAO NerJUUSq2KbC+rZ8YR+pE3CLN71MO2NkjH7K6UKk7B6bIsjK3xxreBXDD1XPYZFLguqM qen4/XQTT4aFtiBrkjwKy6OzZPSOY3lWmCXTreA84tWxW8PLL+1KGqmmZdS4+HsxyYIX ydEdQ7/IFWiP16A/i6hN1CQGpJ3T8K4l0qNGurShTVeY+yWL0ytch9DV4yqEaJq8Vg4L qAOWHdx+aqtyvlT4d4utsK0IP7DeU0Q36AVRJHgkYC4I0LaWMTXyJbzcKGA3ScuoGoxJ GICw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vDkD+uUqmi7yGsqfPO06ZyN3HpS8QWDgQH4vuDrIkp0=; fh=elZJVR8UbTJn4ElLD5wjsKG9IWd7ZfhvhLqWaxv/VvE=; b=UACAvnDrvbyrFJhY1jxHYGwxBzdtSAP37mcfu+PqpBaAmkrXlsBIjDBk30W9tc2hnk o9+ssWBFpO3SoK4QLgkYact/TY5iGT4YQmwgf1V/ZEwHw6gp8cIEyHquZ62LKoB4K3DG 3ze3o9l8Y5MeKCVoJPykU3xj8l8zt+jmxWJ7n3GWNceYiqHv+kSaAkhVP8SWzvCLZ6gg gog1MrFaSiVfJNVWWaXND464nl4KxBHRdXH9JaqQyMirAAS0nIivKUKw6rNErP+R/FYK V4dyr8mBWXyYyew6XP+PlbZgpSqMGsi2lVio3kDKM1HBDDBAoqEILnECDM8m9K/gTSkW J03Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QlpjN5Nc; 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-88203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88203-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 17-20020a631751000000b005e46e6ba6cdsi3290582pgx.391.2024.03.01.01.52.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:52:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QlpjN5Nc; 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-88203-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88203-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 34095282DB4 for ; Fri, 1 Mar 2024 09:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D7A26A8CF; Fri, 1 Mar 2024 09:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QlpjN5Nc" 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 A73446995C; Fri, 1 Mar 2024 09:52:20 +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=1709286742; cv=none; b=HTd1UXeqxoy/xxeeq6S+vCJkkn8RujlbybltHWW7J1cUsLINLjjo2d38VTxWUWcBoNykGaeQAxYSTQHcIUqsVYxXs+AVzKHHHwfG5vhuU1jPVKLeDF76DGEe6JBXLA8OctfNu5iKtXwDojajaDEQZQ4QeAnOHAB1xFdJgIiPdaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709286742; c=relaxed/simple; bh=0eEAsDUiGlym1jRBLErLtOHPYKonoraS/Q/lwYdLL6c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=umiwyrmIKcrGdeV+FDewlvy7nZbWk8eYlMk5732kPxWE7uKtCbi0ngTrsmB9LLzqnps4OXoWJLUiZSjNxZlKm1W2v1ZureQIs1KnE7qDfp9PNQcF4KzbGjdoqAYjldaF00PQQZE3DKmXixI0tQS/w7h9dhKCLveg/LCjmc5/dGQ= 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=QlpjN5Nc; 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=1709286738; bh=0eEAsDUiGlym1jRBLErLtOHPYKonoraS/Q/lwYdLL6c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QlpjN5NcAeEwbGqu8RBj8FauZX1FwPsgaeROmXHEoWtABFUvUWIUbaBKxyeneagj+ 1UMyEDl4P6erEOnJi3aTI2uM1hCwNRyrngSEcUGRVU0ADqgSHnhjKGJ2wkL0tIej5y Leu0Qqm0fJ+NA7PsAPAlPG4hCRWAToti342lVzo/jtY3F07QE5naDvn17ZiHnKo0wv tDob4iV+b+hgvM8LtksTiyL5m1Wt3SY6YUGeB/L3g0Q4UEHOa/KEUeKwliFIMsJ2vJ ubUxB9KvFGIfD7PLvjj4SPMfjJN1ut8Doyf29CMphkVvKLctsGmaGV61XRH55wxG5k 093TghaWTwZKQ== 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 B50A037820C2; Fri, 1 Mar 2024 09:52:18 +0000 (UTC) Date: Fri, 1 Mar 2024 10:52:17 +0100 From: Sebastian Fricke To: Yunfei Dong Cc: =?utf-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4=?= Prado , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com Subject: Re: [PATCH] media: mediatek: vcodec: support 36bit physical address Message-ID: <20240301095217.bmsnizobpb736fgg@basti-XPS-13-9310> References: <20240301020126.11539-1-yunfei.dong@mediatek.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 In-Reply-To: <20240301020126.11539-1-yunfei.dong@mediatek.com> Hey Yunfei, On 01.03.2024 10:01, Yunfei Dong wrote: >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. I would reword this a bit, the address is not beyond 32 bit, which would could be interpret as if the address starts after 32nd bit, instead it is larger than 32bits. Secondly, we don't change the type in case the high bit is missing, we change the type unconditionally, we do change the type so that the high bit isn't missing. My suggestion: The physical address on the MT8188 platform is larger than 32 bits, change the type from unsigned int to unsigned long to be able to access the high bits of the address. One more question below... > >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; > 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; I can see in other parts of the driver that bs->dma_addr is converted to u64 or uint64_t. Is unsigned long always 64-bit on the different Mediatek platforms? If so, why do you prefer unsigned long over u64? (Which describes the type more precisely) (Same applies for: drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c:452) Greetings, Sebastian > tb = instance->tile.va; > for (i = 0; i < rows; i++) { > for (j = 0; j < cols; j++) { >-- >2.18.0 > >