lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 May 2016 23:24:07 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Felipe Balbi <balbi@...nel.org>
Cc:	Arnd Bergmann <arnd@...db.de>, Andy Gross <andy.gross@...aro.org>,
	David Brown <david.brown@...aro.org>,
	Peter Chen <Peter.Chen@....com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Mark Brown <broonie@...nel.org>,
	Bjorn Andersson <bjorn.andersson@...aro.org>,
	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	linux-soc@...r.kernel.org, linux-usb@...r.kernel.org
Subject: [RFC 2/8] usb: ehci-msm: call usb_phy_init instead of open-coding it

While looking at the phy-msm-usb driver, I noticed that its registers
are also accessed by teh ehci-msm driver, basically duplicating part
of the logic that is already present in the phy driver.

This removes the duplicate code from the ehci driver and instead
calls the usb_phy_init() function.

I did not test this change, so please review the patch carefully
and wait for a positive test result before applying.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/usb/host/ehci-msm.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index d3afc89d00f5..4a9f31f77c46 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -30,15 +30,12 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/usb/otg.h>
-#include <linux/usb/msm_hsusb_hw.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
 #include <linux/acpi.h>
 
 #include "ehci.h"
 
-#define MSM_USB_BASE (hcd->regs)
-
 #define DRIVER_DESC "Qualcomm On-Chip EHCI Host Controller"
 
 static const char hcd_name[] = "ehci-msm";
@@ -49,24 +46,13 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
 	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 	int retval;
 
-	ehci->caps = USB_CAPLENGTH;
+	ehci->caps = hcd->regs + 0x100;
 	hcd->has_tt = 1;
 
 	retval = ehci_setup(hcd);
 	if (retval)
 		return retval;
 
-	/* select ULPI phy and clear other status/control bits in PORTSC */
-	writel(PORTSC_PTS_ULPI, USB_PORTSC);
-	/* bursts of unspecified length. */
-	writel(0, USB_AHBBURST);
-	/* Use the AHB transactor, allow posted data writes */
-	writel(0x8, USB_AHBMODE);
-	/* Disable streaming mode and select host mode */
-	writel(0x13, USB_USBMODE);
-	/* Disable ULPI_TX_PKT_EN_CLR_FIX which is valid only for HSIC */
-	writel(readl(USB_GENCONFIG_2) & ~ULPI_TX_PKT_EN_CLR_FIX, USB_GENCONFIG_2);
-
 	return 0;
 }
 
@@ -144,6 +130,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
 		pm_runtime_no_callbacks(&pdev->dev);
 		pm_runtime_enable(&pdev->dev);
 	} else {
+		usb_phy_init(phy);
 		ret = usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
 		if (ret)
 			goto put_hcd;
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