All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/5] omap: Implement common omap_has_feature
Date: Fri, 9 Jul 2010 11:53:39 -0500	[thread overview]
Message-ID: <4C375413.7070608@ti.com> (raw)
In-Reply-To: <20100709070811.GD24913@atomide.com>

Tony Lindgren had written, on 07/09/2010 02:08 AM, the following:
> * Nishanth Menon <nm@ti.com> [100708 17:46]:
>> Tony Lindgren had written, on 07/08/2010 04:37 AM, the following:
>>> @@ -112,6 +114,12 @@ void omap_get_die_id(struct omap_die_id *odi)
>>> 	odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
>>> }
>>> +u32 omap2_has_feature(u32 feat_mask)
>>> +{
>>> +	/* REVISIT: Add necessary omap2 feature tests here */
>>> +	return ((feat_mask & omap_features) == feat_mask);
>>> +}
>>> +
>> I did consider this path initially,
>> a) Additional functional call overhead here. some of the calls to
>> has_feature() will get called through pretty active paths, we would
>> like it to be minimized to compile time optimized inline function as
>> much as possible.(no reason why this cant me a inline macro in
>> cpu.h?) -
> 
> Well it should not matter how slow this code is, it should only be
> used to initialize things during __init.
> 
> Any code doing detection after initialization is wrong.
couple of reasons why this may not make sense:
a) drivers can be modules -e.g. lets say dss driver would like to know 
if vrfb OR tiler is used -> __init wont make sense
b) has_feature could be used as part of data flow to make decision what 
is to be done.

e.g.

lets say dma chaining as a feature OR dma list as a feature, we should 
allow for usage such as the following:
int chain_dma(...)
{
	if (!omap_has_feature(OMAP_HAS_DMA_CHAINING)) {
		return -EINVAL;
	}
}

this means that we would prefer these kind of path to be high 
performance paths (data paths) - aka inline functions make more sense 
than incurring a function call overhead.

-- 
Regards,
Nishanth Menon

  reply	other threads:[~2010-07-09 16:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08  9:37 [RFC 0/5] Introduce omap_has_feature Tony Lindgren
2010-07-08  9:37 ` [PATCH 1/5] omap2/3: id: fix sparse warning Tony Lindgren
2010-07-08  9:37 ` [PATCH 2/5] omap: Implement common omap_has_feature Tony Lindgren
2010-07-08 14:52   ` Nishanth Menon
2010-07-09  7:08     ` Tony Lindgren
2010-07-09 16:53       ` Nishanth Menon [this message]
2010-07-08  9:37 ` [PATCH 3/5] omap: Replace omap3_has_ macros with omap_has_feature Tony Lindgren
2010-07-08 14:53   ` Nishanth Menon
2010-07-08  9:38 ` [PATCH 4/5] omap: Remove old omap3_has_ macros Tony Lindgren
2010-07-08 14:54   ` Nishanth Menon
2010-07-08  9:38 ` [PATCH 5/5] omap: Allow testing for omap type with omap_has_feature Tony Lindgren
2010-07-08 15:03   ` Nishanth Menon
2010-07-08 16:15     ` Venkatraman S
2010-07-08 16:28       ` Nishanth Menon
2010-07-08 19:28         ` Venkatraman S
2010-07-08 19:37           ` Nishanth Menon
2010-07-09  7:04             ` Tony Lindgren
2010-07-09 16:53               ` Nishanth Menon

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=4C375413.7070608@ti.com \
    --to=nm@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.