<div dir="ltr">Sorry i was supposed to reply for another mail. Did it here by mistake.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 10:29 AM, manty kuma <span dir="ltr">&lt;<a href="mailto:mantykuma@gmail.com" target="_blank">mantykuma@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Ideally, it depends on the platform you are working. You need to discuss with them for the correct approach. For Qualcomm they have some hardware caled as RPU(Register protection unit). They have systems calls exposed for using them. You can associtate it to the register you want protection. I dont know if there is any way you could do it in Linux itself?<br>

<br></div>Regards,<br>Sandeep<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 6:03 AM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, 14 Nov 2013 18:32:05 +0900, manty kuma said:<br>
<br>
&gt; I see that when we declare a variable as module_param from a driver, i can<br>
&gt; see it listed in &quot;/sys/module/xxx/parameters/...&quot;.<br>
&gt;<br>
&gt; Ex : /sys/module/usbcore/parameters/autosuspend<br>
&gt;<br>
&gt; we can modify and read it with echo and cat commands from terminal.<br>
&gt;<br>
&gt; But is there a way i can read this value from other drivers? Common sense<br>
&gt; says it should be there because if we are able to access them from user<br>
&gt; space, from kernel space we should definitely be able to do. Is it so? If<br>
&gt; yes, what are the API&#39;s?<br>
<br>
</div>It&#39;s just a variable.  Read the source and find out what it&#39;s name is.<br>
You may need an EXPORT_SYMBOL() to make it available if it isn&#39;t already.<br>
And depending on the variable and its use, you may need locking and/or<br>
atomic operations to read it.<br>
<br>
And *modifying* another module&#39;s variables is just asking for trouble,<br>
mostly because very little code is written assuming that its variables may<br>
be maliciously modified out from under it.  So consider code like:<br>
<br>
int foo_size, i;<br>
struct bar *stuff;<br>
<br>
stuff = malloc(foo_size* sizeof(struct bar));<br>
<br>
/* somebody raises the value of foo_size from outside */<br>
<br>
for (i=0; i &lt; foo_size; i++) do_something(stuff[i]);<br>
<br>
You can see where that sort of stuff is heading....<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>