Disabling a BH : spin_lock_bh or local_bh_disable.

2014-06-12 Thread priyaranjan
Hi All,

I was referring to  "Unreliable Guide To Locking by Paul Rusty Russell".

Here is a quote below :-

"If a bottom half shares data with user context, you have two problems.
Firstly, the current user context can be interrupted by a bottom half, and
secondly, the critical region could be entered from another CPU. This is
where spin_lock_bh() (include/linux/spinlock.h) is used. It disables bottom
halves on that CPU, then grabs the lock. spin_unlock_bh() does the reverse"

Note : -

"user context" here means : The kernel executing on behalf of a particular
process or kernel thread (given by the current() macro.) Not to be confused
with userspace. Can be interrupted by software or hardware interrupts.


I have below questions related to the same.

1. If the BH is a tasklet/workque and in the user context we disable it,
what happens when a interrupt(tied to the same tasklet/workque) occurs ? I
hope the spin_lock_bh() do not disable the interrupt.

2. I hope that the spin_lock_bh needs to be acquired by the user context.
Can anybody confirm this? How the critical section is achieved from the BH
in the same context?

3.Overall It would be great if anybody can help me understand what happens
when a BH is disabled with Interrupts still enabled for the BH.

Regards,
Priyaranjan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: why a static function is in kernel symbol table

2014-06-12 Thread Valdis . Kletnieks
On Thu, 12 Jun 2014 16:23:58 -0700, Ji Li said:

> I happened to find that a static function show up in kernel symbol table:

> Could anyone kindly cast some light?

Hint: 'static' prevents code in other compilation units (basically, other .c
files) from referencing it directly (though they can still access it via a
function pointer variable or other similar tricks).  That does *not* mean that
other code in the *same* compilation unit can't reference the static function
in a way that requires a symbol table entry...



pgp2U8T9BG7x4.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


why a static function is in kernel symbol table

2014-06-12 Thread Ji Li
Hi all,

I happened to find that a static function show up in kernel symbol table:

 static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,

int push_one, gfp_t gfp);

I feel puzzled. The only difference between this function with other
static functions in net/ipv4/tcp_output.c is that tcp_write_xmit is
declared at the very beginning of the file. However, I tried putting
declaration of another static function in front of tcp_write_xmit, but
it still did not show up in newly compiled vmlinux.

Could anyone kindly cast some light?

Thanks
Ji

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 01

2014-06-12 Thread me storage
For Email Client Try to read the Documentation of kernel.org

https://www.kernel.org/doc/Documentation/email-clients.txt

Hi,
> Which email client is best to submit tasks . I use gmail , and I get a
> problem with attachment base64!?
>
> What you suggest me to use!
>
> Regards,
> N.G
>
> On Tue, Apr 29, 2014 at 6:34 PM, Pranay Srivastava 
> wrote:
> > On Tue, Apr 29, 2014 at 8:40 PM, me storage 
> wrote:
> >> Hi i every one i am new to linux kernel programming .I am participating
> in
> >> Eudyptula Challenge .Recently i submitted my solutions to Task 01 but i
> >> gives me reply like the below
> >>
> >> "Please read the requirements for the Makefile and allow the module to
> be
> >> built against any kernel source tree on the filesystem, not just those
> >> kernels that happened to be installed in /lib/ at some point in time."
> >>
> >> And my make file is like this
> >>
> >> ifneq ($(KERNELRELEASE),)
> >>  obj-m += helloworld.o
> >>  else
> >>  default
> >
> > I hope you understand the -C switch
> > :
> >>make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
> >>  clean:
> >>make -C /lib/modules/$(shell uname -r)/bulid M=$(PWD) clean
> >>  end
> >>
> >
> > If not then find it out and see what you need to change.
> >
> >>
> >> So can any please tell me how to allow the module to be built against
> any
> >> kernel source tree on the filesystem?
> >> or can any one pleae tell me what does it mean?
> >> Thank you
> >>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: Eudyptula Challenge Task 01

2014-06-12 Thread Jeff Haran
> -Original Message-
> From: kernelnewbies-boun...@kernelnewbies.org 
> [mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of
> valdis.kletni...@vt.edu
> Sent: Thursday, June 12, 2014 4:44 PM
> To: Nada Saif
> Cc: me storage; Pranay Srivastava; kernelnewbies
> Subject: Re: Eudyptula Challenge Task 01
> 
> On Fri, 13 Jun 2014 01:40:34 +0300, Nada Saif said:
> > Which email client is best to submit tasks . I use gmail , and I get a
> > problem with attachment base64!?
> 
> But "best" is a subjective term.  You're almost certainly better off
> finding out how to make your preferred email software behave itself than
> moving to a client you don't know and understand just to submit tasks.
> 

Unless you happened to be consigned to using Outlook because your employer's IT 
is all MS, through which it is impossible to send a plain text email without it 
getting munged one way or another.

Jeff Haran


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 01

2014-06-12 Thread Valdis . Kletnieks
On Fri, 13 Jun 2014 01:40:34 +0300, Nada Saif said:
> Which email client is best to submit tasks . I use gmail , and I get a
> problem with attachment base64!?

Personally, I use exmh.  But that's pretty hardcore fringe. And I'm not
moving off it, because I have somewhere north of 1 million archived
emails and a 900+ line .procmailrc, and converting everything to something
else would be *painful*.

But "best" is a subjective term.  You're almost certainly better off
finding out how to make your preferred email software behave itself than
moving to a client you don't know and understand just to submit tasks.

% more /usr/src/linux/Documentation/email-clients.txt



pgpOsYIIagmM9.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 01

2014-06-12 Thread Kai Bojens
Am 13.06.2014 00:40, schrieb Nada Saif:


> Which email client is best to submit tasks . I use gmail , and I get a
> problem with attachment base64!?

Mutt.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 01

2014-06-12 Thread Aruna Hewapathirane
>>Hi,
>>Which email client is best to submit tasks . I use gmail , and I get a
>>problem with attachment base64!?

>>what you suggest me to use!

Try Thunderbird ! Does a lot more than simply send email :)

>
> Regards,
> N.G
>
> On Tue, Apr 29, 2014 at 6:34 PM, Pranay Srivastava 
> wrote:
> > On Tue, Apr 29, 2014 at 8:40 PM, me storage 
> wrote:
> >> Hi i every one i am new to linux kernel programming .I am participating
> in
> >> Eudyptula Challenge .Recently i submitted my solutions to Task 01 but i
> >> gives me reply like the below
> >>
> >> "Please read the requirements for the Makefile and allow the module to
> be
> >> built against any kernel source tree on the filesystem, not just those
> >> kernels that happened to be installed in /lib/ at some point in time."
> >>
> >> And my make file is like this
> >>
> >> ifneq ($(KERNELRELEASE),)
> >>  obj-m += helloworld.o
> >>  else
> >>  default
> >
> > I hope you understand the -C switch
> > :
> >>make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
> >>  clean:
> >>make -C /lib/modules/$(shell uname -r)/bulid M=$(PWD) clean
> >>  end
> >>
> >
> > If not then find it out and see what you need to change.
> >
> >>
> >> So can any please tell me how to allow the module to be built against
> any
> >> kernel source tree on the filesystem?
> >> or can any one pleae tell me what does it mean?
> >> Thank you
> >>
> >> ___
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >>
> >
> >
> >
> > --
> > ---P.K.S
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge Task 01

2014-06-12 Thread Nada Saif
Hi,
Which email client is best to submit tasks . I use gmail , and I get a
problem with attachment base64!?

What you suggest me to use!

Regards,
N.G

