Re: [PATCH] misc: sram: extend usage of reserved partitions

From: Vladimir Zapolskiy
Date: Mon Sep 21 2015 - 08:42:30 EST


Hi Greg,

On 21.09.2015 08:30, Greg Kroah-Hartman wrote:
> On Mon, Aug 10, 2015 at 12:40:02AM +0300, Vladimir Zapolskiy wrote:
>> This change adds functionality to operate on reserved SRAM partitions
>> described in device tree file. Two partition properties are added,
>> "pool" and "export", the first one allows to share a specific partition
>> for usage by a kernel consumer in the same manner as it is done for
>> the whole SRAM device, and "export" property provides access to some
>> SRAM area from userspace over sysfs interface. Practically it is
>> possible to specify both properties for an SRAM partition, however
>> simultaneous access from a kernel consumer and from userspace is not
>> serialized, but still the combination may be useful for debugging
>> purpose.
>
> This scares me, why do we need to partition sram off in this manner?

at the moment SRAM has no fine grained access interface (i.e. by
offset), it seems practicable to have such an interface, especially if
SRAM is accessed from outside of the kernel.

> What uses it in this way?

On practice I experience the following usecases:
* updates in a particular SRAM area specified by offset and size are
done by bootloader, then this information is utilized by the kernel,
* a particular SRAM area is rw accessed from userspace.

Support of both aforementioned options is provided by the proposed change.

> I need some other people to weigh in on this, and at the very least, I
> need some DT people to bless the changes there...

I'll send next revisions of the change to DT list.

Please note, that the partitioning of SRAM specified in DT is already
present in vanilla (commit 2da19688f4, "reserved areas" on SRAM), this
change adds an option to set a property of that reserved area, here
"reserved area" means SRAM area not accessible by genalloc clients of
"mmio-sram" device.

--
With best wishes,
Vladimir
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/