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

Commit a18edb25 authored by Srinivasarao Pathipati's avatar Srinivasarao Pathipati
Browse files

Reverts below USB and netfilter patches



bcbaf126 UPSTREAM: usb: dwc3: Try usb-role-switch first in dwc3_drd_init
4ccf7afa usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
a5bdea59 usb: dwc3: gadget: Don't modify GEVNTCOUNT in pullup()
67bf926f usb: dwc3: gadget: Refactor pullup()
24e4f630 usb: dwc3: gadget: Prevent repeat pullup()
62b6cbc5 usb: dwc3: Issue core soft reset before enabling run/stop
e24f90d7 usb: dwc3: gadget: Avoid starting DWC3 gadget during UDC unbind
d288c638 usb: dwc3: disable USB core PHY management
36f7b71f netfilter: nf_conntrack_irc: Fix forged IP logic
d0a24bc8 netfilter: nf_conntrack_irc: Tighten matching on DCC message.

Change-Id: Ic2e52fe1a18c7643d001f408a0442b99d1cf3d6b
Signed-off-by: default avatarSrinivasarao Pathipati <quic_c_spathi@quicinc.com>
parent 0ce03d16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type)
 * dwc3_core_soft_reset - Issues core soft reset and PHY reset
 * @dwc: pointer to our context structure
 */
