Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4988514ybl; Tue, 14 Jan 2020 01:27:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx9/kc5dZftBluAI7LVv4bH4DFocD5aay1/4nWd6XL5IvbrD1hktALrQAZGZIQFwrsuxN+a X-Received: by 2002:aca:d483:: with SMTP id l125mr15286935oig.124.1578994057157; Tue, 14 Jan 2020 01:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578994057; cv=none; d=google.com; s=arc-20160816; b=B81YUWH1366eKIPaxDTKBo9gmIXg/buy5i4NjcN+uIwDHccxNs74J7lrReJLTTcQNq 00dHepB8MBaVcqii67gFQymZbSd47gIMqbAsMpJH39KhzNONpDYKM6/AYeBx/c/2T2xz Fn3yu6+CLL7a5zu+sAyxxF+F7LdKjiIqJKbcxwKPmpzCKlul7kdt6PAOj8AlXXsm+inn +F99rhOl+SrhTraGsHAbek4ww27SrYJaXrMVqAk1KNQNyBy6Iy/JkMR/7yqH+Fgdkgs5 4C041PcBS7NgBQRSFbgZX1VBRhc4RCH6RZumI4gpyywvbXMCcsHSC28AGwo+zkjzLAtn qySw== 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=a0thWxtcKc9YM15dZdbAE3AeXYoB4GtLK4BXGH2HS3E=; b=EqJU37Go9G+UR6gBU4P97TdPYkLccbGVa6ceV7XsfwpxJjMAKytAgyXcxKoEve4Q6X cL9aTckVGUKbRwnVM3ACf+VkvBPgeFB2LisYIuS3e0CRi3KoJrSPhy8N0VwHE7EfzpRM VxqfXKKWp7/XBcsKjA7eyQIlhiL1v1Q8LJ5ivn+omTjb2GFgK2CXZGvNSPYK218G0GZ7 qmNepu5ZGPYwt43jgH8Obmml/1xJSc2vVY9LJa0V8VNUPGgoTQBBcGx3lhQX2S4iISeP orCoTzDB6lNDikfX7jOG1vZ5V8iSmNbRwjbwterl/r0ja96mVVrYeJ+01xhZkqEPPaYF uGVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iWUptrz+; 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 v3si6875101oif.122.2020.01.14.01.27.25; Tue, 14 Jan 2020 01:27:37 -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=iWUptrz+; 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 S1728746AbgANJ0U (ORCPT + 99 others); Tue, 14 Jan 2020 04:26:20 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39060 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgANJ0T (ORCPT ); Tue, 14 Jan 2020 04:26:19 -0500 Received: by mail-pg1-f193.google.com with SMTP id b137so6121844pga.6 for ; Tue, 14 Jan 2020 01:26:19 -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=a0thWxtcKc9YM15dZdbAE3AeXYoB4GtLK4BXGH2HS3E=; b=iWUptrz+rNTUSdgrIRAaDyg1wkGN/How5iOmIQtXnA+jPIGeiZhPadCACKCjLh+UdI WxKjQKzxmjkL6/Zsy1BwmOlbmo4VXPq1rBW0+LJROYG/YnXFIbWvCL72qMUHf9a3X5g5 NaIpJsuBc3rBj9hI3Gdn5Eof6SoTsve7Zv0BOg0SU7TUfnjlnj0hp2aGWNE4nBQkvwrO qzlU+6xoeum4A6lXhFclsUDbm+OWMbVr9V/mEgZUFWxy5i5tXt5R4w6IHKOjyHIsCFND Jjvapz5RwQSE7KEphcEHhWiWpuM9fL6x3AHSMX1uERdIKh8NPjnNXhEKIbC5j5qBDU8x ZUVw== 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=a0thWxtcKc9YM15dZdbAE3AeXYoB4GtLK4BXGH2HS3E=; b=mIyOMzreYOoVUdOJrJntmV6RnxRwAZqWz7rWRN/lQ8Iz34XNQ5cWbDJr9uaL8LJW+3 OwGwnY6E1xF65QQrQ6aQ+azFE/J/mvnGNfO2MIGErHXrey0DT+Ks29g6poo38pQk3zBs Dq0+19pkzPj7HEAGFbNsS/BxcZRmab/DGtlmJTyQcFmAQIr8raxUYZYxribF9i9Womzb ZgbT9l6BketfPnVeSrG4HhEAmfN/lbnErOZq+4F2N/S0m0k9KuAVrjykwi7nwDgS9uEH A2HO7vlW8WR+qNGqgeJikcnV1LjmtryHwkPLy3Pp09sksAArpAeA9FszANicbXGcBta8 4FeA== X-Gm-Message-State: APjAAAUZNXX2VKNJyrU3mmP9XnvWp2gqUKq+JyX9KtUi/PNo3WSTavSg GNDT6fBkt3OO0GvKXAW4kdYEfQ== X-Received: by 2002:a62:8202:: with SMTP id w2mr24834647pfd.100.1578993979012; Tue, 14 Jan 2020 01:26:19 -0800 (PST) Received: from localhost ([122.172.140.51]) by smtp.gmail.com with ESMTPSA id 200sm17798271pfz.121.2020.01.14.01.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2020 01:26:18 -0800 (PST) Date: Tue, 14 Jan 2020 14:56:15 +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: <20200114092615.nvj6mkwkplub5ul7@vireshk-i7> References: <3f5567ec928e20963d729350e6d674c4acb0c7a0.1578648530.git.viresh.kumar@linaro.org> <20200113064156.lt3xxpzygattz3he@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 13-01-20, 12:36, Arnd Bergmann wrote: > On Mon, Jan 13, 2020 at 7:42 AM Viresh Kumar wrote: > > On 10-01-20, 12:15, Arnd Bergmann wrote: > > > On Fri, Jan 10, 2020 at 10:43 AM Viresh Kumar wrote: > > > > > > 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 ? > > > > > +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 ? > > To answer all three, what I meant is that the payload pointer appears > to be transport specific and I am not sure if I understood the below statement properly. Is there something missing from it ? > should not be part of the common > structure if there is generic way to access it. The scmi protocol requires a block of shared memory which is represented by struct scmi_shared_mem, and payload is this memory block itself. This block of memory is accessed throughout driver.c file using ioread/write commands. If payload is transport specific, so will be those accesses, isn't it ? Are you suggesting to move all this to mailbox.c (the transport specific file) instead ? I am sorry, but I am not able to understand how exactly you want me to reorder code here :( @Sudeep: I had a question for you though. Looks like we are doing ioremap() of this payload for every channel's tx/rx, why ? Why is the same memory area mapped that way ? Can we just map the area once for scmi block ? -- viresh