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

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

Merge "USB: ci13xxx: Fail EP HALT operation in suspend state"

parents ca75d06d d096e0b3
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -3234,6 +3234,13 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
				__func__);
				__func__);
		return -EAGAIN;
		return -EAGAIN;
	}
	}

	if (udc->suspended) {
		dev_err(udc->transceiver->dev,
			"%s: Unable to dequeue while suspended\n", __func__);
		return -EAGAIN;
	}

	spin_lock_irqsave(mEp->lock, flags);
	spin_lock_irqsave(mEp->lock, flags);
	/*
	/*
	 * Only ep0 IN is exposed to composite.  When a req is dequeued
	 * Only ep0 IN is exposed to composite.  When a req is dequeued
@@ -3300,6 +3307,7 @@ static int is_sps_req(struct ci13xxx_req *mReq)
static int ep_set_halt(struct usb_ep *ep, int value)
static int ep_set_halt(struct usb_ep *ep, int value)
{
{
	struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
	struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
	struct ci13xxx *udc = _udc;
	int direction, retval = 0;
	int direction, retval = 0;
	unsigned long flags;
	unsigned long flags;


@@ -3308,6 +3316,12 @@ static int ep_set_halt(struct usb_ep *ep, int value)
	if (ep == NULL || mEp->desc == NULL)
	if (ep == NULL || mEp->desc == NULL)
		return -EINVAL;
		return -EINVAL;


	if (udc->suspended) {
		dev_err(udc->transceiver->dev,
			"%s: Unable to halt EP while suspended\n", __func__);
		return -EINVAL;
	}

	spin_lock_irqsave(mEp->lock, flags);
	spin_lock_irqsave(mEp->lock, flags);


#ifndef STALL_IN
#ifndef STALL_IN