[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #11 from commit-h...@freebsd.org ---
A commit references this bug:

Author: hselasky
Date: Wed Sep 19 08:13:58 UTC 2018
New revision: 338793
URL: https://svnweb.freebsd.org/changeset/base/338793

Log:
  MFC r338679:
  Improve LibUSB debugging by simultaneously allowing both function
  and transfer prints. Make sure the debug level comes from the
  correct USB context.

  Found by: Ludovic Rousseau 
  PR:   231264
  Sponsored by: Mellanox Technologies

Changes:
_U  stable/9/lib/
_U  stable/9/lib/libusb/
  stable/9/lib/libusb/libusb10.h
  stable/9/lib/libusb/libusb10_io.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #10 from commit-h...@freebsd.org ---
A commit references this bug:

Author: hselasky
Date: Wed Sep 19 08:12:41 UTC 2018
New revision: 338792
URL: https://svnweb.freebsd.org/changeset/base/338792

Log:
  MFC r338679:
  Improve LibUSB debugging by simultaneously allowing both function
  and transfer prints. Make sure the debug level comes from the
  correct USB context.

  Found by: Ludovic Rousseau 
  PR:   231264
  Sponsored by: Mellanox Technologies

Changes:
_U  stable/10/
  stable/10/lib/libusb/libusb10.h
  stable/10/lib/libusb/libusb10_io.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #9 from commit-h...@freebsd.org ---
A commit references this bug:

Author: hselasky
Date: Wed Sep 19 08:11:44 UTC 2018
New revision: 338791
URL: https://svnweb.freebsd.org/changeset/base/338791

Log:
  MFC r338679:
  Improve LibUSB debugging by simultaneously allowing both function
  and transfer prints. Make sure the debug level comes from the
  correct USB context.

  Found by: Ludovic Rousseau 
  PR:   231264
  Sponsored by: Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/lib/libusb/libusb10.h
  stable/11/lib/libusb/libusb10_io.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-14 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

Hans Petter Selasky  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|In Progress |Closed

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-14 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #8 from commit-h...@freebsd.org ---
A commit references this bug:

Author: hselasky
Date: Fri Sep 14 13:41:37 UTC 2018
New revision: 338679
URL: https://svnweb.freebsd.org/changeset/base/338679

Log:
  Improve LibUSB debugging by simultaneously allowing both function
  and transfer prints. Make sure the debug level comes from the
  correct USB context.

  Found by: Ludovic Rousseau 
  PR:   231264
  MFC after:1 week
  Approved by:  re (kib)
  Sponsored by: Mellanox Technologies

Changes:
  head/lib/libusb/libusb10.h
  head/lib/libusb/libusb10_io.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-14 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #7 from Ludovic Rousseau  ---
Created attachment 197089
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197089=edit
allows LIBUSB_DEBUG_FUNCTION and LIBUSB_DEBUG_TRANSFER

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-14 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #6 from Ludovic Rousseau  ---
This new patch works for me.

I would like to be able to have LIBUSB_DEBUG_FUNCTION *and*
LIBUSB_DEBUG_TRANSFER logs.

This is easy to do using:
  libusb_set_debug(ctx, LIBUSB_DEBUG_FUNCTION | LIBUSB_DEBUG_TRANSFER);
and the attached patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

Hans Petter Selasky  changed:

   What|Removed |Added

 Attachment #197047|0   |1
is obsolete||

--- Comment #5 from Hans Petter Selasky  ---
Created attachment 197056
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197056=edit
LibUSB patch

Can you try this updated patch instead? Does it work for you?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #4 from Ludovic Rousseau  ---
The patch does not fix the problem for libusb10_do_transfer_cb().

Only for the 2 other uses of GET_CONTEXT(NULL).

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

Hans Petter Selasky  changed:

   What|Removed |Added

 Status|New |In Progress

--- Comment #3 from Hans Petter Selasky  ---
Patch looks good.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #2 from Ludovic Rousseau  ---
The code ctx = GET_CONTEXT(NULL); is also used in

libusb_bulk_transfer() at
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L588

and

libusb_interrupt_transfer() at
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L606

Patch attached. It works for me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

--- Comment #1 from Ludovic Rousseau  ---
Created attachment 197047
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197047=edit
Correctly et the context

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb()

2018-09-09 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231264

Bug ID: 231264
   Summary: libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O
done"); does not work in libusb10_do_transfer_cb()
   Product: Base System
   Version: CURRENT
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: usb
  Assignee: u...@freebsd.org
  Reporter: ludovic.rousseau+free...@gmail.com

The _only_ use of DPRINTF(..., LIBUSB_DEBUG_TRANSFER, ...) is in the function
libusb10_do_transfer_cb of libusb10_io.c
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L500

The function uses it as:
ctx = GET_CONTEXT(NULL);
DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done");

Since the ctx context is fetched from NULL it has default values and ctx->debug
is 0.

DPRINTF() definition uses ctx->debug to know the debug level.
https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.h#L44

In the present case the debug level will be 0 so nothing is logged.

I don't know how to get the libusb context from a libusb_transfer, the only
parameter passed to libusb10_do_transfer_cb().

Another idea for improvement would be to use a bitmap for ctx->debug so it
would be possible to enable both LIBUSB_DEBUG_TRANSFER and
LIBUSB_DEBUG_FUNCTION at the same time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"