All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC on writel and writel_relaxed
@ 2018-03-21  3:07 Sinan Kaya
  2018-03-21  3:40   ` Oliver
  0 siblings, 1 reply; 216+ messages in thread
From: Sinan Kaya @ 2018-03-21  3:07 UTC (permalink / raw)
  To: open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), linux-rdma

Hi PPC Maintainers,

We are seeking feedback on the status of relaxed write API implementation.
What is the motivation for not implementing the relaxed API? 

I see that network drivers are working around the issue by calling
__raw_write() API directly but this also breaks other architectures
like SPARC since the semantics of __raw_writel() seems to be system dependent.

This is putting drivers into a tight position and they cannot achieve true
multi-arch enablement and are forced into calling __raw APIs flavors
directly with #ifdef BIG_ENDIAN ugliness.

Sinan

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 216+ messages in thread
* Re: RFC on writel and writel_relaxed
@ 2018-03-27 21:54 Alexander Duyck
  2018-03-27 22:35 ` Sinan Kaya
  2018-03-27 23:43 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 216+ messages in thread
From: Alexander Duyck @ 2018-03-27 21:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Sinan Kaya, Arnd Bergmann, Jason Gunthorpe, David Laight, Oliver,
	open list:LINUX FOR POWERPC (32-BIT AND 64-BIT),
	linux-rdma, Will Deacon, Paul E. McKenney, netdev

On Tue, Mar 27, 2018 at 2:35 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Tue, 2018-03-27 at 10:46 -0400, Sinan Kaya wrote:
>>  combined buffers.
>>
>> Alex:
>> "Don't bother. I can tell you right now that for x86 you have to have a
>> wmb() before the writel().
>
> No, this isn't the semantics of writel. You shouldn't need it unless
> something changed and we need to revisit our complete understanding of
> *all* MMIO accessor semantics.

The issue seems to be that there have been two different ways of
dealing with this. There has historically been a number of different
drivers that have been carrying this wmb() workaround since something
like 2002. I get that the semantics for writel might have changed
since then, but those of us who already have the wmb() in our drivers
will be very wary of anyone wanting to go through and remove them
since writel is supposed to be "good enough". I would much rather err
on the side of caution here.

I view the wmb() + writel_relaxed() as more of a driver owning and
handling this itself. Besides in the Intel Ethernet driver case it is
better performance as our wmb() placement for us also provides a
secondary barrier so we don't need to add a separate smp_wmb() to deal
with a potential race we have with the Tx cleanup.

> At least for UC space, it has always been accepted (and enforced) that
> writel would not require any other barrier to order vs. previous stores
> to memory.

So the one thing I would question here is if this is UC vs UC or if
this extends to other types as well? So for x86 we could find
references to Write Combining being flushed by a write to UC memory,
however I have yet to find a clear explanation of what a write to UC
does to WB. My personal inclination would be to err on the side of
caution. I just don't want us going through and removing the wmb()
calls because it "should" work. I would want to know for certain it
will work.

- Alex

^ permalink raw reply	[flat|nested] 216+ messages in thread

end of thread, other threads:[~2018-04-02 13:01 UTC | newest]

