st_magn_i2c DRDY on INT1 not available error

2015-07-13 Thread Joo Aun Saw
Hi,

I have an lsm303dlhc chip with accelerometer and magnetometer sensors.
I'm having difficulty getting the st_magn_i2c driver to work. I get
this error message:
 iio iio:device0: DRDY on INT1 not available.
 st-magn-i2c: probe of 1-001e failed with error -22

This is my device tree fragment:
fragment@0 {
target = i2c_arm;

__overlay__ {
#address-cells = 0x1;
#size-cells = 0x0;
status = okay;

lsm303dlhc-magn@1e {
compatible = st,lsm303dlhc-magn;
reg = 0x1e;
status = okay;
st,drdy-int-pin = 1;
};
};
};

I'm running kernel 3.18.11. The accelerometer driver works fine though.

What am I doing wrong? Any help would be greatly appreciated.

Thanks.
Joo

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


Re: Test

2015-07-13 Thread Leng Xuedong
Sorry your mail sent to kernelnewbies HSA failed forever.
On Jul 14, 2015 12:41 PM, Navy nav...@126.com wrote:

 I'm a student and it's my first time to use Mailing List. I want to see if
 somebody can see this mail.
 Thank you.


 ___
 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


Test

2015-07-13 Thread Navy
I'm a student and it's my first time to use Mailing List. I want to see if 
somebody can see this mail.
Thank you.


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


Re: About Low Hanging Fruits

2015-07-13 Thread Robert P. J. Day
On Mon, 13 Jul 2015, valdis.kletni...@vt.edu wrote:

 On Mon, 13 Jul 2015 12:13:28 +0530, Mayur Patil said:

I just want to know like other Open source projects is there a thing in
  linux kernel as Low hanging fruits.

 The Linux kernel has been worked over by professional programmers
 for more than a decade, and as a result the number of things that
 can be attacked by a relatively unskilled newcomer is fairly low.

 Your best place to start is probably under drivers/staging, where we
 put all the stuff that's *not* up to standards yet.  Each driver
 should have a TO-DO file describing what needs doing, and Greg HK is
 always willing to take checkpatch style fixups for the staging tree
 (many other maintainers *don't* want style patches that aren't
 connected to other work - if there's other active work, they can
 introduce merge conflicts, and if nobody's working on something,
 it's best to not touch stable code...)

  actually, one area of low-hanging fruit is the Documentation/
directory, which could always use some attention. documentation is
always getting out of date, so pick a subsystem and clean up the docs.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday


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


Re: filesystem encryption problem.

2015-07-13 Thread Rohan Puri
On 13 Jul 2015 22:08, Amir Hezarkhani amir6...@gmail.com wrote:


 On Jul 13, 2015 1:18 AM, Rohan Puri rohan.pur...@gmail.com wrote:
 
  No issues, you are welcome.
 
  Enjoy life,
  Rohan
 
  On 13 Jul 2015 01:19, Amir Hezarkhani amir6...@gmail.com wrote:
 
 
  On Jul 12, 2015 10:00 PM, Rohan Puri rohan.pur...@gmail.com wrote:
  
  
   On 12 Jul 2015 22:20, Amir Hezarkhani amir6...@gmail.com wrote:
   
Thank for replies. About copy_to_user and copy_from_user, whats
the better way?
I dont have much experience in kernel development but I'm trying
to learn. Can you recommend me some books, documents, etc so I can learn
more about filesystems in kernel. I am also interested to learn how mmap
works because I have problems with execution of binary files in my
encrypted filesystem.
   
On Jul 12, 2015 8:30 PM, kernelnewbies-requ...@kernelnewbies.org
wrote:
   
   
   
On Sun, Jul 12, 2015 at 8:08 PM, Freeman Zhang 
freeman.zhang1...@gmail.com wrote:
   
 Original Message 
 hello
 I am working on adding a simple encryption to file contents in
ext4 driver
 (for learning purposes) I added simple XOR encryption to
aio_read and
 aio_write functions and it worked until I faced this problem:

 when I open a file in encrypted filesystem using VIM text
editor and when I
 try to save it it gives me this error:

 pointer block id wrong
 can not find line 1

 and it just corrupts the entire file!

 this is my aio_write function:

 aio_write_enc(struct kiocb *iocb, const struct iovec *iov,
 unsigned long nr_segs, loff_t pos)
 {
 size_t i;
 ssize_t ret;
 char *data=vmalloc(sizeof(char)*iov-iov_len);
 copy_from_user(data,iov-iov_base,iov-iov_len);

 for(i=0;iiov-iov_len;i++)
 {
 data[i]^=5;
 }
 struct iovec iov_enc= { .iov_base = iov-iov_base,
.iov_len =
 iov-iov_len };

 copy_to_user(iov_enc.iov_base,data,iov-iov_len);
 ret=ext4_file_write(iocb,iov_enc,nr_segs,pos);
 vfree(data);
 return ret;
 }

 this just changes the data and then calls original function.

 is there anything wrong with this function? can anyone help me?



Hi Amir,
   
I'm not quite sure about what's wrong with your function, but
here are
two suggestions I got from the list when I did similar things:
   
1. wrapfs
2. ecryptfs
   
I think you should check these two stackable filesystems if you
haven't.
   
Hope this can help a little bit!
   
Freeman
   
   
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
   
   
Hi Amir,
   
I agree with Freeman Zhang over here. The way you are doing it is
not right. There is a mechanism to create stacks of file system and you
should go down that path.
   
Having said this, you should definitely debug the issue that you
are facing. Some pointers : -
1. As you have already mentioned that this is happening only for
vim and not while regular read(using cat, etc), you need to check what vim
does special to read a file. I would suggest make use of strace and do
reading with and without vim, maybe you will get something of interest.
2. re-read code to check, you might be messing up while write or
read.
   
Apart from these some basic practices you need to follow is : -
   
1. check for error conditions, like you missed checking error
from vmalloc() and the below code will execute even if it failed, this
should be avoided.
2. copy_from_user  again copying back to user is in-efficient.

 Yes you are right. This was the problem.

   
   
Enjoy life,
Rohan
   
   
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
   
  
   Hi Amir,
  
   Please reply at the bottom. Regarding what's the better way would
depend on how you design stuff.
  
   Following is my recommendation :-
  
   For conceptual knowledge of general file systems the best would be
OS book by Prof Remzi Arpaci-Dusseau.
   Excellently explained.
  
   For linux kernel conceptual stuff get hold of Robert love Linux
kernel development.
  
   Read lots of kernel generic filesystem code in FS dir. Lots of basic
functionality is implemented in helper functions present in this dir.
  
   Enjoy life,
   Rohan
 
  Thanks a lot Rohan.  And sorry about the bad reply.

 Ok I solved the problem. As Rohan said, copy_from_user and then
copy_to_user was inefficient. So I removed 'copy to user' part and assigned
'data' to iov_enc.base . thanks guys and Happy codding.

Hi Amir,

Good to know.

Enjoy life,
Rohan
___
Kernelnewbies mailing list

Re: About Low Hanging Fruits

2015-07-13 Thread Valdis . Kletnieks
On Mon, 13 Jul 2015 12:13:28 +0530, Mayur Patil said:

   I just want to know like other Open source projects is there a thing in
 linux kernel as Low hanging fruits.

The Linux kernel has been worked over by professional programmers for more
than a decade, and as a result the number of things that can be attacked
by a relatively unskilled newcomer is fairly low.

Your best place to start is probably under drivers/staging, where we put
all the stuff that's *not* up to standards yet.  Each driver should have
a TO-DO file describing what needs doing, and Greg HK is always willing to
take checkpatch style fixups for the staging tree (many other maintainers
*don't* want style patches that aren't connected to other work - if there's
other active work, they can introduce merge conflicts, and if nobody's working
on something, it's best to not touch stable code...)


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


About Low Hanging Fruits

2015-07-13 Thread Mayur Patil
Hi,

  I just want to know like other Open source projects is there a thing in
linux kernel as

  Low hanging fruits. I have searched in bugzilla but not able to find it.

  Thanks  !!



-- 



*Regards,Mayur S Patil,Looking for RD or Soft Engg positions,Pune, India.*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies