linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Wesley Cheng <wcheng@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 4.19 06/21] usb: dwc3: gadget: Ignore EP queue requests during bus reset
Date: Mon, 10 May 2021 14:03:18 +0200	[thread overview]
Message-ID: <20210510120318.GA3547@duo.ucw.cz> (raw)
In-Reply-To: <20210502140517.2719912-6-sashal@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

Hi!

> [ Upstream commit 71ca43f30df9c642970f9dc9b2d6f463f4967e7b ]
> 
> The current dwc3_gadget_reset_interrupt() will stop any active
> transfers, but only addresses blocking of EP queuing for while we are
> coming from a disconnected scenario, i.e. after receiving the disconnect
> event.  If the host decides to issue a bus reset on the device, the
> connected parameter will still be set to true, allowing for EP queuing
> to continue while we are disabling the functions.  To avoid this, set the
> connected flag to false until the stop active transfers is complete.

This is mismerged / crazy. Will probably break the driver completely.


> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2717,6 +2717,15 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
>  
>  	dwc->connected = true;
>  
> +	/*
> +	 * Ideally, dwc3_reset_gadget() would trigger the function
> +	 * drivers to stop any active transfers through ep disable.
> +	 * However, for functions which defer ep disable, such as mass
> +	 * storage, we will need to rely on the call to stop active
> +	 * transfers here, and avoid allowing of request queuing.
> +	 */
> +	dwc->connected = false;
> +
>  	/*
>  	 * WORKAROUND: DWC3 revisions <1.88a have an issue which
>  	 * would cause a missing Disconnect Event if there's a

See how connected = true is immediately overwritten? In mainline
= true assignment is done below, so it does not have this problem.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2021-05-10 12:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 14:04 [PATCH AUTOSEL 4.19 01/21] staging: wimax/i2400m: fix byte-order issue Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 4.19 02/21] crypto: api - check for ERR pointers in crypto_destroy_tfm() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 4.19 03/21] usb: gadget: uvc: add bInterval checking for HS mode Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 04/21] genirq/matrix: Prevent allocation counter corruption Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 05/21] usb: gadget: f_uac1: validate input parameters Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 06/21] usb: dwc3: gadget: Ignore EP queue requests during bus reset Sasha Levin
2021-05-10 12:03   ` Pavel Machek [this message]
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 07/21] usb: xhci: Fix port minor revision Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 08/21] PCI: PM: Do not read power state in pci_enable_device_flags() Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 09/21] x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 10/21] tee: optee: do not check memref size on return from Secure World Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 11/21] perf/arm_pmu_platform: Fix error handling Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 12/21] usb: xhci-mtk: support quirk to disable usb2 lpm Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 13/21] xhci: check control context is valid before dereferencing it Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 14/21] xhci: fix potential array out of bounds with several interrupters Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 15/21] spi: dln2: Fix reference leak to master Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 16/21] spi: omap-100k: " Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 17/21] platform/x86: thinkpad_acpi: Correct thermal sensor allocation Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 18/21] intel_th: Consistency and off-by-one fix Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 19/21] phy: phy-twl4030-usb: Fix possible use-after-free in twl4030_usb_remove() Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 20/21] crypto: omap-aes - Fix PM reference leak on omap-aes.c Sasha Levin
2021-05-02 14:05 ` [PATCH AUTOSEL 4.19 21/21] btrfs: convert logic BUG_ON()'s in replace_path to ASSERT()'s Sasha Levin

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=20210510120318.GA3547@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wcheng@codeaurora.org \
    /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).