	.file	"extr_hub.c_hub_port_reset.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"warm "
.LC1:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"only USB3 hub support warm reset\n"
	.section	.rodata.str1.1
.LC3:
	.string	"cannot %sreset (err = %d)\n"
.LC4:
	.string	"port_wait_reset: err = %d\n"
.LC5:
	.string	"hot reset failed, warm reset\n"
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"not enabled, trying %sreset again...\n"
	.align 8
.LC7:
	.string	"Cannot enable. Maybe the USB cable is bad?\n"
	.text
	.p2align 4
	.type	hub_port_reset, @function
hub_port_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, r8d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR 24[rsp], rdx
	movsx	rdx, esi
	mov	DWORD PTR 20[rsp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 24[rdi]
	mov	rdi, QWORD PTR [rdi]
	mov	rax, QWORD PTR -8[rax+rdx*8]
	mov	QWORD PTR 8[rsp], rax
	call	hub_is_superspeed@PLT
	test	eax, eax
	jne	.L2
	test	r13d, r13d
	jne	.L59
	lea	rdi, ehci_cf_port_reset_rwsem[rip]
	call	down_read@PLT
.L5:
	mov	esi, DWORD PTR 16[rbx]
	mov	edi, ebp
	call	clear_bit@PLT
	mov	eax, DWORD PTR PORT_RESET_TRIES[rip]
	test	eax, eax
	jle	.L6
	lea	rax, 48[rsp]
	xor	r14d, r14d
	mov	QWORD PTR 32[rsp], rax
	lea	rax, 52[rsp]
	mov	QWORD PTR 40[rsp], rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L60:
	test	r12d, r12d
	je	.L10
	test	r13d, r13d
	lea	rax, .LC0[rip]
	mov	ecx, r12d
	lea	rdx, .LC1[rip]
	lea	rsi, .LC3[rip]
	cmovne	rdx, rax
	mov	rax, QWORD PTR 8[rsp]
	lea	rdi, 4[rax]
	xor	eax, eax
	call	dev_err@PLT
.L12:
	mov	eax, r12d
	add	eax, DWORD PTR ENOTCONN[rip]
	je	.L14
	mov	eax, r12d
	add	eax, DWORD PTR ENODEV[rip]
	je	.L14
	mov	rax, QWORD PTR 8[rsp]
	test	r13d, r13d
	lea	rdx, .LC1[rip]
	lea	r15, 4[rax]
	lea	rax, .LC0[rip]
	cmovne	rdx, rax
.L19:
	xor	eax, eax
	lea	rsi, .LC6[rip]
	mov	rdi, r15
	call	dev_dbg@PLT
	mov	eax, DWORD PTR HUB_LONG_RESET_TIME[rip]
	add	r14d, 1
	cmp	DWORD PTR PORT_RESET_TRIES[rip], r14d
	mov	DWORD PTR 20[rsp], eax
	jle	.L21
.L20:
	test	r13d, r13d
	mov	edx, DWORD PTR USB_PORT_FEAT_BH_PORT_RESET[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	esi, ebp
	cmove	edx, DWORD PTR USB_PORT_FEAT_RESET[rip]
	call	set_port_feature@PLT
	mov	r12d, eax
	add	eax, DWORD PTR ENODEV[rip]
	jne	.L60
	test	r12d, r12d
	jne	.L12
.L15:
	xor	r12d, r12d
.L14:
	mov	rdi, QWORD PTR [rbx]
	mov	edx, DWORD PTR USB_PORT_FEAT_C_RESET[rip]
	mov	esi, ebp
	call	usb_clear_port_feature@PLT
	mov	rdi, QWORD PTR [rbx]
	call	hub_is_superspeed@PLT
	test	eax, eax
	je	.L17
	mov	edx, DWORD PTR USB_PORT_FEAT_C_BH_PORT_RESET[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	esi, ebp
	call	usb_clear_port_feature@PLT
	mov	edx, DWORD PTR USB_PORT_FEAT_C_PORT_LINK_STATE[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	esi, ebp
	call	usb_clear_port_feature@PLT
	cmp	QWORD PTR 24[rsp], 0
	je	.L18
	mov	edx, DWORD PTR USB_PORT_FEAT_C_CONNECTION[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	esi, ebp
	call	usb_clear_port_feature@PLT
.L18:
	mov	rcx, QWORD PTR 32[rsp]
	mov	rdx, QWORD PTR 40[rsp]
	mov	esi, ebp
	mov	rdi, rbx
	call	hub_port_status@PLT
	test	rax, rax
	js	.L17
	mov	edx, DWORD PTR 52[rsp]
	mov	esi, ebp
	mov	rdi, rbx
	call	hub_port_warm_reset_required@PLT
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR 8[rsp]
	lea	rdx, .LC0[rip]
	lea	r15, 4[rax]
	test	r13d, r13d
	jne	.L19
	lea	rsi, .LC5[rip]
	mov	rdi, r15
	xor	eax, eax
	mov	r13d, 1
	call	dev_dbg@PLT
	lea	rdx, .LC0[rip]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L2:
	test	r13d, r13d
	jne	.L5
	lea	rcx, 48[rsp]
	lea	rdx, 52[rsp]
	mov	esi, ebp
	mov	rdi, rbx
	call	hub_port_status@PLT
	test	rax, rax
	jne	.L5
	mov	edx, DWORD PTR 52[rsp]
	mov	esi, ebp
	mov	rdi, rbx
	xor	r13d, r13d
	call	hub_port_warm_reset_required@PLT
	test	rax, rax
	setne	r13b
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	mov	ecx, DWORD PTR 20[rsp]
	mov	rdx, QWORD PTR 24[rsp]
	mov	r8d, r13d
	mov	esi, ebp
	mov	rdi, rbx
	call	hub_port_wait_reset@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L15
	add	eax, DWORD PTR ENOTCONN[rip]
	je	.L14
	mov	eax, r12d
	add	eax, DWORD PTR ENODEV[rip]
	je	.L14
	mov	rdi, QWORD PTR 8[rbx]
	mov	edx, r12d
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	dev_dbg@PLT
	jmp	.L12
.L6:
	mov	rax, QWORD PTR 8[rsp]
	lea	r15, 4[rax]
	.p2align 4,,10
	.p2align 3
.L21:
	lea	rsi, .LC7[rip]
	mov	rdi, r15
	xor	eax, eax
	call	dev_err@PLT
.L17:
	test	r12d, r12d
	je	.L61
	mov	rdi, QWORD PTR 24[rsp]
	test	rdi, rdi
	je	.L27
	mov	esi, DWORD PTR USB_STATE_NOTATTACHED[rip]
	call	usb_set_device_state@PLT
.L27:
	mov	rdi, QWORD PTR [rbx]
	call	hub_is_superspeed@PLT
	test	eax, eax
	je	.L62
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L63
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L61:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR USB_PORT_QUIRK_FAST_ENUM[rip], eax
	jne	.L64
	mov	rax, QWORD PTR [rbx]
	mov	eax, DWORD PTR [rax]
	and	eax, DWORD PTR USB_QUIRK_HUB_SLOW_RESET[rip]
	cmp	eax, 1
	sbb	edi, edi
	and	edi, -100
	add	edi, 150
	call	msleep@PLT
.L24:
	mov	r14, QWORD PTR 24[rsp]
	test	r14, r14
	je	.L27
	mov	edi, DWORD PTR [r14]
	call	bus_to_hcd@PLT
	xor	esi, esi
	mov	rdi, r14
	mov	rbp, rax
	call	update_devnum@PLT
	mov	rax, QWORD PTR 0[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L28
	mov	rsi, r14
	mov	rdi, rbp
	call	rax
.L28:
	mov	rdi, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR USB_STATE_DEFAULT[rip]
	call	usb_set_device_state@PLT
	mov	rdi, QWORD PTR [rbx]
	call	hub_is_superspeed@PLT
	test	eax, eax
	jne	.L1
.L62:
	lea	rdi, ehci_cf_port_reset_rwsem[rip]
	call	up_read@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L59:
	mov	rdi, QWORD PTR 8[rbx]
	lea	rsi, .LC2[rip]
	call	dev_err@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L64:
	mov	esi, 12000
	mov	edi, 10000
	call	usleep_range@PLT
	jmp	.L24
.L63:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hub_port_reset, .-hub_port_reset
	.comm	ehci_cf_port_reset_rwsem,4,4
	.comm	USB_STATE_NOTATTACHED,4,4
	.comm	USB_STATE_DEFAULT,4,4
	.comm	USB_QUIRK_HUB_SLOW_RESET,4,4
	.comm	USB_PORT_QUIRK_FAST_ENUM,4,4
	.comm	USB_PORT_FEAT_RESET,4,4
	.comm	USB_PORT_FEAT_C_RESET,4,4
	.comm	USB_PORT_FEAT_C_PORT_LINK_STATE,4,4
	.comm	USB_PORT_FEAT_C_CONNECTION,4,4
	.comm	USB_PORT_FEAT_C_BH_PORT_RESET,4,4
	.comm	USB_PORT_FEAT_BH_PORT_RESET,4,4
	.comm	PORT_RESET_TRIES,4,4
	.comm	HUB_LONG_RESET_TIME,4,4
	.comm	ENOTCONN,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_hub.c_hub_port_reset.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"warm \000"
	.align	2
.LC1:
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"only USB3 hub support warm reset\012\000"
	.align	2
.LC3:
	.ascii	"cannot %sreset (err = %d)\012\000"
	.align	2
.LC4:
	.ascii	"port_wait_reset: err = %d\012\000"
	.align	2
.LC5:
	.ascii	"hot reset failed, warm reset\012\000"
	.align	2
.LC6:
	.ascii	"not enabled, trying %sreset again...\012\000"
	.align	2
.LC7:
	.ascii	"Cannot enable. Maybe the USB cable is bad?\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hub_port_reset, %function
hub_port_reset:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r1
	sub	sp, sp, #44
	ldr	r1, [r0, #12]
	str	r3, [sp, #16]
	ldr	r3, .L66
	sub	ip, r6, #-1073741823
	str	r2, [sp, #20]
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	ldr	r3, [r1, ip, lsl #2]
	mov	r5, r0
	ldr	r0, [r0]
	ldr	r7, [sp, #80]
	str	r3, [sp, #12]
	bl	hub_is_superspeed
	cmp	r0, #0
	bne	.L2
	cmp	r7, #0
	bne	.L59
	ldr	r0, .L66+4
	bl	down_read
.L5:
	ldr	fp, .L66+8
	mov	r0, r6
	ldr	r1, [r5, #8]
	bl	clear_bit
	ldr	r3, [fp]
	cmp	r3, #0
	ble	.L6
	mov	r8, #0
	ldr	r9, .L66+12
	b	.L20
.L60:
	cmp	r0, #0
	beq	.L10
	mov	r3, r0
	ldr	r1, .L66+16
	ldr	r0, [sp, #12]
	cmp	r7, #0
	ldr	r2, .L66+20
	add	r0, r0, #4
	movne	r2, r1
	ldr	r1, .L66+24
	bl	dev_err
	ldr	r10, .L66+28
.L12:
	ldr	r3, [r10]
	cmn	r4, r3
	beq	.L14
	ldr	r3, [r9]
	cmn	r4, r3
	beq	.L14
	ldr	r3, [sp, #12]
	cmp	r7, #0
	add	r10, r3, #4
	ldr	r3, .L66+16
	ldr	r2, .L66+20
	movne	r2, r3
.L19:
	ldr	r1, .L66+32
	mov	r0, r10
	bl	dev_dbg
	ldr	r2, .L66+36
	ldr	r1, [fp]
	ldr	r3, [r2]
	add	r8, r8, #1
	cmp	r1, r8
	str	r3, [sp, #16]
	ble	.L21
.L20:
	cmp	r7, #0
	ldrne	r3, .L66+40
	ldreq	r3, .L66+44
	mov	r1, r6
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	set_port_feature
	ldr	r3, [r9]
	mov	r4, r0
	cmn	r0, r3
	bne	.L60
	cmp	r0, #0
	bne	.L61
.L15:
	mov	r4, #0
.L14:
	ldr	r3, .L66+48
	mov	r1, r6
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	usb_clear_port_feature
	ldr	r0, [r5]
	bl	hub_is_superspeed
	cmp	r0, #0
	beq	.L17
	ldr	r3, .L66+52
	mov	r1, r6
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	usb_clear_port_feature
	ldr	r3, .L66+56
	mov	r1, r6
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	usb_clear_port_feature
	ldr	r3, [sp, #20]
	cmp	r3, #0
	beq	.L18
	ldr	r3, .L66+60
	mov	r1, r6
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	usb_clear_port_feature
.L18:
	mov	r1, r6
	mov	r0, r5
	add	r3, sp, #28
	add	r2, sp, #32
	bl	hub_port_status
	cmp	r0, #0
	blt	.L17
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [sp, #32]
	bl	hub_port_warm_reset_required
	cmp	r0, #0
	beq	.L17
	ldr	r3, [sp, #12]
	cmp	r7, #0
	ldrne	r2, .L66+16
	add	r10, r3, #4
	bne	.L19
	mov	r0, r10
	ldr	r1, .L66+64
	bl	dev_dbg
	mov	r7, #1
	ldr	r2, .L66+16
	b	.L19
.L2:
	cmp	r7, #0
	bne	.L5
	mov	r1, r6
	mov	r0, r5
	add	r3, sp, #28
	add	r2, sp, #32
	bl	hub_port_status
	cmp	r0, #0
	bne	.L5
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [sp, #32]
	bl	hub_port_warm_reset_required
	subs	r7, r0, #0
	movne	r7, #1
	b	.L5
.L10:
	mov	r1, r6
	mov	r0, r5
	ldr	r3, [sp, #16]
	ldr	r2, [sp, #20]
	str	r7, [sp]
	bl	hub_port_wait_reset
	subs	r4, r0, #0
	beq	.L15
	ldr	r10, .L66+28
	ldr	r3, [r10]
	cmn	r4, r3
	beq	.L14
	ldr	r3, [r9]
	cmn	r4, r3
	beq	.L14
	mov	r2, r4
	ldr	r1, .L66+68
	ldr	r0, [r5, #4]
	bl	dev_dbg
	b	.L12
.L61:
	ldr	r10, .L66+28
	b	.L12
.L6:
	ldr	r3, [sp, #12]
	add	r10, r3, #4
.L21:
	mov	r0, r10
	ldr	r1, .L66+72
	bl	dev_err
.L17:
	cmp	r4, #0
	beq	.L62
	ldr	r0, [sp, #20]
	cmp	r0, #0
	beq	.L27
	ldr	r3, .L66+76
	ldr	r1, [r3]
	bl	usb_set_device_state
.L27:
	ldr	r0, [r5]
	bl	hub_is_superspeed
	cmp	r0, #0
	beq	.L63
.L1:
	ldr	r3, .L66
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L64
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L62:
	ldr	r3, .L66+80
	ldr	r2, [sp, #12]
	ldr	r3, [r3]
	ldr	r2, [r2]
	tst	r2, r3
	bne	.L65
	ldr	r2, [r5]
	ldr	r3, .L66+84
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r2, r3
	moveq	r0, #50
	movne	r0, #150
	bl	msleep
.L24:
	ldr	r7, [sp, #20]
	cmp	r7, #0
	beq	.L27
	ldr	r0, [r7]
	bl	bus_to_hcd
	mov	r6, r0
	mov	r1, #0
	mov	r0, r7
	bl	update_devnum
	ldr	r3, [r6]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L28
	mov	r0, r6
	mov	r1, r7
	blx	r3
.L28:
	ldr	r3, .L66+88
	ldr	r0, [sp, #20]
	ldr	r1, [r3]
	bl	usb_set_device_state
	ldr	r0, [r5]
	bl	hub_is_superspeed
	cmp	r0, #0
	bne	.L1
.L63:
	ldr	r0, .L66+4
	bl	up_read
	b	.L1
.L59:
	ldr	r0, [r5, #4]
	ldr	r1, .L66+92
	bl	dev_err
	ldr	r3, .L66+96
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L65:
	ldr	r1, .L66+100
	ldr	r0, .L66+104
	bl	usleep_range
	b	.L24
.L64:
	bl	__stack_chk_fail
.L67:
	.align	2
.L66:
	.word	.LC8
	.word	ehci_cf_port_reset_rwsem
	.word	PORT_RESET_TRIES
	.word	ENODEV
	.word	.LC0
	.word	.LC1
	.word	.LC3
	.word	ENOTCONN
	.word	.LC6
	.word	HUB_LONG_RESET_TIME
	.word	USB_PORT_FEAT_BH_PORT_RESET
	.word	USB_PORT_FEAT_RESET
	.word	USB_PORT_FEAT_C_RESET
	.word	USB_PORT_FEAT_C_BH_PORT_RESET
	.word	USB_PORT_FEAT_C_PORT_LINK_STATE
	.word	USB_PORT_FEAT_C_CONNECTION
	.word	.LC5
	.word	.LC4
	.word	.LC7
	.word	USB_STATE_NOTATTACHED
	.word	USB_PORT_QUIRK_FAST_ENUM
	.word	USB_QUIRK_HUB_SLOW_RESET
	.word	USB_STATE_DEFAULT
	.word	.LC2
	.word	EINVAL
	.word	12000
	.word	10000
	.size	hub_port_reset, .-hub_port_reset
	.comm	ehci_cf_port_reset_rwsem,4,4
	.comm	USB_STATE_NOTATTACHED,4,4
	.comm	USB_STATE_DEFAULT,4,4
	.comm	USB_QUIRK_HUB_SLOW_RESET,4,4
	.comm	USB_PORT_QUIRK_FAST_ENUM,4,4
	.comm	USB_PORT_FEAT_RESET,4,4
	.comm	USB_PORT_FEAT_C_RESET,4,4
	.comm	USB_PORT_FEAT_C_PORT_LINK_STATE,4,4
	.comm	USB_PORT_FEAT_C_CONNECTION,4,4
	.comm	USB_PORT_FEAT_C_BH_PORT_RESET,4,4
	.comm	USB_PORT_FEAT_BH_PORT_RESET,4,4
	.comm	PORT_RESET_TRIES,4,4
	.comm	HUB_LONG_RESET_TIME,4,4
	.comm	ENOTCONN,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
