Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0980ee3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: u_bam_data: Reset DBM only if USB request was dequeued"

parents 56446fa5 df86e172
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1216,7 +1216,7 @@ static void reset_pipe_for_resume(struct usb_bam_pipe_connect *pipe_connect)
		pr_err("%s failed to reset the IPA pipe\n", __func__);
		return;
	}

	pr_debug("%s: USB/IPA pipes reset after resume\n", __func__);
}

/* Stop PROD transfers in case they were started */
+12 −1
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ struct bam_data_ch_info {
	unsigned int		rx_flow_control_triggered;
	/* used for RNDIS/ECM network inteface based design */
	atomic_t		is_net_interface_up;
	bool			tx_req_dequeued;
};

static struct work_struct *rndis_conn_w;
@@ -640,6 +641,7 @@ static void bam_data_stop_endless_rx(struct bam_data_port *port)

	spin_unlock_irqrestore(&port->port_lock, flags);
}

static void bam_data_stop_endless_tx(struct bam_data_port *port)
{
	struct bam_data_ch_info *d = &port->data_ch;
@@ -653,6 +655,7 @@ static void bam_data_stop_endless_tx(struct bam_data_port *port)
		return;
	}
	ep = port->port_usb->in;
	d->tx_req_dequeued = true;
	spin_unlock_irqrestore(&port->port_lock, flags);

	pr_debug("%s: dequeue\n", __func__);
@@ -2031,8 +2034,15 @@ static void bam2bam_data_resume_work(struct work_struct *w)
	}

	if (d->trans == USB_GADGET_XPORT_BAM2BAM_IPA) {
		/*
		 * If usb_req was dequeued as part of bus suspend then
		 * corresponding DBM EP should also be reset.
		 * There is a possbility that usb_bam may not have dequeued the
		 * request in case of quick back to back usb bus suspend resume.
		 */
		if (gadget_is_dwc3(gadget) &&
			msm_dwc3_reset_ep_after_lpm(gadget)) {
			msm_dwc3_reset_ep_after_lpm(gadget) &&
					d->tx_req_dequeued) {
				configure_usb_data_fifo(d->src_bam_idx,
					port->port_usb->out,
					d->src_pipe_type);
@@ -2043,6 +2053,7 @@ static void bam2bam_data_resume_work(struct work_struct *w)
				msm_dwc3_reset_dbm_ep(port->port_usb->in);
				spin_lock_irqsave(&port->port_lock, flags);
		}
		d->tx_req_dequeued = false;
		usb_bam_resume(&d->ipa_params);
	}
exit: