Re: interrupt handler not getting called after resume

2019-12-04 Thread anish singh
On Wed, Dec 4, 2019 at 1:49 AM Pintu Agarwal wrote: > > On Wed, 4 Dec 2019 at 00:28, anish singh wrote: > > > > On Tue, Dec 3, 2019 at 6:12 AM Pintu Agarwal wrote: > > > > > > Hi All, > > > > > > I have one general query. > > > >

Re: interrupt handler not getting called after resume

2019-12-03 Thread anish singh
On Tue, Dec 3, 2019 at 6:12 AM Pintu Agarwal wrote: > > Hi All, > > I have one general query. > > If an interrupt handler is NOT getting called (for one device) after > the system resume (from snapshot image), then what could be the issue? Most likely during resume the interrupt was not enabled.

Re: I2C bus driver TIMEDOUT because of PM autosuspend

2019-12-02 Thread anish singh
On Fri, Nov 29, 2019 at 12:53 PM Primoz Beltram wrote: > > I am analysing a problem with I2C bus driver where the problem shows up > as I2C bus completely blocked. The LX driver in question is > /drivers/i2c/busses/i2c-xiic.c. > Problem is difficult to reproduce, it happens very rarely. So far I s

Re: how long wait_for_completion_interruptible_timeout() blocks

2019-06-19 Thread anish singh
On Wed, Jun 19, 2019 at 10:47 PM Subhashini Rao Beerisetty < subhashbeerise...@gmail.com> wrote: > Hi All, > > I’ve two Linux systems, I tried to measure how long > wait_for_completion_interruptible_timeout() blocked after completion > is signaled by complete() call. I noticed two different result

Re: custom audio card on beaglebone

2017-01-25 Thread anish singh
On Wed, Jan 25, 2017 at 2:30 AM, wrote: > Hi Anish, > > thanks for giving me some thougt. > Here is what I found: > > On Sun, Jan 22, 2017 at 03:47:54PM -0800, anish singh wrote: > > On Sun, Jan 22, 2017 at 1:38 PM, jo wrote: > > > > > root@beaglebone:~# a

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

2017-01-23 Thread anish singh
On Mon, Jan 23, 2017 at 7:46 AM, Rajasekhar Pulluru < pullururajasek...@gmail.com> wrote: > Hi, > > I have a query on device tree pertaining to modelling a gpio pin as an > interrupt source. > I have searched mailing list archives and kernel documentation before > posting this and couldn't get any

Re: custom audio card on beaglebone

2017-01-22 Thread anish singh
On Sun, Jan 22, 2017 at 1:38 PM, jo wrote: > Hi everyone, > > I am currently trying to get a simple audio I2S DAC board ( > https://polyvection.com/shop/plaindac/) to work on a beaglebone green > wireless. The components is a PCM5121, a popular one that has an existing > driver. > > so far, > - I

Re: adding 32 bit compatibility layer in custom kernel module

2017-01-03 Thread anish singh
On Tue, Jan 3, 2017 at 10:59 PM, Pradeepa Kumar wrote: > my app is crashing as it is trying iterate cmsghdrs > it got after call to recvmsg(); > To give some context > below is the flow > > 32 bit app <--> my kernel module <--> 64 bit app > my kernel module implements new protocol and > provides

Re: Options for adding I2C devices and how-to

2016-09-30 Thread anish singh
On Fri, Sep 30, 2016 at 9:23 PM, vibnwis wrote: > > Many thanks Anish for answering my doubts. > > >> You need to find out the device address of your device. >> find out which device is not connected and connect your device on that >> bus and change the device tree to replace the device address.

Re: UIO driver test

2016-04-15 Thread anish singh
On Fri, Apr 15, 2016 at 1:29 AM, Gadre Nayan wrote: > Dear all, > > I am trying to test a dummy UIO driver to get timer interrupt events > in Userspace. > > I register the UIO driver as a platform driver: > > static struct platform_device *uio_dummy_device; > > static struct device_driver uio_dum

Re: Why Completely Fair Scheduler(CFS) using Red-Black tree instead of Min-heap?

2015-10-18 Thread anish singh
On Sat, Oct 17, 2015 at 11:25 AM, venu gangireddy wrote: > Hi, > > Currently, I am learning about CFS scheduler in linux, and I want to know > reason about the data structure chooses in CFS implementation. > > Nice. > CFS scheduler picks next process based on minimum virtual time and to get > th

Re: SPI operations on interrupt context!?

2015-09-08 Thread anish singh
On Tue, Sep 8, 2015 at 10:19 AM, Daniel. wrote: > Hi all, > > I'm dealing with a SPI driver and I have a doubt. I need to read and write > data to spi (registers and values) inside interrupt handler. I want to know > if this pattern is safe or if I'll face problems with it. > AFAIK the spi calls

Re: what is the use of #ifndefs

2015-07-20 Thread anish singh
On Mon, Jul 20, 2015 at 3:03 AM, Ahmed Soliman wrote: > currently I started reading through the linux kernel and I started > reading liunx/include/linux/list.h> I understood some of the functions > but still I dont know what does these lines of code do > #ifndef _LINUX_LIST_H > #define _LINUX_LIS

Re: About guiding hello world module submission

2015-06-24 Thread anish singh
On Wed, Jun 24, 2015 at 12:49 PM, Mayur Patil wrote: > Hi All, > >I am conducting one workshop at FUDCon in which I am trying to teach > how to write > Great > > and send your first linux kernel device driver. Could please suggest me > the place where I > > can guide the students to send th

Re: A flow path for ethernet kernel driver

2015-05-18 Thread anish singh
On Mon, May 18, 2015 at 12:23 PM, Airton Ishimori wrote: > Hello, everybody, > > I'm trying to develop a new Ethernet driver (Realtek) for Linux kernel > 4.0.2. > > [3.612938] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded > > As part of my studies, I'm trying to trace the path for functions

Re: Question regarding strange-looking code in drivers/isdn/i4l/isdn_ppp.c

2015-02-02 Thread anish singh
On Mon, Feb 2, 2015 at 11:26 AM, Bas Peters wrote: > Hi, > > I was checking some code in drivers/isdn/isdn_pp and came across the > following: > > case PPP_VJC_COMP: > if (is->debug & 0x20) > printk(KERN_DEBUG "isdn_ppp: VJC_COMP\n"); >

Re: Difference between INIT_LIST_HEAD and LIST_HEAD_INIT

2015-01-06 Thread anish singh
On Tue, Jan 6, 2015 at 1:37 AM, nawab wrote: > hi friends , > > i have a simple doubt when i was looking on linux/list.h > > I have seen that INIT_LIST_HEAD and LIST_HEAD_INIT are performing the > same functionality,the major difference is > the argument passed. > yes but that is minor differe

Re: doubt about interrupts and spinlocks

2014-10-24 Thread anish singh
inline answers. On Fri, Oct 24, 2014 at 8:04 AM, Oscar Salvador < osalvador.vilard...@gmail.com> wrote: > Hi! > > I have a doubt about interrupts and spin locks. > I'm not sure if I'm in the good way: > > When an interrupt is raised, the kernel (through do_IRQ and etc) > acknowledges the interrup

Re: Beagleboard and Panda Board Drivers

2014-08-16 Thread anish singh
On Sat, Aug 16, 2014 at 7:45 PM, Nick Krause wrote: > I would like to read the code for these drivers and am not sure where > which drivers? > the code for them is. > If someone can send me the directory that would be great as I am not > which directory? > sure where the > code is. > Thanks Nic

Re: Problem facing while running checkpatch.pl on linux-next tree

2014-07-27 Thread anish singh
On Jul 27, 2014 2:01 AM, "Rahul Garg" wrote: > > Hi All, > > I am trying to run checkpatch.pl on linux-next tree's staging folder. > But whatever sub directory, I try to run it on. It is giving me the > same error for all the files : > > ERROR: Does not appear to be a unified-diff format patch Use

Re: Help with flame wars

2014-07-24 Thread anish singh
On Wed, Jul 23, 2014 at 10:37 PM, Kristofer Hallin < kristofer.hal...@gmail.com> wrote: > Seems like you got some great guidance too. > > https://lkml.org/lkml/2014/7/23/443 > On 24 Jul 2014 06:38, "Nick Krause" wrote: > >> As a new kernel developer I seem to have sent out some bad patches and >>

Re: about pr_debug

2014-06-24 Thread anish singh
On Tue, Jun 24, 2014 at 11:09 PM, lx wrote: > hi all: >I'm confused with pr_debug. My codes is: > ### > #include > #include > > static int __init init_page_dir(void) > { > pr_debug("Hello world\n"); > use printk or do echo "file_name +p" > /sy

Re: [kernelnewbies]a question about checkpatch.pl

2014-06-08 Thread anish singh
Joe can help you with that. On Sun, Jun 8, 2014 at 7:29 AM, lx wrote: > hi all: > I used the script of checkpatch.pl, but some error messages appeared. > ## > [root@localhost kernel_test]# perl checkpatch.pl -f task_01.c > Nested quantifiers in regex; mar

Re: Registering shared & unshared interrupt handlers

2014-02-16 Thread anish singh
On Sun, Feb 16, 2014 at 10:36 PM, Jay Aurabind wrote: > Dear all, > > I've been going through Robert Love's LKD. Here is an excerpt from it > regarding registration of interrupt handlers: > > "When request_irq() is called with IRQF_SHARED specified, the call succeeds > only if the interrupt line i

Re: How to invalidate cache in kernel driver?

2014-02-13 Thread anish singh
On Feb 13, 2014 10:29 AM, "m silverstri" wrote: > > I have an output buffer in my kernel driver. And that share with my > hardware, which uses it for output. > > When I got an interrupt, the kernel driver will copy the data from the > output buffer to user space buffer. > > How can I invalidate ca

Re: How to allocate memory and get the physical address in kernel

2014-02-05 Thread anish singh
On Wed, Feb 5, 2014 at 6:26 PM, m silverstri wrote: > Hi, > > I am developing a kernel driver. I need to allocate buffer in the > kernel driver and pass the physical address of the buffer to the Chip > register so that it can generate output there. Can you elaborate more here? > > I tried using km

Re: Question about using spinlock to synchronize between kernel driver and an interrupt handler

2014-02-02 Thread anish singh
On Sat, Feb 1, 2014 at 11:49 PM, m silverstri wrote: > On Sat, Feb 1, 2014 at 5:34 AM, Josh Cartwright wrote: >> On Sat, Feb 01, 2014 at 01:32:49AM -0800, anish singh wrote: >>> On Sat, Feb 1, 2014 at 1:15 AM, m silverstri >>> wrote: >>> > By driver code ,

Re: Question about using spinlock to synchronize between kernel driver and an interrupt handler

2014-02-01 Thread anish singh
ter_value x_variable=0 wait_for_event*(x_variable); } interrupt_handler(){ x_variable=1 wake_up(); } request_irq(interrupt_handler); > > > On Sat, Feb 1, 2014 at 1:06 AM, anish singh > wrote: >> On Sat, Feb 1, 2014 at 1:03 AM, m silverstri >> wrote: >>> On Sat, Feb 1

Re: Question about using spinlock to synchronize between kernel driver and an interrupt handler

2014-02-01 Thread anish singh
On Sat, Feb 1, 2014 at 1:03 AM, m silverstri wrote: > On Sat, Feb 1, 2014 at 12:48 AM, anish singh > wrote: >> On Sat, Feb 1, 2014 at 12:32 AM, m silverstri >> wrote: >> don't top-post >> >>> In my driver code, >>> I want to set a bit in a

Re: Question about using spinlock to synchronize between kernel driver and an interrupt handler

2014-02-01 Thread anish singh
until the interrupt is sent from the HW. so i suppose this is what you want to do. write ->register->interrupt happens->disable register ->handle interrupt --->enable register. Look at any driver code from linux kernel code and it mostly does this. > > > > On Sat, Feb 1,

Re: Question about using spinlock to synchronize between kernel driver and an interrupt handler

2014-02-01 Thread anish singh
On Fri, Jan 31, 2014 at 11:55 PM, m silverstri wrote: > Hi, > > I read this article http://www.linuxjournal.com/article/5833 to learn > about spinlock. I try this to use it in my kernel driver. > > Here is what my driver code needs to do: > In f1(), it will get the spin lock, and caller can call f

Re: malloc memory to be 32 byte aligned in kernel

2014-01-28 Thread anish singh
On Tue, Jan 28, 2014 at 11:20 AM, m silverstri wrote: > Hi, > > I am writing a kernel driver, can you please tell me how can I > allocate a buffer which is 32 byte aligned? malloc already aligns memory for basic data types AFAIK > > Thank you. > > ___ >

Re: list_empty atomic?

2013-12-12 Thread anish singh
On Thu, Dec 12, 2013 at 12:21 PM, Filipe David Manana wrote: > Hello, > > I have a list that is manipulated by several threads. Insert, remove > and iteration are protected by a lock. Is the locking necessary too > just for checking if the list is empty, i.e., is list_empty() > atomic/safe to call

Re: watchdog pet in kernel module

2013-12-02 Thread anish singh
On Mon, Dec 2, 2013 at 10:34 PM, Vipul Jain wrote: > Hi, > > I would like to move the hardware watchdog pet code from user space to > kernel space inside the ipmi module and would like to know how to go about > pet the hardware watchdog at periodic interval. Any pointers help will be a cursory gla

Re: Ordering / preemption of work in a workqueue preempt?

2013-11-18 Thread anish singh
On Mon, Nov 18, 2013 at 10:20 PM, Arun KS wrote: > Hi Rajat, > > On Fri, Nov 15, 2013 at 8:46 PM, Rajat Jain wrote: >> Hi, >> >> I have a single work queue, on which I have scheduled a worker function >> [using queue_work(wq, fn)] in interrupt context. >> >> I get the interrupt twice before the

Re: Ordering / preemption of work in a workqueue preempt?

2013-11-16 Thread anish singh
On Fri, Nov 15, 2013 at 5:01 PM, Rajat Sharma wrote: > Hi Rajat, > > > On Fri, Nov 15, 2013 at 7:16 AM, Rajat Jain wrote: >> >> Hi, >> >> I have a single work queue, on which I have scheduled a worker function >> [using queue_work(wq, fn)] in interrupt context. >> >> I get the interrupt twice bef

Re: Ordering / preemption of work in a workqueue preempt?

2013-11-15 Thread anish singh
On Fri, Nov 15, 2013 at 5:01 PM, Rajat Sharma wrote: > Hi Rajat, > > > On Fri, Nov 15, 2013 at 7:16 AM, Rajat Jain wrote: >> >> Hi, >> >> I have a single work queue, on which I have scheduled a worker function >> [using queue_work(wq, fn)] in interrupt context. >> >> I get the interrupt twice bef

Re: Question on Platform Device/Driver

2013-11-10 Thread anish singh
an open /dev node. How do i do something similar using a platform driver like the one above? > > Thanks & Regards, > Sanchayan. > > > > > On Sun, Nov 10, 2013 at 2:02 AM, anish singh wrote: >> >> >> On Nov 9, 2013 4:18 AM, "sanchayan maity"

Re: Question on Platform Device/Driver

2013-11-09 Thread anish singh
On Nov 9, 2013 4:18 AM, "sanchayan maity" wrote: > > Can someone give me some pointers or tell me as to how can one use a platform driver for reading and writing? > > For example, if i have a wm97xx codec IC, a core platform driver is provided (as on the below link). > http://lxr.free-electrons.co

Re: ALIGN MACRO understanding

2013-11-08 Thread anish singh
On Nov 6, 2013 10:38 PM, "Mandeep Sandhu" wrote: > > On Thu, Nov 7, 2013 at 11:04 AM, sdptr...@gmail.com > wrote: > > While going through kernel source , I came across this ALIGN macro > > > > #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > > > > and > > > > #define __ALIGN_KERNEL(x,

Re: Question on Alignment

2013-11-03 Thread anish singh
> > On Sat, Nov 2, 2013 at 9:20 PM, anish singh > wrote: >> >> >> >> >> On Sat, Nov 2, 2013 at 7:42 PM, Shyam Sunkara wrote: >>> >>> Hi All, >>> >>> I'm allocating a memory for linux driver using the kmalloc and I need to

Re: Question on Alignment

2013-11-02 Thread anish singh
On Sat, Nov 2, 2013 at 7:42 PM, Shyam Sunkara wrote: > Hi All, > > I'm allocating a memory for linux driver using the kmalloc and I need to > align it to 32 bit how do I do it? > Did you mean 32 bit or byte? > > > Thank you, > > Regards, > Omk > > ___

Re: down_interruptible() return non-zero value once signal is received and trying down_interruptible again in loop return value is always non-zero

2013-10-20 Thread anish singh
On Fri, Oct 18, 2013 at 5:26 AM, Mushtaq Khan wrote: > Hi, > > In kernel driver, using Semaphore to block on resources (Descriptors and > memory). > Semaphore is initialized in locking state using call "init_MTEX_LOCKED()", > when resources are not available process calls down_interruptible() and

Re: can a bottom half be scheduled by another BH ??

2013-10-03 Thread anish singh
On Oct 3, 2013 8:28 PM, "sujan dutta" wrote: > > > Yes you can, infact network subsystem softirq are reactive so it can run again. > however, reactivated softirq are not immediately process but until kernel handles the pending softirqs because it might introduce latency in user-space. > And for be

Re: mmap giving Permission Denied error

2013-09-21 Thread anish singh
On Sep 21, 2013 7:35 PM, "Ravi Teja" wrote: > > Hello Ratheesh, > > I have intentionally used MAP_FIXED flag as I am interested in mapping to 0x. AFAICS in linux generally mapping to null address is not allowed as this decision helps in debugging null dereference errors. > > Even after set

Re: how to implement mmap for sysfs device driver

2013-09-20 Thread anish singh
On Sep 20, 2013 2:25 PM, "Niroj Pokhrel" wrote: > > Hi all, > I want to implement a device driver with mmap operations. However, I am not using ioctl call. > My approach: > i. I have created a sysfs bin files (because it support mmap) Why you want to implement mmap for sysfs file? What are you try

Re: Plug/unplug events of headphone

2013-09-14 Thread anish singh
On Sep 14, 2013 8:57 PM, "Dmitry Kolesov" wrote: > > Thanks for reply. > I have problem with headphone on my laptop. > I can not listen sound from speakers after reboot laptop if I power off laptop with headphone. > And I need to plug/unplug headphone to listen music from speakers. I suggest seeki

Re: Getting Started

2013-08-05 Thread anish singh
On Aug 5, 2013 10:24 PM, "Sumeet pawnikar" wrote: > > Hi Valdis, > > Thanks for these steps, > > On Wed, Jul 31, 2013 at 6:05 PM, wrote: >> >> On Wed, 31 Jul 2013 10:32:59 +0530, you said: >> >> > I am a computer science student. I want to contribute to the open source >> > projects, debugging. A

Re: Not able to get crash dump

2013-08-02 Thread anish singh
On Aug 3, 2013 3:02 AM, "neha naik" wrote: > > Hi All, > I looked into my issue and i had only one cpu on that machine and i was getting messages like process # waiting for # secs. > My theory is that this process was of doing some kind of busy looping on that cpu so that the operating system c

Re: sys_read buffer too large

