FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 09-18-2012, 10:38 AM
Ian Jackson
 
Default Handling /etc/modprobe.d and module load order

Ben Hutchings writes ("Re: Handling /etc/modprobe.d and module load order"):
> On Mon, 2012-09-17 at 16:46 +0000, Amit wrote:
> > It is a driver for a PIC microcontroller board. I was using usbhid but
> > there was a bug that I couldn't work around.
>
> A bug in which?

I assume a bug in the board which Amit wanted to work around by using
a stunt version of the usbhid driver.

> > I haven't thought of this. How does this work in the case when usbhid
> > already has the device in its device ID table.
>
> They both get loaded.

And how should Amit arrange that the stunt driver, not normal usbhid,
gets control of the device ?

Ian.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20568.20278.966711.586783@chiark.greenend.org.uk"> http://lists.debian.org/20568.20278.966711.586783@chiark.greenend.org.uk
 
Old 09-18-2012, 05:21 PM
Amit
 
Default Handling /etc/modprobe.d and module load order

Ian Jackson <ijackson <at> chiark.greenend.org.uk> writes:

>
> Ben Hutchings writes ("Re: Handling /etc/modprobe.d and module load order"):
> > On Mon, 2012-09-17 at 16:46 +0000, Amit wrote:
> > > It is a driver for a PIC microcontroller board. I was using usbhid but
> > > there was a bug that I couldn't work around.
> >
> > A bug in which?
>
> I assume a bug in the board which Amit wanted to work around by using
> a stunt version of the usbhid driver.

Yes, that is correct. The bug is in the firmware of the PIC
microcontroller.

>
> > > I haven't thought of this. How does this work in the case when usbhid
> > > already has the device in its device ID table.
> >
> > They both get loaded.
>
> And how should Amit arrange that the stunt driver, not normal usbhid,
> gets control of the device ?
>

This is main problem. Both the drivers try and control the device. The
only work around I could come up with was to pass a usbhid quirks to
ignore this specific board and then load the custom driver.

Thanks for the reply.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120918T191704-247@post.gmane.org">http://lists.debian.org/loom.20120918T191704-247@post.gmane.org
 
Old 09-18-2012, 05:58 PM
 
Default Handling /etc/modprobe.d and module load order

On Sep 18, Amit <amit.uttam@gmail.com> wrote:

> This is main problem. Both the drivers try and control the device. The
> only work around I could come up with was to pass a usbhid quirks to
> ignore this specific board and then load the custom driver.
Actually there is a different solution:

# stop handling the device identified by VID and PID
ACTION=="add", SUBSYSTEM=="drivers",
ENV{DEVPATH}=="/bus/usb-serial/drivers/usbhid",
ATTR{remove_id}="xxxx yyyy"

# if no driver has claimed the interface yet, load your_driver
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface",
ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy",
DRIVER=="",
RUN+="/sbin/modprobe -b your_driver"

Or just:

echo 'xxxx yyyy' > /sys/bus/usb/drivers/usbhid/remove_id
modprobe your_driver

--
ciao,
Marco
 
Old 09-20-2012, 07:15 PM
Amit
 
Default Handling /etc/modprobe.d and module load order

Marco d'Itri <md <at> Linux.IT> writes:

[snip]

>
> Or just:
>
> echo 'xxxx yyyy' > /sys/bus/usb/drivers/usbhid/remove_id
> modprobe your_driver
>

Tried this but it seems the PIC is buggier than I thought. There are
times when it disconnects and reconnects itself. As soon as the
reconnect happens, usbhid takes over the device. Thus, negating the
above command.

I ended up placing a line in */etc/default/grub* that passes the usbhid
quirks and have the postinst call update-grub. This passes the quirks to
kernel during boot so all seems well now.

Thanks,
Amit


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120920T211137-68@post.gmane.org">http://lists.debian.org/loom.20120920T211137-68@post.gmane.org
 

Thread Tools




All times are GMT. The time now is 10:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org