On Tue, Apr 29, 2014 at 6:34 PM, Pranay Srivastava  wrote:
> On Tue, Apr 29, 2014 at 8:40 PM, me storage  wrote:
>> Hi i every one i am new to linux kernel programming .I am participating in
>> Eudyptula Challenge .Recently i submitted my solutions to Task 01 but i
>> gives me reply like the below
>>
>> "Please read the requirements for the Makefile and allow the module to be
>> built against any kernel source tree on the filesystem, not just those
>> kernels that happened to be installed in /lib/ at some point in time."
>>
>> And my make file is like this
>>
>> ifneq ($(KERNELRELEASE),)
>>  obj-m += helloworld.o
>>  else
>>  default
>
> I hope you understand the -C switch
> :
>>make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>>  clean:
>>make -C /lib/modules/$(shell uname -r)/bulid M=$(PWD) clean
>>  end
>>
>
> If not then find it out and see what you need to change.
>
>>
>> So can any please tell me how to allow the module to be built against any
>> kernel source tree on the filesystem?
>> or can any one pleae tell me what does it mean?
>> Thank you
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
>
> --
> ---P.K.S
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: ?ظ?: git download

2014-06-12 Thread Valdis . Kletnieks
On Thu, 12 Jun 2014 14:44:35 +0800, "jinz...@wingtech.com" said:
> And use "top" command, show the memory has used 90%+, but the CPU just 1%+.

This is not indication of a problem - Linux will intentionally try to keep
potentially useful data cached in memory, so you should *normally* see
memory 90-95% full..

Oh, and your swapspace is probably *way* too big - 8G of RAM and 24G of swap
is just asking for trouble.  1G or 2G of swap is very useful to prevent
an OOM if you get close to your RAM limit.  But if you're dug much deeper
into swap, you're probably thrashing so hard that you'll actually wish
that you *did* OOM something and get control of your system back

(And yes, there's times when 8G of RAM and 24G of swap makes sense.  That's
like 0.1% of the time, and if you're the admin of such a system, you
probably aren't the type that will ask questions on kernelnewbies. ;)


pgprEIg972wze.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: SOC: Zedboard: Driver question

2014-06-12 Thread priyaranjan
On Thu, Jun 12, 2014 at 8:13 PM, amit mehta  wrote:

> On Thu, Jun 12, 2014 at 4:52 PM, priyaranjan 
> wrote:
> >
> >
> >
> > On Thu, Jun 12, 2014 at 7:09 PM, amit mehta 
> wrote:
> >>
> >> We are working on a school project in which we are trying to develop a
> >> audio mixer
> >> on Zedboard (Development board from Digilent). We have developed the IP
> >> and have
> >> integrated it with the overall hardware using Programmable logic. This
> >> board has ARM
> >> core. We have a Digilent pre-configured Linux source which we
> >> cross-compiled
> >> for ARM board, device tree blob and bootloader for Zync(BOOT.BIN). The
> >> system
> >> boots fine with Linux, but now to expose the recently added hardware
> >> implementation
> >> of audio mixer, we are trying to develop the driver using the platform
> >> driver API.
> >> Currently, In our reconfigurable hardware, we have 2 channels and a
> mixer
> >> and we
> >> want to access those individually as some file nodes under /proc FS. The
> >> sample
> >> code is shown below:
> >>
> >> 
> >> /* device match table to match with device node in device tree
> >>  * These are the list of devices that we want to expose as platform
> device
> >>  */
> >> static const struct of_device_id myiir_of_match[] __devinitconst = {
> >> {.compatible = "dglnt,myiir-audio-ch0"},
> >> {.compatible = "dglnt,myiir-audio-ch1"},
> >> {.compatible = "dglnt,myiir-audio-mix0"},
> >> {},
> >> };
> >>
> >> MODULE_DEVICE_TABLE(of, myiir_of_match);
> >>
> >> /* platform driver structure for myiir driver */
> >> static struct platform_driver myiir_driver = {
> >> .driver = {
> >> .name = DRIVER_NAME,
> >> .owner = THIS_MODULE,
> >> .of_match_table = myiir_of_match},
> >> .probe = myiir_probe,
> >> .remove = __devexit_p(myiir_remove),
> >> .shutdown = __devexit_p(myiir_shutdown)
> >> };
> >>
> >> /* Register myiir platform driver */
> >> module_platform_driver(myiir_driver);
> >> 
> >>
> >> Now, inside the probe routine (myiir_probe), can we create proc
> >> entries by calling
> >> create_proc for each of these nodes and setting the appropriate read and
> >> write
> >> methods(file_operations) ?
> >
> >
> >
> > Yes, I feel this is fine, the proc entries to be created in probe,
> > Initialize all data structures as required in probe.
> >
> Thank you for this confirmation. I've one more query regarding the
> IO addresses. The CAD tool from Xilinx shows the base addresses
> of our custom IP, which we have put into the device tree blob(also
> shown in the attached screeshot) and in our driver, we are requesting
> the memory region and after calling the ioremap, we access those
> IO addresses, but is there are need to write the register addresses
> in the device tree file in a particular order(asceding/descending) ?
>

I am not sure about ascending or descending order but yes, the register
addresses should be in the device tree. You can check more examples on the
same and follow.


> 
> myiir-aud-ch0 {
> compatible = "dglnt,myiir-audio-ch0";
> reg = <0x7420 0x1>;
> };
> myiir-aud-ch1 {
> compatible = "dglnt,myiir-audio-ch1";
> reg = <0x7422 0x1>;
> };
> myiir-aud-mix0 {
> compatible = "dglnt,myiir-audio-mix0";
> reg = <0x6860 0x1>;
> };
> 
> The sequence of operation in probe routine is:
>
> platform_get_resource(pdev, IORESOURCE_MEM, 0);
> remap_size = res->end - res->start + 1;
> request_mem_region(res->start, remap_size, pdev->name);
> base_addr = ioremap(res->start, remap_size);
>
> Thanks,
> Kumar
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: SOC: Zedboard: Driver question

2014-06-12 Thread priyaranjan
On Thu, Jun 12, 2014 at 7:09 PM, amit mehta  wrote:

> We are working on a school project in which we are trying to develop a
> audio mixer
> on Zedboard (Development board from Digilent). We have developed the IP
> and have
> integrated it with the overall hardware using Programmable logic. This
> board has ARM
> core. We have a Digilent pre-configured Linux source which we
> cross-compiled
> for ARM board, device tree blob and bootloader for Zync(BOOT.BIN). The
> system
> boots fine with Linux, but now to expose the recently added hardware
> implementation
> of audio mixer, we are trying to develop the driver using the platform
> driver API.
> Currently, In our reconfigurable hardware, we have 2 channels and a mixer
> and we
> want to access those individually as some file nodes under /proc FS. The
> sample
> code is shown below:
>
> 
> /* device match table to match with device node in device tree
>  * These are the list of devices that we want to expose as platform device
>  */
> static const struct of_device_id myiir_of_match[] __devinitconst = {
> {.compatible = "dglnt,myiir-audio-ch0"},
> {.compatible = "dglnt,myiir-audio-ch1"},
> {.compatible = "dglnt,myiir-audio-mix0"},
> {},
> };
>
> MODULE_DEVICE_TABLE(of, myiir_of_match);
>
> /* platform driver structure for myiir driver */
> static struct platform_driver myiir_driver = {
> .driver = {
> .name = DRIVER_NAME,
> .owner = THIS_MODULE,
> .of_match_table = myiir_of_match},
> .probe = myiir_probe,
> .remove = __devexit_p(myiir_remove),
> .shutdown = __devexit_p(myiir_shutdown)
> };
>
> /* Register myiir platform driver */
> module_platform_driver(myiir_driver);
> 
>
> Now, inside the probe routine (myiir_probe), can we create proc
> entries by calling
> create_proc for each of these nodes and setting the appropriate read and
> write
> methods(file_operations) ?
>


Yes, I feel this is fine, the proc entries to be created in probe,
 Initialize all data structures as required in probe.



>
> 
> struct proc_dir_entry *myiir_proc_entry[3];
>
> myiir_proc_entry[0] = proc_create("myiir-audio-ch0", 0, NULL,
> &proc_myiir_ch0_operations);
>
> myiir_proc_entry[1] = proc_create("myiir-audio-ch1", 0, NULL,
> &proc_myiir_ch1_operations);
>
> myiir_proc_entry[2] = proc_create("myiir-audio-mix0", 0, NULL,
> &proc_myiir_mix0_operations);
>
> 
>
> While browsing the Internet, we found some sample driver code, which we are
> also using as a template. I've attached the driver that is based on
> the same template.
>
> 
> myiir-aud-ch0 {
> compatible = "dglnt,myiir-audio-ch0";
> reg = <0x7420 0x1>;
> };
> myiir-aud-ch1 {
> compatible = "dglnt,myiir-audio-ch1";
> reg = <0x7422 0x1>;
> };
> myiir-aud-mix0 {
> compatible = "dglnt,myiir-audio-mix0";
> reg = <0x6860 0x1>;
> };
> 
>
> The driver is far from complete, but as of now the compilation woks fine.
> 
> user@fpga4v:~/tutorial/IIRdriver$ make ARCH=arm
> CROSS_COMPILE=arm-xilinx-linux-gnueabi-
> make -C ../linux-digilent-3.6-digilent-13.01/
> M=/home/user/tutorial/IIRdriver modules
> make[1]: Entering directory
> `/home/user/tutorial/linux-digilent-3.6-digilent-13.01'
>   CC [M]  /home/user/tutorial/IIRdriver/myiir.o
>   Building modules, stage 2.
>   MODPOST 1 modules
>   CC  /home/user/tutorial/IIRdriver/myiir.mod.o
>   LD [M]  /home/user/tutorial/IIRdriver/myiir.ko
> make[1]: Leaving directory
> `/home/user/tutorial/linux-digilent-3.6-digilent-13.01'
> 
>
>
Overall this looks to be a good attempt .Kumar :)


> Thanks,
> Kumar
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


SOC: Zedboard: Driver question

2014-06-12 Thread amit mehta
We are working on a school project in which we are trying to develop a
audio mixer
on Zedboard (Development board from Digilent). We have developed the IP and have
integrated it with the overall hardware using Programmable logic. This
board has ARM
core. We have a Digilent pre-configured Linux source which we cross-compiled
for ARM board, device tree blob and bootloader for Zync(BOOT.BIN). The system
boots fine with Linux, but now to expose the recently added hardware
implementation
of audio mixer, we are trying to develop the driver using the platform
driver API.
Currently, In our reconfigurable hardware, we have 2 channels and a mixer and we
want to access those individually as some file nodes under /proc FS. The sample
code is shown below:


/* device match table to match with device node in device tree
 * These are the list of devices that we want to expose as platform device
 */
static const struct of_device_id myiir_of_match[] __devinitconst = {
{.compatible = "dglnt,myiir-audio-ch0"},
{.compatible = "dglnt,myiir-audio-ch1"},
{.compatible = "dglnt,myiir-audio-mix0"},
{},
};

MODULE_DEVICE_TABLE(of, myiir_of_match);

/* platform driver structure for myiir driver */
static struct platform_driver myiir_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = myiir_of_match},
.probe = myiir_probe,
.remove = __devexit_p(myiir_remove),
.shutdown = __devexit_p(myiir_shutdown)
};

/* Register myiir platform driver */
module_platform_driver(myiir_driver);


Now, inside the probe routine (myiir_probe), can we create proc
entries by calling
create_proc for each of these nodes and setting the appropriate read and write
methods(file_operations) ?


struct proc_dir_entry *myiir_proc_entry[3];

myiir_proc_entry[0] = proc_create("myiir-audio-ch0", 0, NULL,
&proc_myiir_ch0_operations);

myiir_proc_entry[1] = proc_create("myiir-audio-ch1", 0, NULL,
&proc_myiir_ch1_operations);

myiir_proc_entry[2] = proc_create("myiir-audio-mix0", 0, NULL,
&proc_myiir_mix0_operations);



While browsing the Internet, we found some sample driver code, which we are
also using as a template. I've attached the driver that is based on
the same template.


myiir-aud-ch0 {
compatible = "dglnt,myiir-audio-ch0";
reg = <0x7420 0x1>;
};
myiir-aud-ch1 {
compatible = "dglnt,myiir-audio-ch1";
reg = <0x7422 0x1>;
};
myiir-aud-mix0 {
compatible = "dglnt,myiir-audio-mix0";
reg = <0x6860 0x1>;
};


The driver is far from complete, but as of now the compilation woks fine.

user@fpga4v:~/tutorial/IIRdriver$ make ARCH=arm
CROSS_COMPILE=arm-xilinx-linux-gnueabi-
make -C ../linux-digilent-3.6-digilent-13.01/
M=/home/user/tutorial/IIRdriver modules
make[1]: Entering directory
`/home/user/tutorial/linux-digilent-3.6-digilent-13.01'
  CC [M]  /home/user/tutorial/IIRdriver/myiir.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC  /home/user/tutorial/IIRdriver/myiir.mod.o
  LD [M]  /home/user/tutorial/IIRdriver/myiir.ko
make[1]: Leaving directory
`/home/user/tutorial/linux-digilent-3.6-digilent-13.01'


Thanks,
Kumar
#include  
#include 
#include  		/*Needed for copy_from_user */
#include 	 		/*Needed for IO Read/Write Functions */
#include 		/*Needed for Proc File System Functions */
#include 		/*Needed for Sequence File Operations */
#include 	/*Needed for Platform Driver Functions */

/* Define Driver Name */
#define DRIVER_NAME "myiir"

unsigned long *base_addr;	/* Vitual Base Address */
struct resource *res;		/* Device Resource Structure */
unsigned long remap_size;	/* Device Memory Size */

/* Write operation for /proc/myiir
* ---
* When user cat a string to /proc/myiir file, the string will be stored in
* const char __user *buf. This function will copy the string from user
* space into kernel space, and change it to an unsigned long value.
* It will then write the value to the register of myiir controller,
* and turn on the corresponding LEDs eventually.
*/

static ssize_t proc_myiir_write(struct file *file, const char __user * buf,
	size_t count, loff_t * ppos)
{
	char myiir_phrase[16];
	u32 myiir_value;

	if (count < 11) {
		if (copy_from_user(myiir_phrase, buf, count))
			return -EFAULT;

		myiir_phrase[count] = '\0';
	}

	myiir_value = simple_strtoul(myiir_phrase, NULL, 0);
	wmb();
	iowrite32(myiir_value, base_addr);
	return count;
}

/* Callback function when opening file /proc/myiir
* --
* Read the register value of myiir controller, print the value to
* the sequence file struct seq_file *p. In file open operation for /proc/myiir
* this callback function will be called first to fill up the seq_file,
* and seq_read function will print whateve

Re: git download

2014-06-12 Thread Valdis . Kletnieks
On Thu, 12 Jun 2014 14:32:26 +0800, "jinz...@wingtech.com" said:
> Now we install git on servers, when we use "git clone" to download the code,
> the rate is too slow, how to speed the rate?

a) You can just start it Friday as you leave the office, and it should be
done by the time you get in on Monday.

b) Remember that if you want it on multiple machines, you can clone it to one
box, and then use that as the source of a clone to other boxes


pgp1BOhAGK8D2.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies