Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some small USB fixes for 6.1-rc7 that resolve some reported
problems:

- cdnsp driver fixes for reported problems

- dwc3 fixes for some small reported problems

- uvc gadget driver fix for reported regression

All of these have been in linux-next with no reported problems"

* tag 'usb-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: cdnsp: fix issue with ZLP - added TD_SIZE = 1
usb: dwc3: gadget: Clear ep descriptor last
usb: dwc3: exynos: Fix remove() function
usb: cdnsp: Fix issue with Clear Feature Halt Endpoint
usb: dwc3: gadget: Disable GUSB2PHYCFG.SUSPHY for End Transfer
usb: gadget: uvc: also use try_format in set_format

+46 -81
+4 -8
drivers/usb/cdns3/cdnsp-gadget.c
··· 600 600 601 601 trace_cdnsp_ep_halt(value ? "Set" : "Clear"); 602 602 603 - if (value) { 604 - ret = cdnsp_cmd_stop_ep(pdev, pep); 605 - if (ret) 606 - return ret; 603 + ret = cdnsp_cmd_stop_ep(pdev, pep); 604 + if (ret) 605 + return ret; 607 606 607 + if (value) { 608 608 if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_STOPPED) { 609 609 cdnsp_queue_halt_endpoint(pdev, pep->idx); 610 610 cdnsp_ring_cmd_db(pdev); ··· 613 613 614 614 pep->ep_state |= EP_HALTED; 615 615 } else { 616 - /* 617 - * In device mode driver can call reset endpoint command 618 - * from any endpoint state. 619 - */ 620 616 cdnsp_queue_reset_ep(pdev, pep->idx); 621 617 cdnsp_ring_cmd_db(pdev); 622 618 ret = cdnsp_wait_for_cmd_compl(pdev);
+12 -5
drivers/usb/cdns3/cdnsp-ring.c
··· 1763 1763 int trb_buff_len, 1764 1764 unsigned int td_total_len, 1765 1765 struct cdnsp_request *preq, 1766 - bool more_trbs_coming) 1766 + bool more_trbs_coming, 1767 + bool zlp) 1767 1768 { 1768 1769 u32 maxp, total_packet_count; 1770 + 1771 + /* Before ZLP driver needs set TD_SIZE = 1. */ 1772 + if (zlp) 1773 + return 1; 1769 1774 1770 1775 /* One TRB with a zero-length data packet. */ 1771 1776 if (!more_trbs_coming || (transferred == 0 && trb_buff_len == 0) || ··· 1965 1960 /* Set the TRB length, TD size, and interrupter fields. */ 1966 1961 remainder = cdnsp_td_remainder(pdev, enqd_len, trb_buff_len, 1967 1962 full_len, preq, 1968 - more_trbs_coming); 1963 + more_trbs_coming, 1964 + zero_len_trb); 1969 1965 1970 1966 length_field = TRB_LEN(trb_buff_len) | TRB_TD_SIZE(remainder) | 1971 1967 TRB_INTR_TARGET(0); ··· 2031 2025 2032 2026 if (preq->request.length > 0) { 2033 2027 remainder = cdnsp_td_remainder(pdev, 0, preq->request.length, 2034 - preq->request.length, preq, 1); 2028 + preq->request.length, preq, 1, 0); 2035 2029 2036 2030 length_field = TRB_LEN(preq->request.length) | 2037 2031 TRB_TD_SIZE(remainder) | TRB_INTR_TARGET(0); ··· 2082 2076 u32 ep_state = GET_EP_CTX_STATE(pep->out_ctx); 2083 2077 int ret = 0; 2084 2078 2085 - if (ep_state == EP_STATE_STOPPED || ep_state == EP_STATE_DISABLED) { 2079 + if (ep_state == EP_STATE_STOPPED || ep_state == EP_STATE_DISABLED || 2080 + ep_state == EP_STATE_HALTED) { 2086 2081 trace_cdnsp_ep_stopped_or_disabled(pep->out_ctx); 2087 2082 goto ep_stopped; 2088 2083 } ··· 2232 2225 /* Set the TRB length, TD size, & interrupter fields. */ 2233 2226 remainder = cdnsp_td_remainder(pdev, running_total, 2234 2227 trb_buff_len, td_len, preq, 2235 - more_trbs_coming); 2228 + more_trbs_coming, 0); 2236 2229 2237 2230 length_field = TRB_LEN(trb_buff_len) | TRB_INTR_TARGET(0); 2238 2231
+1 -10
drivers/usb/dwc3/dwc3-exynos.c
··· 37 37 struct regulator *vdd10; 38 38 }; 39 39 40 - static int dwc3_exynos_remove_child(struct device *dev, void *unused) 41 - { 42 - struct platform_device *pdev = to_platform_device(dev); 43 - 44 - platform_device_unregister(pdev); 45 - 46 - return 0; 47 - } 48 - 49 40 static int dwc3_exynos_probe(struct platform_device *pdev) 50 41 { 51 42 struct dwc3_exynos *exynos; ··· 133 142 struct dwc3_exynos *exynos = platform_get_drvdata(pdev); 134 143 int i; 135 144 136 - device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); 145 + of_platform_depopulate(&pdev->dev); 137 146 138 147 for (i = exynos->num_clks - 1; i >= 0; i--) 139 148 clk_disable_unprepare(exynos->clks[i]);
+8 -7
drivers/usb/dwc3/gadget.c
··· 291 291 * 292 292 * DWC_usb3 3.30a and DWC_usb31 1.90a programming guide section 3.2.2 293 293 */ 294 - if (dwc->gadget->speed <= USB_SPEED_HIGH) { 294 + if (dwc->gadget->speed <= USB_SPEED_HIGH || 295 + DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_ENDTRANSFER) { 295 296 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); 296 297 if (unlikely(reg & DWC3_GUSB2PHYCFG_SUSPHY)) { 297 298 saved_config |= DWC3_GUSB2PHYCFG_SUSPHY; ··· 1024 1023 reg &= ~DWC3_DALEPENA_EP(dep->number); 1025 1024 dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); 1026 1025 1027 - /* Clear out the ep descriptors for non-ep0 */ 1028 - if (dep->number > 1) { 1029 - dep->endpoint.comp_desc = NULL; 1030 - dep->endpoint.desc = NULL; 1031 - } 1032 - 1033 1026 dwc3_remove_requests(dwc, dep, -ESHUTDOWN); 1034 1027 1035 1028 dep->stream_capable = false; ··· 1037 1042 if (dep->flags & DWC3_EP_DELAY_STOP) 1038 1043 mask |= (DWC3_EP_DELAY_STOP | DWC3_EP_TRANSFER_STARTED); 1039 1044 dep->flags &= mask; 1045 + 1046 + /* Clear out the ep descriptors for non-ep0 */ 1047 + if (dep->number > 1) { 1048 + dep->endpoint.comp_desc = NULL; 1049 + dep->endpoint.desc = NULL; 1050 + } 1040 1051 1041 1052 return 0; 1042 1053 }
+21 -51
drivers/usb/gadget/function/uvc_v4l2.c
··· 199 199 * V4L2 ioctls 200 200 */ 201 201 202 - struct uvc_format { 203 - u8 bpp; 204 - u32 fcc; 205 - }; 206 - 207 - static struct uvc_format uvc_formats[] = { 208 - { 16, V4L2_PIX_FMT_YUYV }, 209 - { 0, V4L2_PIX_FMT_MJPEG }, 210 - }; 211 - 212 202 static int 213 203 uvc_v4l2_querycap(struct file *file, void *fh, struct v4l2_capability *cap) 214 204 { ··· 226 236 fmt->fmt.pix.field = V4L2_FIELD_NONE; 227 237 fmt->fmt.pix.bytesperline = video->bpp * video->width / 8; 228 238 fmt->fmt.pix.sizeimage = video->imagesize; 229 - fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; 230 - fmt->fmt.pix.priv = 0; 231 - 232 - return 0; 233 - } 234 - 235 - static int 236 - uvc_v4l2_set_format(struct file *file, void *fh, struct v4l2_format *fmt) 237 - { 238 - struct video_device *vdev = video_devdata(file); 239 - struct uvc_device *uvc = video_get_drvdata(vdev); 240 - struct uvc_video *video = &uvc->video; 241 - struct uvc_format *format; 242 - unsigned int imagesize; 243 - unsigned int bpl; 244 - unsigned int i; 245 - 246 - for (i = 0; i < ARRAY_SIZE(uvc_formats); ++i) { 247 - format = &uvc_formats[i]; 248 - if (format->fcc == fmt->fmt.pix.pixelformat) 249 - break; 250 - } 251 - 252 - if (i == ARRAY_SIZE(uvc_formats)) { 253 - uvcg_info(&uvc->func, "Unsupported format 0x%08x.\n", 254 - fmt->fmt.pix.pixelformat); 255 - return -EINVAL; 256 - } 257 - 258 - bpl = format->bpp * fmt->fmt.pix.width / 8; 259 - imagesize = bpl ? bpl * fmt->fmt.pix.height : fmt->fmt.pix.sizeimage; 260 - 261 - video->fcc = format->fcc; 262 - video->bpp = format->bpp; 263 - video->width = fmt->fmt.pix.width; 264 - video->height = fmt->fmt.pix.height; 265 - video->imagesize = imagesize; 266 - 267 - fmt->fmt.pix.field = V4L2_FIELD_NONE; 268 - fmt->fmt.pix.bytesperline = bpl; 269 - fmt->fmt.pix.sizeimage = imagesize; 270 239 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; 271 240 fmt->fmt.pix.priv = 0; 272 241 ··· 270 321 fmt->fmt.pix.priv = 0; 271 322 272 323 return 0; 324 + } 325 + 326 + static int 327 + uvc_v4l2_set_format(struct file *file, void *fh, struct v4l2_format *fmt) 328 + { 329 + struct video_device *vdev = video_devdata(file); 330 + struct uvc_device *uvc = video_get_drvdata(vdev); 331 + struct uvc_video *video = &uvc->video; 332 + int ret; 333 + 334 + ret = uvc_v4l2_try_format(file, fh, fmt); 335 + if (ret) 336 + return ret; 337 + 338 + video->fcc = fmt->fmt.pix.pixelformat; 339 + video->bpp = fmt->fmt.pix.bytesperline * 8 / video->width; 340 + video->width = fmt->fmt.pix.width; 341 + video->height = fmt->fmt.pix.height; 342 + video->imagesize = fmt->fmt.pix.sizeimage; 343 + 344 + return ret; 273 345 } 274 346 275 347 static int