Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3500231imu; Mon, 7 Jan 2019 04:38:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN63Tgs5+TCf9CQNgwx/ubCCOBCIe0sXYvE1jo1R3xLiuPUnWqI+AJG9xEBse6QsCZq3Qlzo X-Received: by 2002:a63:c00b:: with SMTP id h11mr11039814pgg.429.1546864709971; Mon, 07 Jan 2019 04:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546864709; cv=none; d=google.com; s=arc-20160816; b=s3ozyxXV3hO/yLPA0kIa2oWTrZin2evS9EzRY5mk4Ut601QCi36HCvJ+cOFpVve/3b MiLRnwpfaadL2Ofrc/3WtgbmMbSHE8sO0XjP+iEqdR095gzgxtI6P8/plYlCesthfuQg itEjFK1maQ6+4aRnM+Ur0s7/7hjcyKhVCRPzJqmYMwhFKWaj32OwzZsaEp+kqMtZ629h /7L3ymZ8D/IuOA9EjhJDq7FBWji1495HRPtQ/PdeBeALh4QDR5SYqOy6ADv1A4QyMZfs j99udjf9ZG3xCUso6kgQGzlg/ASyMaZfqGf+mAD8YI40LxLUpT9nN4F7nKMw6lpTgweh gPgw== 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=gvRqz1wNwDh7mvgFhe5fRfF/HM86Fnb4hBFCteSNdeU=; b=tdZdMIvirDFQgf7+MhL3GwE+CVda+foPpLc6PlNa/p8lP5mIUTthCfB0v9tvj0tEoo 4rBz5aNhKJf4qE2jPly7OEBMdDmdePIry3YL2D4h5hS1Y0S4Qacu7W4wDZ1c+00s48aw ET4zbgQmDgeCJ4eJe1pcV0wm3M15du4/Lre+r7wFmr6RmICmim6On76aVga/+3ZhlTCe CiAjrtcOX/BVpQUentjGV8sKqi3o+o2jL52Ax8WiZlpLzvalPLNmuO0LvXFXVzDCQ6Os 8EkDQeT7Q2dig7vHxqC7B9pnktofanPLdH7LxVj4eLFokkEbVa6NYBwSqoijCGLJpCP/ FI9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2mTMM31d; 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 a6si7155748pgc.137.2019.01.07.04.38.15; Mon, 07 Jan 2019 04:38:29 -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=2mTMM31d; 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 S1727602AbfAGMfk (ORCPT + 99 others); Mon, 7 Jan 2019 07:35:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:49612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727523AbfAGMfh (ORCPT ); Mon, 7 Jan 2019 07:35:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 692CA206BB; Mon, 7 Jan 2019 12:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546864536; bh=w0rKpo3ouhKZB5c94TbfanQnnPkK+YEXnb6d8xZzHck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2mTMM31dfqlooxNwPDjkUDsWfS0oMJJLhRxtNikVkgZ06UtwCCuyaGbYuuxi0ngdU eZyzsqqhW6y7CpkRjA4j5UfK/9CtnPSZkPA/KfLGvanyu08YzkCXzvzrD0ciqUbMy6 NUwSwI7Ql22PdUabXwdjqWckLIppwnIQ3H0Rc1mE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Gerhold , Felipe Balbi Subject: [PATCH 4.20 043/145] Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs" Date: Mon, 7 Jan 2019 13:31:20 +0100 Message-Id: <20190107104443.053575332@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104437.308206189@linuxfoundation.org> References: <20190107104437.308206189@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephan Gerhold commit 3004cfd6204927c1294060b849029cf0c2651074 upstream. Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get the phy GPIOs") changed the code to claim the PHY GPIOs permanently for Intel Baytrail devices. This causes issues when the actual PHY driver attempts to claim the same GPIO descriptors. For example, tusb1210 now fails to probe with: tusb1210: probe of dwc3.0.auto.ulpi failed with error -16 (EBUSY) dwc3-pci needs to turn on the PHY once before dwc3 is loaded, but usually the PHY driver will then hold the GPIOs to turn off the PHY when requested (e.g. during suspend). To fix the problem, this reverts the commit to restore the old behavior to put the GPIOs immediately after usage. Link: https://www.spinics.net/lists/linux-usb/msg174681.html Cc: stable@vger.kernel.org Signed-off-by: Stephan Gerhold Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -170,20 +170,20 @@ static int dwc3_pci_quirks(struct dwc3_p * put the gpio descriptors again here because the phy driver * might want to grab them, too. */ - gpio = devm_gpiod_get_optional(&pdev->dev, "cs", - GPIOD_OUT_LOW); + gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); if (IS_ERR(gpio)) return PTR_ERR(gpio); gpiod_set_value_cansleep(gpio, 1); + gpiod_put(gpio); - gpio = devm_gpiod_get_optional(&pdev->dev, "reset", - GPIOD_OUT_LOW); + gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpio)) return PTR_ERR(gpio); if (gpio) { gpiod_set_value_cansleep(gpio, 1); + gpiod_put(gpio); usleep_range(10000, 11000); } }