linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rohit Sarkar <rohitsarkar5398@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
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 13:04:36 +0530	[thread overview]
Message-ID: <5e7c5b10.1c69fb81.eb1b6.4979@mx.google.com> (raw)
In-Reply-To: <fdc818d7-842c-cfef-3654-0478e74bfa73@infradead.org>

On Wed, Mar 25, 2020 at 11:07:55PM -0700, Randy Dunlap wrote:
> On 3/25/20 10:31 PM, Rohit Sarkar wrote:
> > On Wed, Mar 25, 2020 at 02:40:27PM -0700, Randy Dunlap wrote:
> >> On 3/25/20 10:13 AM, Rohit Sarkar wrote:
> >>> On Wed, Mar 25, 2020 at 04:41:38PM +0100, Hubert CHAUMETTE wrote:
> >>>> Le 25/03/2020 15:47, Rohit Sarkar a écrit :
> >>>>> I was trying to mess around with the driver that drives my mouse. I
> >>>>> found out that it is usbhid. I then added a printk statement to the init
> >>>>> and exit function of usbhid.
> >>>>> I then compiled and installed the usbhid drivers. Post that I ran
> >>>>> `sudo modprobe -r usbhid` and `sudo modprobe usbhid` but couldnt observe
> >>>>> any logs in dmesg.
> >>>>>
> >>>>> I am certain I am missing something fundamental. Could someone help me
> >>>>> with this.
> >>>>
> >>>> Hi,
> >>>>
> >>>> Did you check whether your module was effectively loaded with lsmod?
> >>>> What log level did you use in your printk statement? Depending on your
> >>>> system default loglevel your logs might not be printed. A quick fix
> >>>> would be to use one of the lowest levels (pr_emerg, but pr_err might
> >>>> suffice).
> >>>> Regards,
> >>>
> >>> Hey,
> >>> I did check that module was loaded. And one of the signs was that my
> >>> mouse started working after insmod :).
> > Hi,
> >> Hi,
> >> I'm not convinced that your modified usbhid module was loaded.
> > Hmm, here's my dmesg logs if that helps:
> > "
> > [  382.132319] usbcore: deregistering interface driver usbhid
> > [  391.077410] input: MOSART Semi. 2.4G Wireless Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:3938:1031.0002/input/input26
> > [  391.136724] input: MOSART Semi. 2.4G Wireless Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:3938:1031.0002/input/input27
> > [  391.137285] hid-generic 0003:3938:1031.0002: input,hiddev0,hidraw0: USB HID v1.10 Mouse [MOSART Semi. 2.4G Wireless Mouse] on usb-0000:00:14.0-2/input0
> > [  391.137480] usbcore: registered new interface driver usbhid
> > [  391.137483] usbhid: USB HID core driver
> > "
> 
> I can't tell that helps any.
> 
> >> Could an older (original) usbhid module be reloaded so that the mouse
> >> started working again?  That would also explain the lack of (new) messages.
> > I think so too. But how do I verify if this is the case?
> > 
> >> What kernel version are you using?  Is it a distro kernel?
> > I am currently running a bleeding edge kernel that I built. ie 5.6-rc7. 
> >> Are you trying to replace the usbhid module in a distro kernel or are
> >> you building the entire kernel?
> > I am building the entire kernel
> >>> I used printk(KERN_ALERT "some message") for logging. I also tried with
> >>> KERN_ERR but no luck. 
> >>>
> >>> 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
> 
> 
> -- 
> ~Randy
> 

  parent reply	other threads:[~2020-03-26  7:34 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 [this message]
2020-03-26 16:02                 ` Randy Dunlap
2020-03-26 16:14                   ` Rohit Sarkar
2020-03-26 16:16                     ` Randy Dunlap
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=5e7c5b10.1c69fb81.eb1b6.4979@mx.google.com \
    --to=rohitsarkar5398@gmail.com \
    --cc=hubert.chaumette@kolabnow.com \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=rdunlap@infradead.org \
    /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).