Commit cb2e5ee8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg KH:
 "Here are a number of small USB driver fixes for reported issues for
  6.11-rc3. Included in here are:

   - usb serial driver MODULE_DESCRIPTION() updates

   - usb serial driver fixes

   - typec driver fixes

   - usb-ip driver fix

   - gadget driver fixes

   - dt binding update

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

* tag 'usb-6.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: typec: ucsi: Fix a deadlock in ucsi_send_command_common()
  usb: typec: tcpm: avoid sink goto SNK_UNATTACHED state if not received source capability message
  usb: gadget: f_fs: pull out f->disable() from ffs_func_set_alt()
  usb: gadget: f_fs: restore ffs_func_disable() functionality
  USB: serial: debug: do not echo input by default
  usb: typec: tipd: Delete extra semi-colon
  usb: typec: tipd: Fix dereferencing freeing memory in tps6598x_apply_patch()
  usb: gadget: u_serial: Set start_delayed during suspend
  usb: typec: tcpci: Fix error code in tcpci_check_std_output_cap()
  usb: typec: fsa4480: Check if the chip is really there
  usb: gadget: core: Check for unset descriptor
  usb: vhci-hcd: Do not drop references before new references are gained
  usb: gadget: u_audio: Check return codes from usb_ep_enable and config_ep_by_speed.
  usb: gadget: midi2: Fix the response for FB info with block 0xff
  dt-bindings: usb: microchip,usb2514: Add USB2517 compatible
  USB: serial: garmin_gps: use struct_size() to allocate pkt
  USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by
  USB: serial: add missing MODULE_DESCRIPTION() macros
  USB: serial: spcp8x5: remove unused struct 'spcp8x5_usb_ctrl_arg'
parents 42b34a8d 65ba8cef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ properties:
      - usb424,2412
      - usb424,2417
      - usb424,2514
      - usb424,2517

  reg: true

