From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E9E5C28CC2 for ; Thu, 30 May 2019 04:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 291B02184B for ; Thu, 30 May 2019 04:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559190443; bh=LUA98mtYbLoFF5SBGBxmbooAGm/0s25pCjeNGGv4PpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oNy7lmr7c7yibzG8/wg/C8pGhEfqZew5OHvY2QpoX5RLtL0J6yZVKIFe7mBb+0fPT Wv8Rgto8pAWGalX1b7ke3DNdGZ8pP/IS/mTJaRTi21b5fJ6GpIWJWj0qxSVBHwNnms RxACriLiknsm+qHuVl+TlyLoWY62hn0TDtNNemdQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388239AbfE3E1W (ORCPT ); Thu, 30 May 2019 00:27:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:33692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729831AbfE3DOV (ORCPT ); Wed, 29 May 2019 23:14:21 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 56F7E2455C; Thu, 30 May 2019 03:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186061; bh=LUA98mtYbLoFF5SBGBxmbooAGm/0s25pCjeNGGv4PpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IM006jd649+7jBfOmexSHxLaadh/eiPrMlY91wWnqW50uQIa/rP3s0iJyS2MLV8qN GRb6gfrJJtvZoau27/nnbOC/kJ6d5EcamIXoW/XGdCw745E5EPQfyTiAtZ61Shx2Vj gbcac7roH5ukaBZQKEQf2N2n1NWYkjOsHPqjn9i8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Kocialkowski , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH 5.0 168/346] phy: sun4i-usb: Make sure to disable PHY0 passby for peripheral mode Date: Wed, 29 May 2019 20:04:01 -0700 Message-Id: <20190530030549.669050168@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030540.363386121@linuxfoundation.org> References: <20190530030540.363386121@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit e6f32efb1b128344a2c7df9875bc1a1abaa1d395 ] On platforms where the MUSB and HCI controllers share PHY0, PHY passby is required when using the HCI controller with the PHY, but it must be disabled when the MUSB controller is used instead. Without this, PHY0 passby is always enabled, which results in broken peripheral mode on such platforms (e.g. H3/H5). Fixes: ba4bdc9e1dc0 ("PHY: sunxi: Add driver for sunxi usb phy") Signed-off-by: Paul Kocialkowski Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sasha Levin --- drivers/phy/allwinner/phy-sun4i-usb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 4bbd9ede38c83..cc5af961778d6 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -554,6 +554,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) struct sun4i_usb_phy_data *data = container_of(work, struct sun4i_usb_phy_data, detect.work); struct phy *phy0 = data->phys[0].phy; + struct sun4i_usb_phy *phy = phy_get_drvdata(phy0); bool force_session_end, id_notify = false, vbus_notify = false; int id_det, vbus_det; @@ -610,6 +611,9 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) mutex_unlock(&phy0->mutex); } + /* Enable PHY0 passby for host mode only. */ + sun4i_usb_phy_passby(phy, !id_det); + /* Re-route PHY0 if necessary */ if (data->cfg->phy0_dual_route) sun4i_usb_phy0_reroute(data, id_det); -- 2.20.1