From patchwork Wed May 13 09:44:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11545629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CA0C913 for ; Wed, 13 May 2020 09:59:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF32A206D6 for ; Wed, 13 May 2020 09:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363947; bh=KaBdmx0FEom7Oa5L1jSWEFIFXl5TMxoTKMFAD99rzvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sYlqnRXjoGLk9ueItBPGsbpXiB/TJGNOeH0W1Y8LVY6opNydG0BrXG16ZnaYXVjWT Dn9puJNWSGSOAurQ9/tnUm2x/+q4r3LWrZJLQgDEqOA+6P/UfO2NmdMcM2g/TWmNIz l4uTSu+wQB1JHJlEXJUP7azS7w1ZBhgn4s5M6ic8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388323AbgEMJ7D (ORCPT ); Wed, 13 May 2020 05:59:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732656AbgEMJx5 (ORCPT ); Wed, 13 May 2020 05:53:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 1BDC4205ED; Wed, 13 May 2020 09:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363636; bh=KaBdmx0FEom7Oa5L1jSWEFIFXl5TMxoTKMFAD99rzvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4uXfb8rtRGVf1ZmkOTDpLe6IeIhlUre3bAoI7AShBmhhsZmnjmp3Sij7vslGzvTT GQS8P7mgu3WrHz83el+415NSzhe6JMZXcv4wjrcMfreaUySZF2f5LQ6CE6yBwO5LoK cG/EyUGTf4X2Laei6gJ34ssYIWjWQnsu9O3VFQO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , linux-usb@vger.kernel.org, Stephen Boyd , Bryan ODonoghue , Peter Chen Subject: [PATCH 5.6 063/118] usb: chipidea: msm: Ensure proper controller reset using role switch API Date: Wed, 13 May 2020 11:44:42 +0200 Message-Id: <20200513094423.468102573@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094417.618129545@linuxfoundation.org> References: <20200513094417.618129545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Bryan O'Donoghue commit 91edf63d5022bd0464788ffb4acc3d5febbaf81d upstream. Currently we check to make sure there is no error state on the extcon handle for VBUS when writing to the HS_PHY_GENCONFIG_2 register. When using the USB role-switch API we still need to write to this register absent an extcon handle. This patch makes the appropriate update to ensure the write happens if role-switching is true. Fixes: 05559f10ed79 ("usb: chipidea: add role switch class support") Cc: stable Cc: Greg Kroah-Hartman Cc: Philipp Zabel Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Stephen Boyd Signed-off-by: Bryan O'Donoghue Signed-off-by: Peter Chen Link: https://lore.kernel.org/r/20200507004918.25975-2-peter.chen@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/ci_hdrc_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -114,7 +114,7 @@ static int ci_hdrc_msm_notify_event(stru hw_write_id_reg(ci, HS_PHY_GENCONFIG_2, HS_PHY_ULPI_TX_PKT_EN_CLR_FIX, 0); - if (!IS_ERR(ci->platdata->vbus_extcon.edev)) { + if (!IS_ERR(ci->platdata->vbus_extcon.edev) || ci->role_switch) { hw_write_id_reg(ci, HS_PHY_GENCONFIG_2, HS_PHY_SESS_VLD_CTRL_EN, HS_PHY_SESS_VLD_CTRL_EN);