Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1663798ybk; Thu, 21 May 2020 12:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2ige2baQJMk17p3lbzULFm5B4gVzhw64XfSIJT7cQkhnTU6Pne5mFaPCc8d400UjSGilI X-Received: by 2002:a17:906:3ed3:: with SMTP id d19mr5307788ejj.404.1590088212207; Thu, 21 May 2020 12:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590088212; cv=none; d=google.com; s=arc-20160816; b=THz8MhPMZx50oTkBtOsnLjtWIVLlPBmg3Oyya0hGc5CJhM7FeE7Lfq5AeY/0b16z2n xWraCeXkE6zlvFjAc2+L1dw6b/gAkZj5A2VH/1uoPuwVNNSmE9ElHQ4/N3ZAPEBHHVNu XfIgZbBCukXqZNYjhEi+AIxSKAKtg6a5/CL2GDDVjPc6UuJSc+O09j3wxCLckieyQ0Su G4If5EypHm3Jr47dv7e90Uq2W4jcid2gA/pnoZHe/5rMIGIE0+vbxNja2/NNfq+G0wuY /BJkSPzcskzgQc3m+MiiYvUkOZiXco9L2ffsiTt1BBj0RpPVWhaKcFrqYIiO9wAWSq7C ezaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=TsE8Woh4zkRDEYdrJ4szky2f76HNP2vRTH83cKZFVYw=; b=q7z48clc1FdxFdWlfFRzn8ySgH3R9uH8Yc58KtDquEsRemhSI1nSqDGb3UumTOwwKs aXJk4fQHWH1paV7zSm0Y0yd89Ne14RcQW8famCNJ39E9WzRyBeidUXNJugIgPAFEkcqH NGiBdWHSSlRTwSTRJ6ETwc/h0uJfj1gTWyJe7ine64W7ZJ1mABKmxYm4Xr75/TrpATww lYTsdiQDt9jh6PMYuq6LvXDmBIBwDUKmU4cfYcON4ides7CXFVwh1JBVpirI3IcqCS1g eQbgxEH0D7MVGvzHCUK3//oirMa1zBJIwNuUDhaSPouk7plbRtyXYQvwvZYOFApQ7jxh GDtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=G6bkOMjE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx8si3386276edb.196.2020.05.21.12.09.48; Thu, 21 May 2020 12:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=G6bkOMjE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbgEUTGW (ORCPT + 99 others); Thu, 21 May 2020 15:06:22 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:38346 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729548AbgEUTGV (ORCPT ); Thu, 21 May 2020 15:06:21 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04LJ6An4026452; Thu, 21 May 2020 14:06:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1590087970; bh=TsE8Woh4zkRDEYdrJ4szky2f76HNP2vRTH83cKZFVYw=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=G6bkOMjEAsuxKVKPsCnDAuLxmCjCWKUiG33hlFw2mv7smJKWSjhixJX/8O+k5Io+t NOoBOzAiaD4X/jVU3vX4XnezShs1pabJEG28E+RI4iL2A/g9xEwp0D7oHgf12ciX1D gTf5Yz0CIcBg43CoNVB+6rMZkj2yX5f8DTVl+3/o= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04LJ6AQf067299 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 May 2020 14:06:10 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 21 May 2020 14:06:09 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 21 May 2020 14:06:09 -0500 Received: from [10.250.48.148] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04LJ6994034395; Thu, 21 May 2020 14:06:09 -0500 Subject: Re: [PATCH 2/4] remoteproc: introduce version element into resource type field To: Bjorn Andersson CC: Rob Herring , Mathieu Poirier , Clement Leger , Loic Pallardy , Arnaud Pouliquen , Lokesh Vutla , , , , References: <20200325204701.16862-1-s-anna@ti.com> <20200325204701.16862-3-s-anna@ti.com> <20200521175421.GI408178@builder.lan> From: Suman Anna Message-ID: Date: Thu, 21 May 2020 14:06:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200521175421.GI408178@builder.lan> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, On 5/21/20 12:54 PM, Bjorn Andersson wrote: > On Wed 25 Mar 13:46 PDT 2020, Suman Anna wrote: > >> The current remoteproc core has supported only 32-bit remote >> processors and as such some of the current resource structures >> may not scale well for 64-bit remote processors, and would >> require new versions of resource types. Each resource is currently >> identified by a 32-bit type field. Introduce the concept of version >> for these resource types by overloading this 32-bit type field >> into two 16-bit version and type fields with the existing resources >> behaving as version 0 thereby providing backward compatibility. >> >> The version field is passed as an additional argument to each of >> the handler functions, and all the existing handlers are updated >> accordingly. Each specific handler will be updated on a need basis >> when a new version of the resource type is added. >> > > I really would prefer that we add additional types for the new > structures, neither side will be compatible with new versions without > enhancements to their respective implementations anyways. OK. > >> An alternate way would be to introduce the new types as completely >> new resource types which would require additional customization of >> the resource handlers based on the 32-bit or 64-bit mode of a remote >> processor, and introduction of an additional mode flag to the rproc >> structure. >> > > What would this "mode" indicate? If it's version 0 or 1? No, for indicating if the remoteproc is 32-bit or 64-bit and adjust the loading handlers if the resource types need to be segregated accordingly. > >> Signed-off-by: Suman Anna >> --- >> drivers/remoteproc/remoteproc_core.c | 25 +++++++++++++++---------- >> drivers/remoteproc/remoteproc_debugfs.c | 17 ++++++++++------- >> include/linux/remoteproc.h | 8 +++++++- >> 3 files changed, 32 insertions(+), 18 deletions(-) >> > [..] >> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h >> index 77788a4bb94e..526d3cb45e37 100644 >> --- a/include/linux/remoteproc.h >> +++ b/include/linux/remoteproc.h >> @@ -86,7 +86,13 @@ struct resource_table { >> * this header, and it should be parsed according to the resource type. >> */ >> struct fw_rsc_hdr { >> - u32 type; >> + union { >> + u32 type; >> + struct { >> + u16 t; >> + u16 v; >> + } st; > > I see your "type" is little endian... Yeah, definitely a draw-back if we want to support big-endian rprocs. Do you have any remoteprocs following big-endian? All TI remoteprocs are little-endian except for really old ones. regards Suman