Re: debugfs question ...

2019-05-01 Thread 'Greg KH'
On Wed, May 01, 2019 at 03:18:51PM +0100, r...@metamail.co wrote: > Hello and thanks, > > > > > > > The pattern for the implementation is (AFAICT) right out of the book > > > > > > > You are returning a "short" read, and then disallowing ppos to be set to a > > non-zero value? That's a recipie

RE: debugfs question ...

2019-05-01 Thread rdq
> my guess is your are not returning EOF (= 0). User space expects a return > value of 0 (EOF) to terminate reading. But your code will always return > sizeof("Hello world\n"). A fix would be to not only increment ppos, but also > check if it's already behind your data. > > Regards, > > Martin T

Re: debugfs question ...

2019-04-30 Thread Martin Christian
Hi, my guess is your are not returning EOF (= 0). User space expects a return value of 0 (EOF) to terminate reading. But your code will always return sizeof("Hello world\n"). A fix would be to not only increment ppos, but also check if it's already behind your data. Regards, Martin Am 30.04.19

Re: debugfs question ...

2019-04-30 Thread Greg KH
On Tue, Apr 30, 2019 at 12:45:08PM +0100, r...@metamail.co wrote: > Greetings, > > My I2C sensor driver has a debugfs entry for development purposes. > Everything works fine with the exception of the read operation. When 'cat' > is used, the read operation is called repeatedly and indefinitely. If