2013-07-20 Thread anish singh
On Sat, Jul 20, 2013 at 2:04 PM, Don Raikes wrote: > Hello all, > > ** ** > > I am very new to kernel programming. In fact, I have been working on it > for a week now. > > ** ** > > I am taking a computer science class, and one of our assignments is to > hook some of the system calls in a

Re: local_irq_save vs raw_local_irq_save

2013-07-05 Thread anish singh
instruction : > http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/BABHBAAB.html > CPSID i ; Disable all interrupts except NMI (set PRIMASK.PM) > Registers overview : > http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/CHDBIBGJ.html > About PRIMASK

Re: [I2C] informations + advice about messages handling

2013-05-24 Thread anish singh
On Fri, May 24, 2013 at 1:14 PM, Jean Delvare wrote: > Hi Anish, Mylène, > > On Fri, 24 May 2013 12:52:40 +0530, anish singh wrote: >> On Fri, May 24, 2013 at 12:41 PM, Mylene Josserand >> wrote: >> > I have read that this function "i2c_smbus_write_byte_dat

Re: [I2C] informations + advice about messages handling

2013-05-24 Thread anish singh
On Fri, May 24, 2013 at 12:41 PM, Mylene Josserand wrote: > Hi all, > > > I am learning how i2c is working and I read that, to write in an i2c > register, I need to use the function "i2c_smbus_write_byte_data". Only in case your device is smbus compliant. > I wanted to know how the message are ha

Re: kernel panic in sample block device driver

2013-05-01 Thread anish singh
kernel panic logs? On Wed, May 1, 2013 at 10:57 AM, Kumar amit mehta wrote: > Hi, > > I'm new to block layer in linux and to learn the same, I'm trying to > come up with a sample memory based block device driver, with which I can > experiment and learn along the way. I'm referring to sample code

Re: I2C: kernel & userspace drivers : using i2c-stub

2013-04-22 Thread anish singh
does I2c-stub create the /dev node?If it is not creating then you have to do it yourself. On Mon, Apr 22, 2013 at 5:11 PM, Sagar Padhye wrote: > Hi, > > [USING : Ubuntu 12.04 LTS] > > I am trying to learn I2C subsystem. I havent found much of well documented > things that can help a newbie on g

Re: what does it use two "!!"

2013-04-01 Thread anish singh
!! is generally used to make the return bool value. You can use kernelnewbies and linux kernel mailing list. On Mon, Apr 1, 2013 at 12:43 PM, Ben Wu wrote: > > > Dear All: > 1> I found some placeuse two "!!", what's means > if(button->gpio != INVALID_GPIO) > state = !!((gpio_get_val

Re: Why we Use both mm_users and mm_count in struct mm_struct{ }

2013-03-25 Thread anish singh
el thread. And we borrow memory descriptor from this process. and I think the memory descriptor would be changed so that it can point to the kernel thread. > > Rgs, > Rami Rosen > http://ramirose.wix.com/ramirosen > > > > > > > On Mon, Mar 25, 2013 at 8:02 AM, ani

Re: Why we Use both mm_users and mm_count in struct mm_struct{ }

2013-03-24 Thread anish singh
On Mon, Mar 25, 2013 at 1:35 AM, Rami Rosen wrote: > Hi, Niroj, > > Please look at the following scenario: > Suppose we create a kernel thread. > With kernel threads, the mm member of the task_struct is NULL. > (We are not permitted to access user space addresses from kernel thread, > so we don't

Re: Disabling interrupts and masking interrupts

2013-03-07 Thread anish singh
handle_edge_irq in kernel/irq/ > > Did I understand correctly ? > rgs > Kevin > > On Thu, Mar 7, 2013 at 5:00 PM, anish singh > wrote: >> On Thu, Mar 7, 2013 at 7:28 PM, Kevin Wilson wrote: >>> Hello, >>> what is the difference between disabl

Re: Disabling interrupts and masking interrupts

2013-03-07 Thread anish singh
On Thu, Mar 7, 2013 at 7:28 PM, Kevin Wilson wrote: > Hello, > what is the difference between disabling interrupts and masking > interrupts ? Disabling interrupts is done, AFAIK, with irq_disable(). Disabling interrupts means that you have disabled the source of interrupt. Masking means that you

Re: How to measure the RAM read/write performance

2013-02-27 Thread anish singh
(v7l) > BogoMIPS: 163.38 > Features: swp half thumb fastmult vfp edsp neon vfpv3 tls > CPU implementer : 0x51 > CPU architecture: 7 > CPU variant : 0x1 > CPU part: 0x00f > CPU revision: 2 > > Thanks > Sandeep > > > > > O

Re: How to measure the RAM read/write performance

2013-02-27 Thread anish singh
On Tue, Feb 26, 2013 at 5:01 PM, sandeep kumar wrote: > Hi All > In performance benchmark tools, When we profile read/write timings mostly, > those read/writes are done to cache only. > > I want to measure my DDR(RAM chip) performance. > So i want to make sure, every read/write should happen to DD

Re: Intro and some questions

2013-02-20 Thread anish singh
On Wed, Feb 20, 2013 at 1:01 PM, NeonJohn wrote: > Greetings, > > I just discovered this list while beating my head against the wall > (kernel noobs do that a lot, I hear). I thought I'd introduce myself. > > I'm mainly an EE but with fairly extensive Unix and Linux user space > coding and with e

Re: spinlock deadlock

2013-02-15 Thread anish singh
adding Joe Perches as generally he looks after printk stuff. On Fri, Feb 15, 2013 at 2:22 PM, buyitian wrote: > is it possible that printk cause deadlock? the path is as below: > > 1. taskA runs on CPU0, and run schedule to acqire the rq->lock. > 2. taskA calls printk while holding rq->lock. > 3

Re: Use of copy_to_user() and copy_from_user() functions

2013-02-11 Thread anish singh
On Tue, Feb 12, 2013 at 9:24 AM, Chetan Nanda wrote: > > > > On Mon, Feb 11, 2013 at 5:25 PM, anish singh > wrote: >> >> >> >> On Mon, Feb 11, 2013 at 4:51 PM, पारस wrote: >> > Hi All, >> > >> > To read/write data to user-spa

Re: Use of copy_to_user() and copy_from_user() functions

2013-02-11 Thread anish singh
On Mon, Feb 11, 2013 at 4:51 PM, पारस wrote: > Hi All, > > To read/write data to user-space from kernel-space we use copy_from_user() > and copy_to_user() functions. > > What is the use of these function? > Why kernel can't directly access user address and read/write on to it? what will happen if

Re: Linux Kernel Networking document (free, 178 pages doc)

2013-01-29 Thread anish singh
On Tue, Jan 29, 2013 at 1:14 PM, Mulyadi Santosa wrote: > On Mon, Jan 28, 2013 at 11:53 PM, Rami Rosen wrote: >> Hi everyone, >> You can find here an up to date and detailed document in pdf (178 >> pages) about Linux Kernel Networking; going deep into design and >> implementation details as well

Re: Can jiffies freeze?

2013-01-21 Thread anish singh
On Tue, Jan 22, 2013 at 11:21 AM, sandeep kumar wrote: > Hi all > As far as I know jiffie counter is incremented HZ times/second. And it is > used to measure the time lapses in the kernel code. > > I m seeing a case where, actualy time spent in some module using giffies is > zero, but while seeing

Re: What is asmlinkage ?

2013-01-04 Thread anish singh
On Fri, Jan 4, 2013 at 3:41 PM, Rajat Sharma wrote: >> Is this correct for all architectures? > > I guess not, asmlinkage is undefined for arm, so I assume this mechanism is > not there for arm. then how do they do it? > > > > On Fri, Jan 4, 2013 at 2:24 PM, 卜弋天 wrote: >> >> >> >> 在 2013-1-4,15:3

Re: how to look for source code in kernel

2012-12-27 Thread anish singh
On Fri, Dec 28, 2012 at 10:42 AM, amit mehta wrote: On Thu, Dec 27, 2012 at 11:01:52PM +0530, kishore kumar wrote: > can anybody tell me how to look into source code, as most are hidden in > kernel. You can find the Linux source code at http://kernel.org/ . >> for browsing

Re: how to look for source code in kernel

2012-12-27 Thread anish singh
On Fri, Dec 28, 2012 at 1:23 AM, Henrique Rodrigues wrote: > http://lxr.linux.no/ is a really good linux cross referencing website for > code reference. > > On Thu, Dec 27, 2012 at 10:40 AM, Jonathan Neuschäfer > wrote: >> >> On Thu, Dec 27, 2012 at 11:01:52PM +0530, kishore kumar wrote: >> > can

Re: How kernel handle interrupts

2012-12-20 Thread anish singh
On Dec 20, 2012 6:30 AM, "Woody Wu" wrote: > > Hi, List > > Where is the Kernel code that handles external interrupts? I want to > have a look at it but haven't found out where it is. > > Actually, I have some basic questions about interrupt handling in Linux. > 1. After Kernel's ISR received an i

Re: GPIO Watchdog device driver

2012-11-13 Thread anish singh
On Tue, Nov 13, 2012 at 9:03 AM, Mulyadi Santosa wrote: > On Tue, Nov 13, 2012 at 10:37 PM, Andreas Schmidt > wrote: >> Hi all, >> I wrote a GPIO watchdog for a extern simple watchdog (LTC2917). It is a >> voltage supervisor with watchdog timer functionality. Do you think >> should I send this to

Re: Why can not processes switch in atomic context?

2012-07-04 Thread anish singh
On Wed, Jul 4, 2012 at 1:51 PM, Javier Martinez Canillas wrote: > On Tue, Jul 3, 2012 at 4:24 PM, 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

Re: Why can not processes switch in atomic context?

2012-07-03 Thread anish singh
Always CC Kernelnewbies. On Wed, Jul 4, 2012 at 12:52 AM, Parmenides wrote: >>> 1. For the spinlock case, it is easy to get if preemption is allowed >>> in critical section, the purpose of protection provided by spinlock >>> can not be achieved readily. >> I don't know what you mean here.Please c

Re: Sysfs class attribute problem

2012-06-20 Thread anish singh
r); } static ssize_t attr1_store(struct class *cls, const char *buf, size_t count) { printk("the string is : %s count %d\n", buf, count); return snprintf(gvar, count, "%s\n", buf); } static void hello_exit(void) { class_unregister(&pwm_class);

Re: Sysfs class attribute problem

2012-06-19 Thread anish singh
On Tue, Jun 19, 2012 at 3:14 PM, jeshwanth Kumar N K wrote: > Hello all > > I am new to sysfs interface ans I read about in mochel's documentation. And > doing some experiements on it. Let's come to Tue problem, in my module I > have a global variable type char* myglobal and it s static, I am putt

Re: Continuous Interrupt Problem

2012-06-14 Thread anish singh
unable to register touch irq.(%s)\r\n", >>             device->input_dev->name); >>             goto err_request_irq; >>         } >>     } >> >> >> >> The pin by default has to be initialized to Active Low. >> >> >> >> >

Re: Continuous Interrupt Problem

2012-06-14 Thread anish singh
On Thu, Jun 14, 2012 at 2:11 PM, siddharth saxena wrote: > Hi Arun > > I tried changing the flag to IRQF_TRIGGER_HIGH but then device is behaving > abnormally(Hangs and is dead after some time). > Flooding interrupts still observed. Problem not solved. > > I want to know, are we supposed to change

Re: Continuous Interrupt Problem

2012-06-13 Thread anish singh
On Thu, Jun 14, 2012 at 10:34 AM, siddharth saxena wrote: > Hi all > > I need help with an issue. > I have written a touch driver for a device and used the flag > IRQF_TRIGGER_LOW to request irq. > Now, when I boot the device, the touch interrupts are coming already without > touching the screen.

Re: Finding the interrupt vector of a given IRQ

2012-05-27 Thread anish singh
On Mon, May 28, 2012 at 2:57 AM, richard -rw- weinberger wrote: > On Sun, May 27, 2012 at 2:02 AM, Mark Farnell wrote: >> In the kernel, how can I find out the interrupt vector number of a >> given IRQ (for example, IRQ7)? >> >> Within the kernel module, I would like to manually set the IRQ using

Re: How does the driver initialize corresponding with several same devices ?

2012-04-18 Thread anish singh
On Wed, Apr 18, 2012 at 4:37 PM, Philipp Ittershagen wrote: > On Wed, Apr 18, 2012 at 04:32:12PM +0530, anish singh wrote: >> On Wed, Apr 18, 2012 at 4:18 PM, Philipp Ittershagen >> wrote: >> > On Wed, Apr 18, 2012 at 05:16:01PM +0800, Li Haifeng wrote: >> >>

Re: Virtual machine query

2012-01-02 Thread anish singh
On Mon, Jan 2, 2012 at 11:23 PM, Dave Hylands wrote: > Hi Manish, > > On Mon, Jan 2, 2012 at 8:13 AM, manish honap > wrote: >> During Kernel development what type of set-up do developers normally use ? >> e.g. Machine configuration, virtualization environment etc. >> or whether they use physical

Re: What is "__attribute__()" in kernel code

2011-09-30 Thread anish singh
On Fri, Sep 30, 2011 at 3:28 PM, sandeep kumar wrote: > Hi all, > > I was wondering what __attribute__ does in the kernel code? > I found several definitions but couldnot come to one conclusion.. > > __releases(x)  is defined in compiler.h. What does this mean?? > # define __releases(x)   

Re: profiling functions called in interrupt context

2011-09-20 Thread anish singh
On Tue, Sep 20, 2011 at 4:11 PM, Nuno Martins wrote: > > > On Tue, Sep 20, 2011 at 5:59 AM, Amit Nagal wrote: >> >> On Tue, Sep 20, 2011 at 10:25 AM, rohan puri >> wrote: >> > >> > >> > On Tue, Sep 20, 2011 at 10:13 AM, Amit Nagal >> > wrote: >> >> >> >> On Tue, Sep 20, 2011 at 10:05 AM, rohan

Re: analysis of kernel panic logs.

2011-09-06 Thread anish singh
On Tue, Sep 6, 2011 at 10:14 PM, Dave Hylands wrote: > Hi Sandeep, > > On Mon, Sep 5, 2011 at 1:37 AM, sandeep kumar > wrote: > ...snip... >> As our analysis for the problem goes, >> init being the critical process, when killed, platform called a system call >> to restart the kernel. >> is it co

Re: Re: Regarding threaded irq and normal irq

2011-09-06 Thread anish singh
On Tue, Sep 6, 2011 at 10:59 AM, anish singh wrote: > On Tue, Sep 6, 2011 at 10:51 AM, Mulyadi Santosa > wrote: >> Hi :) >> >> On 06/09/2011, sandeep kumar wrote: >>> Hmm..But when i tried to take a mutex lock in threaded_irq, it is throwing a >>> w

