Re: How to prevent a module from unloading when in used

2014-07-18 Thread Chetan Nanda
On Fri, Jul 18, 2014 at 9:47 AM, Greg KH g...@kroah.com wrote:

 On Fri, Jul 18, 2014 at 09:43:48AM +0530, Chetan Nanda wrote:
 
 
 
  On Wed, Jul 16, 2014 at 9:51 PM, Greg KH g...@kroah.com wrote:
 
  On Wed, Jul 16, 2014 at 08:57:38PM +0530, Chetan Nanda wrote:
  
  
  
   On Wed, Jul 16, 2014 at 8:49 PM, Chetan Nanda 
 chetanna...@gmail.com
  wrote:
  
  
  
   On Wed, Jul 16, 2014 at 6:39 PM, John de la Garza 
 j...@jjdev.com
  wrote:
  
   On Wed, Jul 16, 2014 at 04:00:18PM +0530, Chetan Nanda
 wrote:
A depends on B, so B is automatically loaded when A is
 loaded.
B module is also directly being used by the user side
 code via
  misc
interface.
   .
Now when I am unloading module A, via modprobe -r A it
 is
  also
   unloading
the module B which is being used by the application and
  resulting in
   the
kernel crash.
  
   You said that A depends on B, right?  Why do you have A
 dependng
  on B?
   If it A needs to have B then it makes sense that you can
 not
  remove A
   while
   B is in use.  If A doesn't need B, why not remove the
 dependency.
  
  
   A is calling few APIs defined by B.
  
   But why when user space application is already using  module B.
 (it has
  already
   open its device fd) kernel allows to remove it.
  
   I tried with doing try_module_get() in the module's open function,
 it
  prevent
   module B unloading but cause thread doing modprobe -r to hang
   Is there any other way to mark module as busy when being used by
 user
   application?
 
  Never use try_module_get(), that is racy.
 
  What is the user/kernel interface you are using, and why doesn't it
  automatically increase the module count when userspace opens the
  interface?  It should all be done in a way that your module doesn't
 need
  to do anything special.
 
 
  Hi Greg,
 
  Thanks for your mail.
 
  Module is using misc driver interface to export its functionality to
  userspace,
 
  Need to debug further why module count is not getting incremented
 automatically
  when module is open by userspace application via open system call.

 Are you properly setting the .owner field of your file operations
 structure to be THIS_MODULE?  If not, try fixing that up.  If you are,
 try posting your code for review.

 greg k-h


Hi Greg,

Thanks for the hint, indeed that was the issue, .owner field was not set in
file operation structure.
After setting that, 'modprobe -r A' is hanging. As the module B in use and
can't be removed.

I am using busybox on embedded Linux, I think this could be a modprobe
utility issue.
Ideally modprobe should not try to remove the module in used.

Thanks,
Chetan Nanda
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


hi , question function of net_rx(struct net_device *dev)

2014-07-18 Thread lx
hi :
 the source code of net_rx(struct net_device *dev) is:
http://lxr.oss.org.cn/source/drivers/net/ethernet/cirrus/cs89x0.c#L670

I can't understand codes about malloc buffer.
##
684 /* Malloc up new buffer. */
685 skb = netdev_alloc_skb(dev, length + 2);
686 if (skb == NULL) {
687 dev-stats.rx_dropped++;
688 return;
689 }
690 skb_reserve(skb, 2);/* longword align L3 header */
##

How to explain 'length + 2' in line of 685? Why add 2 ?

Thank you.


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


Re: hi , question function of net_rx(struct net_device *dev)

2014-07-18 Thread Denis Kirjanov
On 7/18/14, lx lxlenovos...@gmail.com wrote:
 hi :
  the source code of net_rx(struct net_device *dev) is:
 http://lxr.oss.org.cn/source/drivers/net/ethernet/cirrus/cs89x0.c#L670

 I can't understand codes about malloc buffer.
 ##
 684 /* Malloc up new buffer. */
 685 skb = netdev_alloc_skb(dev, length + 2);
 686 if (skb == NULL) {
 687 dev-stats.rx_dropped++;
 688 return;
 689 }
 690 skb_reserve(skb, 2);/* longword align L3 header */
 ##

 How to explain 'length + 2' in line of 685? Why add 2 ?

That's why it's explained on the line 690.
http://lwn.net/Articles/89597/


 Thank you.


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



-- 
Regards,
Denis

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


How to automate checkpatch get_maintainers git send-email of commits range?

2014-07-18 Thread Andrey Utkin
Is there script for automated checkpatch.pl  get_maintainers.pl 
git send-email for range of commits? I see none. Would it be welcome
to submit such one to kernel tree?

-- 
Andrey Utkin

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


Where find Linux Kernel Development Jobs

2014-07-18 Thread Lucas Tanure
Hi,

What are the best sites, lists, foruns to find Linux Kernel Jobs. No matter
the country.
Linkedin is still the best place ?

Thanks

--
Lucas Tanure
+55 (19) 988176559
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


module_param does not work in Ubuntu 13.10 - Kernel 3.10.0-4

2014-07-18 Thread dora babu
Hi Kernelnewbies,

Subject : module_param does not work in Ubuntu 13.10 - Kernel 3.10.0-4

For the thread in your mailing list, I would like to suggest the person who
posted question that he is not able to pass the parameters to the module in
their product.

I would like them to check the 'insmod' binary behaviour. If they are using
'busybox'(insmod a softlink to it) for inserting the module with
parameters, I would like to suggest them to try with 'insmod' generated out
of its source code(compile or available over internet but not the one
provided by busybox).

I recently faced the same issue, and it turned out to be the issue with the
busybox and worked perfectly fine with the insmod I compiled locally.


-- 
Thanks  Regards,
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to automate checkpatch get_maintainers git send-email of commits range?

2014-07-18 Thread Joe Perches
On Fri, 2014-07-18 at 15:47 -0700, Joe Perches wrote:
 On Fri, 2014-07-18 at 18:22 -0400, Theodore Ts'o wrote:
   and get_maintainers.pl.
 I think checkpatch

Umm, make that get_maintainer...

 is pretty good about cc'ing mostly the
 right folk by default.



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