Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3432072imu; Sun, 11 Nov 2018 14:59:28 -0800 (PST) X-Google-Smtp-Source: AJdET5fyhbp0uc/89ioDspNvkp8GkCD59bmdUF9bGRDoRPRDr3CViTGlJLonvcLzaEe6vda5J+Cs X-Received: by 2002:a62:37c7:: with SMTP id e190-v6mr17473262pfa.145.1541977168121; Sun, 11 Nov 2018 14:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977168; cv=none; d=google.com; s=arc-20160816; b=gPT/8ZXO7jzUmVKuyyS/P+94lGxc6p/cZVU9WFPH6VDZRBlHgt4HiQxc1fbzZ7OhUT AFJu6SyGlsA0xnLVRPDOY/PL30VYVpmTM+mK8R0ifLb4vNlvNtssXBWQwXLD4l6rtlQ9 4Rl5DMOolxQTv8Um4LeW2Q8GhpbPtsZBLfHc/6kYQ92qrq6EoVCsg19MC55orI5esgfP +rh6c2HUFyF50s+CSZKuYfgwQPPtHFs0DvspaxD3FhgYps5CnGwRgg07t70s1JKVcLPg APGaugKDpM38EyfeFCBruIlG6qJkfT2d3oON3IZbfw16P+cGbPE7mhvCzr2d9NjHhrHp 2OkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9XebuffXkQh7Bq1n3pin14eH2XjdkxNaTBdobZsHxU8=; b=Q+hwR0kE4ltddaonzk0WxSqXHPVh84n9WLbNcZ0DilXacYI+tQt/QpKRe1Cgf2gyCy PWgjmahlm2A5LyP/MHNcNUcNtmOgY16c1tXZLTjR5It+jfk7jrBAWweomR9WwE5AeFic KyXgPQwn67TY1fPbYTOHgkfU4EEEl6WV0zfSDZTj9nI2fLTQeFwonwgnqMcSj++VR+nQ Iqtrh08MYIVvQZFbc39c2rrTBAlYLKwcZ9Jw2Kpbl8TSevAJJdHjPPTf8WbLMr9s7dP8 DME5pujc5OMMLy6TsRz2oNoknN5jI6UKtN1epNLV71+ODZ3KdGx5E3loG7bQhIcoChXN 8S8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RoTqCh8X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6-v6si15773133plh.197.2018.11.11.14.59.13; Sun, 11 Nov 2018 14:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RoTqCh8X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403770AbeKLIWk (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403752AbeKLIWj (ORCPT ); Mon, 12 Nov 2018 03:22:39 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A5B92154B; Sun, 11 Nov 2018 22:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975562; bh=Zz5SfDYv0JeN9jjwIG7NIsidNWaRxHMVXJnUeWq6uUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RoTqCh8Xaver/glMoS+/GRkgkWO4GpPCW6dig9RqQlZKnx+jqgcR/ePLhqfU7z1Ch agAr2WttN/202wge7ibI3PhNNqkUIP2a18v83edTASiwlyanP2jzrS5LCYEXyVfXy/ QXNiMTT7TVIDU3VF74YVtDAnsjj33A8qrWUGrtCc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Felipe Balbi Subject: [PATCH 4.14 126/222] usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround" Date: Sun, 11 Nov 2018 14:23:43 -0800 Message-Id: <20181111221658.928759816@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit afc92514a34c7414b28047b1205a6b709103c699 upstream. If the "workaround_for_vbus" is true, the driver will not call usb_disconnect(). So, since the controller keeps some registers' value, the driver doesn't re-enumarate suitable speed after the b-device mode is disabled. To fix the issue, this patch adds usb_disconnect() calling in renesas_usb3_b_device_write() if workaround_for_vbus is true. Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the b-device mode") Cc: # v4.14+ Signed-off-by: Yoshihiro Shimoda Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/renesas_usb3.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2374,6 +2374,9 @@ static ssize_t renesas_usb3_b_device_wri else usb3->forced_b_device = false; + if (usb3->workaround_for_vbus) + usb3_disconnect(usb3); + /* Let this driver call usb3_connect() anyway */ usb3_check_id(usb3);