int dwc3_core_soft_reset(struct dwc3 *dwc)
static int dwc3_core_soft_reset(struct dwc3 *dwc)
{
	u32		reg;
	int		retries = 1000;
+0 −4
Original line number Diff line number Diff line
@@ -998,7 +998,6 @@ struct dwc3_scratchpad_array {
 * @tx_max_burst_prd: max periodic ESS transmit burst size
 * @hsphy_interface: "utmi" or "ulpi"
 * @connected: true when we're connected to a host, false otherwise
 * @softconnect: true when gadget connect is called, false when disconnect runs
 * @delayed_status: true when gadget driver asks for delayed status
 * @ep0_bounced: true when we used bounce buffer
 * @ep0_expect_in: true when we expect a DATA IN transfer
@@ -1203,7 +1202,6 @@ struct dwc3 {
	const char		*hsphy_interface;

	unsigned		connected:1;
	unsigned		softconnect:1;
	unsigned		delayed_status:1;
	unsigned		ep0_bounced:1;
	unsigned		ep0_expect_in:1;
@@ -1428,8 +1426,6 @@ bool dwc3_has_imod(struct dwc3 *dwc);
int dwc3_event_buffers_setup(struct dwc3 *dwc);
void dwc3_event_buffers_cleanup(struct dwc3 *dwc);

int dwc3_core_soft_reset(struct dwc3 *dwc);

#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc);
void dwc3_host_exit(struct dwc3 *dwc);
+6 −5
Original line number Diff line number Diff line
@@ -566,15 +566,16 @@ int dwc3_drd_init(struct dwc3 *dwc)
{
	int ret, irq;

	if (ROLE_SWITCH &&
	    device_property_read_bool(dwc->dev, "usb-role-switch"))
		return dwc3_setup_role_switch(dwc);

	dwc->edev = dwc3_get_extcon(dwc);
	if (IS_ERR(dwc->edev))
		return PTR_ERR(dwc->edev);

	if (dwc->edev) {
	if (ROLE_SWITCH &&
	    device_property_read_bool(dwc->dev, "usb-role-switch")) {
		ret = dwc3_setup_role_switch(dwc);
		if (ret < 0)
			return ret;
	} else if (dwc->edev) {
		dwc->edev_nb.notifier_call = dwc3_drd_notifier;
		ret = extcon_register_notifier(dwc->edev, EXTCON_USB_HOST,
					       &dwc->edev_nb);
+38 −43
Original line number Diff line number Diff line
@@ -2008,42 +2008,14 @@ static void dwc3_gadget_disable_irq(struct dwc3 *dwc);
static void __dwc3_gadget_stop(struct dwc3 *dwc);
static int __dwc3_gadget_start(struct dwc3 *dwc);

static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc)
{
	unsigned long flags;

	spin_lock_irqsave(&dwc->lock, flags);
	dwc->connected = false;

	/*
	 * In the Synopsys DesignWare Cores USB3 Databook Rev. 3.30a
	 * Section 4.1.8 Table 4-7, it states that for a device-initiated
	 * disconnect, the SW needs to ensure that it sends "a DEPENDXFER
	 * command for any active transfers" before clearing the RunStop
	 * bit.
	 */
	dwc3_stop_active_transfers(dwc);
	__dwc3_gadget_stop(dwc);
	spin_unlock_irqrestore(&dwc->lock, flags);

	/*
	 * Note: if the GEVNTCOUNT indicates events in the event buffer, the
	 * driver needs to acknowledge them before the controller can halt.
	 * Simply let the interrupt handler acknowledges and handle the
	 * remaining event generated by the controller while polling for
	 * DSTS.DEVCTLHLT.
	 */
	return dwc3_gadget_run_stop(dwc, false, false);
}

static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
{
	struct dwc3		*dwc = gadget_to_dwc(g);
	unsigned long		flags;
	int			ret;

	is_on = !!is_on;

	dwc->softconnect = is_on;
	/*
	 * Per databook, when we want to stop the gadget, if a control transfer
	 * is still in process, complete it and get the core into setup phase.
@@ -2079,27 +2051,50 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
		return 0;
	}

	if (dwc->pullups_connected == is_on) {
		pm_runtime_put(dwc->dev);
		return 0;
	}
	/*
	 * Synchronize and disable any further event handling while controller
	 * is being enabled/disabled.
	 */
	disable_irq(dwc->irq_gadget);

	spin_lock_irqsave(&dwc->lock, flags);

	if (!is_on) {
		ret = dwc3_gadget_soft_disconnect(dwc);
	} else {
		u32 count;

		dwc->connected = false;
		/*
		 * In the Synopsys DWC_usb31 1.90a programming guide section
		 * 4.1.9, it specifies that for a reconnect after a
		 * device-initiated disconnect requires a core soft reset
		 * (DCTL.CSftRst) before enabling the run/stop bit.
		 * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a
		 * Section 4.1.8 Table 4-7, it states that for a device-initiated
		 * disconnect, the SW needs to ensure that it sends "a DEPENDXFER
		 * command for any active transfers" before clearing the RunStop
		 * bit.
		 */
		dwc3_core_soft_reset(dwc);
		dwc3_stop_active_transfers(dwc);
		__dwc3_gadget_stop(dwc);

		dwc3_event_buffers_setup(dwc);
		/*
		 * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a
		 * Section 1.3.4, it mentions that for the DEVCTRLHLT bit, the
		 * "software needs to acknowledge the events that are generated
		 * (by writing to GEVNTCOUNTn) while it is waiting for this bit
		 * to be set to '1'."
		 */
		count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0));
		count &= DWC3_GEVNTCOUNT_MASK;
		if (count > 0) {
			dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), count);
			dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %
						dwc->ev_buf->length;
		}
	} else {
		__dwc3_gadget_start(dwc);
		ret = dwc3_gadget_run_stop(dwc, true, false);
	}

	ret = dwc3_gadget_run_stop(dwc, is_on, false);
	spin_unlock_irqrestore(&dwc->lock, flags);
	enable_irq(dwc->irq_gadget);

	pm_runtime_put(dwc->dev);

	return ret;
@@ -3796,7 +3791,7 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
{
	int			ret;

	if (!dwc->gadget_driver || !dwc->softconnect)
	if (!dwc->gadget_driver)
		return 0;

	ret = __dwc3_gadget_start(dwc);
+0 −10
Original line number Diff line number Diff line
@@ -9,13 +9,8 @@

#include <linux/platform_device.h>

#include "../host/xhci-plat.h"
#include "core.h"

static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
	.quirks = XHCI_SKIP_PHY_INIT,
};

static int dwc3_host_get_irq(struct dwc3 *dwc)
{
	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
@@ -90,11 +85,6 @@ int dwc3_host_init(struct dwc3 *dwc)
		goto err;
	}

	ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
					sizeof(dwc3_xhci_plat_priv));
	if (ret)
		goto err;

	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));

	if (dwc->usb3_lpm_capable)
Loading