From: David Cohen <david.a.cohen@linux.intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Fei Yang <fei.yang@intel.com>,
"Mark F. Brown" <mark.f.brown@intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: Re: [PATCH v2 3/4] x86: intel-mid: add Merrifield platform support
Date: Tue, 28 Jan 2014 11:35:15 -0800 [thread overview]
Message-ID: <20140128193515.GB11722@psi-dev26.jf.intel.com> (raw)
In-Reply-To: <CAErSpo52sXXKkJZ=bMMZw4G0Z0AJ=-u+Ov14+qp=S+y9LCP=Rg@mail.gmail.com>
On Tue, Jan 28, 2014 at 11:40:57AM -0700, Bjorn Helgaas wrote:
> On Mon, Jan 27, 2014 at 6:30 PM, David Cohen
> <david.a.cohen@linux.intel.com> wrote:
> > Hi Bjorn,
> >
> > On Mon, Jan 27, 2014 at 05:52:30PM -0700, Bjorn Helgaas wrote:
> >> On Mon, Dec 16, 2013 at 1:07 PM, David Cohen
> >> <david.a.cohen@linux.intel.com> wrote:
> >> > This code was partially based on Mark Brown's previous work.
> >> >
> >> > Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
> >> > Signed-off-by: Fei Yang <fei.yang@intel.com>
> >> > Cc: Mark F. Brown <mark.f.brown@intel.com>
> >> > Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> >>
> >> I know this has already been merged to Linus' tree, but it looks funny to me.
> >>
> >> > --- a/arch/x86/platform/intel-mid/intel_mid_weak_decls.h
> >> > +++ b/arch/x86/platform/intel-mid/intel_mid_weak_decls.h
> >> > @@ -16,3 +16,4 @@
> >> > */
> >> > extern void * __cpuinit get_penwell_ops(void) __attribute__((weak));
> >> > extern void * __cpuinit get_cloverview_ops(void) __attribute__((weak));
> >> > +extern void * __init get_tangier_ops(void) __attribute__((weak));
> >>
> >> We should use "__weak" instead of the gcc-specific "__attribute__((weak))".
> >>
> >> I don't think it's a good idea to use __weak on a declaration in a
> >> header file. If there are ever multiple definitions of the symbol,
> >> they are *all* made weak symbols, and one is chosen based on link
> >> order, which is error-prone. I only see one definition now, but the
> >> whole point of weak is to allow multiple definitions, so this looks
> >> like a problem waiting to happen. See 10629d711ed, for example.
> >>
> >> It look me a bit to figure out that these get_*_ops() functions are
> >> used by INTEL_MID_OPS_INIT, which constructs the name using a macro,
> >> so grep/cscope/etc. don't see any users. A comment pointing to
> >> INTEL_MID_OPS_INIT would be helpful.
> >>
> >> What's the reason for making these symbols weak? Normally we use weak
> >> to make a generic default version of a function, while allowing
> >> architectures to replace the default with their own version if
> >> necessary. But I don't see that happening here. Maybe I'm just
> >> missing it, like I missed the uses of get_tangier_ops(), et al.
> >
> > Intel mid was implemented in such way that we should select which soc to
> > be used in compilation time. Depending on the selection, mfld.c or
> > mrfl.c could not be compiled then some symbols wouldn't be available.
> >
> > But IMHO this is a bad legacy design that exists in there, so I started
> > to rework it as you can see in this commit:
> >
> > commit 4cb9b00f42e07830310319a07e6c91413ee8153e
> > Author: David Cohen <david.a.cohen@linux.intel.com>
> > Date: Mon Dec 16 17:37:26 2013 -0800
> >
> > x86, intel-mid: Remove deprecated X86_MDFLD and X86_WANT_INTEL_MID
> > configs
> >
> > I'm sending more patches soon and getting rid of intel_mid_weak_decls.h
> > file is in my TODO list.
>
> Sounds good. While you're looking at it, I have similar questions
> about ipc_device_handler() and msic_generic_platform_data(). It's not
> clear to me why they should be weak.
I'm afraid that's gargabe I missed. It supposed to be removed already.
The original upstreamed patch set needed it, since all platform data
were gathered in a board.c file and some of them could not be compiled.
You can see it here:
http://us.generation-nt.com/answer/patch-v2-00-10-rework-arch-x86-platform-mrst-intel-mid-help-212689892.html
But I reworked this approach and added a sfi_device() macro to let
compiler to gather all the platform data, thus board.c file doesn't
exist. It means it is not necessary anymore to be weak. I can send a
patch right away fixing it.
Thanks for pointing that out.
Br, David
>
> Bjorn
next prev parent reply other threads:[~2014-01-28 19:30 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 20:07 [PATCH v2 0/4] Add Clovertrail and Merrifeld support to Intel MID David Cohen
2013-12-16 20:07 ` [PATCH v2 1/4] x86: intel-mid: move Medfield code out of intel-mid.c core file David Cohen
2014-01-15 22:42 ` [tip:x86/intel-mid] x86, intel-mid: Move " tip-bot for David Cohen
2013-12-16 20:07 ` [PATCH v2 2/4] x86: intel-mid: add Clovertrail platform support David Cohen
2014-01-15 22:42 ` [tip:x86/intel-mid] x86, intel-mid: Add " tip-bot for Kuppuswamy Sathyanarayanan
2013-12-16 20:07 ` [PATCH v2 3/4] x86: intel-mid: add Merrifield " David Cohen
2014-01-15 22:43 ` [tip:x86/intel-mid] x86, intel-mid: Add " tip-bot for David Cohen
2014-01-28 0:52 ` [PATCH v2 3/4] x86: intel-mid: add " Bjorn Helgaas
2014-01-28 1:30 ` David Cohen
2014-01-28 18:40 ` Bjorn Helgaas
2014-01-28 19:35 ` David Cohen [this message]
2014-01-28 23:09 ` [PATCH] x86: intel-mid: cleanup some platform code's header files David Cohen
2014-01-28 23:15 ` [tip:x86/intel-mid] x86, intel-mid: Cleanup some platform code' s " tip-bot for David Cohen
2013-12-16 20:07 ` [PATCH v2 4/4] x86: intel-mid: remove deprecated X86_MDFLD and X86_WANT_INTEL_MID configs David Cohen
2013-12-16 20:47 ` Bjorn Helgaas
2013-12-16 21:31 ` David Cohen
2013-12-17 1:37 ` [PATCH v2.1 " David Cohen
2013-12-20 5:42 ` [PATCH 1/2] x86: intel-mid: return proper error code from get_gpio_by_name() David Cohen
2013-12-20 5:42 ` [PATCH 2/2] x86: intel-mid: sfi_handle_*_dev() should check for pdata error code David Cohen
2013-12-20 8:49 ` Ingo Molnar
2013-12-20 17:40 ` David Cohen
2014-01-15 0:21 ` David Cohen
2014-01-15 6:58 ` Ingo Molnar
2014-01-15 17:39 ` David Cohen
2014-01-15 22:26 ` David Cohen
2014-01-16 9:50 ` Ingo Molnar
2014-01-16 17:23 ` David Cohen
2014-01-16 23:35 ` David Cohen
2013-12-21 1:15 ` [PATCH v2 0/3] x86: intel-mid: handle platform code error in better way David Cohen
2013-12-21 1:15 ` [PATCH v2 1/3] x86: intel-mid: sfi_handle_*_dev() should check for pdata error code David Cohen
2013-12-21 1:15 ` [PATCH v2 2/3] x86: intel-mid: platform code should return error when failing David Cohen
2013-12-21 1:15 ` [PATCH v2 3/3] x86: intel-mid: return proper error code from get_gpio_by_name() David Cohen
2014-01-15 22:43 ` [tip:x86/intel-mid] x86, intel-mid: Remove deprecated X86_MDFLD and X86_WANT_INTEL_MID configs tip-bot for David Cohen
2014-01-14 22:44 ` [PATCH v2 0/4] Add Clovertrail and Merrifeld support to Intel MID David Cohen
2014-01-14 23:52 ` H. Peter Anvin
2014-01-15 0:13 ` David Cohen
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=20140128193515.GB11722@psi-dev26.jf.intel.com \
--to=david.a.cohen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=fei.yang@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mark.f.brown@intel.com \
--cc=mingo@redhat.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
Powered by JetHome