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

Commit 22dc36df authored by Jack Pham's avatar Jack Pham Committed by Krishna Kurapati
Browse files

usb: gadget: qdss: Don't clear debug_inface_enabled upon unbind



The debug_inface_enabled flag is used to enable the additional
control interface.  This is usually set by userspace prior to
creating a ConfigFS configuration.  However, currently the flag
is automatically cleared whenever the function is unbound.
This will result in incorrect enumeration if userspace attempts
to rebind the ConfigFS gadget without resetting the flag.

Instead, clear the flag only from qdss_free_func() which is
called when the QDSS instance is removed from the config.  When
it is re-added upon composition switch it is reasonable to
expect that userspace will properly set the flag again if needed.

Change-Id: I3f961b5226c5270f23140c5999d776e83b7e9b15
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
Signed-off-by: default avatarKrishna Kurapati <quic_kriskura@quicinc.com>
parent 20f6203c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -503,8 +503,6 @@ static void qdss_unbind(struct usb_configuration *c, struct usb_function *f)
	qdss_string_defs[QDSS_DATA_IDX].id = 0;
	qdss_string_defs[QDSS_CTRL_IDX].id = 0;

	qdss->debug_inface_enabled = 0;

	clear_eps(f);
	clear_desc(gadget, f);
}
@@ -981,7 +979,9 @@ static void qdss_cleanup(void)

static void qdss_free_func(struct usb_function *f)
{
	/* Do nothing as usb_qdss_alloc() doesn't alloc anything. */
	struct f_qdss *qdss = func_to_qdss(f);

	qdss->debug_inface_enabled = false;
}

static inline struct usb_qdss_opts *to_f_qdss_opts(struct config_item *item)