+20 −12
Original line number Diff line number Diff line
@@ -3734,11 +3734,9 @@ static int ffs_func_set_alt(struct usb_function *f,
	if (alt > MAX_ALT_SETTINGS)
		return -EINVAL;

	if (alt != (unsigned)-1) {
	intf = ffs_func_revmap_intf(func, interface);
	if (intf < 0)
		return intf;
	}

	if (ffs->func)
		ffs_func_eps_disable(ffs->func);
@@ -3753,12 +3751,6 @@ static int ffs_func_set_alt(struct usb_function *f,
	if (ffs->state != FFS_ACTIVE)
		return -ENODEV;

	if (alt == (unsigned)-1) {
		ffs->func = NULL;
		ffs_event_add(ffs, FUNCTIONFS_DISABLE);
		return 0;
	}

	ffs->func = func;
	ret = ffs_func_eps_enable(func);
	if (ret >= 0) {
@@ -3770,7 +3762,23 @@ static int ffs_func_set_alt(struct usb_function *f,

static void ffs_func_disable(struct usb_function *f)
{
	ffs_func_set_alt(f, 0, (unsigned)-1);
	struct ffs_function *func = ffs_func_from_usb(f);
	struct ffs_data *ffs = func->ffs;

	if (ffs->func)
		ffs_func_eps_disable(ffs->func);

	if (ffs->state == FFS_DEACTIVATED) {
		ffs->state = FFS_CLOSING;
		INIT_WORK(&ffs->reset_work, ffs_reset_work);
		schedule_work(&ffs->reset_work);
		return;
	}

	if (ffs->state == FFS_ACTIVE) {
		ffs->func = NULL;
		ffs_event_add(ffs, FUNCTIONFS_DISABLE);
	}
}

static int ffs_func_setup(struct usb_function *f,
+15 −6
Original line number Diff line number Diff line
@@ -642,12 +642,21 @@ static void process_ump_stream_msg(struct f_midi2_ep *ep, const u32 *data)
		if (format)
			return; // invalid
		blk = (*data >> 8) & 0xff;
		if (blk >= ep->num_blks)
			return;
		if (blk == 0xff) {
			/* inquiry for all blocks */
			for (blk = 0; blk < ep->num_blks; blk++) {
				if (*data & UMP_STREAM_MSG_REQUEST_FB_INFO)
					reply_ump_stream_fb_info(ep, blk);
				if (*data & UMP_STREAM_MSG_REQUEST_FB_NAME)
					reply_ump_stream_fb_name(ep, blk);
			}
		} else if (blk < ep->num_blks) {
			/* only the specified block */
			if (*data & UMP_STREAM_MSG_REQUEST_FB_INFO)
				reply_ump_stream_fb_info(ep, blk);
			if (*data & UMP_STREAM_MSG_REQUEST_FB_NAME)
				reply_ump_stream_fb_name(ep, blk);
		}
		return;
	}
}
+34 −8
Original line number Diff line number Diff line
@@ -592,16 +592,25 @@ int u_audio_start_capture(struct g_audio *audio_dev)
	struct usb_ep *ep, *ep_fback;
	struct uac_rtd_params *prm;
	struct uac_params *params = &audio_dev->params;
	int req_len, i;
	int req_len, i, ret;

	prm = &uac->c_prm;
	dev_dbg(dev, "start capture with rate %d\n", prm->srate);
	ep = audio_dev->out_ep;
	config_ep_by_speed(gadget, &audio_dev->func, ep);
	ret = config_ep_by_speed(gadget, &audio_dev->func, ep);
	if (ret < 0) {
		dev_err(dev, "config_ep_by_speed for out_ep failed (%d)\n", ret);
		return ret;
	}

	req_len = ep->maxpacket;

	prm->ep_enabled = true;
	usb_ep_enable(ep);
	ret = usb_ep_enable(ep);
	if (ret < 0) {
		dev_err(dev, "usb_ep_enable failed for out_ep (%d)\n", ret);
		return ret;
	}

	for (i = 0; i < params->req_number; i++) {
		if (!prm->reqs[i]) {
@@ -629,9 +638,18 @@ int u_audio_start_capture(struct g_audio *audio_dev)
		return 0;

	/* Setup feedback endpoint */
	config_ep_by_speed(gadget, &audio_dev->func, ep_fback);
	ret = config_ep_by_speed(gadget, &audio_dev->func, ep_fback);
	if (ret < 0) {
		dev_err(dev, "config_ep_by_speed in_ep_fback failed (%d)\n", ret);
		return ret; // TODO: Clean up out_ep
	}

	prm->fb_ep_enabled = true;
	usb_ep_enable(ep_fback);
	ret = usb_ep_enable(ep_fback);
	if (ret < 0) {
		dev_err(dev, "usb_ep_enable failed for in_ep_fback (%d)\n", ret);
		return ret; // TODO: Clean up out_ep
	}
	req_len = ep_fback->maxpacket;

	req_fback = usb_ep_alloc_request(ep_fback, GFP_ATOMIC);
@@ -687,13 +705,17 @@ int u_audio_start_playback(struct g_audio *audio_dev)
	struct uac_params *params = &audio_dev->params;
	unsigned int factor;
	const struct usb_endpoint_descriptor *ep_desc;
	int req_len, i;
	int req_len, i, ret;
	unsigned int p_pktsize;

	prm = &uac->p_prm;
	dev_dbg(dev, "start playback with rate %d\n", prm->srate);
	ep = audio_dev->in_ep;
	config_ep_by_speed(gadget, &audio_dev->func, ep);
	ret = config_ep_by_speed(gadget, &audio_dev->func, ep);
	if (ret < 0) {
		dev_err(dev, "config_ep_by_speed for in_ep failed (%d)\n", ret);
		return ret;
	}

	ep_desc = ep->desc;
	/*
@@ -720,7 +742,11 @@ int u_audio_start_playback(struct g_audio *audio_dev)
	uac->p_residue_mil = 0;

	prm->ep_enabled = true;
	usb_ep_enable(ep);
	ret = usb_ep_enable(ep);
	if (ret < 0) {
		dev_err(dev, "usb_ep_enable failed for in_ep (%d)\n", ret);
		return ret;
	}

	for (i = 0; i < params->req_number; i++) {
		if (!prm->reqs[i]) {
+1 −0
Original line number Diff line number Diff line
@@ -1441,6 +1441,7 @@ void gserial_suspend(struct gserial *gser)
	spin_lock(&port->port_lock);
	spin_unlock(&serial_port_lock);
	port->suspended = true;
	port->start_delayed = true;
	spin_unlock_irqrestore(&port->port_lock, flags);
}
EXPORT_SYMBOL_GPL(gserial_suspend);
Loading