Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1922274ybl; Thu, 19 Dec 2019 05:18:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyZd9yakoGW/L5Ye/ClUzjJCiDo4cUY7vVPMnN4vLk7Mg30SAxCigtIqfrzn/fW5WyJsAV2 X-Received: by 2002:a05:6830:158:: with SMTP id j24mr8938476otp.316.1576761499928; Thu, 19 Dec 2019 05:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576761499; cv=none; d=google.com; s=arc-20160816; b=WhQrqNscLQelP1e96F1nQdfvaWE8ez8pHIOYuhjZSwFLY+4E0tFkUIM0BUO6R85NZH bER33ZVmrNMCdclto7DikqT7RxlzJ/0+76TjlsKewzbOP+Wnsbi3NvLS/sIHVSCfH91n VMeyP+xVBI1SL6J9uWy+GFZcI05oJImWDO1N0x87JLlYYAJe0I45B7g9L3WbBFOsvCD4 2qIj3gH0vVd+XPJUkdkNgPvT7PuOoPipnJ6Chs3rycbF2FW2VizDvCXjRorU2w7IiIAm vSqKej/K4w8OCPuq+1kzkKYwJN3MhtXlGhKOq7uPZBNptROO1ESpEGijaxkKpViiLIEp XsRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=jw4pmutuy+Vq97iclaQ8+r0oYbBvDyG4Nv1qzyzsrWU=; b=L9P1reS/3KQATx/VwlO2abLmk6IqvL0EWSaYFZ8ZfPug09gxn6bHRg5WV95P7ZzsyZ 6W0BCE9YIZW1stbB6UgnHJ8yYW3UPI7SOB4c7AEagpaJYC4KGvLp15yugwgPtxFdG9Ni OL5UH2/yq55iZ8PSQyx9BoTPtidPsHPA71085gTvl6DNEi93bMx4COP1Grx1RGGdOnAD Eyv98/2z61IX+IMllty4X7jQ2RlBLOydG398ZayThQ52jQrfEdX2xfP3MKCpFgvMVEw1 ZkUTi686xRVvohclGL9NioHvlqxI9C6sdDHj2ytl/r51Lxo8TssfVDoVCEWBF/2kV/fQ A6Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=LFUH1vdr; 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 z3si3029570oib.164.2019.12.19.05.18.06; Thu, 19 Dec 2019 05:18:19 -0800 (PST) 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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=LFUH1vdr; 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 S1726873AbfLSNR2 (ORCPT + 99 others); Thu, 19 Dec 2019 08:17:28 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:46294 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfLSNR1 (ORCPT ); Thu, 19 Dec 2019 08:17:27 -0500 Received: by mail-io1-f68.google.com with SMTP id t26so5667736ioi.13 for ; Thu, 19 Dec 2019 05:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jw4pmutuy+Vq97iclaQ8+r0oYbBvDyG4Nv1qzyzsrWU=; b=LFUH1vdr/zB8R4iQUX1VdCJ5DJbOKe7GdTOH3PkFeydwmE7naIinE52ec+tOae3k/x kSQS/nO31+WMKhPzYbamyaOj0rObU6yFQ7ODCYON+v2cBs5M0vgSeL3NFDTgmoZS660p UXyaIiQkMBm6ssxqh9nlTRlHsu4WQwZHPQK11HTs5GxXnFZofQcFBQLpZpSi6uyqamu/ DZtEFUYLWUbb1RCtYp0ZG9XbbY+m4H5Rs/BMfCWQoKOdH7ZBGMhpaSbJzWJW2rOp3lE8 3cyR6LWuVLfGIfEnXWYG0dLqFHSo79RbSftItp1+9DGtTXVoeQgp9W5xjlqaoKOd650E WVVQ== 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:content-transfer-encoding; bh=jw4pmutuy+Vq97iclaQ8+r0oYbBvDyG4Nv1qzyzsrWU=; b=EnlIqn0LN4G/dcUAEuaBRmHJIMcCKjVWQgEUrt+IouNqq3dsXCWGvzgGODFWAbTFmP MGv8Rhx4d+64l9k4CwuCiUeYYnjMb149vA9uUqSO9w1o54RmJfpwSGlCH+spx8hj9VyD Zx/zHJYA2Wu4NQhsUM10RaWeZYwtnSMQ6Fz1Gp9sXW/SJgfIlg19RVobTODDdV29p5gj Qbz2X5tAQiW+d0nSGdxpFXqX3og9GyFpb6PdS+0zKL2GK/g/7pphc7PvusBXMcaf7KPZ eR2XkdKwOUumMJGx162OW/VggbQJ3zhs1YqE/RplC5BYt5BMlZr6p2E3MQh0EGLxh4v/ UxGQ== X-Gm-Message-State: APjAAAVw5jUB+tnVNnxmcK/xP9qseoMtoc5kIKZJW6lNJmJ8uRMwXTdj ZTtNodI+Sa/G4FTcFQMhVTSvExQljLrslw6KJZFo7fto X-Received: by 2002:a02:c85b:: with SMTP id r27mr6964167jao.57.1576761446932; Thu, 19 Dec 2019 05:17:26 -0800 (PST) MIME-Version: 1.0 References: <20191204155941.17814-1-brgl@bgdev.pl> <20191219131249.GA12008@firefly> In-Reply-To: <20191219131249.GA12008@firefly> From: Bartosz Golaszewski Date: Thu, 19 Dec 2019 14:17:16 +0100 Message-ID: Subject: Re: [PATCH v2 10/11] gpiolib: add new ioctl() for monitoring changes in line info To: Kent Gibson Cc: Andy Shevchenko , Bartosz Golaszewski , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 19 gru 2019 o 14:13 Kent Gibson napisa=C5=82(a= ): > > On Thu, Dec 19, 2019 at 02:05:19PM +0100, Bartosz Golaszewski wrote: > > wt., 10 gru 2019 o 18:00 Andy Shevchenko na= pisa=C5=82(a): > > > > > > > On a different note: why would endianness be an issue here? 32-bit > > > > variables with 64-bit alignment should still be in the same place i= n > > > > memory, right? > > > > > > With explicit padding, yes. > > > > > > > Any reason not to use __packed for this structure and not deal with > > > > this whole compat mess? > > > > > > Have been suggested that explicit padding is better approach. > > > (See my answer to Kent) > > > > > > > I also noticed that my change will only allow user-space to read on= e > > > > event at a time which seems to be a regression with regard to the > > > > current implementation. I probably need to address this too. > > > > > > Yes, but we have to have ABI v2 in place. > > > > Hi Andy, > > > > I was playing with some ideas for the new ABI and noticed that on > > 64-bit architecture the size of struct gpiochip_info is reported to be > > 68 bytes, not 72 as I would expect. Is implicit alignment padding not > > applied to a struct if there's a non-64bit-aligned 32-bit field at the > > end of it? Is there something I'm missing here? > > > > Struct alignment is based on the size of the largest element. > The largest element of struct gpiopchip_info is a __u32, so the struct > gets 32-bit alignment, even on 64-bit. > > The structs with the problems all contain a __u64, and so get padded out > to a 64-bit boundary. > Thanks for the clarification, now it makes sense. I assumed memory alignment depends on the architecture. I need to educate myself more on this subject I guess. Bart