Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3611748ybl; Sun, 12 Jan 2020 22:44:08 -0800 (PST) X-Google-Smtp-Source: APXvYqz19flQd7B5X1VojUdkiIXbh721v8GRuhGcWDm0OydT+r2SlRp1PMOPH7zxS5gYySvxqQpj X-Received: by 2002:aca:815:: with SMTP id 21mr11848232oii.52.1578897847972; Sun, 12 Jan 2020 22:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578897847; cv=none; d=google.com; s=arc-20160816; b=mjFeCdRcdUlKBLvdLwWed8NtG0jfXl26Y/QTNxPwT5zIs91LQI/0nRh8jLhJQw2TGl QN5v9EnmQbrkiNX17VOGzMQ3oJPuLb3PTDvjJ0KxFpLDk2b29vg0y4hfSvg6YxcP70mE fQ2UbGwivxpjTsOhhhuNGyelLSQ9so/OITV4cSHwfhYy7J4WomaQwicSTuOki+Dku5XL DvDWuRMLUV/0WDBEKNBm1z+qljJ45cD5V/ztofg0MRKGYa1QDpQrlfNXRon2yUaYnfIA T21LI9OGx8BIw8ogQY9+n0iAss+4NgNaWUbRTQkARVPtxw84JKHCYkRjNxsWhWNUk8Zj i+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BpLUIBBpeUpV1O+9thahetvf61yecpH01T0vJhinKFM=; b=BSNrIO/s9sU310KF4dBAVsMoPDWha1MLJujc36NVM14tf+k5WgxTynxguVH4LnXQCs sBJ9ISBor9pk3tsGHDkEj9H61Q7Q4n8dqQk4x/4UuAvEPv/TQDMgQnz4dR79yauB+Wk3 muqhmxOfrK8ZMFJmEFyrE5LUaGPc3QHpyzvBDTRCLb2p/UGIhMJxBEzhTEkBLTBmlMjs OOrGMSxpdCEK0aGVIZ04jQ3K+Wq20o0b/9p9TIxTz60qKLvwPndIYEyE2luoHSfD3F4p rKaf48PZKu+Nkz8FnXrCVeGerV5LYMnnzqqLgjXWHXvGl3Hzbvtfnt6+baH9MXlrt3vt AYIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="b8+l/1SJ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g93si6305757otg.231.2020.01.12.22.43.56; Sun, 12 Jan 2020 22:44:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="b8+l/1SJ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733310AbgAMGmC (ORCPT + 99 others); Mon, 13 Jan 2020 01:42:02 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42062 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732311AbgAMGmC (ORCPT ); Mon, 13 Jan 2020 01:42:02 -0500 Received: by mail-pg1-f196.google.com with SMTP id s64so4209293pgb.9 for ; Sun, 12 Jan 2020 22:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BpLUIBBpeUpV1O+9thahetvf61yecpH01T0vJhinKFM=; b=b8+l/1SJZQ3yqeJbUvB2xZMyvwiAY6T5D/jZU1adrI6P5kstOLvvZxqhCmkqIwuMep sYKEoCzAVeb9IMtcgLMsRlZGj/Njlq+d8Reds/98X5aiMgm3JbziB4SEIwRTkn0+NR9m g0KXWevccqv+j1L3ZxtD9evMLz1YZLLTdTSKLRv0pvzSjgHwIL9RmOYo3q/zJDPB0H9S xJ7tNU7F6sI2NVOnd606kh9pY3OCZHfIt0oXCLajWOGjWkZp5gqJsLC/fp2f7iHSMkkz E2NrmdpyzOj05r/NtlH0SGWLXV4Gzs7spPbOr4zoKiylBRyVGa+XozPgSQKxpvzQ8KdT T1UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BpLUIBBpeUpV1O+9thahetvf61yecpH01T0vJhinKFM=; b=R7+EoTk+fy3Hg3js60++DYMS2ZaN9R4JYH5Q5HBCRMzBYIoDrAsJREC4lMJbtgu90q F7JAi+bldJU/dBv3wiHW1IkfgVdHKMJS7kt3t5ygawqpEDZrrwcjl59DaWVcn8a/goxK ZdQiuR3mfnNVyiXBCeQWFMIUdZX7cC2fDYaI8346HAcOYEPkem50YoyQ6uE1U9wPen6j 4l5qCmbSJWoLdyhuNOvaYtST5Lnu5pbcJzF6FzOWO158o5CSnpEp01WWI64RyVaPMxuD C1WkqzinqrQ/T8/8XKQuf/TE+/vCr0Lds60oQoVAo81kSl3qBhznZDdjIih6MSvjxwvD TWQg== X-Gm-Message-State: APjAAAWqHEP8VKDB2XM59lqu2BysU1CWfJR0oPu02JbIqeZdGgwVZ3VN h0HH/qLO55XMnLKChDTVHact5A== X-Received: by 2002:a63:f70b:: with SMTP id x11mr19369380pgh.80.1578897721592; Sun, 12 Jan 2020 22:42:01 -0800 (PST) Received: from localhost ([122.172.140.51]) by smtp.gmail.com with ESMTPSA id d3sm12151329pfn.113.2020.01.12.22.41.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jan 2020 22:42:00 -0800 (PST) Date: Mon, 13 Jan 2020 12:11:56 +0530 From: Viresh Kumar To: Arnd Bergmann Cc: Sudeep Holla , Jassi Brar , cristian.marussi@arm.com, peng.fan@nxp.com, "linux-kernel@vger.kernel.org" , Linux ARM Subject: Re: [PATCH V2] firmware: arm_scmi: Make scmi core independent of transport type Message-ID: <20200113064156.lt3xxpzygattz3he@vireshk-i7> References: <3f5567ec928e20963d729350e6d674c4acb0c7a0.1578648530.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10-01-20, 12:15, Arnd Bergmann wrote: > On Fri, Jan 10, 2020 at 10:43 AM Viresh Kumar wrote: > > > > The SCMI specification is fairly independent of the transport protocol, > > which can be a simple mailbox (already implemented) or anything else. > > The current Linux implementation however is very much dependent of the > > mailbox transport layer. > > > > This patch makes the SCMI core code (driver.c) independent of the > > mailbox transport layer and moves all mailbox related code to a new > > file: mailbox.c. > > > > We can now implement more transport protocols to transport SCMI > > messages, some of the transport protocols getting discussed currently > > are SMC/HVC, SPCI (built on top of SMC/HVC), OPTEE based mailbox > > (similar to SPCI), and vitio based transport as alternative to mailbox. > > > > The transport protocols just need to provide struct scmi_desc, which > > also implements the struct scmi_transport_ops. > > > > Signed-off-by: Viresh Kumar > > --- > > V2: > > - Dropped __iomem from payload data. > > Simply dropping the __iomem isn't much better, now you get other > type mismatches. Right. So what exactly do you suggest I should do now? Drop __iomem from the structure's payload field but keep all local variables and function arguments with __iomem ? > > - Moved transport ops to scmi_desc, and that has a per transport > > instance now which is differentiated using the compatible string. > > - Converted IS_ERR_OR_NULL to IS_ERR. > > These look good to me. > > > + * @payload: Transmit/Receive payload area > > + * @dev: Reference to device in the SCMI hierarchy corresponding to this > > + * channel > > + * @handle: Pointer to SCMI entity handle > > + * @transport_info: Transport layer related information > > + */ > > +struct scmi_chan_info { > > + void *payload; > > + struct device *dev; > > + struct scmi_handle *handle; > > + void *transport_info; > > +}; > > Maybe you can wrap the scmi_chan_info inside of another > structure that contains the payload pointer, and use container_of > to convert between them? We don't need to convert between the two of them, isn't it ? Are you referring some other field here ? > It's not obvious which parts of the structure should be shared and > which are transport specific. All transport specific information is kept in the transport specific structure which is saved here in the transport_info field. Is there something else that isn't clear ? -- viresh