Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp275704ybi; Wed, 29 May 2019 21:11:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqITCrDJfp4fOSjOCvNLGWD5GJ4X803pBpmy2Tl8co/MRaW0FWPUoQxPyUuiapinlRzhXr X-Received: by 2002:a17:902:ac8b:: with SMTP id h11mr1715045plr.31.1559189474178; Wed, 29 May 2019 21:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189474; cv=none; d=google.com; s=arc-20160816; b=IM3bWAaczoNgKsCTWBOxHE4IEtkHHPOAUyrcwdoJFWxxYm0PIM4NmQJqdB3wYlQGId Vp4+cpsRuA5O/er2dEkIRuc7Y9ybNrkCKk+JEBW1SQNc5sdH3PvrVhFv/LFMUYNqIqag TI7QiS/43/QK2F8uLDcY0nABhxaMlygIx+HzQdpn83yOCQHTRCRdUZ0HmG8C7+TmHwMD 22CIBnDC4gJ0zWGYtVyDmycBmIAUJqYOvnl00XATuee5U8K8n3FWehnnOu9a8JErR5qX rIEx64eL8t65JEdHztqhk6tCNUmCkQQGPU7tWjqaHaEyVZI795shyuuDGtWjDOVdXe/A bDKg== 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=r1/QCXinRarrfeDqZsICzWZyX+YCgs/dPveUU7LMIQs=; b=ceZ2q15djk3Z17X5Mb7KUNayXz/irdssy+lQ4K9u9e12nVaxeLf5ZpgyY7lY5BUIn0 XrOXZanmxVcgr3Y5bgElCcomFfpuu0RqANq/NLZvTynFLhgjY5CPLzW6eMlSY34bm6kb Nl0mIpWyqDVInyvF2INO0UNda+LPbxjrfsJoW8N76sBk4nG/+C2oY1ozXpjbUAtRt3Lh F8rLovq3zFX2YoDJxVj4IP1V0CendooM+soJ4BLjIbLv6xQo81lYqZzZLQ/p8JuIqeyH iC5WG3wae9377eNO1u/eErYTFVrwefMFJqNr56wC1udIazU/c7gwTILUN2YZC36yWa9t FUbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X19UE1MI; 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 q184si1353704pfc.199.2019.05.29.21.10.58; Wed, 29 May 2019 21:11:14 -0700 (PDT) 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=X19UE1MI; 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 S1727461AbfE3EIl (ORCPT + 99 others); Thu, 30 May 2019 00:08:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731069AbfE3DRS (ORCPT ); Wed, 29 May 2019 23:17:18 -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 9BEB2246A2; Thu, 30 May 2019 03:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186237; bh=5lqbSiFsCzajkB4FyK61e1Rl1EHlse2aMLHD0Ua8Zf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X19UE1MITgMojc+wdzxN4OPmLva/R23ieQsO85X0b3hHcPiDjEwNRE4yUnYu7TXyj dubWyi/JWeHE5SpuZvXe6ZiyloY5kqMkDQz6rH5VU8zYmnuZZCmnsdTrJwVApiPkxo GXEukqXdobnS7xIu/WSxYc5MlP7s9Tdbvd6kbpbI= 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 4.19 147/276] phy: sun4i-usb: Make sure to disable PHY0 passby for peripheral mode Date: Wed, 29 May 2019 20:05:05 -0700 Message-Id: <20190530030534.820598616@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 15c8fc2abf01f..1f8809bab002c 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -550,6 +550,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; @@ -606,6 +607,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