Re: gpio-led driver

2016-07-20 Thread Gadre Nayan
Hi,

OF stands for open firmware, OF uses a format to represent platform
information, which is called a device tree.

An example of how the driver extracts information from device  tree:

#if defined(CONFIG_OF)
static const struct of_device_id dali_of_ids[] =
{
   { .compatible = "arm,dali_gpio", },
   {},
};

MODULE_DEVICE_TABLE(of, dali_of_ids);
#endif

static struct platform_driver dali_driver = {
.driver = {
.name = "dali_gpio",
.of_match_table = of_match_ptr(dali_of_ids),
},
.probe = Dali_probe,
.remove = Dali_remove,
};

The driver is going to fetch information from the device tree later on
(in probe) using the compatible property mentioned. So if the tree has
the same compatible string then subsequent information can be obtained
from that device tree node.

Thanks

On Thu, Jul 21, 2016 at 9:42 AM, Gadre Nayan  wrote:
> Hi,
>
> OF stands for open firmware, OF uses a format to represent platform
> information, which is called a device tree.
>
> An example of how the driver extracts information from device  tree:
>
> #if defined(CONFIG_OF)
> static const struct of_device_id dali_of_ids[] =
> {
>{ .compatible = "arm,dali_gpio", },
>{},
> };
>
> MODULE_DEVICE_TABLE(of, dali_of_ids);
> #endif
>
> static struct platform_driver dali_driver = {
> .driver = {
> .name = "dali_gpio",
> .of_match_table = of_match_ptr(dali_of_ids),
> },
> .probe = Dali_probe,
> .remove = Dali_remove,
> };
>
> The driver is going to fetch information from the device tree later on
> (in probe) using the compatible property mentioned. So if the tree has
> the same compatible string then subsequent information can be obtained
> from that device tree node.
>
> Thanks
> Nayan Gadre
>
> On Wed, Jul 20, 2016 at 8:30 PM, Anish Kumar
>  wrote:
>>
>>
>> On Jul 20, 2016, at 4:15 AM, Raul Piper  wrote:
>>
>> Hi,
>> I wanted to know the part number
>>
>>
>> What is part number?
>>
>> for the leds-gpio.c in the driver/leds folder and the device tree bindings
>> for this driver .Can some one point out to me where in Linux kernel it is?
>>
>> Also why below line has been used.Is it mandatory?
>> ...
>> .of_match_table = of_gpio_leds_match,
>>
>>
>> This is needed when you are using device tree for getting the board settings
>> but you can also do the same without this as well. Read up on device tree in
>> kernel Documentation folder.
>>
>> },
>>
>> thanks in advance ,
>> Rp
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>

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


Re: gpio-led driver

2016-07-20 Thread Gadre Nayan
Hi,

OF stands for open firmware, OF uses a format to represent platform
information, which is called a device tree.

An example of how the driver extracts information from device  tree:

#if defined(CONFIG_OF)
static const struct of_device_id dali_of_ids[] =
{
   { .compatible = "arm,dali_gpio", },
   {},
};

MODULE_DEVICE_TABLE(of, dali_of_ids);
#endif

static struct platform_driver dali_driver = {
.driver = {
.name = "dali_gpio",
.of_match_table = of_match_ptr(dali_of_ids),
},
.probe = Dali_probe,
.remove = Dali_remove,
};

The driver is going to fetch information from the device tree later on
(in probe) using the compatible property mentioned. So if the tree has
the same compatible string then subsequent information can be obtained
from that device tree node.

Thanks
Nayan Gadre

On Wed, Jul 20, 2016 at 8:30 PM, Anish Kumar
 wrote:
>
>
> On Jul 20, 2016, at 4:15 AM, Raul Piper  wrote:
>
> Hi,
> I wanted to know the part number
>
>
> What is part number?
>
> for the leds-gpio.c in the driver/leds folder and the device tree bindings
> for this driver .Can some one point out to me where in Linux kernel it is?
>
> Also why below line has been used.Is it mandatory?
> ...
> .of_match_table = of_gpio_leds_match,
>
>
> This is needed when you are using device tree for getting the board settings
> but you can also do the same without this as well. Read up on device tree in
> kernel Documentation folder.
>
> },
>
> thanks in advance ,
> Rp
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

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


Re: Mapping of Filename to allocated blocks

2016-07-20 Thread Manoj Rao
Thanks Arshad, Luis for the response.
This project was on back burner for a while and now it's
coming back to life.

tl;dr: I'm looking for a way to tell if a given inode object
belongs to a persistent block device or not ex: a sysfs node
doesn't have a corresponding block device backing it.

I looked into the source code for hdparm implementation.
I was able to borrow a lot of it and move them in kernel (for
academic purposes only). Here's my (very limited) understanding so
far, hdparm tries to read a storage device's 'geometry' which includes
info such as cylinders, heads, sectors etc. on mechanical disks. One
of the key parameters of a storage device is the start_lba which is
basically the first block on a persistent device that contains data
from a given file. In hdparm, it is able to get this info by simply
reading from the block device's sysfs node, under,
/sys/dev/block/.../start
I intend to do something similar in the kernel by doing something
similar to when the above sysfs node is read. The implementation for
this is partition-generic.c
However, I need to run this for each and every read system call which
includes all the procfs, sysfs and other RAM fs based file reads. My
code is causing the kernel to panic at some point due to an illegal
memory access while trying to obtain the starting sector/block for the
file that's currently being read. My hunch is the crash occurs when
file being read is on a non-persistent fs such as a sysfs node
I have gotten hold of the inode structure and I'm trying to find if
a given inode is stored persistently or not and I've been unable to
find this information so far. I have all the appropriate NULL checks
and each time it crashes the accessed address points a garbage,
non-zero address. Any thoughts or inputs are highly
appreciated. Thanks.

​​
--
​Manoj​


On Wed, Apr 27, 2016 at 8:32 PM, arshad hussain 
wrote:

> On Thu, Apr 28, 2016 at 7:28 AM, Manoj Rao  wrote:
> > Hi All,
> >
> > I'm looking for a way to get a filename associated with a given physical
> > block (ideally what I'd like is a mapping of filename <=> all the
> allocated
> > blocks for this file).
>
> If you have not done already, this could be a good starting point.
> Look at FIBMAP IOCTL.
>
> Here is one usage of FIEMAP, demonstrated via hdparam.
> # hdparm --fibmap 
>
> >
> > Is there a recommended way to do this already in kernel? if not, then
> where
> > should I start looking to add changes?
>
> Not sure about what would be the Recommended method. But this could be done
> in user-space vs doing it in kernel space. For example, consider cases like
> single file restore - there will be a requirement to figure out the
> logical - physical block allocation for a file which could be achieved
> through...
> Read superblock
> Read dentry - Home into the required inode (file)
> Read inode - to figure out the location of block.
>
> Note: This is not generic - and would require changes as layout is
> different
> for filesystems.
>
> Thanks
> Arshad
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[SPAM] Re: How do you test Linux kernel?

2016-07-20 Thread Bernd Petrovitsch
Hi!

On Wed, 2016-07-20 at 14:19 +0300, Aleksander Alekseev wrote:
[...]
> It is my understanding that Linux kernel doesn't has usual `make
> check`
> or `make test` command.

If it is usual, which other software project with the same scale/volume
and complexity range has that actually and if it exists - even more
important - how useful is that?

Kind regards,
Bernd
-- 
Bernd Petrovitsch  Email : be...@petrovitsch.priv.at
 LUGA : http://www.luga.at



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


Re: How do you test Linux kernel?

2016-07-20 Thread Greg KH
On Wed, Jul 20, 2016 at 02:19:27PM +0300, Aleksander Alekseev wrote:
> Hello
> 
> It is my understanding that Linux kernel doesn't has usual `make check`
> or `make test` command.

It doesn't?  Have you checked?

$ make help | grep test
Kernel selftest
  kselftest   - Build and run kernel selftest (run as root)
running kselftest on it
  kselftest-clean - Remove all generated kselftest files
  kselftest-merge - Merge all the config dependencies of kselftest to existed

> There are LTP [1] and other related projects
> instead. Could you tell me please what test suits (if any) do _you_ run
> in practice?

It depends on what changes you make, to determine how you test it.

thanks,

greg k-h

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


Re: How old Linux Device Drivers 3 book is now?

2016-07-20 Thread Wenda Ni
Yes, off course. The basic principles are there. This does not change from
kernel to kernel.


Cheers,

Wenda Ni, Ph.D.


On Wed, Jul 20, 2016 at 10:32 AM, Fernando França <
ferna...@desconstruindo.eng.br> wrote:

> Hi everyone.
>
> I'm a totally fresh and newbie with kernel development and I've started
> reading Linux Device Drivers 3 book (CORBET et al).
>
> Since this book approaches is based on kernel 2.6 and we are currently
> with kernel 4.x, someone could help me telling if this book is still a good
> introduction to the subject, or is now highly outdated?
>
> Thanks in advance.
>
> --
> Fernando França
> http://desconstruindo.eng.br
>
> Linux user #263682
> Dificultando a vida dos usuários desde 1999
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: gpio-led driver

2016-07-20 Thread Anish Kumar


> On Jul 20, 2016, at 4:15 AM, Raul Piper  wrote:
> 
> Hi,
> I wanted to know the part number

What is part number?

> for the leds-gpio.c in the driver/leds folder and the device tree bindings 
> for this driver .Can some one point out to me where in Linux kernel it is?
> 
> Also why below line has been used.Is it mandatory?
> ...
> .of_match_table = of_gpio_leds_match,

This is needed when you are using device tree for getting the board settings 
but you can also do the same without this as well. Read up on device tree in 
kernel Documentation folder.
> },
> 
> thanks in advance ,
> Rp
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How old Linux Device Drivers 3 book is now?

2016-07-20 Thread Fernando França
Hi everyone.

I'm a totally fresh and newbie with kernel development and I've started
reading Linux Device Drivers 3 book (CORBET et al).

Since this book approaches is based on kernel 2.6 and we are currently with
kernel 4.x, someone could help me telling if this book is still a good
introduction to the subject, or is now highly outdated?

Thanks in advance.

--
Fernando França
http://desconstruindo.eng.br

Linux user #263682
Dificultando a vida dos usuários desde 1999
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


kgdb on kernel4.4 for arm

2016-07-20 Thread Pankaj Gupta
Hello all,

I am trying to use kgdboc on arm64 based kernel 4.4 android device, but
could not able to connect it. Is anyone have used kgdb on arm based android
devices?

Thanks & Regards,

*Pankaj Gupta*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How do you test Linux kernel?

2016-07-20 Thread Aleksander Alekseev
Hello

It is my understanding that Linux kernel doesn't has usual `make check`
or `make test` command. There are LTP [1] and other related projects
instead. Could you tell me please what test suits (if any) do _you_ run
in practice?

[1] http://linux-test-project.github.io/

-- 
Best regards,
Aleksander Alekseev

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


gpio-led driver

2016-07-20 Thread Raul Piper
Hi,
I wanted to know the part number for the leds-gpio.c in the
driver/leds folder and the device tree bindings for this driver .Can
some one point out to me where in Linux kernel it is?

Also why below line has been used.Is it mandatory?
...
.of_match_table = of_gpio_leds_match,
},

thanks in advance ,
Rp

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


gpio-led driver

2016-07-20 Thread Raul Piper
Hi,
I wanted to know the part number for the leds-gpio.c in the driver/leds
folder and the device tree bindings for this driver .Can some one point out
to me where in Linux kernel it is?

Also why below line has been used.Is it mandatory?
...
*.of_match_table = of_gpio_leds_match,*
},

thanks in advance ,
Rp
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Pending work related to kernel for a newbie

2016-07-20 Thread sham pavman
Hi Ashijeet,

Its almost always true that we all start off with bugzilla and i believe
you should start from there as well. ( pick up bite size bugs) and start
solving.

However, there is another very important thing. C programming will help you
code in a solution to the problem and often that's the most easiest part.
Its highly important that you understand the problem first.
Understand the subsystems , how they interact . I would urge you to first
read about the linux kernel and how it explains all the subsystems and then
start looking at the issues.

You can solve small issues for the fun of it. But the real strength(at
least if you ask me) of a kernel Engineer is to understand the problem
first.
There are lots of materials online. But if you wish to read any specific
book then
https://books.google.co.in/books/about/Unix_Internals.html?id=Z7qfu9NK7WQC

That's where i started from

On Wed, Jul 20, 2016 at 1:24 PM, Robert P. J. Day 
wrote:

> On Wed, 20 Jul 2016, Aleksander Alekseev wrote:
>
> > Hello, Ashijeet
> >
> > > I am kernel newbie and I was looking for something to work upon to
> > > improve my skill-set. I have good knowledge of C and experience in
> > > writing patches. Also please refer me if there is a to-do list for
> > > newbies related to pending tasks for linux kernel.
> >
> > I'm newbie here as well. Still I have an experience of working on some
> > other open source projects. I believe the idea is always the same.
> >
> > First, take a look on project's issue tracker:
> >
> > https://bugzilla.kernel.org/
> >
> > Also you could probably review an existing code and propose refactoring
> > or optimization patches. Static code analyzers is always a good start
> > point. Try looking for typos in comments - you will be surprised how
> > many mistakes are there. Usually people like to write code but don't
> > like to document and/or test it. Join testing and reviewing new
> > patches, try to improve them.
> >
> > I hope this will help.
>
>   i've mentioned this before ... if you want a safe project that will
> still teach you a whole lot about the kernel, improve all the
> documentation under the Documentation/ directory. there's a *ton* of
> stuff there that is either in need of improving or, in some cases,
> deletion because it's so old. or if you're feeling really ambitious,
> write some *new* documentation for some subsystem for which there is
> none.
>
>   and, finally, you can't screw things up by changing 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
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Pending work related to kernel for a newbie

2016-07-20 Thread Robert P. J. Day
On Wed, 20 Jul 2016, Aleksander Alekseev wrote:

> Hello, Ashijeet
>
> > I am kernel newbie and I was looking for something to work upon to
> > improve my skill-set. I have good knowledge of C and experience in
> > writing patches. Also please refer me if there is a to-do list for
> > newbies related to pending tasks for linux kernel.
>
> I'm newbie here as well. Still I have an experience of working on some
> other open source projects. I believe the idea is always the same.
>
> First, take a look on project's issue tracker:
>
> https://bugzilla.kernel.org/
>
> Also you could probably review an existing code and propose refactoring
> or optimization patches. Static code analyzers is always a good start
> point. Try looking for typos in comments - you will be surprised how
> many mistakes are there. Usually people like to write code but don't
> like to document and/or test it. Join testing and reviewing new
> patches, try to improve them.
>
> I hope this will help.

  i've mentioned this before ... if you want a safe project that will
still teach you a whole lot about the kernel, improve all the
documentation under the Documentation/ directory. there's a *ton* of
stuff there that is either in need of improving or, in some cases,
deletion because it's so old. or if you're feeling really ambitious,
write some *new* documentation for some subsystem for which there is
none.

  and, finally, you can't screw things up by changing 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
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Pending work related to kernel for a newbie

2016-07-20 Thread Aleksander Alekseev
Hello, Ashijeet

> I am kernel newbie and I was looking for something to work upon to
> improve my skill-set. I have good knowledge of C and experience in
> writing patches. Also please refer me if there is a to-do list for
> newbies related to pending tasks for linux kernel.

I'm newbie here as well. Still I have an experience of working on some
other open source projects. I believe the idea is always the same.

First, take a look on project's issue tracker:

https://bugzilla.kernel.org/

Also you could probably review an existing code and propose refactoring
or optimization patches. Static code analyzers is always a good start
point. Try looking for typos in comments - you will be surprised how
many mistakes are there. Usually people like to write code but don't
like to document and/or test it. Join testing and reviewing new
patches, try to improve them.

I hope this will help.

-- 
Best regards,
Aleksander Alekseev

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