linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Rob Lee <rob.lee@linaro.org>
Cc: s.hauer@pengutronix.de, shawn.guo@freescale.com,
	amit.kachhap@linaro.org, amit.kucheria@linaro.org,
	linux-arm-kernel@lists.infradead.org, patches@linaro.org,
	linux-acpi@vger.kernel.org, lenb@kernel.org
Subject: Re: [RFC PATCH v3] ARM: imx: Add basic imx6q thermal management
Date: Wed, 18 Jan 2012 11:56:56 +0000	[thread overview]
Message-ID: <20120118115656.GE1068@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAMXH7KE3CUvoZgW2UQiPLc3-oAHO0gcH4GRHU46ScyK519nvfQ@mail.gmail.com>

On Wed, Jan 18, 2012 at 05:40:02AM -0600, Rob Lee wrote:
> > +       /* In the rarest of cases, order matters here - resume goes first */
> > +       th_zone->therm_dev->device.class->resume = imx6q_thermal_resume;
> > +       th_zone->therm_dev->device.class->suspend = imx6q_thermal_suspend;
> On second thought, I should have barrier between these two statements
> to guarantee order.  I think mb() would be ok.

Err, no.  This is a serious bug.

You're writing to this structure:

static struct class thermal_class = {
        .name = "thermal",
        .dev_release = thermal_release,
};

in thermal_sys.c, which would be shared with other thermal drivers.  This
is far from safe - it's insane.

The ordering or mb() is the least of your problems.

If there isn't suspend/resume support provided, please talk to the thermal
people about how to do this.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2012-01-18 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  4:48 [RFC PATCH v3] ARM: imx: Add basic imx6q thermal management Robert Lee
2012-01-18  4:48 ` Robert Lee
2012-01-18 11:40   ` Rob Lee
2012-01-18 11:56     ` Russell King - ARM Linux [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=20120118115656.GE1068@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=amit.kachhap@linaro.org \
    --cc=amit.kucheria@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=patches@linaro.org \
    --cc=rob.lee@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@freescale.com \
    /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).