Re: [PATCH 05/12] usb: usblp: use irqsave() in USB's complete callback

2018-06-25 Thread Pete Zaitcev
rrect, addresses the stated problem, no forgotten parts found left to fix. Acked-by: Pete Zaitcev -- P -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 05/22] USB: mon: no need to check return value of debugfs_create functions

2018-05-29 Thread Pete Zaitcev
On Tue, 29 May 2018 17:30:50 +0200 Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. Okay, fair enough. And the code works,

[PATCH] usb: Read text within supplied buffer size

2018-03-08 Thread Pete Zaitcev
This change fixes buffer overflows and silent data corruption with the usbmon device driver text file read operations. Signed-off-by: Fredrik Noring <nor...@nocrew.org> Signed-off-by: Pete Zaitcev <zait...@redhat.com> --- diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_

Re: [PATCH 2/6] USB: move many drivers to use DEVICE_ATTR_RO

2018-01-23 Thread Pete Zaitcev
mplements it. Now, you have to know the foo_show convention. But if you think it's worth being a bit more explicit about "this is intended to be a RO attribute", then okay. Acked-by: Pete Zaitcev <zait...@redhat.com> -- P -- To unsubscribe from this list: send the line "

[PATCH] The usbmon triggers a BUG in ./include/linux/mm.h

2018-01-08 Thread Pete Zaitcev
Automated tests triggered this by opening usbmon and accessing the mmap while simultaneously resizing the buffers. This bug was with us since 2006, because typically applications only size the buffers once and thus avoid racing. Reported by Kirill A. Shutemov. Signed-off-by: Pete Zaitcev <z

Re: kernel BUG at ./include/linux/mm.h:LINE! (3)

2018-01-08 Thread Pete Zaitcev
usbmontest: The crash test for usbmon, crashes kernel 4.15 * * Copyright (c) 2007 Red Hat, Inc. * Copyright (c) 2016 Mike Frysinger <vap...@gentoo.org> * Copyright (c) 2018 Pete Zaitcev <zait...@redhat.com> * * This program is free software; you can redistribute it and/or m

Re: kernel BUG at ./include/linux/mm.h:LINE! (3)

2018-01-07 Thread Pete Zaitcev
On Fri, 29 Dec 2017 16:24:20 +0300 "Kirill A. Shutemov" wrote: > Looks like MON_IOCT_RING_SIZE reallocates ring buffer without any > serialization wrt mon_bin_vma_fault(). By the time of get_page() the page > may be freed. As an update: I tried to make a smaller test for

Re: kernel BUG at ./include/linux/mm.h:LINE! (3)

2018-01-03 Thread Pete Zaitcev
On Wed, 3 Jan 2018 13:08:12 -0800 Matthew Wilcox wrote: > > + mutex_lock(>fetch_lock); > > offset = vmf->pgoff << PAGE_SHIFT; > > if (offset >= rp->b_size) > > + mutex_unlock(>fetch_lock); > > return VM_FAULT_SIGBUS; > > chunk_idx = offset

Re: kernel BUG at ./include/linux/mm.h:LINE! (3)

