Re: atomic test and set

2017-10-17 Thread Anish Kumar
> On Oct 17, 2017, at 5:40 PM, Tobin C. Harding wrote: > > Hi, > > Do we have an atomic test and set function in the kernel. I have tried Yes and it is used very much inside the kernel. > > const int KEY_FLAG_BIT = 1; > > ... > >static siphash_key_t ptr_secret

Re: Help on modelling gpio interrupt source when interrupt is shared

2017-01-24 Thread Anish Kumar
> On Jan 23, 2017, at 10:56 PM, Rajasekhar Pulluru > wrote: > > Hi Anish, > > My intention is just to detect interrupt in the user space and read the > device id without using udev. > > I don't want to create a new driver in kernel (assume I can't modify linux

Re: adding 32 bit compatibility layer in custom kernel module

2017-01-03 Thread Anish Kumar
> On Jan 3, 2017, at 10:03 PM, Pradeepa Kumar <cdprade...@gmail.com> wrote: > > Please see inline below > >> On Wed, Jan 4, 2017 at 11:07 AM, Anish Kumar <anish198519851...@gmail.com> >> wrote: >> >> >>> On Jan 3, 2017, at 8:04 PM,

Re: adding 32 bit compatibility layer in custom kernel module

2017-01-03 Thread Anish Kumar
> On Jan 3, 2017, at 8:04 PM, Pradeepa Kumar wrote: > > Hi experts > > down vote > favorite > in my 64 bit kernel, I have a custom kernel module providing new protocol and > providing socket system calls. > > it works fine when 64 bit app runs. > > i am seeing issues

Re: Options for adding I2C devices and how-to

2016-09-30 Thread Anish Kumar
> On Sep 30, 2016, at 6:23 PM, vibnwis wrote: > > Hi there, > > My questions are about the options available for adding I2C devices onto > existing single board computers, such as Panda Board or Raspberry Pi. Later > then I would ask how to get it done. > > By far, I

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?

Re: I have a large patch in the 2000 lines. What to do?

2015-10-09 Thread Anish Kumar
> On Oct 9, 2015, at 11:45 AM, Ivan Safonov wrote: > > Hi! > > I have a large patch in the 2000 lines, which replaces the macro BITn to > BIT(n) in multiple files. I will recommend sending RFC patch first and Get the community comments. If they like your patch then

Re: bitops for handling 32 bits

2015-07-28 Thread Anish Kumar
On Jul 28, 2015, at 10:46 PM, Kevin Wilson wkev...@gmail.com wrote: Hi all, Is there a kernel API for handling 32 bits ? I see a macro like BIT(nr) http://lxr.free-electrons.com/source/include/linux/bitops.h#L6 #define BIT(nr) (1UL (nr)) and also #define

Re: why use while(0) to write set_current_state

2015-06-16 Thread Anish Kumar
On Jun 16, 2015, at 10:01 PM, 慕冬亮 mudonglianga...@gmail.com wrote: I see the macro in the include/linux/sched.h #define __set_current_state(state_value) \ do { current-state = (state_value); } while (0) Why define it like this? What's the meaning of while?

Re: To use wake_up_interruptible in ISR

2015-05-26 Thread Anish Kumar
On May 25, 2015, at 10:02 PM, 김찬 c...@etri.re.kr wrote: Hello, I see in the source (linux ver 3.3) that wake_up_interruptible function doesn't sleep so I used in it an ISR but I'm getting 'BUG:scheduling while atomic' message. (I'm not sure it's coming from this) Remove it and

Re: getting interrupt number

2015-03-08 Thread Anish Kumar
On Mar 8, 2015, at 7:25 PM, Ronit Halder ronit.li...@gmail.com wrote: How to get the interrupt number of a device.I know it's device id and the bus number. The device is a usb mouse. Interrupt number is not a constant value. Depending on the board it changes. For which are you asking ?

Re: Get local CPU id

2015-03-08 Thread Anish Kumar
You can use ftrace and such. On Mar 8, 2015, at 12:06 PM, Matwey V. Kornilov matwey.korni...@gmail.com wrote: Hi, I would like to somehow obtain local CPU core ID in the interrupt handler function. I want to see how my interruptions are distributed among different CPU cores under

Re: workqueues - how to use them correctly

2015-02-10 Thread Anish Kumar
On Feb 10, 2015, at 12:50 AM, Roshan A roshan@gmail.com wrote: hi all, My question is regarding the correct use of workqueues. I have a driver which queues a work item in the interrupt handler. The bottom half function ( the workitem -function ) does have proper locking ( mutex )

Re: container_of

2015-01-17 Thread Anish Kumar
On Jan 17, 2015, at 8:32 AM, Simon Brand simon.br...@postadigitale.de wrote: Good evening, i read the article about the container_of function: http://www.kroah.com/log/linux/container_of.html I understand what it does and how it works. I thought, it could be simplified by

Re: test jiffies on ARM SMP board

2013-02-20 Thread anish kumar
On Wed, 2013-02-20 at 17:30 +, Russell King - ARM Linux wrote: On Wed, Feb 20, 2013 at 10:54:41PM +0530, anish kumar wrote: On Thu, 2013-02-21 at 00:39 +0800, buyitian wrote: i am confused about my test. in one device driver, i put below code: printk(start to test test

Re: process 0 (swapper)

2013-02-16 Thread anish kumar
On Sat, 2013-02-16 at 18:48 +0200, Kevin Wilson wrote: Hi, we see this code in proc_pid_lookup: tgid = name_to_int(dentry); if (tgid == ~0U) goto out; It is the error case when name can't be converted to integer i.e. name is wrong. In other words,

Re: Kernel code interrupted by Timer

2013-02-09 Thread anish kumar
Thanks Frederic. On Sat, 2013-02-09 at 08:44 +0100, Frederic Weisbecker wrote: 2013/2/8 Gaurav Jain gjainroor...@gmail.com: What happens if the kernel executing in some process context (let's say executing a time-consuming syscall) gets interrupted by the Timer - which is apparently allowed

Re: Kernel code interrupted by Timer

2013-02-09 Thread anish kumar
On Sun, 2013-02-10 at 00:47 +0800, Peter Teoh wrote: On Sun, Feb 10, 2013 at 12:22 AM, Frederic Weisbecker fweis...@gmail.com wrote: 2013/2/9 Peter Teoh htmldevelo...@gmail.com: A search in the entire subtree of arch/x86/ and including all its

Re: Kernel code interrupted by Timer

2013-02-08 Thread anish kumar
On Sat, 2013-02-09 at 14:57 +0800, Peter Teoh wrote: On Sat, Feb 9, 2013 at 1:47 PM, anish kumar . Timer interrupts is supposed to cause scheduling and scheduler may or may not pick up your last process(we always use the term task in kernel space

Re: pr_info not printing message in /var/log/messages

2013-02-07 Thread anish kumar
On Tue, 2013-02-05 at 16:18 -0500, valdis.kletni...@vt.edu wrote: On Wed, 06 Feb 2013 04:43:20 +0800, Jimmy Pan said: in fact, i've been always wondering what is the relationship between dmesg and /var/log/message. they diverse a lot... dmesg is provided by kernel using cat /proc/kmsg.

Re: locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread anish kumar
On Fri, 2013-01-25 at 10:00 -0300, Pablo Pessolani wrote: Hi: It is well know that is not recomended to keep a spinlock locked during operations that can be preempted. Some of these operations are copy_to_user, copy_from_user. Below is the code of the write_lock() as a sample. 340

Re: what is the function of do_softirq() ?

2013-01-16 Thread anish kumar
On Wed, 2013-01-16 at 10:25 +, Anuz Pratap Singh Tomar wrote: On Tue, Jan 15, 2013 at 6:31 AM, horseriver horseriv...@gmail.com wrote: hi: what is the function of do_softirq()? Softirq is basically same as bottom half except it is run in irq context.So the

Re: Block device driver: how to terminate the block device if media disappears?

2013-01-12 Thread anish kumar
On Sat, 2013-01-12 at 14:39 -0300, Ezequiel Garcia wrote: On Mon, Jan 7, 2013 at 7:49 AM, John Beard jo...@codexdigital.com wrote: On 21/12/12 18:23, Ezequiel Garcia wrote: On Thu, Dec 13, 2012 at 12:31 PM, John Beard jo...@codexdigital.com wrote: What is the right way to terminate

Re: Regarding module init function

2013-01-08 Thread anish kumar
On Tue, 2013-01-08 at 14:51 +0100, Tobias Boege wrote: On Tue, 08 Jan 2013, Rahul Bedarkar wrote: Ok. in init/main.c we call do_basic_setup(). Where do_initcalls call each of init functions from __early_initcall_end to __initcall_end. But I don't know from where these values gets

Re: How kernel handle interrupts[AX88796B network controller]

2013-01-07 Thread anish kumar
On Mon, 2012-12-24 at 22:10 +0800, Woody Wu wrote: On Fri, Dec 21, 2012 at 01:33:03PM -0800, anish kumar wrote: On Fri, 2012-12-21 at 23:34 +0800, Woody Wu wrote: On Thu, Dec 20, 2012 at 10:05:05AM -0800, anish singh wrote: On Dec 20, 2012 6:30 AM, Woody Wu narkewo...@gmail.com wrote

Re: How kernel handle interrupts[AX88796B network controller]

2013-01-07 Thread anish kumar
On Sat, 2012-12-22 at 23:11 +0800, Woody Wu wrote: On Fri, Dec 21, 2012 at 01:33:03PM -0800, anish kumar wrote: On Fri, 2012-12-21 at 23:34 +0800, Woody Wu wrote: On Thu, Dec 20, 2012 at 10:05:05AM -0800, anish singh wrote: On Dec 20, 2012 6:30 AM, Woody Wu narkewo...@gmail.com wrote

Re: What does ISA/PCI really mean to ARM architecture?

2012-12-27 Thread anish kumar
On Thu, 2012-12-27 at 10:51 +0100, Geert Uytterhoeven wrote: On Thu, Dec 27, 2012 at 9:27 AM, Woody Wu narkewo...@gmail.com wrote: Can a peripheral chip that claims to be ISA or PCI device be used in a ARM based embedded system? For these kind of chips, I only concern about the planar kind

Re: What does ISA/PCI really mean to ARM architecture?

2012-12-27 Thread anish kumar
On Thu, 2012-12-27 at 11:22 -0500, jonsm...@gmail.com wrote: On Thu, Dec 27, 2012 at 3:27 AM, Woody Wu narkewo...@gmail.com wrote: Hi, list I know this might be a very basic question. But I really don't clear at it. Can a peripheral chip that claims to be ISA or PCI device be used in

Re: How kernel handle interrupts

2012-12-21 Thread anish kumar
On Fri, 2012-12-21 at 17:34 +0800, Woody Wu wrote: 在 2012-12-21 AM2:05,anish singh anish198519851...@gmail.com写 道: On Dec 20, 2012 6:30 AM, Woody Wu narkewo...@gmail.com wrote: Hi, List Where is the Kernel code that handles external interrupts? I want to have a look at it

Re: How kernel handle interrupts[AX88796B network controller]

2012-12-21 Thread anish kumar
On Fri, 2012-12-21 at 23:34 +0800, Woody Wu wrote: On Thu, Dec 20, 2012 at 10:05:05AM -0800, anish singh wrote: On Dec 20, 2012 6:30 AM, Woody Wu narkewo...@gmail.com wrote: Hi, List Where is the Kernel code that handles external interrupts? I want to have a look at it but

Re: Callback function from kernel module

2012-11-07 Thread anish kumar
On Sat, 2012-11-03 at 21:56 +0530, jeshkumar...@gmail.com wrote: hello Mulyadi, As per my design, a userspace application shall call some function in the application for each interrupt occur in particular kernel module. So what mechanism shall go ? As subramaniam referred kobject, I am

Re: Finding the interrupt vector of a given IRQ

2012-10-19 Thread anish kumar
On Fri, 2012-10-19 at 10:34 +0530, Arun KS wrote: Hi Anish, On Mon, May 28, 2012 at 9:16 AM, anish singh anish198519851...@gmail.com wrote: On Mon, May 28, 2012 at 2:57 AM, richard -rw- weinberger richard.weinber...@gmail.com wrote: On Sun, May 27, 2012 at 2:02 AM,

Re: Mult core cpus - SMP

2012-09-13 Thread anish kumar
On Thu, 2012-09-13 at 15:33 +0400, Denis Kirjanov wrote: Hello Denis, Don't top post!! Yes, for example IBM 970MP CPU: • Dual processors on a single chip – Each processor has its own dedicated storage subsystem, including a 1 MB L2 cache per core. – Each processor has its own dedicated

Re: Writing I2C chip driver in combination with other structure

2012-09-04 Thread anish kumar
On Fri, 2012-07-20 at 16:24 +0530, aurum spark wrote: Hi All, I have written and seen lot of code of i2c drivers for input subsystem devices and much familiar with that. Now I have started writing driver for one chip that is not exactly type of input device. So, little bit confused about

Re: How to allocate hugepage in kernel module?

2012-08-09 Thread anish kumar
On Fri, 2012-08-10 at 09:00 +0900, J.Hwan Kim wrote: I set the __GFP_COMP flag to __get_free_pages(), but the result was same. Does this help? sourd/core/memalloc.c +170 2012년 08월 09일 17:59, Denis Kirjanov 쓴 글: Forgot to CC kernelnewbies: Did you pass the __GFP_COMP flag to

Re: Why can not processes switch in atomic context?

2012-07-03 Thread anish kumar
On Tue, 2012-07-03 at 22:24 +0800, Parmenides wrote: Hi, It is said that kernel can not be preempted in interrupt context and when it is in a critical section protected by a spin lock 1. For the spinlock case, it is easy to get if preemption is allowed in critical section, the purpose

Re: Missing Key-codes from input.h file.

2012-06-26 Thread anish kumar
On Mon, 2012-06-25 at 23:24 +0530, Dharam Kumar wrote: On Mon, Jun 25, 2012 at 10:47 PM, anish kumar anish198519851...@gmail.com wrote: On Mon, 2012-06-25 at 18:52 +0530, Dharam Kumar wrote: Hi, I'm working on a module which is an input device and hence it needs to report certain key

Re: Missing Key-codes from input.h file.

2012-06-26 Thread anish kumar
On Tue, 2012-06-26 at 09:43 +0200, Matthias Brugger wrote: On 06/26/2012 08:47 AM, Dharam Kumar wrote: On Tue, Jun 26, 2012 at 12:02 PM, anish kumar anish198519851...@gmail.com wrote: On Mon, 2012-06-25 at 23:24 +0530, Dharam Kumar wrote: On Mon, Jun 25, 2012 at 10:47 PM, anish kumar

Re: Missing Key-codes from input.h file.

2012-06-25 Thread anish kumar
On Mon, 2012-06-25 at 18:52 +0530, Dharam Kumar wrote: Hi, I'm working on a module which is an input device and hence it needs to report certain key events. While browsing through the linux/input.h, I did find most of the key-codes(which I need to use)already defined but not all. Few

Re: Continuous Interrupt Problem

2012-06-16 Thread anish kumar
On Fri, 2012-06-15 at 03:22 -0700, Shaji Yusuf wrote: Is the issue resolved? This seems to be more of either a device that's buggy or some misunderstanding in understanding the device specs. I checked with siddharth and understanding in device specs was the problem. I had a similar

request_firmware question

2012-02-07 Thread anish kumar
Hi, Now I have switched to using request_firmware api and after using firmware, memory is being released. Does it save kernel memory compare to case when I am having a having a local static firmware buffer(very big) from which I used to get the firmware and write it to the chip? As I know

Scull -unable to handle kernel paging request

2011-11-19 Thread anish kumar
Hello, Testing the scullwuid produced attached crash logs. Combination of read and write using dd and cat caused this problem. I don't exactly remember exactly what caused the problem but combination of read and write did it. Reproduction would not be possible but just want to know why this

Re: Getting Information from Multiple nodes

2011-11-16 Thread anish kumar
On Wed, 2011-11-16 at 18:00 +0530, Praveen kumar wrote: Hi All, I have a I2C chip driver,and there are two identical chips on two different i2c bus. I have registered the driver and initialized it and created two nodes /dev/chip_0 and /dev/chip_1 If I open the node from user how

Re: Memory leak with dev_add_pack()

2011-01-23 Thread anish kumar
Hi! On 11:40 Sun 23 Jan , Spiro Trikaliotis wrote: ... * On Sat, Jan 22, 2011 at 08:18:05AM +0100 Michael Blizek wrote: ... - Which user grows is /proc/slabinfo? (If this file is emply or does not exist, you may meed to recompile the kernel to use slab instead of sl[b-z]b)