Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2513232imu; Tue, 6 Nov 2018 16:22:32 -0800 (PST) X-Google-Smtp-Source: AJdET5cgmudmwyE8WKovoUHYwiqzMucYWXkgusCZtuKei82+yJf3xp4HDLe/4Gu7i+6m5UwMPXR7 X-Received: by 2002:a17:902:8504:: with SMTP id bj4-v6mr24408870plb.99.1541550151955; Tue, 06 Nov 2018 16:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541550151; cv=none; d=google.com; s=arc-20160816; b=JZoeST9ytpMIYiFptquADPoAxra7nH/pqwPX011IqgaJsucGD5Uwhu03hp9T026a4K rOH1nytY8bB+qJcCrRI6Fjx/Eyb2UVeKLy9E35KcpgeE8LG9GtH751qIFbCwk/IKAvs9 9DFT2TIdBFOEbwJ9anWBuQdtQhAKBNlzLLmcCGaqxXohuN2P1mYI1JFGkPMQ7xjQV650 GwzmTTzrcnTNCT8FjW3stJw5vLtYS66NO9o/lYY0N8XMbsKq36dQra8HMsVn4c4rHSFY NXxRGb3hoLXI5rvbRzVWwWknDZD7EsEjlvZ7c3UASCxxpq12nwZwzG7Ak4/za+/qMPBZ 6UjQ== 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:dkim-signature; bh=F3dmmkrBM26xZCruBFL0oc+LVw/FdHiNlDaVh9Ykdms=; b=Cczk34d8VmM+jSYWC1yQVJ+RUrHNHn5NhX/B+EO55+vSl85I++p8HIVtroukwYMBUy yZGnQm7/B9fr9oCoFt9uG4B+bkFtK1T8ApQ3dJ6DawcV+ObfoT7mjeTabUn21/vB3xJ8 6ma/Z3iuia4ZV6RuRfWom+v2i3yshrVc/7zPSHY4nkjbmGl4JPL6ArV9M+2V6vpuOX+y 5YzQs284evvzc8e+KpNDZF3SaOBhZib+todCSJVQUmyjnRAoJZBHydk/odeeNMvNorqk 3IKUzbMm5gaQ5EHQV7C4Mh69SwRadgHhXr8IV0O73U2X4UEC0yClH8keh5Nr12yvEgJH NGzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iFH6hrDq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23-v6si46924331pgh.581.2018.11.06.16.22.16; Tue, 06 Nov 2018 16:22:31 -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=@google.com header.s=20161025 header.b=iFH6hrDq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731060AbeKGJsy (ORCPT + 99 others); Wed, 7 Nov 2018 04:48:54 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37054 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727270AbeKGJsy (ORCPT ); Wed, 7 Nov 2018 04:48:54 -0500 Received: by mail-wr1-f65.google.com with SMTP id o15-v6so11910683wrv.4 for ; Tue, 06 Nov 2018 16:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F3dmmkrBM26xZCruBFL0oc+LVw/FdHiNlDaVh9Ykdms=; b=iFH6hrDqieyL0+ThKkryVLSC8XS1BdAPCrsjtx2VaaxjB3I8X2sPFNZ5iBFwxsrGuo 80odhMq/3KQDopMfEUVFRLc5bPKJvALFvYZFPBLGKnonbeIICrJHYvST227KKU8XHClo uWnG7xBYEW5gfJerBlUvqZV8FxE8OnVosFXYQlCRYLmSVf0jjGiw8vQFA8EwTsoZafV3 MTOuHwQgmSYQisu5WEr+Lo3JdwCNP/CnRAHssY770sxbX40fMgx0da+/gMquhYO+pwGo qhZyFRxl6Ydjxp+uZkofUKpJgkI3XG5Aq087GYwzOlOsL/X/kwMrbRbjg3QwLiq+ItAh AQ2g== 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=F3dmmkrBM26xZCruBFL0oc+LVw/FdHiNlDaVh9Ykdms=; b=N2rm9YGBOMHEWKGVEjLvhnG6Ml9dPM/QCnvJCWciY1ASV04oWtOx8UO4U8KV0KjSoj FqD5PJeHUPKGrzZtCxcVCgoPfwDEAhYsNvdbcmHPuLQ8AHWfCp39sr4dZ+7HV2V4TrQv PlFakFydm19p4n4sj2334L2HBjkBKNWQv1Ecl3t9oWf+00rR1hwUcPWvz+/VSf+6MEH6 hccwCFGLl1Smk17ebccfcvLnPAPU/VrmwObENaEvN1VduDzVcQ4Krcy0q3UxOp9/Swok h9+3XuyDuslcGCnrf/QMND8r9l2QsCSC903GPe2yL2iYbn6XAlVtpcn9IC122VTfymYG 4VdQ== X-Gm-Message-State: AGRZ1gLcubMgqrdxxaY7p8hPusHaci0xnR4LDQxIwIRqTsPqR+Ez42Zu Dxr4vBc2J/DZ1Fx6PW9Z1gFnq82EGB7a+2aT/jodDw== X-Received: by 2002:a5d:6489:: with SMTP id r9-v6mr23574074wru.92.1541550061092; Tue, 06 Nov 2018 16:21:01 -0800 (PST) MIME-Version: 1.0 References: <20180818155724.GA22569@kroah.com> <20180828103817.GB1397@do-kernel> <20180828123607.GB13441@kroah.com> <20180828143049.GA7388@darwi-kernel> <20180910081626.GA31344@kroah.com> <20180910152837.GA31819@darwi-kernel> In-Reply-To: <20180910152837.GA31819@darwi-kernel> From: Todd Poynor Date: Tue, 6 Nov 2018 16:20:49 -0800 Message-ID: Subject: RFC: staging: gasket: re-implement using UIO To: "Ahmed S. Darwish" Cc: Greg KH , Rob Springer , LKML , devel@linuxdriverproject.org 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, Sep 10, 2018 at 8:28 AM Ahmed S. Darwish wrote: > > The gasket in-kernel framework, recently introduced under staging, > re-implements what is already long-time provided by the UIO > subsystem, with extra PCI BAR remapping and MSI conveniences. > > Before moving it out of staging, make sure we add the new bits to > the UIO framework instead, then transform its signle client, the > Apex driver, to a proper UIO driver (uio_driver.h). > > Link: https://lkml.kernel.org/r/20180828103817.GB1397@do-kernel So I'm looking at this for reals now. The BAR mapping stuff is straightforward with the existing framework. Everything else could be done outside of UIO via the existing device interface, but figured I'd collect any opinions about adding the new bits to UIO. The Apex device has 13 MSIX interrupts. UIO does one IRQ per device. The PRUSS driver registers 8 instances of the UIO device with identical memory mappings but individual IRQs for its 8 interrupts. Currently gasket has userspace pass down an eventfd (via ioctl) for each interrupt it wants to watch. Is there interest in modifying UIO to handle multiple IRQs in some perhaps similar fashion? Speaking of ioctls, are those allowed here, or is sysfs or something else always required? The aforementioned multiple IRQ stuff probably maps nicely to sysfs (there's a small number of them easily represented as attributes), while DMA buffer mappings seem more problematic, but maybe somebody's thought of a good way to represent these already. And then we need to map buffers to our device. We could probably implement this via an IOMMU driver API for our custom MMU and hook that up to generic IOMMU support for UIO, which sounds like something a lot of drivers could use. There's a few other tidbits the driver does, including allocating coherent memory for userspace to share with the device, but that's probably enough for now. If anybody wants to squash any of the above as a non-starter for UIO or point things in a different direction, it's appreciated. Thanks, Todd