Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp562435ybc; Sat, 16 Nov 2019 04:40:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx30U0QMZ0surNEygXZylXPUAdixIEKeodmwQGIJ9XEI4PC5Z/9wgeRgNYlN0F6QRMiO+rB X-Received: by 2002:a17:906:69d2:: with SMTP id g18mr9145603ejs.153.1573908030560; Sat, 16 Nov 2019 04:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573908030; cv=none; d=google.com; s=arc-20160816; b=fJuHk02bgGU5VIYNaigycpJJiVo5gWDUjqrjU+EAshKdGiFp1O8rWGXbwqdf7mxuiZ k0zAYZqS1tVbzUbIr7Et+DpFdipWDG6s52drhgyTkvxVWHPtB+mGz6xmT7wUToEI+Lt8 851vCpSY4txSbkM2oPyMvB3946GXhG+gVpOQMWQ9yVvzsdYKqOGkIV14YBnUEnvVHdUK gO2kyif6AL62bUFkWtt1eReve3Ynhtgmj/t79rn9R9Le+8KLO1GFBtvNuUPWnahkHZld xAVvYjCSI/xdcMe0MFn6ndOJIaXIefkTTY4gG6cxNDr2muGXxMZxod3s1U6IVuQ8mia8 6aZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OchFciPvLkWcDN+9AMaBbCnqAFh6pO0KpnU8vToDEGw=; b=A3cyMfOU60aS/qHbD6SJQAF51uiXi/fA3n1BTBrrstJJCkVxm58IOiYFEJFloknTl3 UlZdYMwCTA2NMiKMKZAlpAryCGWofR8OD84LkaDOP9R4WB4UCG8IW5Za78QZYempCf3s bPogz2aJp3qBeF97BLPClIfXeDQmkSvQBsl1KKhVgO5XSwSzxI0Kny8fFS/GwkglTImN n0gcyPXMZthc6+hJMWklwe/THANqquno+uXGiOSYbmg0PWi/RdetYsMjfwyJzq6+LQ/o UjoLeBLSQ844CIRuDzFXpQqRvLuTIFVKHDck6XaQTWeqBeEPsVc9J2EEk6dh7xUaVSX+ eHXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QEZEAIXG; 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 qn27si7363205ejb.426.2019.11.16.04.40.04; Sat, 16 Nov 2019 04:40:30 -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=@kernel.org header.s=default header.b=QEZEAIXG; 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 S1727556AbfKPMiz (ORCPT + 99 others); Sat, 16 Nov 2019 07:38:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:44974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727471AbfKPMiz (ORCPT ); Sat, 16 Nov 2019 07:38:55 -0500 Received: from localhost (unknown [84.241.192.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A05B6206D3; Sat, 16 Nov 2019 12:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573907934; bh=HBkvlpFZIO65jcpBhQKXq2tVhuOky695hw0cijzuhes=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QEZEAIXGtb20yNhvRlpWj5+HQNlUPUEsmiFAmvRDv0dOoU6+DkD2gRDDvx9o1WEIf QZPuCEZ7csgGCPzhiALnl2vfMDCrhiDmgk7BRKVkZiMncNk2eH7cUvHM0tsOn9zJm3 SbUYJQAMlZCg7jZdejx3g2Ws4UVbVkz6YNDpQsPE= Date: Sat, 16 Nov 2019 13:38:51 +0100 From: Greg Kroah-Hartman To: "Winkler, Tomas" Cc: "Usyskin, Alexander" , "linux-kernel@vger.kernel.org" Subject: Re: [char-misc-next] mei: bus: add more client attributes to sysfs Message-ID: <20191116123851.GA450532@kroah.com> References: <20191116142136.17535-1-tomas.winkler@intel.com> <20191116115824.GB425445@kroah.com> <5B8DA87D05A7694D9FA63FD143655C1B9DD16447@hasmsx108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9DD16447@hasmsx108.ger.corp.intel.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 16, 2019 at 12:08:52PM +0000, Winkler, Tomas wrote: > > > > On Sat, Nov 16, 2019 at 04:21:36PM +0200, Tomas Winkler wrote: > > > From: Alexander Usyskin > > > > > > Export more client attributes via sysfs that are usually obtained upon > > > connection. In some cases, for example a monitoring application may > > > wish to know the attributes without actually performing the connection. > > > Added attributes: > > > max number of connections, fixed address, max message length. > > > > > > Signed-off-by: Alexander Usyskin > > > Signed-off-by: Tomas Winkler > > > --- > > > Documentation/ABI/testing/sysfs-bus-mei | 21 +++++++++++++++ > > > drivers/misc/mei/bus.c | 33 +++++++++++++++++++++++ > > > drivers/misc/mei/client.h | 36 +++++++++++++++++++++++++ > > > 3 files changed, 90 insertions(+) > > > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-mei > > > b/Documentation/ABI/testing/sysfs-bus-mei > > > index 3f8701e8fa24..3d37e2796d5a 100644 > > > --- a/Documentation/ABI/testing/sysfs-bus-mei > > > +++ b/Documentation/ABI/testing/sysfs-bus-mei > > > @@ -26,3 +26,24 @@ KernelVersion: 4.3 > > > Contact: Tomas Winkler > > > Description: Stores mei client protocol version > > > Format: %d > > > + > > > +What: /sys/bus/mei/devices/.../max_conn > > > +Date: Nov 2019 > > > +KernelVersion: 5.5 > > > +Contact: Tomas Winkler > > > +Description: Stores mei client maximum number of connections > > > + Format: %d > > > + > > > +What: /sys/bus/mei/devices/.../fixed > > > +Date: Nov 2019 > > > +KernelVersion: 5.5 > > > +Contact: Tomas Winkler > > > +Description: Stores mei client fixed address, if any > > > + Format: %d > > > + > > > +What: /sys/bus/mei/devices/.../max_len > > > +Date: Nov 2019 > > > +KernelVersion: 5.5 > > > +Contact: Tomas Winkler > > > +Description: Stores mei client maximum message length > > > + Format: %d > > > diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index > > > 53bb394ccba6..a0a495c95e3c 100644 > > > --- a/drivers/misc/mei/bus.c > > > +++ b/drivers/misc/mei/bus.c > > > @@ -791,11 +791,44 @@ static ssize_t modalias_show(struct device *dev, > > > struct device_attribute *a, } static DEVICE_ATTR_RO(modalias); > > > > > > +static ssize_t max_conn_show(struct device *dev, struct device_attribute > > *a, > > > + char *buf) > > > +{ > > > + struct mei_cl_device *cldev = to_mei_cl_device(dev); > > > + u8 maxconn = mei_me_cl_max_conn(cldev->me_cl); > > > + > > > + return scnprintf(buf, PAGE_SIZE, "%d", maxconn); > > > > Nit, you can just do sprintf() for sysfs file attributes as you "know" > > the buffer is big enough and your variable will fit. > > > > Not a bit deal, but something to do in the future. > > > Right, missed that, I can fix it in a follow up patch or resend this one. follow-up is fine, I've already queued this one up. thanks, greg k-h