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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 Nov 2015 23:38:49 +0000
From:	Alexey Klimov <klimov.linux@...il.com>
To:	John Crispin <blogic@...nwrt.org>
Cc:	Kishon Vijay Abraham I <kishon@...com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink

Hi John,

On Wed, Nov 4, 2015 at 10:54 AM, John Crispin <blogic@...nwrt.org> wrote:
> Add a driver to setup the USB phy on Mediatek/Ralink SoCs.
> The driver is trivial and only sets the power and host/device mode.
>
> Signed-off-by: John Crispin <blogic@...nwrt.org>
> ---
>  .../devicetree/bindings/phy/ralink-usb-phy.txt     |   17 ++
>  drivers/phy/Kconfig                                |    7 +
>  drivers/phy/Makefile                               |    1 +
>  drivers/phy/phy-ralink-usb.c                       |  183 ++++++++++++++++++++
>  4 files changed, 208 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/ralink-usb-phy.txt
>  create mode 100644 drivers/phy/phy-ralink-usb.c

[..]

> +static int ralink_usb_phy_exit(struct phy *_phy)
> +{
> +       return 0;
> +}
> +
> +static int ralink_usb_phy_power_on(struct phy *_phy)
> +{
> +       if (atomic_inc_return(&usb_pwr_ref) == 1) {

> +               int host = 1;
> +               u32 t;
> +
> +               usb_phy_enable(1);
> +
> +               if (host) {

Could you please check how it's supposed to work with host var always
initialized with 1?
Do you want to drop if-else check here or ..?


> +                       rt_sysc_m32(0, RT_SYSCFG1_USB0_HOST_MODE,
> +                                      RT_SYSC_REG_SYSCFG1);
> +                       if (!IS_ERR(rsthost))
> +                               reset_control_deassert(rsthost);
> +                       if (!IS_ERR(rstdev))
> +                               reset_control_deassert(rstdev);
> +               } else {
> +                       rt_sysc_m32(RT_SYSCFG1_USB0_HOST_MODE, 0,
> +                                   RT_SYSC_REG_SYSCFG1);
> +                       if (!IS_ERR(rstdev))
> +                               reset_control_deassert(rstdev);
> +               }
> +               mdelay(100);
> +
> +               t = rt_sysc_r32(RT_SYSC_REG_USB_PHY_CFG);
> +               dev_info(&_phy->dev, "remote usb device wakeup %s\n",
> +                       (t & UDEV_WAKEUP) ? ("enabbled") : ("disabled"));
> +               if (t & USB_PHY_UTMI_8B60M)
> +                       dev_info(&_phy->dev, "UTMI 8bit 60MHz\n");
> +               else
> +                       dev_info(&_phy->dev, "UTMI 16bit 30MHz\n");
> +       }
> +
> +       return 0;
> +}

-- 
Best regards,
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