Re: USB host port {,performance} issues with Beaglebone

2016-03-08 Thread Victor Dodon
Hi Felipe,

On Mon, Mar 7, 2016 at 11:13 PM, Felipe Balbi  wrote:
>
> Hi,
>
> Victor Dodon  writes:
>> [ text/plain ]
>> Sorry, I accidentally pressed Send
>>
>> On Mon, Mar 7, 2016 at 7:35 PM, Victor Dodon  wrote:
>>> Hi all,
>>>
>>> I have some performance issues with the host port on a Beaglebone
>>> board. I tested with kernel 3.8.13, 3.14.55 and 4.1.18 and the issue
>>> still persists. Running a fio test with 64k random reads from a USB
>>> flash drive yields a maximum of 14402.01 KiB/s (115216.08 Kb/s). The
>>> 3.14 and 4.1 kernels where build with CONFIG_TI_CPPI41_DMA=y. I was
>>> able to get a much better performance on the client USB port by
>>> enabling fifo double buffering. Iperf over a gigabit connection and a 
>>> Ethernet
>>> to USB adapter plugged in the host port gives a maximum of 180Mbit/s with 
>>> fifo
>>> double buffering enabled for the ep1 and ep2.
>>>
>>> Are there any known performance issues in the musb driver? For my use
>>> case I need
>>> a higher bandwidth and I would like to improve the host controller,
>>> but I'm a beginner in Kernel hacking and I would appreciate some help,
>>> tips or any cues to start.
>>>
>>> I also found a few problems with the host port. For example:
>>> Using the setup described above (gigabit connection and a Ethernet
>>> to USB adapter plugged in the host port and with a running iSCSI
>>> initiator on the BB,
>>> in usb/musb/musb_core.c if I change mode_4_cfg to enable double
>>> buffering, and I restart the board while doing a dd from the disk
>>> mounted with iSCSI, the kernel stops at:
>>
>> *if I enable double buffering for both RX and TX for only for ep 1
>> then the kernel stops at:
>>
>> [  233.930764] blk_update_request: I/O error, dev sda, sector 1620736
>> [  234.451076] musb-hdrc musb-hdrc.1.auto: remove, state 1
>> [  234.469702] usb usb1: USB disconnect, device number 1
>> [  234.492716] init: iscsid main process (466) killed by TERM signal
>> [  234.510663] usb 1-1: USB disconnect, device number 2
>> [  234.533235] usb 1-1.1: USB disconnect, device number 3
>> [  234.555153] usb 1-1.3: USB disconnect, device number 4
>> [  234.586962] musb-hdrc musb-hdrc.1.auto: USB bus 1 deregistered
>> [  234.606098] reboot: Restarting system
>>
>> if I enable double buffering for RX and TX for ep 1 and 2, only when
>
> you mean you're using FIFO_RXTX ? IIRC, that's only for Isochronous
> endpoints.

No, I use:
static struct musb_fifo_cfg mode_4_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512,  },
{ .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, },
...

in the first case, and:

static struct musb_fifo_cfg mode_4_cfg[] = {
{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512,  .mode = BUF_DOUBLE, },
{ .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },

in the second, with a few changes in the last endpoint to fit in 16k.

>
> I'm adding Bin (current MUSB maintainer) to see if he has anything to
> say.
>
> ps: 4.1 is still too old, can you try v4.4 or v4.5-rc6 ?

Ok, I will try the newer kernels.

Thank you very much,
Victor Dodon.

>
>> logging in to the target, the network connectivity fails, I after some
>> time I got:
>>
>> [   92.176028] udevd[98]: worker [803] /devices/platform/hos
>> t0/session1/target0:0:0/0:0:0:0/block/sda/sda1 timeout; kill it
>> [   92.190702] udevd[98]: seq 1480
>> '/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda1'
>> killed
>> [   92.202237] udevd[98]: worker [805]
>> /devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a2
>> timeout; kill it
>> [   92.216125] udevd[98]: seq 1481
>> '/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda2'
>> killed
>> [   92.226088] udevd[98]: worker [806]
>> /devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a3
>> timeout; kill it
>> [   92.240727] udevd[98]: seq 1482
>> '/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda3'
>> killed
>> [   92.252076] udevd[98]: worker [807]
>> /devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a4
>> timeout; kill it
>> [   92.265958] ud

Re: USB host port {,performance} issues with Beaglebone

2016-03-07 Thread Victor Dodon
Sorry, I accidentally pressed Send

On Mon, Mar 7, 2016 at 7:35 PM, Victor Dodon  wrote:
> Hi all,
>
> I have some performance issues with the host port on a Beaglebone
> board. I tested with kernel 3.8.13, 3.14.55 and 4.1.18 and the issue
> still persists. Running a fio test with 64k random reads from a USB
> flash drive yields a maximum of 14402.01 KiB/s (115216.08 Kb/s). The
> 3.14 and 4.1 kernels where build with CONFIG_TI_CPPI41_DMA=y. I was
> able to get a much better performance on the client USB port by
> enabling fifo double buffering. Iperf over a gigabit connection and a Ethernet
> to USB adapter plugged in the host port gives a maximum of 180Mbit/s with fifo
> double buffering enabled for the ep1 and ep2.
>
> Are there any known performance issues in the musb driver? For my use
> case I need
> a higher bandwidth and I would like to improve the host controller,
> but I'm a beginner in Kernel hacking and I would appreciate some help,
> tips or any cues to start.
>
> I also found a few problems with the host port. For example:
> Using the setup described above (gigabit connection and a Ethernet
> to USB adapter plugged in the host port and with a running iSCSI
> initiator on the BB,
> in usb/musb/musb_core.c if I change mode_4_cfg to enable double
> buffering, and I restart the board while doing a dd from the disk
> mounted with iSCSI, the kernel stops at:

*if I enable double buffering for both RX and TX for only for ep 1
then the kernel stops at:

[  233.930764] blk_update_request: I/O error, dev sda, sector 1620736
[  234.451076] musb-hdrc musb-hdrc.1.auto: remove, state 1
[  234.469702] usb usb1: USB disconnect, device number 1
[  234.492716] init: iscsid main process (466) killed by TERM signal
[  234.510663] usb 1-1: USB disconnect, device number 2
[  234.533235] usb 1-1.1: USB disconnect, device number 3
[  234.555153] usb 1-1.3: USB disconnect, device number 4
[  234.586962] musb-hdrc musb-hdrc.1.auto: USB bus 1 deregistered
[  234.606098] reboot: Restarting system

if I enable double buffering for RX and TX for ep 1 and 2, only when
logging in to the target, the network connectivity fails, I after some
time I got:

[   92.176028] udevd[98]: worker [803] /devices/platform/hos
t0/session1/target0:0:0/0:0:0:0/block/sda/sda1 timeout; kill it
[   92.190702] udevd[98]: seq 1480
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda1'
killed
[   92.202237] udevd[98]: worker [805]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a2
timeout; kill it
[   92.216125] udevd[98]: seq 1481
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda2'
killed
[   92.226088] udevd[98]: worker [806]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a3
timeout; kill it
[   92.240727] udevd[98]: seq 1482
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda3'
killed
[   92.252076] udevd[98]: worker [807]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a4
timeout; kill it
[   92.265958] udevd[98]: seq 1483
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda4'
killed
[   92.276066] udevd[98]: worker [811]
/devices/platform/host0/session1/target0:0:0/0:0:0:1/block/sdb ti
meout; kill it
[   92.290420] udevd[98]: seq 1477
'/devices/platform/host0/session1/target0:0:0/0:0:0:1/block/sdb' kill
ed
[   92.299911] udevd[98]: worker [813]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a5
timeout; kill it
[   92.314794] udevd[98]: seq 1484
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda5'
killed
[   92.326211] udevd[98]: worker [814]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a6
timeout; kill it
[   92.340026] udevd[98]: seq 1485
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda6'
killed
[   92.350116] udevd[98]: worker [815]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a7
timeout; kill it
[   92.364315] udevd[98]: seq 1486
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda7'
killed
[   92.374220] udevd[98]: worker [816]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a8
timeout; kill it
[   92.388688] udevd[98]: seq 1487
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda8'
killed
[   92.399953] udevd[98]: worker [817]
/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sd a9
timeout; kill it
[   92.413449] udevd[98]: seq 1488
'/devices/platform/host0/session1/target0:0:0/0:0:0:0/block/sda/sda9'
killed
[  110.497428] [ cut here ]
[  110.501976] WARNING: CPU: 0 PID: 842 at
../../../../../tmp/portage/sys-kernel/kernel-beaglebone-4_1-4
.1.18/work/kernel-beaglebone-4_1-4.1.18/drivers/dma/cppi41.c:611
cppi41_stop_chan+0x26c/0x2d0()
[  110.518903] Modules linked

USB host port {,performance} issues with Beaglebone

2016-03-07 Thread Victor Dodon
Hi all,

I have some performance issues with the host port on a Beaglebone
board. I tested with kernel 3.8.13, 3.14.55 and 4.1.18 and the issue
still persists. Running a fio test with 64k random reads from a USB
flash drive yields a maximum of 14402.01 KiB/s (115216.08 Kb/s). The
3.14 and 4.1 kernels where build with CONFIG_TI_CPPI41_DMA=y. I was
able to get a much better performance on the client USB port by
enabling fifo double buffering. Iperf over a gigabit connection and a Ethernet
to USB adapter plugged in the host port gives a maximum of 180Mbit/s with fifo
double buffering enabled for the ep1 and ep2.

Are there any known performance issues in the musb driver? For my use
case I need
a higher bandwidth and I would like to improve the host controller,
but I'm a beginner in Kernel hacking and I would appreciate some help,
tips or any cues to start.

I also found a few problems with the host port. For example:
Using the setup described above (gigabit connection and a Ethernet
to USB adapter plugged in the host port and with a running iSCSI
initiator on the BB,
in usb/musb/musb_core.c if I change mode_4_cfg to enable double
buffering, and I restart the board while doing a dd from the disk
mounted with iSCSI, the kernel stops at:


Kind regards,
Victor Dodon.
--
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


[PATCH] usb: storage: remove the US_DEBUG macro

2016-02-18 Thread Victor Dodon
Get rid of the US_DEBUG macro and use instead empty inline function definitions
when CONFIG_USB_STORAGE_DEBUG is not defined

Signed-off-by: Victor Dodon 
---
 drivers/usb/storage/debug.h  | 18 +++---
 drivers/usb/storage/ene_ub6250.c |  1 -
 drivers/usb/storage/freecom.c| 12 
 drivers/usb/storage/transport.c  |  2 --
 drivers/usb/storage/usb.c|  2 +-
 5 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index 6b365ce..50070f0 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -52,9 +52,22 @@ void usb_stor_show_sense(const struct us_data *us, unsigned 
char key,
 unsigned char asc, unsigned char ascq);
 __printf(2, 3) void usb_stor_dbg(const struct us_data *us,
 const char *fmt, ...);
-
-#define US_DEBUG(x)x
 #else
+static inline void _usb_stor_show_command(const struct us_data *us,
+  struct scsi_cmnd *srb)
+{
+}
+#define usb_stor_show_command(us, srb) \
+   do { if (0) _usb_stor_show_command(us, srb); } while (0)
+
+static inline void _usb_stor_show_sense(const struct us_data *us,
+   unsigned char key, unsigned char asc,
+   unsigned char ascq)
+{
+}
+#define usb_stor_show_sense(us, key, asc, ascq)\
+   do { if (0) _usb_stor_show_sense(us, key, asc, ascq); } while 0
+
 __printf(2, 3)
 static inline void _usb_stor_dbg(const struct us_data *us,
 const char *fmt, ...)
@@ -62,7 +75,6 @@ static inline void _usb_stor_dbg(const struct us_data *us,
 }
 #define usb_stor_dbg(us, fmt, ...) \
do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
-#define US_DEBUG(x)
 #endif
 
 #endif
diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
index f3cf4ce..73cfd84 100644
--- a/drivers/usb/storage/ene_ub6250.c
+++ b/drivers/usb/storage/ene_ub6250.c
@@ -2296,7 +2296,6 @@ static int ene_transport(struct scsi_cmnd *srb, struct 
us_data *us)
int result = 0;
struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra);
 
-   /*US_DEBUG(usb_stor_show_command(us, srb)); */
scsi_set_resid(srb, 0);
if (unlikely(!(info->SD_Status.Ready || info->MS_Status.Ready))) {
result = ene_init(us);
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 3f2b089..9c37175 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -44,6 +44,10 @@ MODULE_LICENSE("GPL");
 
 #ifdef CONFIG_USB_STORAGE_DEBUG
 static void pdump(struct us_data *us, void *ibuffer, int length);
+#else
+static inline void pdump(struct us_data *us, void *ibuffer, int length)
+{
+}
 #endif
 
 /* Bits of HD_STATUS */
@@ -245,7 +249,7 @@ static int freecom_transport(struct scsi_cmnd *srb, struct 
us_data *us)
memcpy (fcb->Atapi, srb->cmnd, 12);
memset (fcb->Filler, 0, sizeof (fcb->Filler));
 
-   US_DEBUG(pdump(us, srb->cmnd, 12));
+   pdump(us, srb->cmnd, 12);
 
/* Send it out. */
result = usb_stor_bulk_transfer_buf (us, opipe, fcb,
@@ -267,7 +271,7 @@ static int freecom_transport(struct scsi_cmnd *srb, struct 
us_data *us)
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
 
-   US_DEBUG(pdump(us, (void *)fst, partial));
+   pdump(us, (void *)fst, partial);
 
/* The firmware will time-out commands after 20 seconds. Some commands
 * can legitimately take longer than this, so we use a different
@@ -308,7 +312,7 @@ static int freecom_transport(struct scsi_cmnd *srb, struct 
us_data *us)
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
 
-   US_DEBUG(pdump(us, (void *)fst, partial));
+   pdump(us, (void *)fst, partial);
}
 
if (partial != 4)
@@ -365,7 +369,7 @@ static int freecom_transport(struct scsi_cmnd *srb, struct 
us_data *us)
usb_stor_dbg(us, "Waiting for status\n");
result = usb_stor_bulk_transfer_buf (us, ipipe, fst,
FCM_PACKET_LENGTH, &partial);
-   US_DEBUG(pdump(us, (void *)fst, partial));
+   pdump(us, (void *)fst, partial);
 
if (partial != 4 || result > USB_STOR_XFER_SHORT)
return USB_STOR_TRANSPORT_ERROR;
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 5e67f63..2f883a8 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -784,9 +784,7 @@ Retry_Sense:
usb_stor_dbg(us, "-- code: 0x%x, key: 0x%x, ASC: 0x%x, ASCQ:

[PATCH v2] usb: storage: use usb_store_dbg instead of US_DEBUGPX

2016-02-17 Thread Victor Dodon
The US_DEBUGPX macro uses printk without specifying a kernel log level, so
the default kernel log level is used, which may not match LOGLEVEL_DEBUG
used in usb_stor_dbg. Remove the macro and use usb_store_dbg instead.

Signed-off-by: Victor Dodon 
--
Changes in v2:
  - Completely remove the macro instead of using printk_emit
  - Change all uses of US_DEBUGPX to usb_stor_dbg
---
 drivers/usb/storage/debug.c  | 12 
 drivers/usb/storage/debug.h  |  3 ---
 drivers/usb/storage/sddr09.c | 18 +-
 3 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c
index 57bf3ad..5a12c03 100644
--- a/drivers/usb/storage/debug.c
+++ b/drivers/usb/storage/debug.c
@@ -57,7 +57,6 @@
 void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb)
 {
char *what = NULL;
-   int i;
 
switch (srb->cmnd[0]) {
case TEST_UNIT_READY: what = "TEST_UNIT_READY"; break;
@@ -153,10 +152,8 @@ void usb_stor_show_command(const struct us_data *us, 
struct scsi_cmnd *srb)
default: what = "(unknown command)"; break;
}
usb_stor_dbg(us, "Command %s (%d bytes)\n", what, srb->cmd_len);
-   usb_stor_dbg(us, "bytes: ");
-   for (i = 0; i < srb->cmd_len && i < 16; i++)
-   US_DEBUGPX(" %02x", srb->cmnd[i]);
-   US_DEBUGPX("\n");
+   usb_stor_dbg(us, "bytes: %*ph\n", min_t(int, srb->cmd_len, 16),
+(const unsigned char *)srb->cmnd);
 }
 
 void usb_stor_show_sense(const struct us_data *us,
@@ -174,11 +171,10 @@ void usb_stor_show_sense(const struct us_data *us,
if (what == NULL)
what = "(unknown ASC/ASCQ)";
 
-   usb_stor_dbg(us, "%s: ", keystr);
if (fmt)
-   US_DEBUGPX("%s (%s%x)\n", what, fmt, ascq);
+   usb_stor_dbg(us, "%s: %s (%s%x)\n", keystr, what, fmt, ascq);
else
-   US_DEBUGPX("%s\n", what);
+   usb_stor_dbg(us, "%s: %s\n", keystr, what);
 }
 
 void usb_stor_dbg(const struct us_data *us, const char *fmt, ...)
diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index f525203..6b365ce 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -53,7 +53,6 @@ void usb_stor_show_sense(const struct us_data *us, unsigned 
char key,
 __printf(2, 3) void usb_stor_dbg(const struct us_data *us,
 const char *fmt, ...);
 
-#define US_DEBUGPX(fmt, ...)   printk(fmt, ##__VA_ARGS__)
 #define US_DEBUG(x)x
 #else
 __printf(2, 3)
@@ -63,8 +62,6 @@ static inline void _usb_stor_dbg(const struct us_data *us,
 }
 #define usb_stor_dbg(us, fmt, ...) \
do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
-#define US_DEBUGPX(fmt, ...)   \
-   do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
 #define US_DEBUG(x)
 #endif
 
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index b746036..79224fc 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -1102,24 +1102,24 @@ static int
 sddr09_get_wp(struct us_data *us, struct sddr09_card_info *info) {
int result;
unsigned char status;
+   const char *wp_fmt;
 
result = sddr09_read_status(us, &status);
if (result) {
usb_stor_dbg(us, "read_status fails\n");
return result;
}
-   usb_stor_dbg(us, "status 0x%02X", status);
if ((status & 0x80) == 0) {
info->flags |= SDDR09_WP;   /* write protected */
-   US_DEBUGPX(" WP");
+   wp_fmt = " WP";
+   } else {
+   wp_fmt = "";
}
-   if (status & 0x40)
-   US_DEBUGPX(" Ready");
-   if (status & LUNBITS)
-   US_DEBUGPX(" Suspended");
-   if (status & 0x1)
-   US_DEBUGPX(" Error");
-   US_DEBUGPX("\n");
+   usb_stor_dbg(us, "status 0x%02X%s%s%s%s\n", status, wp_fmt,
+status & 0x40 ? " Ready" : "",
+status & LUNBITS ? " Suspended" : "",
+status & 0x01 ? " Error" : "");
+
return 0;
 }
 
-- 
2.7.0.rc3.207.g0ac5344

--
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: storage: make US_DEBUGPX print with LOGLEVEL_DEBUG

2016-02-16 Thread Victor Dodon
On Sun, Feb 14, 2016 at 05:20:21PM -0800, Greg Kroah-Hartman wrote:
> On Wed, Feb 10, 2016 at 04:13:43PM -0800, Victor Dodon wrote:
> > The US_DEBUGPX macro uses printk without specifying a kernel log level, so
> > the default kernel log level is used, which may not match LOGLEVEL_DEBUG
> > used in usb_stor_dbg. Use printk_emit with LOGLEVEL_DEBUG instead.
> > 
> > Signed-off-by: Victor Dodon 
> > ---
> >  drivers/usb/storage/debug.h | 10 --
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> Can you just get rid of US_DEBUGPX() entirely please?  It shouldn't be
> needed anymore, just use usb_stor_dbg() instead.

Using usb_stor_dbg() instead of US_DEBUGPX() in
usb_stor_show_command() prints one byte per line with the full syslog
header, like this:

7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876236] Command
TEST_UNIT_READY (6 bytes)
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876242] bytes: 
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876249]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876255]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876261]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876267]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876273]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876279]  00
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876285]

instead of the desired:

7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876236] Command
TEST_UNIT_READY (6 bytes)
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876242] bytes: 
7,0,Feb 16 14:30:41,ubuntu,kernel:,[  422.876249]  00 00 00 00 00 00

this is why I think the US_DEBUGPX() macro is still needed.

Regards,
Victor Dodon.

> 
> thanks,
> 
> greg k-h
--
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


[PATCH] usb: storage: make US_DEBUGPX print with LOGLEVEL_DEBUG

2016-02-10 Thread Victor Dodon
The US_DEBUGPX macro uses printk without specifying a kernel log level, so
the default kernel log level is used, which may not match LOGLEVEL_DEBUG
used in usb_stor_dbg. Use printk_emit with LOGLEVEL_DEBUG instead.

Signed-off-by: Victor Dodon 
---
 drivers/usb/storage/debug.h | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index f525203..fc1c02f 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -43,6 +43,7 @@
 #define _DEBUG_H_
 
 #include 
+#include 
 
 #define USB_STORAGE "usb-storage: "
 
@@ -53,7 +54,8 @@ void usb_stor_show_sense(const struct us_data *us, unsigned 
char key,
 __printf(2, 3) void usb_stor_dbg(const struct us_data *us,
 const char *fmt, ...);
 
-#define US_DEBUGPX(fmt, ...)   printk(fmt, ##__VA_ARGS__)
+#define US_DEBUGPX(fmt, ...)   \
+   printk_emit(0, LOGLEVEL_DEBUG, NULL, 0, fmt, ##__VA_ARGS__)
 #define US_DEBUG(x)x
 #else
 __printf(2, 3)
@@ -64,7 +66,11 @@ static inline void _usb_stor_dbg(const struct us_data *us,
 #define usb_stor_dbg(us, fmt, ...) \
do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
 #define US_DEBUGPX(fmt, ...)   \
-   do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
+   do {\
+   if (0)  \
+   printk_emit(0, LOGLEVEL_DEBUG, NULL, 0, \
+   fmt, ##__VA_ARGS__);\
+   } while (0)
 #define US_DEBUG(x)
 #endif
 
-- 
2.7.0.rc3.207.g0ac5344

--
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