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

Commit 01f4fd2a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'fixes-for-v4.3-rc3' of...

Merge tag 'fixes-for-v4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.3-rc3

Here's the second pull request for current -rc cycle.

A few fixes on dummy_hcd which have been around for
longer than they should be.

MUSB got a couple fixes, the most important of which
is a fix to DMA channel teardown on AM335x devices.

And DWC3 got a minor fix for when using RT-enabled
kernels.
parents ea934651 a66c275b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2665,8 +2665,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
	int				i;
	irqreturn_t			ret = IRQ_NONE;

	spin_lock(&dwc->lock);

	for (i = 0; i < dwc->num_event_buffers; i++) {
		irqreturn_t status;

@@ -2675,8 +2673,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
			ret = status;
	}

	spin_unlock(&dwc->lock);

	return ret;
}

+11 −0
Original line number Diff line number Diff line
@@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
		ep->udc = udc;
		INIT_LIST_HEAD(&ep->queue);

		if (ep->index == 0) {
			ep->ep.caps.type_control = true;
		} else {
			ep->ep.caps.type_iso = ep->can_isoc;
			ep->ep.caps.type_bulk = true;
			ep->ep.caps.type_int = true;
		}

		ep->ep.caps.dir_in = true;
		ep->ep.caps.dir_out = true;

		if (i)
			list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);

+1 −2
Original line number Diff line number Diff line
@@ -324,7 +324,6 @@ static void bdc_mem_free(struct bdc *bdc)
				bdc->scratchpad.buff, bdc->scratchpad.sp_dma);

	/* Destroy the dma pools */
	if (bdc->bd_table_pool)
	dma_pool_destroy(bdc->bd_table_pool);

	/* Free the bdc_ep array */
+30 −16
Original line number Diff line number Diff line
@@ -1348,6 +1348,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
{
	struct dummy		*dum = dum_hcd->dum;
	struct dummy_request	*req;
	int			sent = 0;

top:
	/* if there's no request queued, the device is NAKing; return */
@@ -1385,12 +1386,15 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
			if (len == 0)
				break;

			/* use an extra pass for the final short packet */
			if (len > ep->ep.maxpacket) {
			/* send multiple of maxpacket first, then remainder */
			if (len >= ep->ep.maxpacket) {
				is_short = 0;
				if (len % ep->ep.maxpacket)
					rescan = 1;
				len -= (len % ep->ep.maxpacket);
				len -= len % ep->ep.maxpacket;
			} else {
				is_short = 1;
			}
			is_short = (len % ep->ep.maxpacket) != 0;

			len = dummy_perform_transfer(urb, req, len);

@@ -1399,6 +1403,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
				req->req.status = len;
			} else {
				limit -= len;
				sent += len;
				urb->actual_length += len;
				req->req.actual += len;
			}
@@ -1421,7 +1426,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
					*status = -EOVERFLOW;
				else
					*status = 0;
			} else if (!to_host) {
			} else {
				*status = 0;
				if (host_len > dev_len)
					req->req.status = -EOVERFLOW;
@@ -1429,16 +1434,25 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
					req->req.status = 0;
			}

		/* many requests terminate without a short packet */
		/*
		 * many requests terminate without a short packet.
		 * send a zlp if demanded by flags.
		 */
		} else {
			if (req->req.length == req->req.actual
					&& !req->req.zero)
			if (req->req.length == req->req.actual) {
				if (req->req.zero && to_host)
					rescan = 1;
				else
					req->req.status = 0;
			if (urb->transfer_buffer_length == urb->actual_length
					&& !(urb->transfer_flags
						& URB_ZERO_PACKET))
			}
			if (urb->transfer_buffer_length == urb->actual_length) {
				if (urb->transfer_flags & URB_ZERO_PACKET &&
				    !to_host)
					rescan = 1;
				else
					*status = 0;
			}
		}

		/* device side completion --> continuable */
		if (req->req.status != -EINPROGRESS) {
@@ -1460,7 +1474,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
		if (rescan)
			goto top;
	}
	return limit;
	return sent;
}

static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep)
@@ -1890,7 +1904,7 @@ static void dummy_timer(unsigned long _dum_hcd)
		default:
treat_control_like_bulk:
			ep->last_io = jiffies;
			total = transfer(dum_hcd, urb, ep, limit, &status);
			total -= transfer(dum_hcd, urb, ep, limit, &status);
			break;
		}

+1 −2
Original line number Diff line number Diff line
@@ -2117,7 +2117,6 @@ static int gr_remove(struct platform_device *pdev)
		return -EBUSY;

	gr_dfs_delete(dev);
	if (dev->desc_pool)
	dma_pool_destroy(dev->desc_pool);
	platform_set_drvdata(pdev, NULL);

Loading