Re: Re: Regarding threaded irq and normal irq

2011-09-05 Thread anish singh
On Tue, Sep 6, 2011 at 10:51 AM, Mulyadi Santosa wrote: > Hi :) > > On 06/09/2011, sandeep kumar wrote: >> Hmm..But when i tried to take a mutex lock in threaded_irq, it is throwing a >> warning message >> "BUG: sleeping function called from invalid context"... So i was wondering >> which way it

Re: question about oops and panic

2011-08-29 Thread anish singh
On Mon, Aug 29, 2011 at 8:01 PM, Mandeep Sandhu wrote: >>> 1. I think oops and panic are both some way to deal with errors occurs >>> in kernel space. Is there any relationship between them? >> AFAIK both are same. >>> > > Really? I thought "oops" would be generated for critical errors like > proc

Re: question about oops and panic

2011-08-29 Thread anish singh
On Mon, Aug 29, 2011 at 2:19 AM, Parmenides wrote: > Hi, > > 1. I think oops and panic are both some way to deal with errors occurs > in kernel space. Is there any relationship between them? AFAIK both are same. > > 2. I make a NULL pointer reference deliberately in a kernel module and > get an oo

Re: Headset driver detection problem during bootup

2011-08-23 Thread anish singh
On Tue, Aug 23, 2011 at 10:52 PM, Takashi Iwai wrote: > At Sat, 20 Aug 2011 22:21:10 +0900, > anish singh wrote: >> >> adding more information and experts on alsa. >> >> On Fri, Aug 19, 2011 at 9:23 PM, anish singh >> wrote: >> > I need some suggesti

