RE: [PATCH 1/9] remoteproc: Bugfix: Deallocate firmware image on shutdown

2013-03-19 Thread Sjur BRENDELAND
Hi Ohad, > On Sun, Feb 10, 2013 at 1:39 PM, wrote: > > From: Dmitry Tarnyagin > > > > Fixes coherent memory leakage, caused by non-deallocated > > firmware image chunk. > > I'll just slightly edit the subject + commit log to indicate this fix > is STE-specific. Sure, no problem. > > > Signe

RE: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio

2013-02-11 Thread Sjur BRENDELAND
Hi Rusty, > From: Rusty Russell [mailto:ru...@rustcorp.com.au] > sjur.brandel...@stericsson.com writes: > > From: Vikram ARV > > > > Add the the Virtio shared memory driver for STE Modems. > > caif_virtio is implemented utilizing the virtio framework > > for data transport and is managed with the

RE: [RFCv2 11/11] remoteproc: Support virtio config space.

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > > +void rproc_virtio_get(struct virtio_device *vdev, unsigned offset, > > + void *buf, unsigned > len) > > +{ > > + struct rproc_vdev *rvdev = vdev_to_rvdev(vdev); > > + void *cfg = &rvdev->rsc->vring[rvdev->rsc->num_of_vrings]; > > +

RE: [RFCv2 09/11] remoteproc: Add operation to find resource table in memory

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > From: Ido Yariv [mailto:i...@wizery.com] > > +struct resource_table *rproc_elf_get_rsctab_addr(struct rproc *rproc, > > +const struct firmware *fw) > > +{ > > + struct elf32_shdr *shdr; > > + > > + shdr = find_rsc_shdr(&rproc->dev, (struct

RE: [RFCv2 05/11] remoteproc: Load firmware once.

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > From: Ido Yariv [mailto:i...@wizery.com] Friday, December 21, 2012 3:16 AM > > Load the firmware once and pave the way for two way > > communication of virtio configuration and status bits. > > The virtio ring device address is now stored in the resource > > table. > > > > NOTE: This p

RE: [RFCv2 08/11] remoteproc: Refactor function rproc_elf_find_rsc_table

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > > +static struct elf32_shdr * > > +find_rsc_shdr(struct device *dev, struct elf32_hdr *ehdr) > > { > > - struct elf32_hdr *ehdr; > > struct elf32_shdr *shdr; > > + int i; > > const char *name_table; > > - struct device *dev = &rproc->dev; > > struct resource_table *tab

RE: [RFCv2 07/11] remoteproc: Register virtio devices after vring allocation

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > On Fri, Dec 14, 2012 at 05:06:56PM +0100, Sjur Brændeland wrote: > > Postpone the registration of virtio devices until all > > vritio ring resource has been allocated. > > This fixes the following bug: The driver's start callback > > is called before all vring notify ids are allocated an

RE: [RFCv2 04/11] remoteproc: Add state RPROC_LOADED

2013-01-15 Thread Sjur BRENDELAND
> > Add state RPROC_LOADED as firmware loading and startup will be > > different states. > > > > Signed-off-by: Sjur Brændeland > > The rproc_state holds the state of the remote processor and it will > still be offline even when the FW is loaded, so I'm not sure if a new > state should be added.

RE: [RFCv2 03/11] remoteproc: Set vring addresses in resource table

2013-01-15 Thread Sjur BRENDELAND
Hi Ido, > > Set the vring addresses in the resource table so that > > the remote device can read the actual addresses used. > > > > Signed-off-by: Sjur Brændeland > > Since this new member will only be referenced in the last patch, perhaps > squash the two patches? This patch fixes two TODOs in

RE: [RFCv2 10/11] remoteproc: Find resource table in device memory

2013-01-15 Thread Sjur BRENDELAND
> This patch should probably be squashed with the next one, since it > doesn't do much on its own. OK. Regards, Sjur -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majo

RE: [RFCv2 05/11] remoteproc: Load firmware once.

2012-12-21 Thread Sjur BRENDELAND
Hi Ido, ] > > > In case the remote processor is added, booted and then rebooted, the > > > program sections wont be reinitialized. This can be a bit problematic, > > > since the firmware might assume values are initialized in its data > > > sections. > > > > > > How about the following alternative

RE: [RFCv2 07/11] remoteproc: Register virtio devices after vring allocation

2012-12-21 Thread Sjur BRENDELAND
Hi Ido, > > Ugh, thanks I missed this. How about calling rproc_alloc_vring from > > rproc_parse_vring so that the resource allocation are done before > > the virtio devices are started? > I don't think that would solve it - rproc_parse_vring is called from > rproc_handle_vdev which is called more

RE: [RFCv2 07/11] remoteproc: Register virtio devices after vring allocation

2012-12-21 Thread Sjur BRENDELAND
Hi Ido, > From: Ido Yariv [mailto:i...@wizery.com] > > Postpone the registration of virtio devices until all > > vritio ring resource has been allocated. > > This fixes the following bug: The driver's start callback > > is called before all vring notify ids are allocated and > > max_notifyid will

RE: [RFCv2 05/11] remoteproc: Load firmware once.

2012-12-21 Thread Sjur BRENDELAND
Hi Ido and Ohad, > In case the remote processor is added, booted and then rebooted, the > program sections wont be reinitialized. This can be a bit problematic, > since the firmware might assume values are initialized in its data > sections. > > How about the following alternative approach - inst

RE: [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal

2012-12-12 Thread Sjur BRENDELAND
> Amit Shah [mailto:amit.s...@redhat.com] writes: > On (Wed) 12 Dec 2012 [10:31:04], Rusty Russell wrote: > > Amit Shah writes: > > > On (Tue) 11 Dec 2012 [09:39:41], Rusty Russell wrote: > > >> Amit Shah writes: > > >> > On (Fri) 16 Nov 2012 [11:22:09], Rusty Russell wrote: > > >> >> Amit Shah

RE: [PATCHv7 4/4] virtio_console: Add support for remoteproc serial

2012-11-02 Thread Sjur BRENDELAND
> On (Fri) 02 Nov 2012 [09:52:08], Rusty Russell wrote: > > Amit Shah writes: > > > On (Tue) 23 Oct 2012 [12:17:49], Rusty Russell wrote: > > >> sjur.brandel...@stericsson.com writes: > > >> > From: Sjur Brændeland > > > > > >> > @@ -1415,7 +1524,16 @@ static void remove_port_data(struct port > *

RE: [remoteproc:for-next 6/9] remoteproc_virtio.c:(.text+0x238e7e): undefined reference to `vring_transport_features'

2012-10-11 Thread Sjur BRENDELAND
> From: Ohad Ben-Cohen [mailto:o...@wizery.com] Sent: 9. oktober 2012 16:39 > On Tue, Oct 9, 2012 at 4:26 PM, Dan Carpenter > > wrote: >> If it already compiles fine on x86 then there is no advantage to >> disabling it. > > Not really; that's really a hardware question and not a software one. >

RE: [remoteproc:for-next 6/9] remoteproc_virtio.c:(.text+0x238e7e): undefined reference to `vring_transport_features'

2012-10-09 Thread Sjur BRENDELAND
Hi Ohad, > On Tue, Oct 2, 2012 at 10:24 AM, Ohad Ben-Cohen > wrote: > > On Mon, Oct 1, 2012 at 4:45 AM, Fengguang Wu > wrote: > >> Hi Ohad, > >> > >> FYI, kernel build failed on > >> > >> tree: git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git > for-next > >> head: bec109a430

RE: [PATCH 1/3] virtio_console:Merge struct buffer_token into struct port_buffer

2012-09-26 Thread Sjur BRENDELAND
> > This merge reduces code size by unifying the approach for > > sending scatter-lists and regular buffers. Any type of > > write operation (splice, write, put_chars) will now allocate > > a port_buffer and send_buf() and free_buf() can always be used. > > Thanks! > This looks much nicer and simp

RE: [PATCHv4] virtio_console: Add support for remoteproc serial

2012-09-24 Thread Sjur BRENDELAND
Hi Amit, > I'm sorry for not being able to look at this earlier. No worries. I'll try to respin and retest this patch by tomorrow. If you by any chance could find time to review so could make it in time for 3.7 it would be great :-) > A general comment is to base this patchset on linux-next; we'

RE: [PATCHv2] virtio_console: Add support for remoteproc serial

2012-09-20 Thread Sjur BRENDELAND
Hi Rusty, > > +#if IS_ENABLED(CONFIG_REMOTEPROC) > > +static inline bool is_rproc_serial(struct virtio_device *vdev) > > +{ > > + return vdev->id.device == VIRTIO_ID_RPROC_SERIAL; > > +} > > +#else > > +static inline bool is_rproc_serial(struct virtio_device *vdev) > > +{ > > + return false; >

RE: [PATCHv3] remoteproc: Add STE modem driver for remoteproc

2012-09-20 Thread Sjur BRENDELAND
Hi Ohad, > > + /* Provide callbacks to modem device */ > > + mdev->drv_ops = &sproc_drv_ops; > > Implicitly providing the modem with drv_ops and drv_data in this > manner feels racy and somewhat error prone. > > E.g., on remove these members are set to NULL, under the assumption > th

RE: [PATCHv2] virtio_console: Add support for remoteproc serial

2012-09-20 Thread Sjur BRENDELAND
> From: Michael S. Tsirkin [mailto:m...@redhat.com] > sjur.brandel...@stericsson.com wrote: > > From: Sjur Brændeland > > > > Add a simple serial connection driver called > > VIRTIO_ID_RPROC_SERIAL (0xB) for communicating with a > > remote processor in an asymmetric multi-processing > > configurat

RE: [RFCv2] remoteproc: Add STE modem driver for remoteproc

2012-09-19 Thread Sjur BRENDELAND
platform_device_{un}register, so I I'd personally just drop them and > call the code directly. This way your code will be a bit more readable > for others. OK, will remove these register/unregister functions. The reason I did include them was to be able to move away from the platform bus, i

RE: Remoteproc: Translating between host and device addresses.

2012-09-10 Thread Sjur BRENDELAND
Hi Ohad, > > One way for the device to figure out the translation between > > host-physical and device-address is to peek into some CarveOut > > resource entry and compute this translation. Because a CarveOut > > resource entry contains both the host-physical-address and the > > device address for

RE: [PATCH 2/3] remoteproc: recover a remoteproc when it has crashed

2012-08-22 Thread Sjur BRENDELAND
Hi Fernando, > > I think you drop the driver module's ref count during recovery, because > > rproc_shutdown calls module_put(). Maybe you should move driver > > ref count handling to rproc_add and rproc_type_release, instead of > > rproc_boot() and rproc_shutdown()? > > How could you remove the r

RE: [PATCH] caif: Do not dereference NULL in chnl_recv_cb()

2012-08-19 Thread Sjur BRENDELAND
> In net/caif/chnl_net.c::chnl_recv_cb() we call skb_header_pointer() > which may return NULL, but we do not check for a NULL pointer before > dereferencing it. > This patch adds such a NULL check and properly free's allocated memory > and return an error (-EINVAL) on failure - much better than cra

RE: [RFC 4/4] remoteproc: Add driver for STE Modem

2012-08-14 Thread Sjur BRENDELAND
Hi Ohad, >>> It seems to me that a char device will solve these issues: we can use >>> ioctl to control the power, if the user crashes we'll know about it >>> via the release handler, and if the remote processor crashes we can >>> let the user know by sending it a notification for it to read via t

Remoteproc: Translating between host and device addresses.

2012-08-14 Thread Sjur BRENDELAND
Hi Ohad, I have one question related to address translation between device address and host-physical address referencing the data-buffer transported in the virtio-rings. The address used in the virtio-ring is the host-physical-address, but the mapping between device-address and host-physical-addre