|
Next: PCI Quirk / Hidden Bus Report
|
| Author |
Message |
External

Since: Feb 02, 2007 Posts: 2642
|
(Msg. 1) Posted: Thu Jul 19, 2007 4:10 am
Post subject: cmpxchg is not available to generic code Archived from groups: linux>kernel (more info?)
|
|
|
arm:
drivers/char/drm/drm_lock.c: In function `drm_lock_take':
drivers/char/drm/drm_lock.c:221: error: implicit declaration of function `cmpxchg'
You might be able to use atomic_cmpxchg, which _is_ present
on all architectures. Or use a spinlock.
What's that code doing anyway? driver-private locking primitives?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: May 26, 2007 Posts: 1211
|
(Msg. 2) Posted: Thu Jul 19, 2007 5:30 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
From: Andrew Morton <akpm RemoveThis @linux-foundation.org>
Date: Thu, 19 Jul 2007 00:05:49 -0700
> What's that code doing anyway? driver-private locking primitives?
It's an atomic lock shared with userspace. Whatever implementation is
used to do the lock on that object must be identical in the userspace
DRM bits.
Unlike futex, the lock operation on the user side isn't optional.
So if the platform can't do a true cmpxchg it generally cannot
support DRM.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Feb 02, 2007 Posts: 2642
|
(Msg. 3) Posted: Thu Jul 19, 2007 5:30 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 19 Jul 2007 09:02:03 +0100 (IST) Dave Airlie <airlied.DeleteThis@linux.ie> wrote:
>
>
> > arm:
> >
> > drivers/char/drm/drm_lock.c: In function `drm_lock_take':
> > drivers/char/drm/drm_lock.c:221: error: implicit declaration of function `cmpxchg'
> >
> > You might be able to use atomic_cmpxchg, which _is_ present
> > on all architectures. Or use a spinlock.
> >
> > What's that code doing anyway? driver-private locking primitives?
>
> When did arm suddenly start wanting DRM?
It's selectable in config. allmodconfig broke.
> they need to grow a userpsace
> cmpxchg as davem mentioned to go along with this, changing the drm now
> isn't possible due to backwards compat..
For reference purposes, that position is not acceptable. We _never_ accept the
"oh I can't change my proposed kernel interface because I already have
userspace relying on it" argument.
Hopefully that won't be an issue here. I guess DRM now needs a
`depends on !ARM'.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2007 Posts: 66
|
(Msg. 4) Posted: Thu Jul 19, 2007 5:30 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 7/19/07, Andrew Morton <akpm DeleteThis @linux-foundation.org> wrote:
> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied DeleteThis @gmail.com> wrote:
>
> > Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
>
> That would certainly be better than adding a sprinkle of architectures
> in DRM Kconfig dependencies.
>
> I don't know how important DRM is on ARM. Zero?
>
I'd guess zero I suppose if you wanted you could hook up a PCI
graphics card on ARM, but if you do that I think you could implement
cmpxchg
Dave.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Feb 02, 2007 Posts: 2642
|
(Msg. 5) Posted: Thu Jul 19, 2007 5:30 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied.DeleteThis@gmail.com> wrote:
> Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
That would certainly be better than adding a sprinkle of architectures
in DRM Kconfig dependencies.
I don't know how important DRM is on ARM. Zero?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Feb 02, 2007 Posts: 2642
|
(Msg. 6) Posted: Thu Jul 19, 2007 5:40 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 19 Jul 2007 09:19:10 +0100 (IST) Dave Airlie <airlied.DeleteThis@linux.ie> wrote:
> >
> >> they need to grow a userpsace
> >> cmpxchg as davem mentioned to go along with this, changing the drm now
> >> isn't possible due to backwards compat..
> >
> > For reference purposes, that position is not acceptable. We _never_ accept the
> > "oh I can't change my proposed kernel interface because I already have
> > userspace relying on it" argument.
>
> Yes it is, I thought breaking userspace API was the worst crime in kernel
> history, (unless you are sysfs...) the userspace DRM has been around since
> 2.2 days at least, so there are lots of legacy userspaces to break..
oh, sorry, I thought this cmpxchg stuff was newly-added.
I guess something changed which has now made DRM available under arm
allmodconfig.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2007 Posts: 66
|
(Msg. 7) Posted: Thu Jul 19, 2007 5:50 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 7/19/07, David Miller <davem DeleteThis @davemloft.net> wrote:
> From: Andrew Morton <akpm DeleteThis @linux-foundation.org>
> Date: Thu, 19 Jul 2007 00:05:49 -0700
>
> > What's that code doing anyway? driver-private locking primitives?
>
> It's an atomic lock shared with userspace. Whatever implementation is
> used to do the lock on that object must be identical in the userspace
> DRM bits.
>
> Unlike futex, the lock operation on the user side isn't optional.
> So if the platform can't do a true cmpxchg it generally cannot
> support DRM.
Actually in theory the userspace side is optional, it should fallback
to always entering the kernel and being slow, but Ive no idea how
well that codepath is tested... but it's an area I'd hate to play with
now ..
Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
Dave.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Dec 07, 2006 Posts: 34
|
(Msg. 8) Posted: Thu Jul 19, 2007 5:50 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> arm:
>
> drivers/char/drm/drm_lock.c: In function `drm_lock_take':
> drivers/char/drm/drm_lock.c:221: error: implicit declaration of function `cmpxchg'
>
> You might be able to use atomic_cmpxchg, which _is_ present
> on all architectures. Or use a spinlock.
>
> What's that code doing anyway? driver-private locking primitives?
When did arm suddenly start wanting DRM? they need to grow a userpsace
cmpxchg as davem mentioned to go along with this, changing the drm now
isn't possible due to backwards compat..
Dave.
--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
Linux kernel - DRI, VAX / pam_smb / ILUG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Dec 07, 2006 Posts: 34
|
(Msg. 9) Posted: Thu Jul 19, 2007 6:10 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
>
>> they need to grow a userpsace
>> cmpxchg as davem mentioned to go along with this, changing the drm now
>> isn't possible due to backwards compat..
>
> For reference purposes, that position is not acceptable. We _never_ accept the
> "oh I can't change my proposed kernel interface because I already have
> userspace relying on it" argument.
Yes it is, I thought breaking userspace API was the worst crime in kernel
history, (unless you are sysfs...) the userspace DRM has been around since
2.2 days at least, so there are lots of legacy userspaces to break..
> Hopefully that won't be an issue here. I guess DRM now needs a
> `depends on !ARM'.
Possibly the answer..
Dave.
--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
Linux kernel - DRI, VAX / pam_smb / ILUG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: May 26, 2007 Posts: 1211
|
(Msg. 10) Posted: Thu Jul 19, 2007 6:00 pm
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
From: Andrew Morton <akpm DeleteThis @linux-foundation.org>
Date: Thu, 19 Jul 2007 01:21:41 -0700
> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied DeleteThis @gmail.com> wrote:
>
> > Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
>
> That would certainly be better than adding a sprinkle of architectures
> in DRM Kconfig dependencies.
>
> I don't know how important DRM is on ARM. Zero?
We already have EMULATED_CMPXCHG guarding DRM.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: May 26, 2007 Posts: 1211
|
(Msg. 11) Posted: Thu Jul 19, 2007 6:00 pm
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
From: "Dave Airlie" <airlied.DeleteThis@gmail.com>
Date: Thu, 19 Jul 2007 18:15:03 +1000
> Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
There is already a "!EMULATED_CMPXCHG" guarding DRM, perhaps
ARM's Kconfig can set that if appropriate.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |
External

Since: Nov 27, 2006 Posts: 373
|
(Msg. 12) Posted: Mon Jul 23, 2007 3:50 am
Post subject: Re: cmpxchg is not available to generic code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Dave Airlie wrote:
> On 7/19/07, Andrew Morton <akpm RemoveThis @linux-foundation.org> wrote:
>
>> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied RemoveThis @gmail.com>
>> wrote:
>>
>> > Maybe we could add CONFIG_HAVE_CMPXCHG and let DRM depend on it..
>>
>> That would certainly be better than adding a sprinkle of architectures
>> in DRM Kconfig dependencies.
>>
>> I don't know how important DRM is on ARM. Zero?
>>
>
> I'd guess zero I suppose if you wanted you could hook up a PCI
> graphics card on ARM, but if you do that I think you could implement
> cmpxchg
ARM does the locked load / store conditional thing which is at least as
strong as cmpxchg, so I imagine it could implement this API in kernel
and userspace quite easily if needed.
--
SUSE Labs, Novell Inc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |  |