public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc/usb: fix bug of CPU hang when missing USB PHY clock
Date: Thu, 18 Oct 2012 11:04:01 +0200	[thread overview]
Message-ID: <201210181104.01357.marex@denx.de> (raw)
In-Reply-To: <3F453DDFF675A64A89321A1F3528102182C009@039-SN1MPN1-003.039d.mgd.msft.net>

Dear Liu Shengzhou-B36685,

> > -----Original Message-----
> > From: Marek Vasut [mailto:marex at denx.de]
> > Sent: Thursday, October 18, 2012 3:16 PM
> > To: Liu Shengzhou-B36685
> > Cc: u-boot at lists.denx.de; Stefan Roese; agust at denx.de
> > Subject: Re: [PATCH] powerpc/usb: fix bug of CPU hang when missing USB
> > PHY clock
> > 
> > Dear Liu Shengzhou-B36685,
> > 
> > > > -----Original Message-----
> > > > 
> > > > > +/* Check USB PHY clock valid */
> > > > > +static int usb_phy_clk_valid(struct usb_ehci *ehci) {
> > > > > +	if ((!(in_be32(&ehci->control) & PHY_CLK_VALID)) &&
> > > > > +			(!in_be32(&ehci->prictrl))) {
> > > > 
> > > > (!A && !B) condition can certainly be done without the double
> > > > negation ;-)
> > > 
> > > [Shengzhou] Yes, using !(A||B) is also okay:)
> > 
> > Good, you did your logic homework well. Now go one step further:
> > 
> > if (a || b)
> > 
> >  return 1;
> 
> [Shengzhou] No, this doesn't work, b is 0 at initial time, but b is 1 at
> the second time, a is depend on the register PHY_CLK_VALID bit, We just
> want to check it at the first time and then think it is always valid after
> that, it's using a trick:)

Good point, I was just testing you of course ;-)

Best regards,
Marek Vasut

  reply	other threads:[~2012-10-18  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  2:40 [U-Boot] [PATCH] powerpc/usb: fix bug of CPU hang when missing USB PHY clock Shengzhou Liu
2012-10-18  4:21 ` Marek Vasut
2012-10-18  6:28   ` Liu Shengzhou-B36685
2012-10-18  7:15     ` Marek Vasut
2012-10-18  8:54       ` Liu Shengzhou-B36685
2012-10-18  9:04         ` Marek Vasut [this message]
2012-10-19 21:21           ` Andy Fleming
2012-10-22  4:51             ` Liu Shengzhou-B36685
2012-10-19 20:13   ` Anatolij Gustschin
2012-10-22  3:47     ` Liu Shengzhou-B36685

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201210181104.01357.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox