linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Bin Liu <binmlist@gmail.com>,
	Brian Hutchinson <b.hutchman@gmail.com>,
	Felipe Balbi <balbi@ti.com>,
	Matthijs van Duin <matthijsvanduin@gmail.com>,
	Paul Bolle <pebolle@tiscali.nl>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH v2] phy: Add a driver for dm816x USB PHY
Date: Wed, 18 Mar 2015 08:26:19 -0700	[thread overview]
Message-ID: <20150318152618.GN31346@atomide.com> (raw)
In-Reply-To: <550994B3.5080301@ti.com>

* Kishon Vijay Abraham I <kishon@ti.com> [150318 08:09]:
> On Wednesday 18 March 2015 05:42 AM, Tony Lindgren wrote:
> >+
> >+/*
> >+ * We have phy-core.c handle pm_runtime calls for us. We implement
> >+ * these functions for phy-core.c to keep track of power_count.
> >+ * Note that we may want to remove these eventually and rely only
> >+ * on the usecounting done by PM runtime.
> 
> irrespective of whether the phy drivers implement power_off/power_on callbacks
> or not, the phy core maintains it's usecount. So the following two functions
> shouldn't be needed at all.

OK thanks, I will drop them then.

> >+static int dm816x_usb_phy_power_off(struct phy *x)
> >+{
> >+	return 0;
> >+}
> >+
> >+static int dm816x_usb_phy_power_on(struct phy *x)
> >+{
> >+	return 0;
> >+}
...

> >+static int dm816x_usb_phy_runtime_suspend(struct device *dev)
> >+{
> >+	struct dm816x_usb_phy *phy = dev_get_drvdata(dev);
> >+	unsigned int mask, val;
> >+	int error = 0;
> >+
> >+	mask = BIT(phy->instance);
> >+	val = ~BIT(phy->instance);
> >+	error = regmap_update_bits(phy->syscon, phy->usb_ctrl,
> >+				   mask, val);
> 
> Shouldn't this be protected since both the PHYs can access the same register?

Here regmap takes care of the locking of the syscon register.
Note that this only happens when using regmap_update_bits(), doing
a separate regmap read followed by a regmap write won't achieve the
same.

BTW, we should update the other PHY drivers accessing the SCM region
to do the same using the syscon if not doing already.

Regards,

Tony

      reply	other threads:[~2015-03-18 15:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  0:12 [PATCH v2] phy: Add a driver for dm816x USB PHY Tony Lindgren
     [not found] ` <1426637554-27178-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-03-18 11:13   ` Paul Bolle
2015-03-18 14:56     ` Tony Lindgren
2015-03-18 15:07 ` Kishon Vijay Abraham I
2015-03-18 15:26   ` Tony Lindgren [this message]

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=20150318152618.GN31346@atomide.com \
    --to=tony@atomide.com \
    --cc=b.hutchman@gmail.com \
    --cc=balbi@ti.com \
    --cc=binmlist@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthijsvanduin@gmail.com \
    --cc=pebolle@tiscali.nl \
    --cc=rusty@rustcorp.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).