* cmpxchg is not available to generic code
@ 2007-07-19 7:05 Andrew Morton
2007-07-19 7:27 ` David Miller
2007-07-19 8:02 ` Dave Airlie
0 siblings, 2 replies; 12+ messages in thread
From: Andrew Morton @ 2007-07-19 7:05 UTC (permalink / raw)
To: Dave Airlie; +Cc: linux-kernel
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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 7:05 cmpxchg is not available to generic code Andrew Morton
@ 2007-07-19 7:27 ` David Miller
2007-07-19 8:15 ` Dave Airlie
2007-07-19 8:02 ` Dave Airlie
1 sibling, 1 reply; 12+ messages in thread
From: David Miller @ 2007-07-19 7:27 UTC (permalink / raw)
To: akpm; +Cc: airlied, linux-kernel
From: Andrew Morton <akpm@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 7:05 cmpxchg is not available to generic code Andrew Morton
2007-07-19 7:27 ` David Miller
@ 2007-07-19 8:02 ` Dave Airlie
2007-07-19 8:10 ` Andrew Morton
1 sibling, 1 reply; 12+ messages in thread
From: Dave Airlie @ 2007-07-19 8:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:02 ` Dave Airlie
@ 2007-07-19 8:10 ` Andrew Morton
2007-07-19 8:19 ` Dave Airlie
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2007-07-19 8:10 UTC (permalink / raw)
To: Dave Airlie; +Cc: linux-kernel
On Thu, 19 Jul 2007 09:02:03 +0100 (IST) Dave Airlie <airlied@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'.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 7:27 ` David Miller
@ 2007-07-19 8:15 ` Dave Airlie
2007-07-19 8:21 ` Andrew Morton
2007-07-19 20:58 ` David Miller
0 siblings, 2 replies; 12+ messages in thread
From: Dave Airlie @ 2007-07-19 8:15 UTC (permalink / raw)
To: David Miller; +Cc: akpm, airlied, linux-kernel
On 7/19/07, David Miller <davem@davemloft.net> wrote:
> From: Andrew Morton <akpm@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:10 ` Andrew Morton
@ 2007-07-19 8:19 ` Dave Airlie
2007-07-19 8:36 ` Andrew Morton
0 siblings, 1 reply; 12+ messages in thread
From: Dave Airlie @ 2007-07-19 8:19 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
>
>> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:15 ` Dave Airlie
@ 2007-07-19 8:21 ` Andrew Morton
2007-07-19 8:23 ` Dave Airlie
2007-07-19 20:54 ` David Miller
2007-07-19 20:58 ` David Miller
1 sibling, 2 replies; 12+ messages in thread
From: Andrew Morton @ 2007-07-19 8:21 UTC (permalink / raw)
To: Dave Airlie; +Cc: David Miller, airlied, linux-kernel
On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied@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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:21 ` Andrew Morton
@ 2007-07-19 8:23 ` Dave Airlie
2007-07-23 6:48 ` Nick Piggin
2007-07-19 20:54 ` David Miller
1 sibling, 1 reply; 12+ messages in thread
From: Dave Airlie @ 2007-07-19 8:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Miller, airlied, linux-kernel
On 7/19/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:19 ` Dave Airlie
@ 2007-07-19 8:36 ` Andrew Morton
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2007-07-19 8:36 UTC (permalink / raw)
To: Dave Airlie; +Cc: linux-kernel
On Thu, 19 Jul 2007 09:19:10 +0100 (IST) Dave Airlie <airlied@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:21 ` Andrew Morton
2007-07-19 8:23 ` Dave Airlie
@ 2007-07-19 20:54 ` David Miller
1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2007-07-19 20:54 UTC (permalink / raw)
To: akpm; +Cc: airlied, airlied, linux-kernel
From: Andrew Morton <akpm@linux-foundation.org>
Date: Thu, 19 Jul 2007 01:21:41 -0700
> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:15 ` Dave Airlie
2007-07-19 8:21 ` Andrew Morton
@ 2007-07-19 20:58 ` David Miller
1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2007-07-19 20:58 UTC (permalink / raw)
To: airlied; +Cc: akpm, airlied, linux-kernel
From: "Dave Airlie" <airlied@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: cmpxchg is not available to generic code
2007-07-19 8:23 ` Dave Airlie
@ 2007-07-23 6:48 ` Nick Piggin
0 siblings, 0 replies; 12+ messages in thread
From: Nick Piggin @ 2007-07-23 6:48 UTC (permalink / raw)
To: Dave Airlie; +Cc: Andrew Morton, David Miller, airlied, linux-kernel
Dave Airlie wrote:
> On 7/19/07, Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> On Thu, 19 Jul 2007 18:15:03 +1000 "Dave Airlie" <airlied@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-07-23 6:48 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 7:05 cmpxchg is not available to generic code Andrew Morton
2007-07-19 7:27 ` David Miller
2007-07-19 8:15 ` Dave Airlie
2007-07-19 8:21 ` Andrew Morton
2007-07-19 8:23 ` Dave Airlie
2007-07-23 6:48 ` Nick Piggin
2007-07-19 20:54 ` David Miller
2007-07-19 20:58 ` David Miller
2007-07-19 8:02 ` Dave Airlie
2007-07-19 8:10 ` Andrew Morton
2007-07-19 8:19 ` Dave Airlie
2007-07-19 8:36 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox