Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5081544ybl; Tue, 14 Jan 2020 03:13:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz+TjBocwoW2WxyiYcOwmBJoqf9D+sIO0NgSsLgsbNCBIUUGvb/Mx/Lv816cNFerjAZ1u2J X-Received: by 2002:aca:a883:: with SMTP id r125mr17215784oie.56.1579000382910; Tue, 14 Jan 2020 03:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579000382; cv=none; d=google.com; s=arc-20160816; b=Z9CtB7HBVKHMxfkdwvs4wS5IeiqZHBZWukgNl93hvgQcbjiN6114NVI2oTTNtEryWt 0dm22u/mE0urnaulwa7oQmBR+OZZ5xtKa37In44WlLcCefkCx6+6eIlTXiLWYFlaIb1P NvE99fPexSpCtwzT9EjApMvv8rcbJHG0JmqWhMu9Llo8v/uVWPM4Zs+MtdiqUSeGUs/l DpPht5JUIhdcOQOBtV8TGmUdBq5hXYAh3e/XL+ErlLt5Yu5iYX2A35hPmUPnm3a5B+xf 9K8eH/mPhHt81ywh/8xo+CMVrulMboVwabyyp9EAK+Uh4rYyZTKtLHyWskXSFqu3oHYp 0V9Q== 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=XBZrfX8lefbqoC00uqxUIqwNp5iGop4pPam/KdlVaFk=; b=hZaJUiTWNdIf/xqjQ1aGkaax5oGODKrTzQgshA5NuyOm/Cb3vj1McIYvAn34+AxC+n HnKHj7yuVzwdlwVXwGa5HazyW1ARz4Uc3FYMcaekGOqBPCeuvPPoCaCUoEGKpHMWmmmW qzM73xWvmd2RmOwploXh5HO7JmdXSDtgjbsuHpXMhv56Efryb5GNB+siDrBYELdZnuNJ ukq4J/QVctWf4E5mHYnrvbghsPYa4+AfxFFyBFl7lbi27A7RF2Rr73Aiz22aJhDt+asX OVBOP8/SCx4jBZ+ZlksqANquuVf2zomnop4ODJkvH5jjlji6PON0hDeSn41R1FpHK8lI cMsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MYlOh9JC; 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 q6si8902270oth.26.2020.01.14.03.12.51; Tue, 14 Jan 2020 03:13:02 -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=MYlOh9JC; 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 S1729393AbgANLLO (ORCPT + 99 others); Tue, 14 Jan 2020 06:11:14 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42529 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgANLLO (ORCPT ); Tue, 14 Jan 2020 06:11:14 -0500 Received: by mail-pg1-f195.google.com with SMTP id s64so6234483pgb.9 for ; Tue, 14 Jan 2020 03:11:13 -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=XBZrfX8lefbqoC00uqxUIqwNp5iGop4pPam/KdlVaFk=; b=MYlOh9JC9NAdMnXM2MBHckOrg9L7PtmZWQR1EHKqZTnAQkUW6ztN4gbv/7cjOS0rqh 1obsqbOBRJmZNZVXi4CI54+9cSBw/VZoneiX1Zy+OFSNSywEJyW0svuLthCEaei/bXO7 MKt34QBOOGpz8HBh5a7Kg934lWshPDyRqWrIUXt9FTeasQ6KnagCCDXvN/+6ne09FYqz jviGn+mkd04b2qwFGUzHXqnay+kK+hTZ2eLncKPqsdZu7k+Infp4/FPX1/DSOxuQxl00 rDip6nMi0+8qfTYvf+41v0H/1Ok2L97+7ETuhXhj2lpuMJVu8R4wxAribW8Uso6Wk5BY wL5w== 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=XBZrfX8lefbqoC00uqxUIqwNp5iGop4pPam/KdlVaFk=; b=W6M71YIzDfJ9wK+q24TyCi0HikHwtXo1osYoZ2741upXlmudKZnJNu9gBtKhGnjLIi va6/ebSAzfc8hw2USsOCluo0Ev1MhsyLvxm9XkZ0nCrWB4bC5PUDx+RKvJOGR67ZJ1M9 V1hSVe0jnVkRm/AoF0nW3dBDHZZz3TNkXDq6Lf1YkwcRwTGt1fn5qzMrBIvOtUWeIM6L BaC72fMwXpn/9ABz4b/cgaWPwTyM/5vwFnGlMb7kvlotaEnmRneffuXbYHOEZ1Q0ttIk QzEo1QGnHi4AHYoj3p19zQHBCyy9NKbDx/5/V9vR0qkq/Jr0DkmdNd2ompHd/XLHsdph JSHQ== X-Gm-Message-State: APjAAAXQKWr0ZVC32QLxFrrrqU9vIu5By2DJw5FQZutLx0LnlL4ZV2K7 hBHiiEW+TY4LzNsZMaetY/8TfQ== X-Received: by 2002:a62:e912:: with SMTP id j18mr24978532pfh.4.1579000273517; Tue, 14 Jan 2020 03:11:13 -0800 (PST) Received: from localhost ([122.172.140.51]) by smtp.gmail.com with ESMTPSA id y203sm18478129pfb.65.2020.01.14.03.11.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 03:11:12 -0800 (PST) Date: Tue, 14 Jan 2020 16:41:10 +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: <20200114111110.jhkj2y47ncp5233r@vireshk-i7> References: <3f5567ec928e20963d729350e6d674c4acb0c7a0.1578648530.git.viresh.kumar@linaro.org> <20200113064156.lt3xxpzygattz3he@vireshk-i7> <20200114092615.nvj6mkwkplub5ul7@vireshk-i7> 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 14-01-20, 10:56, Arnd Bergmann wrote: > My point was that you cannot mix __iomem accesses with pointer > accesses. As I understood it, the current version uses a pointer to a The current version is stupid as I misunderstood the whole __iomem thing and just dropped it :) > hardware mailbox with structured data, so you have to use ioremap() > to get a token you can pass into ioread(), but (some of) the new > transport types would just be backed by regular RAM, on which this > is not a well-defined operation and you have to use memremap() > and memcpy() instead. Okay, I think I understand that a bit now. So here are the things which I may need to do now: - Maybe move payload to struct scmi_mailbox structure, as that is the transport dependent structure.. - Do ioremap, etc in mailbox.c only instead of driver.c - Provide more ops in struct scmi_transport_ops to provide read/write helpers to the payload and implement the ones based on ioread/iowrite in mailbox.c .. Am I thinking in the right direction now ? -- viresh