Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1025117yba; Thu, 9 May 2019 09:30:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3NfoHoTDII+Jy+Oz3LDrFbHiM3UAAh0DLJICpyxux85AkDI4cVi+TYNqGVC9wsOz72yES X-Received: by 2002:a65:480c:: with SMTP id h12mr6665084pgs.266.1557419433236; Thu, 09 May 2019 09:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557419433; cv=none; d=google.com; s=arc-20160816; b=i3LEh6IpsNB/vEzdz78edwjdzGR4fvNsndQ06/DrRrcLmcKjLxFYSGQLF3mvAqIEw7 D4fvKwMJhpwref0PRV8Jco0c+ItbKspboPDr4SdNJTFEmA5BMo+n4EX6QVqzjHQK88Hr T0wZHU+eLtkT7jTtIHi9QrPr7GNwJamFbBPyIFvEir/S4jIO5VyEM6BH/QBSPO0QaQnU iI5AaigTjtEdGKCLkK9YgzgfssVCbq0P+joEe9IHfaiGDDof233JSYKQdS9ZboKh/jP6 HkjZ2VKVTNzgNiO/wQpidv5SWGJtXU4tu9NlcHucJNMyaJAqDJb4ifpb7+Eli+oCdVCJ 3vwg== 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=pZJuXm30yJjd76Wy2Pip1008q4e1Z6Nd+OjUS67/HqQ=; b=GNJ/ZHOJUq7VhQjObMVo9iBAahH9sF7Pvv0mbo4E0mQ2KpzpwToZszc6DxFuSu1u6R FOcsGD7xStjLHvRm8bw/7Pcan/V1Nybx+h6zxC7iQK9CjmcVS3Z1FGNElbZcu2pyiONc ZIs51NB3NK3LF84NVszIEKQvlKbJqWMqOMZEXZBmIK7A+25SjADjhPVD9ErA2emiIvl4 3qdy0+x35YefwAVD+G1UdocPVYJZ1j/Vs0dkmvBavIagI/vfY4eHJVERGwoG03prrFkR 38WJyO2IBoWKPGRUQs5MW8cH2pYoCL5cEx2+pHP5K4YxujSZF3oz0lDUXHoAwHJTcYL3 NcRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PhpBv3IT; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r24si3492185pgo.573.2019.05.09.09.30.17; Thu, 09 May 2019 09:30:33 -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=@kernel.org header.s=default header.b=PhpBv3IT; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbfEIQ2P (ORCPT + 99 others); Thu, 9 May 2019 12:28:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:49126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbfEIQ2P (ORCPT ); Thu, 9 May 2019 12:28:15 -0400 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BA98217D6; Thu, 9 May 2019 16:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557419294; bh=Lo3r6wNDDWExsDlCrsz8PRoFKAFhRY2+YVQdSepHBIQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PhpBv3ITWgz5jj6W/YaFgqU0Z3P2KxPCEpcMo8uxAA/qN4c5Tx0dY53ZytcL8UlLp 4hPc7nSjA14iIRed/Fem1pCw3YNLkN6OEpAVf2y/eKErfSaHbDHOfTUPPhpqfrKkKx RgHz+M1T9QkqJ4JY06uGCKE+akJKlDhY059Zqbmw= Received: by mail-ed1-f53.google.com with SMTP id e24so2577642edq.6; Thu, 09 May 2019 09:28:14 -0700 (PDT) X-Gm-Message-State: APjAAAXod85uE7nwHRdez0ER8O+tJr3mgrHuBnpKDyKj+2yngCszGyEI wxvIjh9pJtqQzeqYmxWMELVhRhNjlxvUtf1ehBA= X-Received: by 2002:a50:b854:: with SMTP id k20mr5122116ede.224.1557419292938; Thu, 09 May 2019 09:28:12 -0700 (PDT) MIME-Version: 1.0 References: <1556528151-17221-1-git-send-email-hao.wu@intel.com> <1556528151-17221-18-git-send-email-hao.wu@intel.com> In-Reply-To: <1556528151-17221-18-git-send-email-hao.wu@intel.com> From: Alan Tull Date: Thu, 9 May 2019 11:27:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 17/18] fpga: dfl: fme: add global error reporting support To: Wu Hao Cc: Moritz Fischer , linux-fpga@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, Luwei Kang , Ananda Ravuri , Xu Yilun 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, Apr 29, 2019 at 4:13 AM Wu Hao wrote: Hi Hao, The changes look good. There's one easy to fix thing that Greg has pointed out recently on another patch (below). > > This patch adds support for global error reporting for FPGA > Management Engine (FME), it introduces sysfs interfaces to > report different error detected by the hardware, and allow > user to clear errors or inject error for testing purpose. > > Signed-off-by: Luwei Kang > Signed-off-by: Ananda Ravuri > Signed-off-by: Xu Yilun > Signed-off-by: Wu Hao Acked-by: Alan Tull > --- > v2: fix issues found in sysfs doc. > fix returned error code issues for writable sysfs interfaces. > (use -EINVAL if input doesn't match error code) > reorder the sysfs groups in code. > +static ssize_t revision_show(struct device *dev, struct device_attribute *attr, > + char *buf) > +{ > + struct device *err_dev = dev->parent; > + void __iomem *base; > + > + base = dfl_get_feature_ioaddr_by_id(err_dev, FME_FEATURE_ID_GLOBAL_ERR); > + > + return scnprintf(buf, PAGE_SIZE, "%u\n", dfl_feature_revision(base)); Greg is discouraging use of scnprintf for sysfs attributes where it's not needed [1]. Please fix this up the attributes added in this patchset. Besides that, looks good, I added my Ack. Alan > +} > +static DEVICE_ATTR_RO(revision); [1] https://lkml.org/lkml/2019/4/25/1050