Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp527181ybc; Sat, 16 Nov 2019 04:02:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzaFq0SS/3IgEQLyEMK+IzOych+1uJZ7xvKm/U92Ch7Uir836oAgDdsN38IeCn7elsQ5jpD X-Received: by 2002:a17:906:1942:: with SMTP id b2mr9219486eje.36.1573905733977; Sat, 16 Nov 2019 04:02:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573905733; cv=none; d=google.com; s=arc-20160816; b=vyfR6htLD4fJLsvRvzaEYxxIXxB1tY+8UM4NRIUeXyvFwwg+ILgLyvHoEWLGBraxGs ulkcUlcXbZsgbX/crGLL9NW+oimZOhBGPIXAAOmiR/e5fJSuElaGQd4YqYphouu3gAV1 qUgdBflNaTcprc4KQ+2pECUjP72Y+35Ok4FtNu6Gfx5iobKsX3SV7P2XW7gBbUZW3J/W HzlrNGqlf5Tm5IVaA7ZAm5hNRUP9u0GiGyWanIwdgBycq0TS5sYlSjeLJDE+ScoIE91E qtbSOhTTFMs6Iv5T09v29L3eVzdyYHIIwvxOjEL4qPihDIC3Wuz4yaPPdzzoMV7F55mb Bb3g== 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=8vKWf3FOmW48gdw7OJcX7nlxTYmk47NGDaHdJTebpxA=; b=PV/Jp9yo4x8bsKrf5BDKkkzhNSwHFQCjIg36HhEiZ9XwUzIviplMxK5kblQAP3P+i/ rr/Mga6WeXVZj7A3L6TptPMh4yEswyU6FKRRg9u1TRS1jliEfXe07jKV1Vf6OP6fTUqm BNEB6PTXcDCAfk8FImJyamvlPKHRJ0UwGpTTV0apiq5/HWqo/ievOaA1nSFG8bPk1DKz x+3RL3Fvw2CxmDaMwqMG+bW97m3YRz9IUIPoblTzYF1H/HmoZK2oNmmJ6IkLLTaSPuHg S0urylC3p+8zWAbn0E3SVPfPWMBUB24OdEHeIekLwfdZJ8Sh9oiurrbuJNzOBAebLTEI VUYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zJEPORk4; 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 mj10si7598192ejb.7.2019.11.16.04.01.43; Sat, 16 Nov 2019 04:02:13 -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=zJEPORk4; 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 S1727533AbfKPL63 (ORCPT + 99 others); Sat, 16 Nov 2019 06:58:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:58526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbfKPL62 (ORCPT ); Sat, 16 Nov 2019 06:58:28 -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 3D8AA206D3; Sat, 16 Nov 2019 11:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573905507; bh=G6B0AxgbXFr3HFRlfs/FptCB7nlL5xT03ZBsPb83aRs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zJEPORk44GaBau/3juxveA5ed2FkR+sse4+BMIGaZQd+P4hDOAvyzywPtfVkF8KC3 jGaMZA0MYczrl0W0HDX8QPr+hpcgpmk/oSNYsESo2G+vk2LBQstkiClmfO+x+Tg3FH wnIDoz3R/iDueylaG2sfcjR3aZziEIOWK0sZC5s0= Date: Sat, 16 Nov 2019 12:58:24 +0100 From: Greg Kroah-Hartman To: Tomas Winkler Cc: Alexander Usyskin , linux-kernel@vger.kernel.org Subject: Re: [char-misc-next] mei: bus: add more client attributes to sysfs Message-ID: <20191116115824.GB425445@kroah.com> References: <20191116142136.17535-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191116142136.17535-1-tomas.winkler@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 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. thanks, greg k-h