Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp537159ybc; Sat, 16 Nov 2019 04:11:52 -0800 (PST) X-Google-Smtp-Source: APXvYqw2/oJhjufVGXsXrduh7P7NX7qQWXQWYziHrfWmBGj3nsGh9n146zW2+XSX7OClPJ7Wbvrn X-Received: by 2002:a17:906:1c4d:: with SMTP id l13mr9159224ejg.308.1573906312624; Sat, 16 Nov 2019 04:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573906312; cv=none; d=google.com; s=arc-20160816; b=n6jCS5sqveVMB5j0A7UPE+5KFhvuymGGGdd6N4sX26Lm7GZOpo4cL/gR14CtMBQe8b wVgbra29Mffmb9XIMRp93SG78IwKHMwAmUEuxh5+d0GcpfZhyIDuxJmjF8ewmwNDWO6k YYXZxH8EVCddYxWhy6zayDgTMgKV1BPRp6uElQgzIl3jE82SA62NYNN1c1uUoTLvNSRl mrt62qXB21h+MU/bjRIZFGCjVsp8cGJeIU8ZSekw+7O3gfhuwD7fPBH/kK7Z5NLHgxqK LrY0kfK3EqpKT9hIkooju1kD2I1sKfwV2f2j4LkFVB9aQRy8NPfIjsZ7/Uwfiv/dRZ0/ N2WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=kd/FpAvJwLXB1gjHgBE/tQzdw9Hr/wBGaU7yq5cpj6s=; b=UcFFK03T7IqqxWoS8DdGA9mM3x6PZ9y2cqWKJygD+nUhZ0UkG26bZqFJGcGiAyRbIA Mh2Mnrpo0iep1/WZzmab0N/pTfe+xIGYq7wj0nAA0WKw3tRY3F3D6wEfNTaY7LPmW7pn GXgB1Rgbz0JjwfFtU7q7Arb3SRYO3C2kvDB+Ee+iR2UgCzZMhdL0iI2M9hZNojoocZvK Mr7drcI3EEP/zF81hexAbHIMLUjlInNdra+ifv/kkXszUg/na6xJSKhszvtHa5ju3GS5 +vywt4/hhrVQI5JpKPJ24Ot/PG7cV/j8wAQKOvHfCcvwLTy4/jQ9NNJScp7FF/oc8WD2 iTLQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si7556778eja.146.2019.11.16.04.11.27; Sat, 16 Nov 2019 04:11:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727601AbfKPMI6 convert rfc822-to-8bit (ORCPT + 99 others); Sat, 16 Nov 2019 07:08:58 -0500 Received: from mga07.intel.com ([134.134.136.100]:52807 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbfKPMI6 (ORCPT ); Sat, 16 Nov 2019 07:08:58 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2019 04:08:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,312,1569308400"; d="scan'208";a="406934313" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 16 Nov 2019 04:08:57 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 16 Nov 2019 04:08:56 -0800 Received: from hasmsx107.ger.corp.intel.com (10.184.198.27) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 16 Nov 2019 04:08:56 -0800 Received: from hasmsx108.ger.corp.intel.com ([169.254.9.66]) by hasmsx107.ger.corp.intel.com ([169.254.2.168]) with mapi id 14.03.0439.000; Sat, 16 Nov 2019 14:08:53 +0200 From: "Winkler, Tomas" To: Greg Kroah-Hartman CC: "Usyskin, Alexander" , "linux-kernel@vger.kernel.org" Subject: RE: [char-misc-next] mei: bus: add more client attributes to sysfs Thread-Topic: [char-misc-next] mei: bus: add more client attributes to sysfs Thread-Index: AQHVnHIYaV4WCqSUt0SW8MHHb8kk8aeNj+AAgAAieMA= Date: Sat, 16 Nov 2019 12:08:52 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9DD16447@hasmsx108.ger.corp.intel.com> References: <20191116142136.17535-1-tomas.winkler@intel.com> <20191116115824.GB425445@kroah.com> In-Reply-To: <20191116115824.GB425445@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDQ4MGIxNDYtMDZmZC00NzRhLTk1YmYtNWMyOWQ2NDk5YmFmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUk1GajEycUlOcFMxSTBkbHhsUzVDNGl5MG9rdUlaTG5TMmpBQUtVbW40aTVHMVlvMkt4N3FDMFM1WFZqaDJEMyJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 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. Right, missed that, I can fix it in a follow up patch or resend this one. Thanks Tomas