Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp324946imm; Mon, 9 Jul 2018 02:25:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPzN2gKey0yEX31uA3rcd5ahgvWsVJ3TjBusEzNEJU8+414ohERVv6oKGTl9eSheH2NpnV X-Received: by 2002:a62:9bc5:: with SMTP id e66-v6mr20395478pfk.84.1531128343463; Mon, 09 Jul 2018 02:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531128343; cv=none; d=google.com; s=arc-20160816; b=HnvcbkJ6qz91Ui3iO4hMge5fnEFg2LeISkIgR2UCPTBxbbtiWE+5GNVrgDR8bjbIck o9SyUNrm1fY/qEJqCwsuCqSW+woEfkdOMvR9znzdQ8gvPwaOae54sw/KDQU3U21Jro8V Qfi7+mOulXPnLM8cENwj4MSuOTNiXqlYeyJOADg+XVgaKkteKjgNVoeX4XHfSLZQna2B ENokUOIzmx//bBvZi0bHFFR5KkPDvUnN4OLgjdvh/vMP+9ekwAcn0GKG3Dn6XbzXzZne NKVSelDTFNqAfhHcCF07ZvHv9V1uhiCTxnLONdo9H16qchPcrTUPNpeBF+qsmz3qkwdV 424A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=wtgZh7aWIm+e4IJUwxxS6DFphYJ6JhlG/9v1/DeW2C8=; b=eUC2tVdVExnihEBeKgG5p9GaMuDm3AumBNo/JvUNXZyhk7LsXtXUHJ0qTwZ8H0ruDv g3eu8DtLSE2SCygvQDU7RL1P0T6BpOjPjXP9e6r/F26h49NRUJkowvh2ixYNo3rkuE4K y6S1bSLZulc/VBUGemEXmHrikTukRXYf5+0mCKz3JNq96NHaX8mL4SKRnsObOVHTN5Zn eihc4tro5c7Lq/wHVfVmZF2S1zAsDaw1fKlZ+UML1zhyBgvR9JCj/LThEfhovO/hir1Y qDDwwEm0CzrGlS/3IND7mKhOnQ6SbynatebRzuZ35khPEoOH6lToqasbVfy7OuV1vg47 9w4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11-v6si13906727plz.333.2018.07.09.02.25.28; Mon, 09 Jul 2018 02:25:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932812AbeGIJXd (ORCPT + 99 others); Mon, 9 Jul 2018 05:23:33 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:35858 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932431AbeGIJXb (ORCPT ); Mon, 9 Jul 2018 05:23:31 -0400 Received: by mail-ua0-f196.google.com with SMTP id y8-v6so11278430uan.3; Mon, 09 Jul 2018 02:23:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wtgZh7aWIm+e4IJUwxxS6DFphYJ6JhlG/9v1/DeW2C8=; b=PloS3/DlHloQiDPOy2igNmaynAIAbq6WCjvCFeTPluB++9Q/YIzyaI89ys4H0QRBTk Wy2MsWm99VNy4HR2M46Nzg2YQQbgzVVpJX+efbDYYDRmQ1VWxbihAiRvvZErYX3wsqST AqjEYb1Ygdxy8aIhPOWTlT9WB439qafXskKAUl/8xOo5l7IzJ5TBoD0EXyaUlnRGeuhi ZW5nDH2osanbgsTGw/74ioX0qzUnU46WXXF8TnxL5hRvjEw01yLCkQxd0j5qMYPDNj1N 3NX9T1p2L1z/IwDnnXqJLh9jgG19fWyDHN8dSI6H2NGm2VdSq3KvWpb7luKy79r3LLfW yXyA== X-Gm-Message-State: APt69E0pVLYsgijAoDo8JN3mR4Swj89I9fEm3nDCldANheR5/OAtsVo0 F7ln0Rysw+6O+xVlvzGyQXg/OZ+JwJmPVSHdLhI= X-Received: by 2002:ab0:221:: with SMTP id 30-v6mr2544654uas.26.1531128210652; Mon, 09 Jul 2018 02:23:30 -0700 (PDT) MIME-Version: 1.0 References: <20180709044444.6397-1-abrodkin@synopsys.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 9 Jul 2018 11:23:19 +0200 Message-ID: Subject: Re: [RESEND PATCH v2] devres: Really align data field to unsigned long long To: David Laight Cc: Alexey Brodkin , Linux Kernel Mailing List , arcml , Linux-Arch , Greg KH , Greg KH , Thomas Gleixner , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 9, 2018 at 11:15 AM David Laight wrote: > From: Alexey Brodkin > > Sent: 09 July 2018 05:45 > > Depending on ABI "long long" type of a particular 32-bit CPU > > might be aligned by either word (32-bits) or double word (64-bits). > > Make sure "data" is really 64-bit aligned for any 32-bit CPU. > > > > At least for 32-bit ARC cores ABI requires "long long" types > > to be aligned by normal 32-bit word. This makes "data" field aligned to > > 12 bytes. Which is still OK as long as we use 32-bit data only. > > > > But once we want to use native atomic64_t type (i.e. when we use special > > instructions LLOCKD/SCONDD for accessing 64-bit data) we easily hit > > misaligned access exception. > > Shouldn't there be a typedef for the actual type. > Perhaps it is even atomic64_t ? > And have the __aligned(8) applied to that typedef ?? That indeed sounds like the best thing to do, as it will fix this issue in other places, too. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds