linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bin Liu <b-liu@ti.com>
To: linux-usb@vger.kernel.org
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Apelete Seketeli <apelete@seketeli.net>,
	Hans de Goede <hdegoede@redhat.com>,
	Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Fabio Baltieri <fabio.baltieri@linaro.org>
Subject: [RFC] musb: removing otg protocol support
Date: Fri, 16 Mar 2018 14:09:51 -0500	[thread overview]
Message-ID: <20180316190951.GA23225@uda0271908> (raw)

Hi,

The kernel usb stack and musb drivers have gone through some changes in
the past several kernel versions, such as adding otg fsm, musb runtime
PM, and musb otg state moving from musb to musb->xceiv... I am wondering
if the otg protocol (hnp, srp) functions are already broken in the musb
drivers, but I don't have a platform to confirm it.

Do we know by any chance there is still someone using the musb otg
functions in any relatively newer kernel and we still need to support
otg in musb?  If not, I am thinking to clean up the otg functions in
musb drivers to make the code easy to read and maintain.

If we can make the conclusion to remove it, I propose the patch below
to disable musb otg first, then clean up the driver later if nobody
complains about the otg function removal.

Regards,
-Bin.

8<---

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 86066328e480..4403b4cdd0b8 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1865,11 +1865,8 @@ int musb_gadget_setup(struct musb *musb)
 
 	/* this "gadget" abstracts/virtualizes the controller */
 	musb->g.name = musb_driver_name;
-#if IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE)
-	musb->g.is_otg = 1;
-#elif IS_ENABLED(CONFIG_USB_MUSB_GADGET)
+	/* don't support otg protocols */
 	musb->g.is_otg = 0;
-#endif
 	INIT_DELAYED_WORK(&musb->gadget_work, musb_gadget_work);
 	musb_g_init_endpoints(musb);
 
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 069a1f775048..a3a5bd36ee98 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2795,7 +2795,8 @@ int musb_host_setup(struct musb *musb, int power_budget)
 		musb->xceiv->otg->state = OTG_STATE_A_IDLE;
 	}
 	otg_set_host(musb->xceiv->otg, &hcd->self);
-	hcd->self.otg_port = 1;
+	/* don't support otg protocols */
+	hcd->self.otg_port = 0;
 	musb->xceiv->otg->host = &hcd->self;
 	hcd->power_budget = 2 * (power_budget ? : 250);
 

             reply	other threads:[~2018-03-16 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 19:09 Bin Liu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-18 13:16 [RFC] musb: removing otg protocol support Greg Kroah-Hartman
2018-03-18 16:36 Hans de Goede
2018-03-19 14:20 Bin Liu
2018-03-19 14:24 Bin Liu
2018-03-19 14:40 Greg Kroah-Hartman
2018-03-19 14:59 Bin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180316190951.GA23225@uda0271908 \
    --to=b-liu@ti.com \
    --cc=apelete@seketeli.net \
    --cc=balbi@kernel.org \
    --cc=fabio.baltieri@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mian.yousaf.kaukab@stericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).