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] [day] [month] [year] [list]
Message-ID: <HK2PR06MB0548DB0A4DFDAFEF0A27D2C2D8A60@HK2PR06MB0548.apcprd06.prod.outlook.com>
Date:   Tue, 8 Nov 2016 10:15:25 +0000
From:   Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To:     Peter Chen <hzpeterchen@...il.com>
CC:     "kishon@...com" <kishon@...com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "balbi@...nel.org" <balbi@...nel.org>,
        "Peter.Chen@....com" <Peter.Chen@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH v3] phy: rcar-gen3-usb2: add sysfs for usb role swap

Hi,

> From: Peter Chen
> Sent: Tuesday, November 08, 2016 6:25 PM
> 
> On Wed, Nov 02, 2016 at 03:47:12PM +0900, Yoshihiro Shimoda wrote:
< snip >
> > +	/* If current and new mode is the same, this returns the error */
> > +	if (is_host == new_mode_is_host)
> > +		return -EINVAL;
> > +
> > +	if (new_mode_is_host) {
> > +		if (!is_b_device && !is_host)	/* A-Peripheral */
> > +			rcar_gen3_init_from_a_peri_to_a_host(ch);
> > +		if (is_b_device && !is_host)	/* B-Peripheral */
> > +			rcar_gen3_init_for_b_host(ch);
> 
> is_host must be false here

Thank you for the review!
I will clean up the code and submit v4 patch soon.

> > +	} else {
> > +		if (!is_b_device && is_host)	/* A-Host */
> > +			rcar_gen3_init_for_a_peri(ch);
> > +		if (is_b_device && is_host)	/* B-Host */
> > +			rcar_gen3_init_for_peri(ch);
> 
> is_host must be true here

Same the above.

> > +	}
> > +
> > +	return count;
> > +}
> > +
> 
> How can you handle the case which ID pin is incorrect, eg, ID is 0, but
> it is peripheral mode at the initialization?

This driver always checks the ID pin and sets the suitable mode in initialization timing.
So, we can ignore such a situation.

< In detail >
 phy_init()			@ drivers/phy/phy-core.c
 --> rcar_gen3_phy_usb2_init()
  --> rcar_gen3_phy_init_otg()
   --> rcar_gen3_device_recognition()
    --> if (!rcar_gen3_check_id(ch))
          rcar_gen3_init_for_host(ch);   <-- Sets the mode as host
        else
          rcar_gen3_init_for_peri(ch);   <-- Sets the mode as peripheral
++phy->init_count;		@ drivers/phy/phy-core.c

Best regards,
Yoshihiro Shimoda

> --
> 
> Best Regards,
> Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