Re: Headset driver detection problem during bootup

2011-08-20 Thread anish singh
adding more information and experts on alsa. On Fri, Aug 19, 2011 at 9:23 PM, anish singh wrote: > I need some suggestions for below situation: > > Headset if it is inserted before the device is powered up is > now detected by forcefully calling the interrupt handler in > the pr

Interrupt not getting re-enabled after handler is killed

2011-08-10 Thread anish singh
Intention: Wanted to modify the behavior of threaded interrupt handler not being called after the threaded_handler was killed. Reason: Well there is no reason as such but just want to see what all needs to be done to get this right.I know that what i am doing is completely wrong as i would get a s

No printk to inform how much memory freed in ARM after booting

2011-07-29 Thread anish singh
Guess, this is trivial question but probably useful to know. void free_initmem(void) { #ifdef CONFIG_HAVE_TCM extern char __tcm_start, __tcm_end; totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)), __phys_to_pfn(__pa(&__tcm_end)),

Re: Can we map a device address to two different memory locations?

2011-05-27 Thread anish singh
On Fri, May 27, 2011 at 10:54 PM, Mulyadi Santosa wrote: > Hi... > > On Fri, May 27, 2011 at 17:49, sandeep kumar > wrote: > > Now the question is can we memory map a one device resource(say some > > iomemory) to two different memory locations? > > the other way of seeing at this question is, >

Usbvideo dropped in linux-next?

2011-05-16 Thread anish singh
I was looking for drivers/staging/usbvideo folder but couldn't find it there. Is it dropped from linux-next?If yes then will it be included in future? Reference: http://www.spinics.net/lists/linux-next/msg14307.html One more question.I made a patch against http://git.kernel.org/?p=linux/kernel/g

Re: looking for simple module/driver programming examples in source tree

2011-05-03 Thread anish singh
On Tue, May 3, 2011 at 7:50 PM, Javier Martinez Canillas < martinez.jav...@gmail.com> wrote: > > > >> i'm also interesting in collecting examples of documentation for > >> basic kernel programming concepts. sometimes, there are excellent > >> examples in the source Documentation/ directory, som

Re: Linux MMC framework

2011-04-06 Thread anish singh
On Thu, Apr 7, 2011 at 9:40 AM, Hanumant Singh wrote: > HI > > I am looking for some documentation on the Linux mmc framework. I > didnot find anything in the Documentation folder. Is there some book/link > that I can refer to? > Linux MMC framework consists of MMC core+ SD protocol implement

Re: Regarding threaded irq

2011-03-03 Thread anish singh
On Thu, Mar 3, 2011 at 10:41 PM, Thomas Petazzoni < thomas.petazz...@free-electrons.com> wrote: > Hello, > > On Mon, 28 Feb 2011 21:23:37 +0900 > anish singh wrote: > > > I have a touch driver which is not yet using threded_irq.So i am planning > to > &g

Re: Regarding threaded irq

2011-02-28 Thread anish singh
On Tue, Mar 1, 2011 at 2:11 PM, spinlock cp wrote: > Hi Anish > > > > On Mon, Feb 28, 2011 at 5:53 PM, anish singh > wrote: > >> I have a touch driver which is not yet using threded_irq.So i am planning >> to change it to >> use threaded_irq. >

  1   2   >