From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: "Lee Jones" <lee@kernel.org>, "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Pavel Machek" <pavel@kernel.org>,
"Arnd Bergmann" <arnd@arndb.de>,
"Sebastian Reichel" <sre@kernel.org>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Ion Agorria" <ion@agorria.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v1 2/9] misc: Support Asus Transformer's EC access device
Date: Tue, 3 Feb 2026 17:45:12 +0100 [thread overview]
Message-ID: <2026020314-humbling-mobility-c24a@gregkh> (raw)
In-Reply-To: <CAPVz0n2HmLwdif5ry+y56LB8Gpwh2o9_gJ7K2jhcZVR=rPgfPA@mail.gmail.com>
On Tue, Feb 03, 2026 at 06:28:11PM +0200, Svyatoslav Ryhel wrote:
> вт, 3 лют. 2026 р. о 14:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org> пише:
> >
> > On Tue, Feb 03, 2026 at 01:54:58PM +0200, Svyatoslav Ryhel wrote:
> > > вт, 3 лют. 2026 р. о 13:41 Greg Kroah-Hartman <gregkh@linuxfoundation.org> пише:
> > > >
> > > > On Sun, Feb 01, 2026 at 12:43:36PM +0200, Svyatoslav Ryhel wrote:
> > > > > --- /dev/null
> > > > > +++ b/drivers/misc/asus-dockram.c
> > > > > @@ -0,0 +1,327 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0-or-later
> > > > > +/*
> > > > > + * ASUS EC: DockRAM
> > > > > + */
> > > > > +
> > > > > +#include <linux/device.h>
> > > > > +#include <linux/err.h>
> > > > > +#include <linux/i2c.h>
> > > > > +#include <linux/mfd/asus-ec.h>
> > > > > +#include <linux/mod_devicetable.h>
> > > > > +#include <linux/module.h>
> > > > > +#include <linux/mutex.h>
> > > > > +#include <linux/slab.h>
> > > > > +#include <linux/string.h>
> > > > > +#include <linux/sysfs.h>
> > > > > +#include <linux/types.h>
> > > > > +#include <linux/unaligned.h>
> > > > > +
> > > > > +struct dockram_ec_data {
> > > > > + struct mutex ctl_lock; /* prevent simultaneous access */
> > > > > + char ctl_data[DOCKRAM_ENTRY_BUFSIZE];
> > > > > +};
> > > > > +
> > > > > +int asus_dockram_read(struct i2c_client *client, int reg, char *buf)
> > > > > +{
> > > > > + int rc;
> > > > > +
> > > > > + memset(buf, 0, DOCKRAM_ENTRY_BUFSIZE);
> > > > > + rc = i2c_smbus_read_i2c_block_data(client, reg, DOCKRAM_ENTRY_BUFSIZE, buf);
> > > > > + if (rc < 0)
> > > > > + return rc;
> > > > > +
> > > > > + if (buf[0] > DOCKRAM_ENTRY_SIZE) {
> > > > > + dev_err(&client->dev, "bad data len; buffer: %*ph; rc: %d\n",
> > > > > + DOCKRAM_ENTRY_BUFSIZE, buf, rc);
> > > > > + return -EPROTO;
> > > > > + }
> > > > > +
> > > > > + dev_dbg(&client->dev, "got data; buffer: %*ph; rc: %d\n",
> > > > > + DOCKRAM_ENTRY_BUFSIZE, buf, rc);
> > > > > +
> > > > > + return 0;
> > > > > +}
> > > > > +EXPORT_SYMBOL_GPL(asus_dockram_read);
> > > >
> > > > No documentation for these new public symbols?
> > > >
> > >
> > > These functions are mainly used in communication between the dockram
> > > device, asus-ec and its subdevices. Export is used here because all
> > > mentioned devices can be built as modules. I can add descriptions of
> > > functions into header if needed, but they should never be used outside
> > > of dockram-EC complex. Same applies to 2 export functions in the EC
> > > MFD.
> >
> > Then you should properly document this :)
> >
> > > > > +static BIN_ATTR_RW(dockram, DOCKRAM_ENTRIES * DOCKRAM_ENTRY_SIZE);
> > > > > +static DEVICE_ATTR_RW(control_reg);
> > > >
> > > > You did not document your new sysfs files in Documentation/ABI/ which is
> > > > required.
> > > >
> > > > Also, why do you need a brand new user/kernel api at all? Who is going
> > > > to use this and for what?
> > > >
> > >
> > > These api were used mainly for debugging/logging purposes and descend
> > > from original downstream EC driver. I can both add documentation into
> > > ABI or remove them if that is absolutely necessary.
> >
> > Debugging should not be in sysfs, please put this type of stuff into
> > debugfs instead if you really need it.
> >
>
> There is no similar way to handle BIN_ATTR_RW in the debugfs (), may I
> preserve dockram_read/write with __maybe_unused instead of removing
> them? I will add comment with explanation
debugfs allows you to do much much more than simple stuff like
BIN_ATTR_RW(). Go wild there, but don't put debugging stuff in sysfs,
that is NOT what it is there for at all, but rather, that is exactly
what debugfs is for.
thanks,
greg k-h
next prev parent reply other threads:[~2026-02-03 16:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 10:43 [PATCH v1 0/9] mfd: Add support for Asus Transformer embedded controller Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 1/9] dt-bindings: misc: document ASUS Transformers EC Dockram Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 2/9] misc: Support Asus Transformer's EC access device Svyatoslav Ryhel
2026-02-03 11:41 ` Greg Kroah-Hartman
2026-02-03 11:54 ` Svyatoslav Ryhel
2026-02-03 12:00 ` Greg Kroah-Hartman
2026-02-03 12:01 ` Svyatoslav Ryhel
2026-02-03 16:28 ` Svyatoslav Ryhel
2026-02-03 16:45 ` Greg Kroah-Hartman [this message]
2026-02-03 16:50 ` Svyatoslav Ryhel
2026-02-03 16:58 ` Greg Kroah-Hartman
2026-02-04 12:40 ` Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 3/9] dt-bindings: mfd: document ASUS Transformer EC Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 4/9] mfd: Add driver for Asus Transformer embedded controller Svyatoslav Ryhel
2026-02-01 17:51 ` kernel test robot
2026-02-01 19:06 ` kernel test robot
2026-02-01 10:43 ` [PATCH v1 5/9] input: serio: Add driver for Asus Transformer dock keyboard and touchpad Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 6/9] input: keyboard: Add driver for Asus Transformer dock multimedia keys Svyatoslav Ryhel
2026-02-03 11:00 ` Dmitry Torokhov
2026-02-03 11:18 ` Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 7/9] leds: Add driver for Asus Transformer LEDs Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 8/9] power: supply: Add driver for Asus Transformer battery Svyatoslav Ryhel
2026-02-01 10:43 ` [PATCH v1 9/9] power: supply: Add charger driver for Asus Transformers Svyatoslav Ryhel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026020314-humbling-mobility-c24a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=ion@agorria.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox