Re: Calling usb_bulk_msg inside usbtouch_process_pkt is causing kernel panic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 04, 2012 at 12:31:53PM +0000, Nuno Santos wrote:
> On 01/03/2012 06:40 PM, Greg KH wrote:
> >On Tue, Jan 03, 2012 at 06:20:26PM +0000, Nuno Santos wrote:
> >>On 01/03/2012 06:16 PM, Greg KH wrote:
> >>>On Tue, Jan 03, 2012 at 06:00:18PM +0000, Nuno Santos wrote:
> >>>>Hi Greg,
> >>>>
> >>>>This is my packet process function. This is a multitouch controller.
> >>>>In every frame I need to get touch data and if any touch is
> >>>>available to be inject into the system, that is done in this method.
> >>>>
> >>>>static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch,
> >>>>unsigned char *pkt, int len)
> >>>>{
> >>>>     int touch=0,currentTouch=0,transferedBytes=0;
> >>>>     PDPX_TOUCH Touch;
> >>>>
> >>>>     struct usbtouch_device_info *type = usbtouch->type;
> >>>>     struct dpx_priv *priv = usbtouch->priv;
> >>>>     struct usb_device *usbdev = interface_to_usbdev(usbtouch->interface);
> >>>>
> >>>>     if (!type->read_data(usbtouch, pkt))
> >>>>         return;
> >>>>
> >>>>     tCurrent = jiffies;
> >>>>     elapsed = tCurrent-tInitial;
> >>>>     elapsed = elapsed * 1000 / HZ;
> >>>>
> >>>>     if (elapsed>1000)
> >>>>     {
> >>>I'm guessing this code isn't in the kernel tree, right?  :)
> >>It's really bad?
> >Wrong coding style.
> 
> Can you please point me the bad things? This driver was my first
> Kernel experience. The base for this driver was the usbtouchscreen
> driver present in the kernel source.

Please read Documentation/CodingStyle for the correct kernel coding
style we use.

> >>>Why not?
> >>Why not what? :)
> >Why isn't this code/driver in the main kernel.org tree already?  Has it
> >been submitted?
> No. I can't submit this driver as it is to the kernel source because
> it has proprietary code to handle touch detection.

So you are saying that your tiny bit of a driver trumps the entire
multi-million line license of the whole kernel?  Sorry, I don't buy
that, and, by virtue of that, am not allowed to help you with your code.
Please go talk to your company lawyer about this issue.

Good luck, you are on your own here.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux