linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Iles <jamie@jamieiles.com>
To: john stultz <johnstul@us.ibm.com>
Cc: Jamie Iles <jamie@jamieiles.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>
Subject: Re: [PATCHv3] x86, mrst: share APB timer code with other platforms
Date: Mon, 9 May 2011 21:50:15 +0100	[thread overview]
Message-ID: <20110509205015.GA3341@pulham.picochip.com> (raw)
In-Reply-To: <1304972542.2939.20.camel@work-vm>

On Mon, May 09, 2011 at 01:22:22PM -0700, john stultz wrote:
> On Tue, 2011-04-12 at 12:10 +0100, Jamie Iles wrote:
> > The APB timers are an IP block from Synopsys (DesignWare APB timers)
> > and are also found in other systems including ARM SoC's.  This patch
> > adds functions for creating clock_event_devices and clocksources from
> > APB timers but does not do the resource allocation.  This is handled
> > in a higher layer to allow the timers to be created from multiple
> > methods such as platform_devices.
> > 
> > Changes since v2:
> > 	- Make eoi() for clock_event_device optional for x86 where eoi
> > 	is handled in firmware.
> > Changes since v1:
> > 	- Use the correct timer for clocksource on x86
> > 	- Select the correct timer rating for x86
> > 	- Restore freerunning timer behaviour for oneshot event devices
> > 	- Reenable event irq correctly for hotplug
> 
> Sorry for being slow to review this.

No worries, appreciate the review.

> Just a minor nit below.
> 
> > +struct dw_apb_clocksource *
> > +dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base,
> > +			unsigned long freq)
> > +{
> > +	struct dw_apb_clocksource *dw_cs = kzalloc(sizeof(*dw_cs), GFP_KERNEL);
> > +
> > +	if (!dw_cs)
> > +		return NULL;
> > +
> > +	dw_cs->timer.base = base;
> > +	dw_cs->timer.freq = freq;
> > +	dw_cs->cs.name = name;
> > +	dw_cs->cs.rating = rating;
> > +	dw_cs->cs.read = __apbt_read_clocksource;
> > +	dw_cs->cs.mask = CLOCKSOURCE_MASK(32);
> > +	dw_cs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
> > +	dw_cs->cs.resume = apbt_restart_clocksource;
> > +
> > +	return dw_cs;
> > +}
> 
> So I don't see anything that frees the dw_apb_clocksource structure
> after it has been allocated. Should this instead be allocated by the
> caller and passed in to be initialized here?

Yeah, either that or I could add a dw_apb_clocksource_remove() that does 
the clocksource_unregister() and kfree().  That's probably a little more 
consistent with the rest of the driver.

Jamie

      reply	other threads:[~2011-05-09 20:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 11:10 [PATCHv3] x86, mrst: share APB timer code with other platforms Jamie Iles
2011-05-08 17:16 ` Jamie Iles
2011-05-09 17:55   ` Jacob Pan
2011-05-09 20:22 ` john stultz
2011-05-09 20:50   ` Jamie Iles [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=20110509205015.GA3341@pulham.picochip.com \
    --to=jamie@jamieiles.com \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).