From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit Date: Mon, 9 Jul 2018 15:54:09 +0200 Message-ID: <20180709135409.GQ2476@hirez.programming.kicks-ass.net> References: <20180709134550.29541-1-abrodkin@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20180709134550.29541-1-abrodkin@synopsys.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: Alexey Brodkin Cc: linux-arch@vger.kernel.org, Greg Kroah-Hartman , Will Deacon , linux-kernel@vger.kernel.org, stable@vger.kernel.org, David Laight , Geert Uytterhoeven , Greg KH , Thomas Gleixner , linux-snps-arc@lists.infradead.org List-Id: linux-arch.vger.kernel.org On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index f98a097e73f2..d65327cb83c9 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -24,8 +24,12 @@ struct devres_node { > > struct devres { > struct devres_node node; > - /* -- 3 pointers */ > - unsigned long long data[]; /* guarantee ull alignment */ > + /* > + * data[] must be 64 bit aligned even on 32 bit architectures > + * because it might be accessed by instructions that require > + * aligned memory arguments such as atomic64_t. > + */ > + u8 __aligned(8) data[]; > }; >From a quick reading in Documentation/driver-model/devres.txt this devres muck is supposed to be device memory, right? atomics (as in atomic*_t) are not defined for use on mmio. wth kind of code is relying on this? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from merlin.infradead.org ([205.233.59.134]:54350 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754437AbeGINyk (ORCPT ); Mon, 9 Jul 2018 09:54:40 -0400 Date: Mon, 9 Jul 2018 15:54:09 +0200 From: Peter Zijlstra Subject: Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit Message-ID: <20180709135409.GQ2476@hirez.programming.kicks-ass.net> References: <20180709134550.29541-1-abrodkin@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180709134550.29541-1-abrodkin@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Alexey Brodkin Cc: linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, Greg Kroah-Hartman , Geert Uytterhoeven , David Laight , Thomas Gleixner , Will Deacon , Greg KH , stable@vger.kernel.org Message-ID: <20180709135409.1SthS0PLwQSgRyAZdPrantuXEXwg6UhF6n_K4zvmigk@z> On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index f98a097e73f2..d65327cb83c9 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -24,8 +24,12 @@ struct devres_node { > > struct devres { > struct devres_node node; > - /* -- 3 pointers */ > - unsigned long long data[]; /* guarantee ull alignment */ > + /* > + * data[] must be 64 bit aligned even on 32 bit architectures > + * because it might be accessed by instructions that require > + * aligned memory arguments such as atomic64_t. > + */ > + u8 __aligned(8) data[]; > };