From patchwork Wed May 13 09:44:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11545637 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 86A9F159A for ; Wed, 13 May 2020 10:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65F1020769 for ; Wed, 13 May 2020 10:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589364079; bh=KaBdmx0FEom7Oa5L1jSWEFIFXl5TMxoTKMFAD99rzvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IQSq5tOiu6tp9lzvQxhpTIpDY2rIf//CPCgp4Oe1/z0H8qvacx576IHSTLLJSG0Jr jvCbXumGUWKeDBG94tXJC7/PKY9law2BnrUTLO5zeTHcHptmHtCgmx6fuimF6QGVYk cgJXAA/HpKnvmbkLyPmFEiW9yTghM7maDljtF4AU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387610AbgEMJvJ (ORCPT ); Wed, 13 May 2020 05:51:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:51594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387603AbgEMJvI (ORCPT ); Wed, 13 May 2020 05:51:08 -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 0AE8E20575; Wed, 13 May 2020 09:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363467; bh=KaBdmx0FEom7Oa5L1jSWEFIFXl5TMxoTKMFAD99rzvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAx7GN0SY1Uo24yWRpjLR6JJUU1F6+NDx44Jc4k6K9MqAjAZjkpWqy0TRj8V93GRL VeQm9m59sz1g/5+Ldj/J7gXGMof8nq38pWkh5QIY9eQbmXTvHB6WDClPr+YLcfiee/ rIs6jzzNgEZD4uQ0mASKT+Bswo112pwBSPFQBGJo= 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.4 47/90] usb: chipidea: msm: Ensure proper controller reset using role switch API Date: Wed, 13 May 2020 11:44:43 +0200 Message-Id: <20200513094413.789775786@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094408.810028856@linuxfoundation.org> References: <20200513094408.810028856@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);