From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751601AbbBLUzZ (ORCPT ); Thu, 12 Feb 2015 15:55:25 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:52383 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbbBLUzX (ORCPT ); Thu, 12 Feb 2015 15:55:23 -0500 Message-ID: <54DD131F.8040704@ti.com> Date: Thu, 12 Feb 2015 14:54:55 -0600 From: Suman Anna User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ohad Ben-Cohen , Tony Lindgren CC: Kevin Hilman , Dave Gerlach , Robert Tivy , "linux-kernel@vger.kernel.org" , "linux-omap@vger.kernel.org" , linux-arm Subject: Re: [PATCH v3 2/2] remoteproc: add support to handle internal memories References: <1420838519-15669-1-git-send-email-s-anna@ti.com> <1420838519-15669-3-git-send-email-s-anna@ti.com> <20150211205757.GI2531@atomide.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ohad, On 02/12/2015 03:09 AM, Ohad Ben-Cohen wrote: > On Wed, Feb 11, 2015 at 10:57 PM, Tony Lindgren wrote: >>>> +static int rproc_handle_intmem(struct rproc *rproc, struct fw_rsc_intmem *rsc, >>>> + int offset, int avail) >>>> +{ >>> ... >>>> + va = (__force void *)ioremap_nocache(rsc->pa, rsc->len); >>> >>> Back in the days when we developed remoteproc there was a tremendous >>> effort to move away from ioremap when not strictly needed. >> >> The use of ioremap in general is just fine for drivers as long >> as they access a dedicated area to the specific device. Accessing >> random registers and memory in the SoC is what I'm worried about. > > Yes, the proposed interface essentially allows exactly this random > access, since the parameters to ioremap would be provided from the > user space (specifically from the resource table contained within the > firmware of the remote processor). My original motivation was that it would only need to be added on firmwares requiring support for loading into internal memories, otherwise, these are something left to be managed by the software running on the remote processor completely, and MPU will not even touch them. So, let me know if this is a NAK. If so, we have two options - one to go the sram node model where each of them have to be defined separately, and have a specific property in the rproc nodes to be able to get the gen_pool handles. The other one is simply to define these as and use devm_ioremap_resource() (so use DT for defining the regions instead of a resource table entry). regards Suman From mboxrd@z Thu Jan 1 00:00:00 1970 From: s-anna@ti.com (Suman Anna) Date: Thu, 12 Feb 2015 14:54:55 -0600 Subject: [PATCH v3 2/2] remoteproc: add support to handle internal memories In-Reply-To: References: <1420838519-15669-1-git-send-email-s-anna@ti.com> <1420838519-15669-3-git-send-email-s-anna@ti.com> <20150211205757.GI2531@atomide.com> Message-ID: <54DD131F.8040704@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Ohad, On 02/12/2015 03:09 AM, Ohad Ben-Cohen wrote: > On Wed, Feb 11, 2015 at 10:57 PM, Tony Lindgren wrote: >>>> +static int rproc_handle_intmem(struct rproc *rproc, struct fw_rsc_intmem *rsc, >>>> + int offset, int avail) >>>> +{ >>> ... >>>> + va = (__force void *)ioremap_nocache(rsc->pa, rsc->len); >>> >>> Back in the days when we developed remoteproc there was a tremendous >>> effort to move away from ioremap when not strictly needed. >> >> The use of ioremap in general is just fine for drivers as long >> as they access a dedicated area to the specific device. Accessing >> random registers and memory in the SoC is what I'm worried about. > > Yes, the proposed interface essentially allows exactly this random > access, since the parameters to ioremap would be provided from the > user space (specifically from the resource table contained within the > firmware of the remote processor). My original motivation was that it would only need to be added on firmwares requiring support for loading into internal memories, otherwise, these are something left to be managed by the software running on the remote processor completely, and MPU will not even touch them. So, let me know if this is a NAK. If so, we have two options - one to go the sram node model where each of them have to be defined separately, and have a specific property in the rproc nodes to be able to get the gen_pool handles. The other one is simply to define these as and use devm_ioremap_resource() (so use DT for defining the regions instead of a resource table entry). regards Suman