* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-23 12:24 ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
@ 2016-11-23 13:32 ` Guenter Roeck
2016-11-23 14:44 ` Mathias Nyman
2016-11-24 9:02 ` Felipe Balbi
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2016-11-23 13:32 UTC (permalink / raw)
To: Mathias Nyman; +Cc: linux-usb, stable
On 11/23/2016 04:24 AM, Mathias Nyman wrote:
> the tt_info provided by a HS hub might be in use to by a child device
> Make sure we free the devices in the correct order.
>
> This is needed in special cases such as when xhci controller is
> reset when resuming from hibernate, and all virt_devices are freed.
>
> Also free the virt_devices starting from max slot_id as children
> more commonly have higher slot_id than parent.
>
> CC: <stable@vger.kernel.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>
> ---
>
> Guenter Roeck, does this work for you?
>
> A rework of how tt_info is stored and used might be needed,
> but that will take some time and won't go to stable as easily.
I'll give it a try. One concern, though: xhci_free_virt_device() is called
from multiple places, and does not always remove all devices. Is it save
to assume that all other callers remove children first ?
Thanks,
Guenter
> ---
> drivers/usb/host/xhci-mem.c | 38 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 6afe323..b3a5cd8 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -979,6 +979,40 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
> xhci->devs[slot_id] = NULL;
> }
>
> +/*
> + * Free a virt_device structure.
> + * If the virt_device added a tt_info (a hub) and has children pointing to
> + * that tt_info, then free the child first. Recursive.
> + * We can't rely on udev at this point to find child-parent relationships.
> + */
> +void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
> +{
> + struct xhci_virt_device *vdev;
> + struct list_head *tt_list_head;
> + struct xhci_tt_bw_info *tt_info, *next;
> + int i;
> +
> + vdev = xhci->devs[slot_id];
> + if (!vdev)
> + return;
> +
> + tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts);
> + list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
> + /* is this a hub device that added a tt_info to the tts list */
> + if (tt_info->slot_id == slot_id) {
> + /* are any devices using this tt_info? */
> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
> + vdev = xhci->devs[i];
> + if (vdev && (vdev->tt_info == tt_info))
> + xhci_free_virt_devices_depth_first(
> + xhci, i);
> + }
> + }
> + }
> + /* we are now at a leaf device */
> + xhci_free_virt_device(xhci, slot_id);
> +}
> +
> int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
> struct usb_device *udev, gfp_t flags)
> {
> @@ -1829,8 +1863,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
> }
> }
>
> - for (i = 1; i < MAX_HC_SLOTS; ++i)
> - xhci_free_virt_device(xhci, i);
> + for (i = HCS_MAX_SLOTS(xhci->hcs_params1); i > 0; i--)
> + xhci_free_virt_devices_depth_first(xhci, i);
>
> dma_pool_destroy(xhci->segment_pool);
> xhci->segment_pool = NULL;
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-23 13:32 ` Guenter Roeck
@ 2016-11-23 14:44 ` Mathias Nyman
0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2016-11-23 14:44 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-usb, stable
On 23.11.2016 15:32, Guenter Roeck wrote:
> On 11/23/2016 04:24 AM, Mathias Nyman wrote:
>> the tt_info provided by a HS hub might be in use to by a child device
>> Make sure we free the devices in the correct order.
>>
>> This is needed in special cases such as when xhci controller is
>> reset when resuming from hibernate, and all virt_devices are freed.
>>
>> Also free the virt_devices starting from max slot_id as children
>> more commonly have higher slot_id than parent.
>>
>> CC: <stable@vger.kernel.org>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>
>> ---
>>
>> Guenter Roeck, does this work for you?
>>
>> A rework of how tt_info is stored and used might be needed,
>> but that will take some time and won't go to stable as easily.
>
> I'll give it a try. One concern, though: xhci_free_virt_device() is called
> from multiple places, and does not always remove all devices. Is it save
> to assume that all other callers remove children first ?
>
This should be the only place that xhci does a massive xhci_free_virt_device(),
In the other places it's initiated per device by usb core which should handle
child-parent relationships, or then just error paths when failing to allocate
a device in the first place (no children yet)
-Mathias
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-23 12:24 ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
2016-11-23 13:32 ` Guenter Roeck
@ 2016-11-24 9:02 ` Felipe Balbi
2016-11-24 9:57 ` Mathias Nyman
2016-11-24 19:58 ` Guenter Roeck
2016-11-28 20:24 ` Guenter Roeck
3 siblings, 1 reply; 12+ messages in thread
From: Felipe Balbi @ 2016-11-24 9:02 UTC (permalink / raw)
To: Mathias Nyman, linux; +Cc: linux-usb, Mathias Nyman, stable
[-- Attachment #1: Type: text/plain, Size: 3052 bytes --]
Hi,
Mathias Nyman <mathias.nyman@linux.intel.com> writes:
> the tt_info provided by a HS hub might be in use to by a child device
> Make sure we free the devices in the correct order.
>
> This is needed in special cases such as when xhci controller is
> reset when resuming from hibernate, and all virt_devices are freed.
>
> Also free the virt_devices starting from max slot_id as children
> more commonly have higher slot_id than parent.
>
> CC: <stable@vger.kernel.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>
> ---
>
> Guenter Roeck, does this work for you?
>
> A rework of how tt_info is stored and used might be needed,
> but that will take some time and won't go to stable as easily.
> ---
> drivers/usb/host/xhci-mem.c | 38 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 6afe323..b3a5cd8 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -979,6 +979,40 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
> xhci->devs[slot_id] = NULL;
> }
>
> +/*
> + * Free a virt_device structure.
> + * If the virt_device added a tt_info (a hub) and has children pointing to
> + * that tt_info, then free the child first. Recursive.
> + * We can't rely on udev at this point to find child-parent relationships.
> + */
> +void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
> +{
> + struct xhci_virt_device *vdev;
> + struct list_head *tt_list_head;
> + struct xhci_tt_bw_info *tt_info, *next;
> + int i;
> +
> + vdev = xhci->devs[slot_id];
> + if (!vdev)
> + return;
> +
> + tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts);
> + list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
> + /* is this a hub device that added a tt_info to the tts list */
> + if (tt_info->slot_id == slot_id) {
if (tt_info->slot_id != slot_id)
continue;
> + /* are any devices using this tt_info? */
> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
off-by-one here ? Why is i starting from 1?
> + vdev = xhci->devs[i];
> + if (vdev && (vdev->tt_info == tt_info))
if (!vdev || vdev->tt_info != tt_info)
continue;
> + xhci_free_virt_devices_depth_first(
> + xhci, i);
> + }
> + }
> + }
> + /* we are now at a leaf device */
> + xhci_free_virt_device(xhci, slot_id);
> +}
> +
> int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
> struct usb_device *udev, gfp_t flags)
> {
> @@ -1829,8 +1863,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
> }
> }
>
> - for (i = 1; i < MAX_HC_SLOTS; ++i)
> - xhci_free_virt_device(xhci, i);
> + for (i = HCS_MAX_SLOTS(xhci->hcs_params1); i > 0; i--)
converting MAX_HC_SLOTS to HCS_MAX_SLOTS(xhci->hcs_params1) seems
unrelated to $subject. Perhaps just mention on commit log?
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-24 9:02 ` Felipe Balbi
@ 2016-11-24 9:57 ` Mathias Nyman
2016-11-24 11:03 ` Felipe Balbi
0 siblings, 1 reply; 12+ messages in thread
From: Mathias Nyman @ 2016-11-24 9:57 UTC (permalink / raw)
To: Felipe Balbi, linux; +Cc: linux-usb, stable
On 24.11.2016 11:02, Felipe Balbi wrote:
>
> Hi,
>
> Mathias Nyman <mathias.nyman@linux.intel.com> writes:
>> the tt_info provided by a HS hub might be in use to by a child device
>> Make sure we free the devices in the correct order.
>>
>> This is needed in special cases such as when xhci controller is
>> reset when resuming from hibernate, and all virt_devices are freed.
>>
>> Also free the virt_devices starting from max slot_id as children
>> more commonly have higher slot_id than parent.
>>
>> CC: <stable@vger.kernel.org>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>
>> ---
>>
>> Guenter Roeck, does this work for you?
>>
>> A rework of how tt_info is stored and used might be needed,
>> but that will take some time and won't go to stable as easily.
>> ---
>> drivers/usb/host/xhci-mem.c | 38 ++++++++++++++++++++++++++++++++++++--
>> 1 file changed, 36 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
>> index 6afe323..b3a5cd8 100644
>> --- a/drivers/usb/host/xhci-mem.c
>> +++ b/drivers/usb/host/xhci-mem.c
>> @@ -979,6 +979,40 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
>> xhci->devs[slot_id] = NULL;
>> }
>>
>> +/*
>> + * Free a virt_device structure.
>> + * If the virt_device added a tt_info (a hub) and has children pointing to
>> + * that tt_info, then free the child first. Recursive.
>> + * We can't rely on udev at this point to find child-parent relationships.
>> + */
>> +void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
>> +{
>> + struct xhci_virt_device *vdev;
>> + struct list_head *tt_list_head;
>> + struct xhci_tt_bw_info *tt_info, *next;
>> + int i;
>> +
>> + vdev = xhci->devs[slot_id];
>> + if (!vdev)
>> + return;
>> +
>> + tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts);
>> + list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
>> + /* is this a hub device that added a tt_info to the tts list */
>> + if (tt_info->slot_id == slot_id) {
>
> if (tt_info->slot_id != slot_id)
> continue;
>
>> + /* are any devices using this tt_info? */
>> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
>
> off-by-one here ? Why is i starting from 1?
>
>> + vdev = xhci->devs[i];
slit_id 0 is reserved and xhci->devs[0] is not used, so ne need to check it.
All other places that check xhci->devs[0] are avtually buggy
-Mathias
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-24 9:57 ` Mathias Nyman
@ 2016-11-24 11:03 ` Felipe Balbi
2016-11-24 12:07 ` Mathias Nyman
0 siblings, 1 reply; 12+ messages in thread
From: Felipe Balbi @ 2016-11-24 11:03 UTC (permalink / raw)
To: Mathias Nyman, linux; +Cc: linux-usb, stable
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
Hi,
Mathias Nyman <mathias.nyman@linux.intel.com> writes:
>>> + /* are any devices using this tt_info? */
>>> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
>>
>> off-by-one here ? Why is i starting from 1?
>>
>>> + vdev = xhci->devs[i];
>
> slit_id 0 is reserved and xhci->devs[0] is not used, so ne need to
> check it.
hmm... it's reserved for the HW, sure. Do you need to over allocate the
array by 1 just to keep this first member unused? Couldn't you handle
the +1/-1 (depending on the case) in xhci driver itself? Saves a bit of
memory there.
> All other places that check xhci->devs[0] are avtually buggy
fair enough, sounds like an accessor guaranteeing the 'rules of
engagement' for this would be useful.
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-24 11:03 ` Felipe Balbi
@ 2016-11-24 12:07 ` Mathias Nyman
0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2016-11-24 12:07 UTC (permalink / raw)
To: Felipe Balbi, linux; +Cc: linux-usb, stable
On 24.11.2016 13:03, Felipe Balbi wrote:
>
> Hi,
>
> Mathias Nyman <mathias.nyman@linux.intel.com> writes:
>>>> + /* are any devices using this tt_info? */
>>>> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
>>>
>>> off-by-one here ? Why is i starting from 1?
>>>
>>>> + vdev = xhci->devs[i];
>>
>> slit_id 0 is reserved and xhci->devs[0] is not used, so ne need to
>> check it.
>
> hmm... it's reserved for the HW, sure. Do you need to over allocate the
> array by 1 just to keep this first member unused? Couldn't you handle
> the +1/-1 (depending on the case) in xhci driver itself? Saves a bit of
> memory there.
>
There are many things that needs fixing in this area, but not in this patch
-Mathias
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-23 12:24 ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
2016-11-23 13:32 ` Guenter Roeck
2016-11-24 9:02 ` Felipe Balbi
@ 2016-11-24 19:58 ` Guenter Roeck
2016-11-28 20:24 ` Guenter Roeck
3 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2016-11-24 19:58 UTC (permalink / raw)
To: Mathias Nyman; +Cc: linux-usb, stable
On 11/23/2016 04:24 AM, Mathias Nyman wrote:
> the tt_info provided by a HS hub might be in use to by a child device
> Make sure we free the devices in the correct order.
>
> This is needed in special cases such as when xhci controller is
> reset when resuming from hibernate, and all virt_devices are freed.
>
> Also free the virt_devices starting from max slot_id as children
> more commonly have higher slot_id than parent.
>
> CC: <stable@vger.kernel.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>
> ---
>
> Guenter Roeck, does this work for you?
>
Sorry, I didn't have time this week. I'll test it first thing next week.
Guenter
> A rework of how tt_info is stored and used might be needed,
> but that will take some time and won't go to stable as easily.
> ---
> drivers/usb/host/xhci-mem.c | 38 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 6afe323..b3a5cd8 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -979,6 +979,40 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
> xhci->devs[slot_id] = NULL;
> }
>
> +/*
> + * Free a virt_device structure.
> + * If the virt_device added a tt_info (a hub) and has children pointing to
> + * that tt_info, then free the child first. Recursive.
> + * We can't rely on udev at this point to find child-parent relationships.
> + */
> +void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
> +{
> + struct xhci_virt_device *vdev;
> + struct list_head *tt_list_head;
> + struct xhci_tt_bw_info *tt_info, *next;
> + int i;
> +
> + vdev = xhci->devs[slot_id];
> + if (!vdev)
> + return;
> +
> + tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts);
> + list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
> + /* is this a hub device that added a tt_info to the tts list */
> + if (tt_info->slot_id == slot_id) {
> + /* are any devices using this tt_info? */
> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
> + vdev = xhci->devs[i];
> + if (vdev && (vdev->tt_info == tt_info))
> + xhci_free_virt_devices_depth_first(
> + xhci, i);
> + }
> + }
> + }
> + /* we are now at a leaf device */
> + xhci_free_virt_device(xhci, slot_id);
> +}
> +
> int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
> struct usb_device *udev, gfp_t flags)
> {
> @@ -1829,8 +1863,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
> }
> }
>
> - for (i = 1; i < MAX_HC_SLOTS; ++i)
> - xhci_free_virt_device(xhci, i);
> + for (i = HCS_MAX_SLOTS(xhci->hcs_params1); i > 0; i--)
> + xhci_free_virt_devices_depth_first(xhci, i);
>
> dma_pool_destroy(xhci->segment_pool);
> xhci->segment_pool = NULL;
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-23 12:24 ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
` (2 preceding siblings ...)
2016-11-24 19:58 ` Guenter Roeck
@ 2016-11-28 20:24 ` Guenter Roeck
2016-11-30 11:41 ` Mathias Nyman
3 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2016-11-28 20:24 UTC (permalink / raw)
To: Mathias Nyman; +Cc: linux-usb, stable
On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote:
> the tt_info provided by a HS hub might be in use to by a child device
> Make sure we free the devices in the correct order.
>
> This is needed in special cases such as when xhci controller is
> reset when resuming from hibernate, and all virt_devices are freed.
>
> Also free the virt_devices starting from max slot_id as children
> more commonly have higher slot_id than parent.
>
> CC: <stable@vger.kernel.org>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>
> ---
>
> Guenter Roeck, does this work for you?
>
Yes, it does.
Tested-by: Guenter Roeck <groeck@chromium.org>
Thanks,
Guenter
> A rework of how tt_info is stored and used might be needed,
> but that will take some time and won't go to stable as easily.
> ---
> drivers/usb/host/xhci-mem.c | 38 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 6afe323..b3a5cd8 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -979,6 +979,40 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
> xhci->devs[slot_id] = NULL;
> }
>
> +/*
> + * Free a virt_device structure.
> + * If the virt_device added a tt_info (a hub) and has children pointing to
> + * that tt_info, then free the child first. Recursive.
> + * We can't rely on udev at this point to find child-parent relationships.
> + */
> +void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
> +{
> + struct xhci_virt_device *vdev;
> + struct list_head *tt_list_head;
> + struct xhci_tt_bw_info *tt_info, *next;
> + int i;
> +
> + vdev = xhci->devs[slot_id];
> + if (!vdev)
> + return;
> +
> + tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts);
> + list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
> + /* is this a hub device that added a tt_info to the tts list */
> + if (tt_info->slot_id == slot_id) {
> + /* are any devices using this tt_info? */
> + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
> + vdev = xhci->devs[i];
> + if (vdev && (vdev->tt_info == tt_info))
> + xhci_free_virt_devices_depth_first(
> + xhci, i);
> + }
> + }
> + }
> + /* we are now at a leaf device */
> + xhci_free_virt_device(xhci, slot_id);
> +}
> +
> int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
> struct usb_device *udev, gfp_t flags)
> {
> @@ -1829,8 +1863,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
> }
> }
>
> - for (i = 1; i < MAX_HC_SLOTS; ++i)
> - xhci_free_virt_device(xhci, i);
> + for (i = HCS_MAX_SLOTS(xhci->hcs_params1); i > 0; i--)
> + xhci_free_virt_devices_depth_first(xhci, i);
>
> dma_pool_destroy(xhci->segment_pool);
> xhci->segment_pool = NULL;
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-28 20:24 ` Guenter Roeck
@ 2016-11-30 11:41 ` Mathias Nyman
2016-12-09 21:28 ` Guenter Roeck
0 siblings, 1 reply; 12+ messages in thread
From: Mathias Nyman @ 2016-11-30 11:41 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-usb, stable
On 28.11.2016 22:24, Guenter Roeck wrote:
> On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote:
>> the tt_info provided by a HS hub might be in use to by a child device
>> Make sure we free the devices in the correct order.
>>
>> This is needed in special cases such as when xhci controller is
>> reset when resuming from hibernate, and all virt_devices are freed.
>>
>> Also free the virt_devices starting from max slot_id as children
>> more commonly have higher slot_id than parent.
>>
>> CC: <stable@vger.kernel.org>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>
>> ---
>>
>> Guenter Roeck, does this work for you?
>>
> Yes, it does.
>
> Tested-by: Guenter Roeck <groeck@chromium.org>
>
> Thanks,
> Guenter
>
Thanks, I'll send it forward with proper Reported-by and Tested-by tags
after 4.10-rc1
-Mathias
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-11-30 11:41 ` Mathias Nyman
@ 2016-12-09 21:28 ` Guenter Roeck
2016-12-12 13:50 ` Mathias Nyman
0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2016-12-09 21:28 UTC (permalink / raw)
To: Mathias Nyman; +Cc: linux-usb, stable
On Wed, Nov 30, 2016 at 01:41:24PM +0200, Mathias Nyman wrote:
> On 28.11.2016 22:24, Guenter Roeck wrote:
> >On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote:
> >>the tt_info provided by a HS hub might be in use to by a child device
> >>Make sure we free the devices in the correct order.
> >>
> >>This is needed in special cases such as when xhci controller is
> >>reset when resuming from hibernate, and all virt_devices are freed.
> >>
> >>Also free the virt_devices starting from max slot_id as children
> >>more commonly have higher slot_id than parent.
> >>
> >>CC: <stable@vger.kernel.org>
> >>Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
> >>
> >>---
> >>
> >>Guenter Roeck, does this work for you?
> >>
> >Yes, it does.
> >
> >Tested-by: Guenter Roeck <groeck@chromium.org>
> >
> >Thanks,
> >Guenter
> >
>
> Thanks, I'll send it forward with proper Reported-by and Tested-by tags
> after 4.10-rc1
>
Do you have this patch sitting in some branch, by any chance ?
I would like to pick it up if possible.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
2016-12-09 21:28 ` Guenter Roeck
@ 2016-12-12 13:50 ` Mathias Nyman
0 siblings, 0 replies; 12+ messages in thread
From: Mathias Nyman @ 2016-12-12 13:50 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-usb, stable
On 09.12.2016 23:28, Guenter Roeck wrote:
> On Wed, Nov 30, 2016 at 01:41:24PM +0200, Mathias Nyman wrote:
>> On 28.11.2016 22:24, Guenter Roeck wrote:
>>> On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote:
>>>> the tt_info provided by a HS hub might be in use to by a child device
>>>> Make sure we free the devices in the correct order.
>>>>
>>>> This is needed in special cases such as when xhci controller is
>>>> reset when resuming from hibernate, and all virt_devices are freed.
>>>>
>>>> Also free the virt_devices starting from max slot_id as children
>>>> more commonly have higher slot_id than parent.
>>>>
>>>> CC: <stable@vger.kernel.org>
>>>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>>>>
>>>> ---
>>>>
>>>> Guenter Roeck, does this work for you?
>>>>
>>> Yes, it does.
>>>
>>> Tested-by: Guenter Roeck <groeck@chromium.org>
>>>
>>> Thanks,
>>> Guenter
>>>
>>
>> Thanks, I'll send it forward with proper Reported-by and Tested-by tags
>> after 4.10-rc1
>>
> Do you have this patch sitting in some branch, by any chance ?
> I would like to pick it up if possible.
>
Now in
git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git for-usb-linus
Branch is not very well tested yet
-Mathias
^ permalink raw reply [flat|nested] 12+ messages in thread