Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3998026pxj; Tue, 15 Jun 2021 13:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxou4KNfSkPm+Yh/hL1sOOwX8VEggsLHIArxei6K6P9jgJRJuyBRlsRSrPl3Z3Siq/20YIj X-Received: by 2002:a05:6e02:e53:: with SMTP id l19mr917435ilk.15.1623787630077; Tue, 15 Jun 2021 13:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623787630; cv=none; d=google.com; s=arc-20160816; b=zq1VP7uMHqLBEp+Ve/fn75sQm45AVVntrmIMNPC1UW0BeIilMTqxDpmAPyhVmYbusY H5nK8XGiKwhBY3Una/viQuTWGYBe0Gl2QEbVTqAcQVrsOO3U58j0wvIS3rrMgHIf+pjW YGBno3VJfoYNykPL7syygo/wrsU140XeioHZQqVO1taewIzmYhslz6tMTkkCJaY9NpLQ j2tYtoIGB7oPkFlx7Mo4aoc6ATQgHh7rF/dhmcTJP8Wu62kZnwYkbPWRFwCikRsiiPH4 oBpAfoFwPBrkBgQH1Lb6iDNjnDXRK9CR0IkrTxnCSUiEx1ue0elpdsGmsO4ldxk1Qgs0 2hKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H1Hrr3f9fv/XXkIZU+MLNVsm0U18tLCQbKfp3yrHWT8=; b=yG6OkVQJAGiMbDWO1opIm0T4jLgnXS2suUP0cmC08NwDMYngd7Jbbnp/81vzjHWxcv 2r2rI5NNp1sTQgrUAw7FLyszYufeOpQrwmpwxdZKImIIMXyoHMIchWHUt6bnJdQafCIL LEiIsDpdnvExD+pl7lOhUDnrA/oI/HaE13W42KcDZyTNPOYtE72EyCvK9mqb6KTlx34h +Wa+xUpKCcwYiyOlFRuHIEbjgwFzvtXxHXsVMjuITPgWCuvd6BN85nR221CWpc3mV4kp Ttln6858IAz57Pgu5zwy7acSNRWwj3pPlqUghu8Ioieb6tHA6YB6XbDyqBC1n8CbEqw8 JqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YiMM+MC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si19392151ilu.130.2021.06.15.13.06.27; Tue, 15 Jun 2021 13:07:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YiMM+MC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbhFOUFn (ORCPT + 99 others); Tue, 15 Jun 2021 16:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbhFOUFl (ORCPT ); Tue, 15 Jun 2021 16:05:41 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7F26C061574 for ; Tue, 15 Jun 2021 13:03:34 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id r14so371359ljd.10 for ; Tue, 15 Jun 2021 13:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H1Hrr3f9fv/XXkIZU+MLNVsm0U18tLCQbKfp3yrHWT8=; b=YiMM+MC6BQRVEChXL7+wtKkdr+F4h4WDN6eVeYv2RufmZ+UMBbJzKxUsZlajx1uZxz N75NUvGyE2GCltiGwjgLOsN1J1rReAzyxNOC5kS4p7QwKajkJg0sQZksW8FyFLfhqAzv JCAWSROzB3Vzwfs4yFLokKeJV7QESCayhuTLMpS90sJKbPcITclklyVP6DwdjbC1c32D krls5wanQmpzZ87ZUL92g7VFZ1Td0USLzblVpGCmWbaRQdeo9YtyOXLwIzrkjnxi+Kg9 4X003EuuClFQUEv8qZ965MraCpA41G2aX+ZqY19L60T5/ousdJhPqTK8E0ok2f4cQpMk yhQw== 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=H1Hrr3f9fv/XXkIZU+MLNVsm0U18tLCQbKfp3yrHWT8=; b=kHFHISEvNn4tsusqaDk4jCaywmkWdU4JVN9pJGvlpWVjAmkDfYyQ38/GNN2qbwLiZb nEdUrC9c5bNwzu4FrvuWI6eAj0OFB5qkL3RLkbY7UTYgItrKyQ+L7K7EzJlRSAMo/y28 +KLEsq0cGtKVNg0sZte6nOC1pmXMW9c2hsHn1jhK56cJKxZ7jgC1jU1qVTHRG1PglgUw PxG3GIS/SyIYQhkT/n15PaodMaeaqQ0Hw2iIx4kptg87U78QVZX4zGxxOFgH7rKjtXW1 l2NqDrqa1md84x1d3FfkhWtJZoNebcks2sTWXgTtWuDcUQXetEGDle+H/IwxRltH23Sf Zu/Q== X-Gm-Message-State: AOAM531zh7L41KvBaYB+FHYXNYFKJB7OwbWCKH3UDjsXppdJy35t9b9f MLAIXqGo2n25bF7iaK+GGOn4i19yiYndCNSAK2zUjg== X-Received: by 2002:a2e:7811:: with SMTP id t17mr1187761ljc.368.1623787413246; Tue, 15 Jun 2021 13:03:33 -0700 (PDT) MIME-Version: 1.0 References: <10442926ae8a65f716bfc23f32339a6b35e51d5a.1623326176.git.viresh.kumar@linaro.org> <20210611035623.z4f2ynumzozigqnv@vireshk-i7> <20210611080122.tlkidv6bowuka6fw@vireshk-i7> <20210615111551.7tcz7teqp4olhodf@vireshk-i7> In-Reply-To: <20210615111551.7tcz7teqp4olhodf@vireshk-i7> From: Linus Walleij Date: Tue, 15 Jun 2021 22:03:21 +0200 Message-ID: Subject: Re: [PATCH V3 1/3] gpio: Add virtio-gpio driver To: Viresh Kumar Cc: Geert Uytterhoeven , Bjorn Andersson , Bartosz Golaszewski , "Enrico Weigelt, metux IT consult" , Viresh Kumar , "Michael S. Tsirkin" , Jason Wang , Vincent Guittot , Bill Mills , =?UTF-8?B?QWxleCBCZW5uw6ll?= , stratos-dev@op-lists.linaro.org, "open list:GPIO SUBSYSTEM" , linux-kernel , Stefan Hajnoczi , "Stefano Garzarella --cc virtualization @ lists . linux-foundation . org" , virtualization@lists.linux-foundation.org, Alistair Strachan , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 1:15 PM Viresh Kumar wrote: > I am now wondering how interrupts can be made to work here. Do you > have anything in mind for that ? The aggregator does not aggregate interrupts only lines for now. > GPIO sysfs already supports interrupts, (...) I hope that doesn't make you tempted to use sysfs to get interrupts, those are awful, they use sysfs_notify_dirent() which means that if two IRQs happen in fast succession you will miss one of them and think it was only one. The GPIO character device supports low latency events forwarding interrupts to userspace including QEMU & similar, timestamps the events as close in time as possible to when they actually happen (which is necessary for any kind of industrial control) and will never miss an event if the hardware can register it. See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/gpio/gpio-event-mon.c Yours, Linus Walleij