Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp896799imm; Fri, 17 Aug 2018 08:24:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzpEDPro2Nk0hMjUXjNy/dGuuk3MbOtKfw2AD26mnmxItGvawr+LnyaTaZjof7FPj5uDDlv X-Received: by 2002:a63:5866:: with SMTP id i38-v6mr33411135pgm.63.1534519465150; Fri, 17 Aug 2018 08:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534519465; cv=none; d=google.com; s=arc-20160816; b=XF8lu+lWCwPN5qG43vwq0BJd2quiOjAGg9RF1oksBbpYGuA+bxtlx/c46HLxQAem6Y 8LIRnlPwayiZyZlpB/PPFD9kFNmnNiCzzLvFDSX5IcKd3k3eyWt9mD5JXxqxGvr3NeNq maN1La8Ehm0bASctWJ212jIAfKqC2PpMxYJB5283bfaL8s1O3U1AnUodPxINRLipDO53 tCOwsiPnubKrcmP8oQFDKdVP3dUzzORgAaWRkctgYeLrZGqL/TGLWQDB2RnN1KGZxatF DpuN2Ii6ZrF7aos3MkrFcm63lpzzgYy99efaVLObH6FoKjUH+ZfvMRtRNVI+g3ZeKcH+ 54gA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Gtw8U6M1YN6hJovMedXkOYQAN7cTCpNydzYPiCT5XgM=; b=JNg8oKxi0EmDYVLYw+mE0QZCulAk+/jWTJM7oaJ2ns8tt3KrqZLLzurXFX3BdzTFIn FuesQoToWEJ+XDcVX28lMc7mfyRoXqMypXEQ6as70bNRGak6NmGtADUzz6BQ22n6km4z skq7v4dTJF+bZrsvu+cSNNEMvA0neoyCeRkFWn7rbY1TJfaC6hGkrsbLJOu0/Ox91EPu 6vcVo3EayY2dX3rUOM+XFVC3qaioQ7TLD523SsJzsxu/oYnaV0/r9La1TTU+VuPx/3FI UXgmvKg4xxeSzog+uCb4o6p78KANC/PTzJ4BbG4haCxjd+zUQ3RfF5SEcEkRmyQehquP vcjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WQcRXKm7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2-v6si2407755pgu.103.2018.08.17.08.24.08; Fri, 17 Aug 2018 08:24:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WQcRXKm7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727607AbeHQS0p (ORCPT + 99 others); Fri, 17 Aug 2018 14:26:45 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34138 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbeHQS0p (ORCPT ); Fri, 17 Aug 2018 14:26:45 -0400 Received: by mail-qk0-f194.google.com with SMTP id b66-v6so6479583qkj.1; Fri, 17 Aug 2018 08:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Gtw8U6M1YN6hJovMedXkOYQAN7cTCpNydzYPiCT5XgM=; b=WQcRXKm7gzhm2OU2KL11I2t7QG7zbpndEvH6MY6sisTefgiP98SnIWTjKZv64l+ALN w49G/o47pZDOXpoBg9HAv5uuI9wd0WsEDMUsrsNqk13bO+0nxs/2LN0mZeBd+gZ8pFuH ANp5vDCm6/JZOZUUMfDSS3tvLA4CekqNCideZTWrLcHXEIT/qrb//xy99ENHFDr3FFe6 CuJ8xuDRG9MiqSmdfsqxG0+5CAzoYww0tWvgxuh+LMRVm+ejMtcUssSKb+B4XoR1Log+ x5JA4Saf+GvCrZqvicUVfr4vDBjI1ozvi3OBdmJ48PcBEnTV7UoAnHGckjc79/hxXLv9 xZ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Gtw8U6M1YN6hJovMedXkOYQAN7cTCpNydzYPiCT5XgM=; b=DBbSx4sXYWYLOs81ImCmFzbP5gXwk4jp+REGjJhXegZAfSNPDqR3CsW/TW8w12fD8T DaDl//AuQwOFxwjme0qFiSiVEZ8J9knwvLgbGiJE11KUPOpZwGPJOqbXi/2ZQ0Zxl2Ft bo2a5MM9AvprH+9nKldtxP8m+XYspmvXMYPd8/vJc04rzRjlvskFeGLS1oRaKr64c0AR 5GF7SAXV/WBR7sv1UEUNYmuAlAKFYHF+GcSej4vEFE8EKy2zBZlgNo3vtCkqNdVyxAU5 PEXTbwE+LmbGkY0C8kxfAkU+tDr9ayH5m01CqoAEGK+6MYvL1VzzI7LD1gRdfJINL/8k NYlg== X-Gm-Message-State: AOUpUlFmm7QS8q4QNSRTJdRXFqxdjnqDxC/vDGQ+c/G/YyVvx1Z5Y0sq Akn+U5wh46j8SXq3jidqNVH+xw/mXkG+f+yZ/JRa2JYc X-Received: by 2002:a37:3752:: with SMTP id e79-v6mr33571387qka.131.1534519377366; Fri, 17 Aug 2018 08:22:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:949c:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 08:22:56 -0700 (PDT) In-Reply-To: References: <20180815220958.3606-1-atull@kernel.org> <1841468.1pWPcT6Du7@harkonnen> <20180816220034.GA4431@archbook> <2759044.uKe7sI2ItL@pcbe13614> From: Moritz Fischer Date: Fri, 17 Aug 2018 08:22:56 -0700 Message-ID: Subject: Re: [PATCH 2/2] fpga: add FPGA manager debugfs To: Alan Tull Cc: Federico Vaga , Jonathan Corbet , Randy Dunlap , Dinh Nguyen , Appana Durga Kedareswara Rao , linux-kernel , linux-fpga@vger.kernel.org, Linux Doc Mailing List , Alan Tull , Matthew Gerlach 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 Hi Alan, Federico, On Fri, Aug 17, 2018 at 6:19 AM, Alan Tull wrote: > On Fri, Aug 17, 2018, 2:00 AM Federico Vaga wrote: >> >> Hi Mortiz, >> >> I'm not 100% into the problem to understand all cases. I'm putting on the >> table the point of view, mainly, of an user. If you say there are problems >> here or there I believe you. At the beginning, you did not say that this >> interface may introduce problems (and I'm interested in those problems >> since I >> implemented one and we are using it), but that you fear that it becomes >> the >> default (usually, being a default is a good thing). >> >> Since you and Alan are working on this for a long time, you can read each >> other mind, but I need a more verbose email to understand ^_^' >> >> Of course the interface must be safe, I totally agree. In order to make me >> understand what are the issues, can you list some of them? Say you have kernel drivers (a network driver in the FPGA, or an I2C controller) for example bound to hardware on a MMIO bus in the the FPGA. You reprogram the FPGA using the debugfs interface, and the drivers don't get unloaded correctly, the driver will try to access the registers and depending on your system / bus either give you bad values or lock up. Now userland locked up your system. Bad. I'm not saying it isn't possible to do this if you're careful, of course you could first unload the drivers using rrmod and it would work just fine. I just feel an interface like this might make it easier to create the wrong design. I've seen plenty of Application notes from vendors where they literally did "cat foo.bin > /dev/fpga" followed by mmap(/dev/mem...). > > > Before we repeat what the doc l posted says, could you look at it and > comment on what I'm not saying there? > > https://lkml.org/lkml/2018/8/15/525 Alan, maybe I didn't express myself well. I'm fine with the debugfs interface as a debug interface, just not for general usage ;-) I think your document is clear on that. Thanks, Moritz