Re: USB stops working if a malfunctioning USB device is connected

2016-12-06 Thread PrasannaKumar Muralidharan
On 7 December 2016 at 01:09, Alan Stern  wrote:
> On Tue, 6 Dec 2016, PrasannaKumar Muralidharan wrote:
>
>> > The issue did not appear for a day with 4.9-rc5. Will check for a
>> > couple more days and get back.
>>
>> I have been running 4.9-rc5 for quite some time. Did not observe the
>> crash so far but some times my USB port stops recognising the device.
>> After rebooting the system the USB port starts working.
>>
>> No OOPS or message related to this appeared in dmesg output. Is there
>> a way to collect more info?
>
> You can turn on dynamic debugging for USB:
>
> echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control
>
> Alan Stern
>

Okay. Let me try to get more info and get back.

Thanks,
PrasannaKumar
--
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: USB stops working if a malfunctioning USB device is connected

2016-12-06 Thread Alan Stern
On Tue, 6 Dec 2016, PrasannaKumar Muralidharan wrote:

> > The issue did not appear for a day with 4.9-rc5. Will check for a
> > couple more days and get back.
> 
> I have been running 4.9-rc5 for quite some time. Did not observe the
> crash so far but some times my USB port stops recognising the device.
> After rebooting the system the USB port starts working.
> 
> No OOPS or message related to this appeared in dmesg output. Is there
> a way to collect more info?

You can turn on dynamic debugging for USB:

echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control

Alan Stern

--
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: USB stops working if a malfunctioning USB device is connected

2016-12-06 Thread PrasannaKumar Muralidharan
> The issue did not appear for a day with 4.9-rc5. Will check for a
> couple more days and get back.

I have been running 4.9-rc5 for quite some time. Did not observe the
crash so far but some times my USB port stops recognising the device.
After rebooting the system the USB port starts working.

No OOPS or message related to this appeared in dmesg output. Is there
a way to collect more info?

Thanks,
PrasannaKumar
--
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: USB stops working if a malfunctioning USB device is connected

2016-11-18 Thread PrasannaKumar Muralidharan
The issue did not appear for a day with 4.9-rc5. Will check for a
couple more days and get back.

Thanks,
PrasannaKumar
--
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: USB stops working if a malfunctioning USB device is connected

2016-11-16 Thread PrasannaKumar Muralidharan
> At least Debian started building toolchains with PIE enabled by
> default. I've had this problem for a while, actually. I'm building
> kernels with:
>
> $ make CC="gcc -fno-PIE"
>
> and everything builds fine.

Great. Kernel build is going on now. Will post about further developments.
--
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: USB stops working if a malfunctioning USB device is connected

2016-11-16 Thread Felipe Balbi

Hi,

Greg KH  writes:
> On Wed, Nov 16, 2016 at 12:12:53AM +0530, PrasannaKumar Muralidharan wrote:
>> >> scripts/kconfig/conf  --silentoldconfig Kconfig
>> >>   CHK include/config/kernel.release
>> >> Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong
>> >> not supported by compiler
>> >> make: *** [prepare-compiler-check] Error 1
>> >> make: *** Waiting for unfinished jobs
>> >
>> > So turn off CONFIG_CC_STACKPROTECTOR_STRONG or upgrade your C compiler.
>> 
>> I turned off CONFIG_CC_STACKPROTECTOR_STRONG and got the following error
>> ***
>>   HOSTCC  scripts/basic/fixdep
>>   HOSTCC  scripts/basic/bin2c
>>   HOSTCC  arch/x86/tools/relocs_32.o
>>   HOSTCC  arch/x86/tools/relocs_64.o
>>   HOSTCC  arch/x86/tools/relocs_common.o
>>   HOSTLD  arch/x86/tools/relocs
>>   CHK include/config/kernel.release
>>   CHK include/generated/uapi/linux/version.h
>>   CHK include/generated/utsrelease.h
>>   CC  arch/x86/purgatory/purgatory.o
>>   AS  arch/x86/purgatory/stack.o
>>   AS  arch/x86/purgatory/setup-x86_64.o
>>   CC  arch/x86/purgatory/sha256.o
>>   AS  arch/x86/purgatory/entry64.o
>>   CC  arch/x86/purgatory/string.o
>>   LD  arch/x86/purgatory/purgatory.ro
>>   BIN2C   arch/x86/purgatory/kexec-purgatory.c
>>   CHK include/generated/timeconst.h
>>   CC  kernel/bounds.s
>> kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
>>  /*
>> 
>> make[1]: *** [kernel/bounds.s] Error 1
>> make: *** [prepare0] Error 2
>> ***
>> 
>> Using gcc 6.2 to compile kernel. gcc works with
>> -fstack-protector-strong for a simple test c code. I doubt compiler is
>> the problem. Should I make some change to make kernel compile with gcc
>> 6.2? Thank you for your quick response.
>
> This is Ubuntu, right?  Build a 64bit kernel and you should be fine,
> right now Canonical is shipping a version of gcc that doesn't want to
> build the kernel.  There's a patch floating around, go bug the Canonical
> developers to get it upstream please...
>
> If not, I don't know, sorry.

At least Debian started building toolchains with PIE enabled by
default. I've had this problem for a while, actually. I'm building
kernels with:

$ make CC="gcc -fno-PIE"

and everything builds fine.

-- 
balbi


signature.asc
Description: PGP signature


Re: USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread Alan Stern
On Tue, 15 Nov 2016, Greg KH wrote:

> On Wed, Nov 16, 2016 at 12:12:53AM +0530, PrasannaKumar Muralidharan wrote:
> > >> scripts/kconfig/conf  --silentoldconfig Kconfig
> > >>   CHK include/config/kernel.release
> > >> Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong
> > >> not supported by compiler
> > >> make: *** [prepare-compiler-check] Error 1
> > >> make: *** Waiting for unfinished jobs
> > >
> > > So turn off CONFIG_CC_STACKPROTECTOR_STRONG or upgrade your C compiler.
> > 
> > I turned off CONFIG_CC_STACKPROTECTOR_STRONG and got the following error
> > ***
> >   HOSTCC  scripts/basic/fixdep
> >   HOSTCC  scripts/basic/bin2c
> >   HOSTCC  arch/x86/tools/relocs_32.o
> >   HOSTCC  arch/x86/tools/relocs_64.o
> >   HOSTCC  arch/x86/tools/relocs_common.o
> >   HOSTLD  arch/x86/tools/relocs
> >   CHK include/config/kernel.release
> >   CHK include/generated/uapi/linux/version.h
> >   CHK include/generated/utsrelease.h
> >   CC  arch/x86/purgatory/purgatory.o
> >   AS  arch/x86/purgatory/stack.o
> >   AS  arch/x86/purgatory/setup-x86_64.o
> >   CC  arch/x86/purgatory/sha256.o
> >   AS  arch/x86/purgatory/entry64.o
> >   CC  arch/x86/purgatory/string.o
> >   LD  arch/x86/purgatory/purgatory.ro
> >   BIN2C   arch/x86/purgatory/kexec-purgatory.c
> >   CHK include/generated/timeconst.h
> >   CC  kernel/bounds.s
> > kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
> >  /*
> > 
> > make[1]: *** [kernel/bounds.s] Error 1
> > make: *** [prepare0] Error 2
> > ***
> > 
> > Using gcc 6.2 to compile kernel. gcc works with
> > -fstack-protector-strong for a simple test c code. I doubt compiler is
> > the problem. Should I make some change to make kernel compile with gcc
> > 6.2? Thank you for your quick response.
> 
> This is Ubuntu, right?  Build a 64bit kernel and you should be fine,
> right now Canonical is shipping a version of gcc that doesn't want to
> build the kernel.  There's a patch floating around, go bug the Canonical
> developers to get it upstream please...
> 
> If not, I don't know, sorry.

Alternatively, you can try running a 4.8.7 or 4.8.8 kernel, if
Canonical supplies them.  They contain the patches that fix the bugs in
rtsx_usb.

Alan Stern

--
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: USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread Greg KH
On Wed, Nov 16, 2016 at 12:12:53AM +0530, PrasannaKumar Muralidharan wrote:
> >> scripts/kconfig/conf  --silentoldconfig Kconfig
> >>   CHK include/config/kernel.release
> >> Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong
> >> not supported by compiler
> >> make: *** [prepare-compiler-check] Error 1
> >> make: *** Waiting for unfinished jobs
> >
> > So turn off CONFIG_CC_STACKPROTECTOR_STRONG or upgrade your C compiler.
> 
> I turned off CONFIG_CC_STACKPROTECTOR_STRONG and got the following error
> ***
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/basic/bin2c
>   HOSTCC  arch/x86/tools/relocs_32.o
>   HOSTCC  arch/x86/tools/relocs_64.o
>   HOSTCC  arch/x86/tools/relocs_common.o
>   HOSTLD  arch/x86/tools/relocs
>   CHK include/config/kernel.release
>   CHK include/generated/uapi/linux/version.h
>   CHK include/generated/utsrelease.h
>   CC  arch/x86/purgatory/purgatory.o
>   AS  arch/x86/purgatory/stack.o
>   AS  arch/x86/purgatory/setup-x86_64.o
>   CC  arch/x86/purgatory/sha256.o
>   AS  arch/x86/purgatory/entry64.o
>   CC  arch/x86/purgatory/string.o
>   LD  arch/x86/purgatory/purgatory.ro
>   BIN2C   arch/x86/purgatory/kexec-purgatory.c
>   CHK include/generated/timeconst.h
>   CC  kernel/bounds.s
> kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
>  /*
> 
> make[1]: *** [kernel/bounds.s] Error 1
> make: *** [prepare0] Error 2
> ***
> 
> Using gcc 6.2 to compile kernel. gcc works with
> -fstack-protector-strong for a simple test c code. I doubt compiler is
> the problem. Should I make some change to make kernel compile with gcc
> 6.2? Thank you for your quick response.

This is Ubuntu, right?  Build a 64bit kernel and you should be fine,
right now Canonical is shipping a version of gcc that doesn't want to
build the kernel.  There's a patch floating around, go bug the Canonical
developers to get it upstream please...

If not, I don't know, sorry.

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


Re: USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread PrasannaKumar Muralidharan
>> scripts/kconfig/conf  --silentoldconfig Kconfig
>>   CHK include/config/kernel.release
>> Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong
>> not supported by compiler
>> make: *** [prepare-compiler-check] Error 1
>> make: *** Waiting for unfinished jobs
>
> So turn off CONFIG_CC_STACKPROTECTOR_STRONG or upgrade your C compiler.

I turned off CONFIG_CC_STACKPROTECTOR_STRONG and got the following error
***
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/bin2c
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CC  arch/x86/purgatory/purgatory.o
  AS  arch/x86/purgatory/stack.o
  AS  arch/x86/purgatory/setup-x86_64.o
  CC  arch/x86/purgatory/sha256.o
  AS  arch/x86/purgatory/entry64.o
  CC  arch/x86/purgatory/string.o
  LD  arch/x86/purgatory/purgatory.ro
  BIN2C   arch/x86/purgatory/kexec-purgatory.c
  CHK include/generated/timeconst.h
  CC  kernel/bounds.s
kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
 /*

make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
***

Using gcc 6.2 to compile kernel. gcc works with
-fstack-protector-strong for a simple test c code. I doubt compiler is
the problem. Should I make some change to make kernel compile with gcc
6.2? Thank you for your quick response.

Thanks,
PrasannaKumar
--
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: USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread Alan Stern
On Tue, 15 Nov 2016, PrasannaKumar Muralidharan wrote:

> I am getting the following error when I compile 4.9-rc5:
> ***
> scripts/kconfig/conf  --silentoldconfig Kconfig
>   CHK include/config/kernel.release
> Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong
> not supported by compiler
> make: *** [prepare-compiler-check] Error 1
> make: *** Waiting for unfinished jobs

So turn off CONFIG_CC_STACKPROTECTOR_STRONG or upgrade your C compiler.

Alan Stern

--
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: USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread Alan Stern
On Tue, 15 Nov 2016, PrasannaKumar Muralidharan wrote:

> Hi,
> 
> My android device does not work sometime when I connect it to my
> computer. It works sometime, it does not work sometime. If the device
> fails to respond to USB requests then any other USB device that I
> connect is not detected.
> 
> dmesg snippet when I connect the malfunctioning USB device:
> 
> [19850.041339] perf: interrupt took too long (5112 > 4980), lowering
> kernel.perf_event_max_sample_rate to 39000
> [36269.864918] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
> [36275.241134] usb 1-4: device descriptor read/64, error -110
> [36290.858096] usb 1-4: device descriptor read/64, error -110
> [36291.086110] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
> [36296.490381] usb 1-4: device descriptor read/64, error -110
> [36312.107320] usb 1-4: device descriptor read/64, error -110
> [36312.335345] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
> [36317.515675] xhci_hcd :00:14.0: Timeout while waiting for setup
> device command
> [36322.891955] xhci_hcd :00:14.0: Timeout while waiting for setup
> device command
> [36323.099938] usb 1-4: device not accepting address 2, error -62
> [36323.219932] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
> [36328.375162] usb 1-4: device descriptor read/8, error -110
> [36333.751509] usb 1-4: device descriptor read/8, error -110
> [36333.856628] usb 1-4: USB disconnect, device number 2
> [36494.422106] INFO: task rtsx_usb_ms_1:1033 blocked for more than 120 
> seconds.
> [36494.422110]   Not tainted 4.8.0-27-generic #29-Ubuntu
> [36494.422111] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
> disables this message.
> [36494.422113] rtsx_usb_ms_1   D a05d10ba3d18 0  1033  2 
> 0x
> [36494.422116]  a05d10ba3d18 00ffa05b12674c00 a05d15340e40
> a05d10f1aac0
> [36494.422119]  a05d10ba3d00 a05d10ba4000 9b8e7710
> a05d10ba3da0
> [36494.422121]   0258 a05d10ba3d30
> 9b29a855
> [36494.422123] Call Trace:
> [36494.422128]  [] schedule+0x35/0x80
> [36494.422131]  [] usb_kill_urb+0x98/0xd0
> [36494.422134]  [] ? wake_atomic_t_function+0x60/0x60
> [36494.422136]  [] usb_start_wait_urb+0xe5/0x170
> [36494.422138]  [] usb_bulk_msg+0xbd/0x160
> [36494.422143]  [] rtsx_usb_send_cmd+0x63/0x90 [rtsx_usb]
> [36494.422145]  [] rtsx_usb_read_register+0x6c/0xc0 
> [rtsx_usb]
> [36494.422147]  []
> rtsx_usb_detect_ms_card+0x74/0x100 [rtsx_usb_ms]
> [36494.422149]  [] ?
> rtsx_usb_ms_set_param+0x780/0x780 [rtsx_usb_ms]

There's a known bug in the rtsx_usb drivers in the 4.8 kernel.  Try
running a 4.9-rc kernel and see if it helps.

Alan Stern

> [36494.422151]  [] kthread+0xd8/0xf0
> [36494.422153]  [] ret_from_fork+0x1f/0x40
> [36494.422155]  [] ? kthread_create_on_node+0x1e0/0x1e0
> 
> 
> Would be glad to provide any more info if required.
> 
> Thanks,
> PrasannaKumar

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


USB stops working if a malfunctioning USB device is connected

2016-11-15 Thread PrasannaKumar Muralidharan
Hi,

My android device does not work sometime when I connect it to my
computer. It works sometime, it does not work sometime. If the device
fails to respond to USB requests then any other USB device that I
connect is not detected.

dmesg snippet when I connect the malfunctioning USB device:

[19850.041339] perf: interrupt took too long (5112 > 4980), lowering
kernel.perf_event_max_sample_rate to 39000
[36269.864918] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
[36275.241134] usb 1-4: device descriptor read/64, error -110
[36290.858096] usb 1-4: device descriptor read/64, error -110
[36291.086110] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
[36296.490381] usb 1-4: device descriptor read/64, error -110
[36312.107320] usb 1-4: device descriptor read/64, error -110
[36312.335345] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
[36317.515675] xhci_hcd :00:14.0: Timeout while waiting for setup
device command
[36322.891955] xhci_hcd :00:14.0: Timeout while waiting for setup
device command
[36323.099938] usb 1-4: device not accepting address 2, error -62
[36323.219932] usb 1-4: reset high-speed USB device number 2 using xhci_hcd
[36328.375162] usb 1-4: device descriptor read/8, error -110
[36333.751509] usb 1-4: device descriptor read/8, error -110
[36333.856628] usb 1-4: USB disconnect, device number 2
[36494.422106] INFO: task rtsx_usb_ms_1:1033 blocked for more than 120 seconds.
[36494.422110]   Not tainted 4.8.0-27-generic #29-Ubuntu
[36494.422111] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[36494.422113] rtsx_usb_ms_1   D a05d10ba3d18 0  1033  2 0x
[36494.422116]  a05d10ba3d18 00ffa05b12674c00 a05d15340e40
a05d10f1aac0
[36494.422119]  a05d10ba3d00 a05d10ba4000 9b8e7710
a05d10ba3da0
[36494.422121]   0258 a05d10ba3d30
9b29a855
[36494.422123] Call Trace:
[36494.422128]  [] schedule+0x35/0x80
[36494.422131]  [] usb_kill_urb+0x98/0xd0
[36494.422134]  [] ? wake_atomic_t_function+0x60/0x60
[36494.422136]  [] usb_start_wait_urb+0xe5/0x170
[36494.422138]  [] usb_bulk_msg+0xbd/0x160
[36494.422143]  [] rtsx_usb_send_cmd+0x63/0x90 [rtsx_usb]
[36494.422145]  [] rtsx_usb_read_register+0x6c/0xc0 [rtsx_usb]
[36494.422147]  []
rtsx_usb_detect_ms_card+0x74/0x100 [rtsx_usb_ms]
[36494.422149]  [] ?
rtsx_usb_ms_set_param+0x780/0x780 [rtsx_usb_ms]
[36494.422151]  [] kthread+0xd8/0xf0
[36494.422153]  [] ret_from_fork+0x1f/0x40
[36494.422155]  [] ? kthread_create_on_node+0x1e0/0x1e0


Would be glad to provide any more info if required.

Thanks,
PrasannaKumar
--
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