2018-01-03 Thread Pete Zaitcev
On Wed, 3 Jan 2018 12:26:04 +0300 "Kirill A. Shutemov" wrote: > > > +++ b/drivers/usb/mon/mon_bin.c > > > @@ -1228,15 +1228,24 @@ static void mon_bin_vma_close(struct > > > vm_area_struct *vma) > > > static int mon_bin_vma_fault(struct vm_fault *vmf) > > > { > > >

Re: kernel BUG at ./include/linux/mm.h:LINE! (3)

2018-01-02 Thread Pete Zaitcev
On Fri, 29 Dec 2017 16:24:20 +0300 "Kirill A. Shutemov" wrote: > Looks like MON_IOCT_RING_SIZE reallocates ring buffer without any > serialization wrt mon_bin_vma_fault(). By the time of get_page() the page > may be freed. Okay. Who knew that you could fork while holding

Re: [PATCH 2/3] USB: serial: mct_u232: fix big-endian baud-rate handling

2017-05-11 Thread Pete Zaitcev
t_baud_rate(struct tty_struct *tty, > divisor = mct_u232_calculate_baud_rate(serial, value, ); > - put_unaligned_le32(cpu_to_le32(divisor), buf); > + put_unaligned_le32(divisor, buf); > rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), Acked

Re: [PATCH 1/1] usblp: do not set TASK_INTERRUPTIBLE before lock

2015-11-11 Thread Pete Zaitcev
her missed that mutex_lock_interruptible() can set the state, or it didn't do it back then (it was in 2007), and the 7f477358e introduced the existing code. Acked-By: Pete Zaitcev <zait...@yahoo.com> -- Pete -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usb: class: Use USB_CLASS_PRINTER instead of number 7

2015-06-19 Thread Pete Zaitcev
On Fri, 19 Jun 2015 11:37:08 +0200 Krzysztof Opasiak k.opas...@samsung.com wrote: Kernel provides very nice defines for USB device class so it's a good idea to use them in suitable places. It is much easier to grep for such define instead of 7. static const struct usb_device_id usblp_ids[]

Re: [PATCH v1 05/49] USB: usblp: prepare for enabling irq in complete()

2013-08-17 Thread Pete Zaitcev
On Sun, 18 Aug 2013 00:24:30 +0800 Ming Lei ming@canonical.com wrote: Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Pete Zaitcev zait...@kotori.zaitcev.us Signed-off-by: Ming Lei ming@canonical.com Still looks good. -- P

Re: [PATCH 03/50] USB: usblp: spin_lock in complete() cleanup

2013-07-11 Thread Pete Zaitcev
On Thu, 11 Jul 2013 17:05:26 +0800 Ming Lei ming@canonical.com wrote: Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Pete Zaitcev zait...@redhat.com Signed-off-by: Ming Lei ming@canonical.com Signed-off-by: Pete Zaitcev zait

Re: [PATCH] USB: prevent overlapping access by usb-storage and usbfs

2013-01-18 Thread Pete Zaitcev
On Mon, 14 Jan 2013 12:23:05 -0800 Greg KH gre...@linuxfoundation.org wrote: Forgot to mention the side effect of the patch: one can't submit read and write URB simultaneously via USBDEVFS_BULK ioctl(). That has been dealt in 2.4 by later patch by Pete, which I can try to port if

Re: [Patch v2] block: remove the deprecated ub driver

2012-08-27 Thread Pete Zaitcev
On Sun, 26 Aug 2012 14:12:17 -0700 Greg Kroah-Hartman gre...@linuxfoundation.org wrote: Unless you have other plans, I would take this and send it you together with the removal of libusual as you asked. Why not just send a follow-on patch to do the libusual fixups instead? Sending it

Re: Huawei E220 and usb storage

2008-02-25 Thread Pete Zaitcev
On Wed, 20 Feb 2008 07:57:23 +0100, Norbert Preining [EMAIL PROTECTED] wrote: that you did, after taking care of detection and initialization. Look at his dmesg in comment #44 in this: Yes, that looks very similar. Someone reported on the bug that a firmware update exists to resolve the

Re: Huawei E220 and usb storage

2008-02-14 Thread Pete Zaitcev
On Fri, 16 Nov 2007 14:22:56 +0100, Norbert Preining [EMAIL PROTECTED] wrote: The difference with huaweiAktBbo.c seems that kernel uses a nonzero length. Can you try zero length with the kernel? It's the second argument to the last. I tried with the git patch plus changing the

Re: Flushing URBs for small control URBs

2008-02-13 Thread Pete Zaitcev
On Wed, 13 Feb 2008 13:31:54 -0600, Andrew McKay [EMAIL PROTECTED] wrote: spin_lock_bh(port-lock); if (port-write_urb_busy) { If you lock against callbacks and do not trigger tasklets yourself, you must use spin_lock_irqsave (or spin_lock_irq if you are belong to Oliver's denomination).

Re: Flushing URBs for small control URBs

2008-02-13 Thread Pete Zaitcev
On Wed, 13 Feb 2008 15:53:48 -0600, Andrew McKay [EMAIL PROTECTED] wrote: Once the callback function has been called does this guarantee that the URB has already been sent to hardware? Yes (if the returned status was zero). I'll definitely look into this usbmon app. I have timed things

Re: [patch]pm counter leak in usblp

2008-02-12 Thread Pete Zaitcev
On Tue, 12 Feb 2008 19:08:30 +0100, Oliver Neukum [EMAIL PROTECTED] wrote: Signed-off-by: Oliver Neukum [EMAIL PROTECTED] if (handle_bidir(usblp) 0) { + usb_autopm_put_interface(intf); usblp-used = 0; Signed-Off-By: Pete Zaitcev [EMAIL PROTECTED] -- Pete

Re: usbmon output to trace read/writes

2008-02-05 Thread Pete Zaitcev
On Tue, 5 Feb 2008 11:17:46 -0800 (PST), Siddharth Choudhuri [EMAIL PROTECTED] wrote: - Linux 2.6.19 on ARM The problem is, I see the following in /tmp/log (no data words): c04087dc 57025 C Bo:002:02 0 31 c000ec14 57209 S Bo:002:02 -115 512 D

Re: [2.6.24 REGRESSION] BUG: Soft lockup - with VFS

2008-02-05 Thread Pete Zaitcev
On Tue, 5 Feb 2008 14:05:06 -0800, Andrew Morton [EMAIL PROTECTED] wrote: Looks like you deadlocked in ub_request_fn(). I assume that you were using ub.c in 2.6.23 and that it worked OK? If so, we broke it, possibly via changes to the core block layer. I think ub.c is basically abandoned

Re: usbmon output to trace read/writes

2008-02-05 Thread Pete Zaitcev
On Tue, 5 Feb 2008 17:02:58 -0500 (EST), Alan Stern [EMAIL PROTECTED] wrote: In such cases the page number is stored in a scatter-gather entry. Should we modify the core to keep a copy of the page number in the URB, for use by mon_dmapeek()? If you ask me, I'd say that rules of what is

Re: How to debug EOVERFLOW errors

2008-02-04 Thread Pete Zaitcev
On Mon, 04 Feb 2008 08:30:37 -0800, Alan Nisota [EMAIL PROTECTED] wrote: [...] If I do this using blocking reads, the device never sends any data back It appears to be waiting for multiple bulk request URBS in the queue. This apparently eliminates my ability to use libusb, so now I need

Re: request: patch for oracom mp3 stick -- usb-storage: unusual_devs.h

2008-02-01 Thread Pete Zaitcev
On Fri, 1 Feb 2008 11:59:56 -0500 (EST), Alan Stern [EMAIL PROTECTED] wrote: You missed the point. Windows does _not_ do it -- i.e., does not clear a halt on either bulk endpoint. Linux does so only because somebody (either Pete Zaitcev or Pat Lavarre, I can't remember which) pointed out

Re: [usb-storage] request: patch for oracom mp3 stick -- usb-storage: unusual_devs.h

2008-02-01 Thread Pete Zaitcev
On Fri, 1 Feb 2008 11:54:12 -0800, Matthew Dharm [EMAIL PROTECTED] wrote: There's no way to know until Robert tests with no clear-halt at all. Which is very easy to do: enable ub, run usbmon... voila. -- Pete - To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a

Blackberry through a TT hub

2008-01-26 Thread Pete Zaitcev
Hi, Greg: I think the berry_charge is your baby. Please direct me to the right person if it's not so. I have a bug in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=379341 It's pretty long, but the summary is this. When Blackberry is hooked to a hub, it seems to try to re-initialize again

Re: Periodic USB failure

2008-01-18 Thread Pete Zaitcev
On Fri, 18 Jan 2008 16:25:51 -0500, Jon Smirl [EMAIL PROTECTED] wrote: I guess I have to buy another hub. The USB 2.0 hubs I have aren't multi-tt and don't work right with the audio devices. I would rather think about adding a USB bus or two. The thought of three isochronous devices on the

Re: WD My Book 500G external drive: error -110

2008-01-08 Thread Pete Zaitcev
On Tue, 08 Jan 2008 18:56:03 -0500, Sean Darcy [EMAIL PROTECTED] wrote: head -20 /tmp/1.mon.out 810037f38d80 3045534577 S Ii:2:001:1 -115:128 2 81000fe64cc0 3045534596 S Ci:2:001:0 s a3 00 0001 0004 4 20 lines is never sufficient with usbmon. It's more like 20 thousand. But

Re: Kingston Datatraveler

2008-01-07 Thread Pete Zaitcev
On Mon, 7 Jan 2008 16:36:56 -0500 (EST), Alan Stern [EMAIL PROTECTED] wrote: I'm afraid I'm out of good ideas. You can try playing around with the code in drivers/usb/storage/transport.c, adding delays here and there to see if they make any difference. Sorry for repeating this, but usbmon

Re: usblp not waiting for read data

2008-01-02 Thread Pete Zaitcev
On Wed, 2 Jan 2008 15:25:11 +0100, Martin Mares [EMAIL PROTECTED] wrote: | open(/dev/usb/lp0, O_RDONLY|O_LARGEFILE) = 3 | fstat64(3, {st_mode=S_IFCHR|0660, st_rdev=makedev(180, 0), ...}) = 0 | read(3, , 4096) = 0 | close(3)= 0 Figures...

Re: Kingston Datatraveler

2007-12-30 Thread Pete Zaitcev
On Sun, 30 Dec 2007 22:48:39 +, Brian Murphy [EMAIL PROTECTED] wrote: I install Win XP on the system and the drive works fine. Great. I hope it was a dual-boot setup. Is there any way I can modifie the driver so I see the same result as when I put the debug output to the serial port. It

Re: Kingston Datatraveler

2007-12-21 Thread Pete Zaitcev
On Fri, 21 Dec 2007 10:50:06 +, Brian Murphy [EMAIL PROTECTED] wrote: I just discover some thing, If I ouput the trace to a serial port the system works fine. However If I output the trace to the disk I have the same problem as before. [...] I think your device is asking for US_FL_GO_SLOW

Re: Disabling interrupts during IRQ in ohci-hcd

2007-12-06 Thread Pete Zaitcev
On Wed, 5 Dec 2007 17:31:20 -0500 (EST), Alan Stern [EMAIL PROTECTED] wrote: [...] In fact every HCD _must_ keep interrupts disabled while doing most of its IRQ processing. This is because an interrupt could cause some random driver to submit an URB -- and URB submission can't be done