Thread overview: 216+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21  3:07 RFC on writel and writel_relaxed Sinan Kaya
2018-03-21  3:40 ` Oliver
2018-03-21  3:40   ` Oliver
2018-03-21 13:53   ` Sinan Kaya
2018-03-21 13:53     ` Sinan Kaya
2018-03-21 13:58     ` Sinan Kaya
2018-03-21 13:58       ` Sinan Kaya
2018-03-26 13:43       ` Arnd Bergmann
2018-03-26 13:43         ` Arnd Bergmann
2018-03-26 16:00         ` Sinan Kaya
2018-03-26 16:00           ` Sinan Kaya
2018-03-21 14:35     ` David Laight
2018-03-21 14:35       ` David Laight
2018-03-21 15:04       ` Sinan Kaya
2018-03-22  5:24       ` Oliver
2018-03-22  8:20         ` Gabriel Paubert
2018-03-22  8:20           ` Gabriel Paubert
2018-03-22  9:25           ` Oliver
2018-03-22  9:25             ` Oliver
2018-03-22 11:25             ` Gabriel Paubert
2018-03-22 11:25               ` Gabriel Paubert
2018-03-22 10:37         ` David Laight
2018-03-22 10:37           ` David Laight
2018-03-22  4:24     ` Benjamin Herrenschmidt
2018-03-22  4:24       ` Benjamin Herrenschmidt
2018-03-22 10:15       ` Oliver
2018-03-22 10:15         ` Oliver
2018-03-22 13:52         ` Benjamin Herrenschmidt
2018-03-22 13:52           ` Benjamin Herrenschmidt
2018-03-22 17:51           ` Sinan Kaya
2018-03-22 17:51             ` Sinan Kaya
2018-03-23  0:16             ` Benjamin Herrenschmidt
2018-03-23  0:16               ` Benjamin Herrenschmidt
2018-03-23 13:42               ` Sinan Kaya
2018-03-23 13:42                 ` Sinan Kaya
2018-03-24  1:22                 ` Benjamin Herrenschmidt
2018-03-24  1:22                   ` Benjamin Herrenschmidt
2018-03-24 15:06                   ` Sinan Kaya
2018-03-24 15:06                     ` Sinan Kaya
2018-03-26 11:44               ` Will Deacon
2018-03-26 11:44                 ` Will Deacon
2018-03-26 12:11                 ` okaya
2018-03-26 12:11                   ` okaya
2018-03-26 12:42                   ` Sinan Kaya
2018-03-26 12:42                     ` Sinan Kaya
2018-03-23 16:35           ` Jason Gunthorpe
2018-03-23 16:35             ` Jason Gunthorpe
2018-03-24  1:23             ` Benjamin Herrenschmidt
2018-03-24  1:23               ` Benjamin Herrenschmidt
2018-03-26 11:08               ` David Laight
2018-03-26 11:08                 ` David Laight
2018-03-26 16:54                 ` Jason Gunthorpe
2018-03-26 16:54                   ` Jason Gunthorpe
2018-03-26 19:44                   ` Arnd Bergmann
2018-03-26 19:44                     ` Arnd Bergmann
2018-03-26 20:25                     ` Jason Gunthorpe
2018-03-26 20:25                       ` Jason Gunthorpe
2018-03-26 20:43                       ` Arnd Bergmann
2018-03-26 20:43                         ` Arnd Bergmann
2018-03-26 21:09                         ` Jason Gunthorpe
2018-03-26 21:09                           ` Jason Gunthorpe
2018-03-26 21:30                           ` Arnd Bergmann
2018-03-26 21:30                             ` Arnd Bergmann
2018-03-26 21:46                             ` Sinan Kaya
2018-03-26 21:46                               ` Sinan Kaya
2018-03-26 22:01                               ` Benjamin Herrenschmidt
2018-03-26 22:01                                 ` Benjamin Herrenschmidt
2018-03-26 22:08                                 ` Sinan Kaya
2018-03-26 22:08                                   ` Sinan Kaya
2018-03-26 22:28                                   ` Benjamin Herrenschmidt
2018-03-26 22:28                                     ` Benjamin Herrenschmidt
2018-03-26 22:27                                 ` Jason Gunthorpe
2018-03-26 22:27                                   ` Jason Gunthorpe
2018-03-26 22:36                                   ` Benjamin Herrenschmidt
2018-03-26 22:36                                     ` Benjamin Herrenschmidt
2018-03-26 22:42                                     ` Benjamin Herrenschmidt
2018-03-26 22:42                                       ` Benjamin Herrenschmidt
2018-03-26 22:50                                     ` Jason Gunthorpe
2018-03-26 22:50                                       ` Jason Gunthorpe
2018-03-26 23:59                                       ` Benjamin Herrenschmidt
2018-03-26 23:59                                         ` Benjamin Herrenschmidt
2018-03-27  1:39                                         ` Jason Gunthorpe
2018-03-27  1:39                                           ` Jason Gunthorpe
2018-03-27  7:56                                   ` Arnd Bergmann
2018-03-27  7:56                                     ` Arnd Bergmann
2018-03-27  8:56                                     ` Benjamin Herrenschmidt
2018-03-27  8:56                                       ` Benjamin Herrenschmidt
2018-03-27  9:44                                       ` Arnd Bergmann
2018-03-27  9:44                                         ` Arnd Bergmann
2018-03-27 10:00                                         ` Will Deacon
2018-03-27 10:00                                           ` Will Deacon
2018-03-27 11:23                                         ` Benjamin Herrenschmidt
2018-03-27 11:23                                           ` Benjamin Herrenschmidt
2018-03-27 12:22                                           ` okaya
2018-03-27 12:22                                             ` okaya
2018-03-27 14:12                                             ` Jason Gunthorpe
2018-03-27 14:12                                               ` Jason Gunthorpe
2018-03-27 21:27                                               ` Benjamin Herrenschmidt
2018-03-27 21:27                                                 ` Benjamin Herrenschmidt
2018-03-27  9:57                                       ` Will Deacon
2018-03-27  9:57                                         ` Will Deacon
2018-03-27 10:05                                         ` Arnd Bergmann
2018-03-27 10:05                                           ` Arnd Bergmann
2018-03-27 10:09                                           ` Will Deacon
2018-03-27 10:09                                             ` Will Deacon
2018-03-27 10:53                                             ` Arnd Bergmann
2018-03-27 10:53                                               ` Arnd Bergmann
2018-03-27 11:02                                               ` Will Deacon
2018-03-27 11:02                                                 ` Will Deacon
2018-03-27 11:05                                                 ` Arnd Bergmann
2018-03-27 11:05                                                   ` Arnd Bergmann
2018-03-27 11:25                                                 ` Benjamin Herrenschmidt
2018-03-27 11:25                                                   ` Benjamin Herrenschmidt
2018-03-27 13:20                                                 ` David Laight
2018-03-27 13:20                                                   ` David Laight
2018-03-27 13:46                                                 ` Sinan Kaya
2018-03-27 13:46                                                   ` Sinan Kaya
2018-03-27 14:36                                                   ` Will Deacon
2018-03-27 14:36                                                     ` Will Deacon
2018-03-27 21:29                                                     ` Benjamin Herrenschmidt
2018-03-27 21:29                                                       ` Benjamin Herrenschmidt
2018-03-28  8:53                                                       ` Will Deacon
2018-03-28  8:53                                                         ` Will Deacon
2018-03-28  9:00                                                         ` David Laight
2018-03-28  9:00                                                           ` David Laight
2018-03-28  9:09                                                           ` Will Deacon
2018-03-28  9:09                                                             ` Will Deacon
2018-03-28  9:56                                                             ` Benjamin Herrenschmidt
2018-03-28  9:56                                                               ` Benjamin Herrenschmidt
2018-03-28  9:50                                                         ` Benjamin Herrenschmidt
2018-03-28  9:50                                                           ` Benjamin Herrenschmidt
2018-03-28  9:55                                                           ` Arnd Bergmann
2018-03-28  9:55                                                             ` Arnd Bergmann
2018-03-28 10:01                                                             ` Benjamin Herrenschmidt
2018-03-28 10:01                                                               ` Benjamin Herrenschmidt
2018-03-28 10:13                                                               ` Will Deacon
2018-03-28 10:13                                                                 ` Will Deacon
2018-03-28 16:57                                                                 ` Jason Gunthorpe
2018-03-28 16:57                                                                   ` Jason Gunthorpe
2018-03-29  9:19                                                                   ` Will Deacon
2018-03-29  9:19                                                                     ` Will Deacon
2018-03-29 14:45                                                                     ` Jason Gunthorpe
2018-03-29 14:45                                                                       ` Jason Gunthorpe
2018-03-29 14:58                                                                       ` David Laight
2018-03-29 14:58                                                                         ` David Laight
2018-03-29 16:40                                                                         ` Jason Gunthorpe
2018-03-29 16:40                                                                           ` Jason Gunthorpe
2018-03-27 21:24                                                   ` Benjamin Herrenschmidt
2018-03-27 21:24                                                     ` Benjamin Herrenschmidt
2018-03-27 11:21                                         ` Benjamin Herrenschmidt
2018-03-27 11:21                                           ` Benjamin Herrenschmidt
2018-03-27  9:42                                     ` Will Deacon
2018-03-27  9:42                                       ` Will Deacon
2018-03-27 11:20                                       ` Benjamin Herrenschmidt
2018-03-27 11:20                                         ` Benjamin Herrenschmidt
2018-03-27 11:24                                         ` Will Deacon
2018-03-27 11:24                                           ` Will Deacon
2018-03-27 14:24                                       ` Jason Gunthorpe
2018-03-27 14:24                                         ` Jason Gunthorpe
2018-03-27 14:16                                     ` Jason Gunthorpe
2018-03-27 14:16                                       ` Jason Gunthorpe
2018-03-26 22:00                             ` Benjamin Herrenschmidt
2018-03-26 22:00                               ` Benjamin Herrenschmidt
2018-03-27 14:46                               ` Sinan Kaya
2018-03-27 15:01                                 ` Jose Abreu
2018-03-27 15:10                                 ` Will Deacon
2018-03-27 18:54                                   ` Alexander Duyck
2018-03-27 19:54                                     ` Arnd Bergmann
2018-03-27 19:54                                       ` Arnd Bergmann
2018-03-27 20:46                                       ` Arnd Bergmann
2018-03-27 20:46                                         ` Arnd Bergmann
2018-03-27 21:33                                     ` Benjamin Herrenschmidt
2018-03-28  0:39                                       ` Linus Torvalds
2018-03-28  1:03                                         ` Benjamin Herrenschmidt
2018-03-28  2:51                                           ` Linus Torvalds
2018-03-28  3:24                                             ` Sinan Kaya
2018-03-28  4:41                                               ` Benjamin Herrenschmidt
2018-03-28  6:14                                               ` Linus Torvalds
2018-03-28 11:41                                                 ` okaya
2018-03-28 15:13                                                   ` Benjamin Herrenschmidt
2018-03-28 15:55                                                     ` David Miller
2018-03-28 16:23                                                       ` Nicholas Piggin
2018-03-28 21:31                                                         ` Benjamin Herrenschmidt
2018-03-28 22:09                                                           ` Nicholas Piggin
2018-03-29  9:20                                                           ` Will Deacon
2018-03-29 13:56                                                       ` Sinan Kaya
2018-03-29 14:04                                                         ` David Miller
2018-03-29 16:29                                                         ` Arnd Bergmann
2018-03-29 16:59                                                           ` Sinan Kaya
2018-03-30  1:40                                                         ` Benjamin Herrenschmidt
2018-04-02 13:01                                                           ` Sinan Kaya
2018-03-28  4:33                                             ` Benjamin Herrenschmidt
2018-03-28  6:26                                               ` Linus Torvalds
2018-03-28  6:42                                                 ` Benjamin Herrenschmidt
2018-03-28  6:53                                                   ` Linus Torvalds
2018-03-28  6:53                                                     ` Linus Torvalds
2018-03-28  6:53                                                     ` Linus Torvalds
2018-03-28  6:56                                                     ` Benjamin Herrenschmidt
2018-03-28  7:11                                                       ` Arnd Bergmann
2018-03-28  7:42                                                         ` Benjamin Herrenschmidt
2018-03-28  9:07                                                   ` Will Deacon
2018-03-28  9:56                                                     ` Benjamin Herrenschmidt
2018-03-28 10:13                                                       ` Aw: " Lino Sanfilippo
2018-03-28 10:20                                                         ` Benjamin Herrenschmidt
2018-03-28 11:30                                                       ` David Laight
2018-03-28 11:30                                                         ` David Laight
2018-03-28 15:12                                                         ` Benjamin Herrenschmidt
2018-03-28 16:16                                                           ` David Laight
2018-03-28 16:16                                                             ` David Laight
2018-03-28  1:21                                   ` Benjamin Herrenschmidt
2018-03-27 21:35                                 ` Benjamin Herrenschmidt
2018-03-26 21:26                   ` Benjamin Herrenschmidt
2018-03-26 21:26                     ` Benjamin Herrenschmidt
2018-03-27 21:54 Alexander Duyck
2018-03-27 22:35 ` Sinan Kaya
2018-03-27 23:43 ` Benjamin Herrenschmidt

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.