suspend mode

2019-10-05 Thread nunojsa
Hi all,

I have a HWMON driver which is using simple pm options. So, I have a suspend() 
and resume() where I try
to lock a mutex before suspending/resuming. This mutex is shared with the 
read/write path of the
hwmon attributes. I also have a flag which is set when suspend() is done so 
that, if someone tries to
read some attribute, will get an error since doing a read/write on the device 
bus will wake it up. Im
starting to think that this does not make any sense. Is there any way that a 
userland process runs during
suspend? As I understand, all tasks should be frozen before starting to suspend 
the HW devices. Is this right?
Furthermore, now that I think about this, trying to lock the mutex on the PM 
callbacks seems dangerous
since it can lead to deadlock (if some frozen task is helding the lock?). 
However, I definitely saw drivers
trying to lock shared mutexes in the PM callbacks. Aren't these callbacks 
atomic? Is there any scenario where
it makes to sense to care about concurrency in these functions?


Thanks for the help!
- Nuno Sá

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


Re: Contribute

2017-07-22 Thread nunojsa
On 22.07.2017 11:56, Greg KH wrote:
> On Sat, Jul 22, 2017 at 11:39:45AM +0200, nunojsa wrote:
>> Hi all,
>>
>> Im fairly new to linux kernel and would like to start with some staging work 
>> (seems like the best way to start).
>> Basically what i would like to know is which tree should i clone for this? 
>> My understanding is that one should never work directly on top of the 
>> mainline tree, instead (for this case) on top of the linux staging tree. The 
>> same goes, for example, for USB subsystem development in which case i should 
>> just clone the usb development tree (and the same for all subsystems).
>>
>> Is my understanding correct?
> 
> Yes it is, make sure you work off of the correct branch as well.  For> the 
> staging tree, working off of the staging-next is best.

This would be my next question. Regarding the linux-next tree, the same as i 
wrote before also applies? So, I should not work directly in the linux-next 
tree but instead in the correspondent branch (subsystem-next) of the specific 
subsystem I'm working on? 

> 
> thanks and good luck!
> 
> greg k-h
> 

Thanks for your help!


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


Contribute

2017-07-22 Thread nunojsa
Hi all,

Im fairly new to linux kernel and would like to start with some staging work 
(seems like the best way to start).
Basically what i would like to know is which tree should i clone for this? My 
understanding is that one should never work directly on top of the mainline 
tree, instead (for this case) on top of the linux staging tree. The same goes, 
for example, for USB subsystem development in which case i should just clone 
the usb development tree (and the same for all subsystems).

Is my understanding correct?

Thank you in advance!

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


[no subject]

2016-03-07 Thread nunojsa


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