linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Rohit Sarkar <rohitsarkar5398@gmail.com>
Cc: Hubert CHAUMETTE <hubert.chaumette@kolabnow.com>,
	Oliver Neukum <oneukum@suse.com>,
	linux-usb@vger.kernel.org, linux-newbie@vger.kernel.org
Subject: Re: Beginner query regarding usbhid
Date: Thu, 26 Mar 2020 09:16:26 -0700	[thread overview]
Message-ID: <4637ad23-b086-b76d-5ce0-99da85764b45@infradead.org> (raw)
In-Reply-To: <5e7cd502.1c69fb81.2402c.714b@mx.google.com>

On 3/26/20 9:14 AM, Rohit Sarkar wrote:
> On Thu, Mar 26, 2020 at 09:02:55AM -0700, Randy Dunlap wrote:
>> On 3/26/20 12:34 AM, Rohit Sarkar wrote:
>>
>>>>>>>
>>>>>>> The command I used for building was "make -C /home/rohit/LINUX/kernels/staging  M=$(pwd)"
>>>>>>> and for installing the modules: "sudo make -C /home/rohit/LINUX/kernels/staging  M=$(pwd) modules_install"
>>>>>>> both were executed from the usbhid directory.
>>>>>>
>>>>>> why those commands?  seems unusual.
>>>>> My Linux kernel source is in the directory mentioned in the commands. So
>>>>> it is same as running "make M=drivers/hid/usbhid/" from the linux kernel
>>>>> source root.
>>>>
>>>> So /home/rohit/kernels/staging is the top-level kernel source directory?
>>>>
>>>> "M=dir" is for external modules to be built.  AFAICT you are not building any
>>>> external modules.
>>>>
>>>> Just run
>>>> $ cd <top of kernel source tree>
>>>> $ make all
>>>> $ sudo make install
>>> Further, on my system it takes a significant amount of time to run "make
>>> all" for some reason. (30 minutes) even though I have previously
>>> built the kernel and not pulled any update.
>>> AFAIK, make is only supposed to build the files that have
>>> changed. Idk why it is also compiling other files. Most of the time is
>>> taken by make running modpost.
>>>
>>> That is the reason I tried to build and install only the hid folder
>>
>> OK, I get that.
>>
>> For a driver that is built as a loadable module, you should be able to
>> edit the driver, build it, unload previous version (rmmod),
>> load new version (modprobe or insmod), and test it, without having to
>> reboot the kernel. [until an oops or BUG or WARN happens]
>>
>> If you don't "install" the new module file, I think that modprobe will
>> look in /lib/modules/kernel_version/* for the module file and find the
>> old one.  In this case I usually use "insmod path_to_new_driver_file"
>> to load & test it.
> Hmm, the weird part is that I did run "sudo make modules_install".
> Shouldnt that get the latest modules into /lib/modules/{kernel
> version}/*. Although it didnt work before rebooting.

Yes.

> I guess insmod path_to_new_driver_file is the best option here.


-- 
~Randy


  reply	other threads:[~2020-03-26 16:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 13:42 Beginner query regarding usbhid Rohit Sarkar
2020-03-25 14:45 ` Oliver Neukum
2020-03-25 14:47   ` Rohit Sarkar
2020-03-25 15:41     ` Hubert CHAUMETTE
2020-03-25 17:13       ` Rohit Sarkar
2020-03-25 21:40         ` Randy Dunlap
2020-03-26  5:31           ` Rohit Sarkar
2020-03-26  6:07             ` Randy Dunlap
2020-03-26  6:53               ` Rohit Sarkar
2020-03-26 15:56                 ` Randy Dunlap
2020-03-26  7:34               ` Rohit Sarkar
2020-03-26 16:02                 ` Randy Dunlap
2020-03-26 16:14                   ` Rohit Sarkar
2020-03-26 16:16                     ` Randy Dunlap [this message]
2020-03-26 11:48               ` Rohit Sarkar
2020-03-26 16:04                 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4637ad23-b086-b76d-5ce0-99da85764b45@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=hubert.chaumette@kolabnow.com \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=rohitsarkar5398@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).