Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3761426pxt; Tue, 10 Aug 2021 10:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRDz9hYIjf64f2N8vZL4iPWXNFy3SJC7aKoPc9WaO2+S6UDOgwWxHYmNHgEjqze8B+AOW2 X-Received: by 2002:a17:906:551:: with SMTP id k17mr12350944eja.391.1628617348053; Tue, 10 Aug 2021 10:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617348; cv=none; d=google.com; s=arc-20160816; b=szqIBEdNJbtx2AQGIQBaYE7onjgvCjcCEJ84EBfLOBE0wkM3i7SfViM6dVHsywtQne 5ygtV729cfr02+LgJ78164kIuL+X9QPF7H4wTiqR+2i15T3X68LHtyHfO+67nBUkVFWJ qHYk4k99UxvaAs2cZ2FtJlHwaYCvBYWD4PfPsi2i0H9l932cpTwyt2PCUbaxqT3PAg8w sbpOzhl3y3q+yDTIL5yKb+P0dmkKyRs6CkbbcK4iEH5tSFZ+qj8dLBv3gqNWcn1UNmZB qPe0qEpZmM7eklDhZW2qljPMRVog21wicA+9w0b2eyop0cIMkf/blaK3DVUmtlasK2f/ TSqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=szG6hkca/UnkusPQlWemzKoEc4E9Pm1R5O73EwxUNjA=; b=0GK4yDENMzugFp7gGmew5kDW+YhNhBw2at/jC+3mYVWjOP3CJUlKeiSCnV0yllat1m 8XUxn8HcpHXt26cQOItZuFjXm4iY2LcaFyxuuWRP36GdksjWc9l+uRZPNpXVNBqeDcXP po57dCD3ezlurmZ+q5+KIHOjB1T4ic497Y0Bt485u3RY38VruM/FnxfsZMclqumwRpvw 21kxETRm41FaNfPwrVZZnnTzJL1qyakJ4W7Dk9/pfy84qoB5wRKnekYM1awHoVWDhipw ipiOhTIe1dTUWZUpkBLjWXIpDBy0+FHcwRpfWS3QVpn29/tfUsWgJwhFcSTRDBp0s+kM VYyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d3ytQYqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si22777756edc.478.2021.08.10.10.42.03; Tue, 10 Aug 2021 10:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d3ytQYqk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233718AbhHJRhS (ORCPT + 99 others); Tue, 10 Aug 2021 13:37:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:42218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233687AbhHJRfk (ORCPT ); Tue, 10 Aug 2021 13:35:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 10A396112D; Tue, 10 Aug 2021 17:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616908; bh=g6u9MC6VB7YyB0JK8nbLe/q2Qem+gXZ8+qzTdGX5y/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d3ytQYqkOIcP0WaiCFQ14wRXHleDSV+abv//XMMAh0mgRKl5fYnWG35h9wBHePlcv K4/nRcSjR9cO2Ir4YCzvPz+shuXn5atntmk/nUxzwx6FC2lOnr7VthLVluanYIdZ1c 5DCnz1iW7CyKE5Zk/o/kb93zv8wQui+cQNt6Uz6M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pawel Laszczak , Peter Chen Subject: [PATCH 5.4 44/85] usb: cdns3: Fixed incorrect gadget state Date: Tue, 10 Aug 2021 19:30:17 +0200 Message-Id: <20210810172949.730043782@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pawel Laszczak commit aa35772f61752d4c636d46be51a4f7ca6c029ee6 upstream. For delayed status phase, the usb_gadget->state was set to USB_STATE_ADDRESS and it has never been updated to USB_STATE_CONFIGURED. Patch updates the gadget state to correct USB_STATE_CONFIGURED. As a result of this bug the controller was not able to enter to Test Mode while using MSC function. Cc: Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20210623070247.46151-1-pawell@gli-login.cadence.com Signed-off-by: Peter Chen Signed-off-by: Greg Kroah-Hartman --- drivers/usb/cdns3/ep0.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/cdns3/ep0.c +++ b/drivers/usb/cdns3/ep0.c @@ -736,6 +736,7 @@ static int cdns3_gadget_ep0_queue(struct request->actual = 0; priv_dev->status_completion_no_call = true; priv_dev->pending_status_request = request; + usb_gadget_set_state(&priv_dev->gadget, USB_STATE_CONFIGURED); spin_unlock_irqrestore(&priv_dev->lock, flags); /*