Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-24 Thread Maximilian Luz
On 9/24/20 9:41 AM, Arnd Bergmann wrote: On Thu, Sep 24, 2020 at 12:23 AM Maximilian Luz wrote: On 9/23/20 8:51 PM, Arnd Bergmann wrote: On Wed, Sep 23, 2020 at 8:29 PM Maximilian Luz wrote: On 9/23/20 6:48 PM, Arnd Bergmann wrote: The version I showed avoids the pointers and is compatible

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-24 Thread Maximilian Luz
On 9/24/20 8:46 AM, Greg Kroah-Hartman wrote: On Thu, Sep 24, 2020 at 12:06:54AM +0200, Maximilian Luz wrote: On 9/23/20 8:29 PM, Greg Kroah-Hartman wrote: On Wed, Sep 23, 2020 at 08:03:38PM +0200, Maximilian Luz wrote: On 9/23/20 6:14 PM, Greg Kroah-Hartman wrote: [...] So the -EFAULT ret

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-24 Thread Arnd Bergmann
On Thu, Sep 24, 2020 at 12:23 AM Maximilian Luz wrote: > On 9/23/20 8:51 PM, Arnd Bergmann wrote: > > On Wed, Sep 23, 2020 at 8:29 PM Maximilian Luz > > wrote: > >> On 9/23/20 6:48 PM, Arnd Bergmann wrote: > > > > The version I showed avoids the pointers and is compatible with > > 32-bit user sp

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Greg Kroah-Hartman
On Thu, Sep 24, 2020 at 12:06:54AM +0200, Maximilian Luz wrote: > On 9/23/20 8:29 PM, Greg Kroah-Hartman wrote: > > On Wed, Sep 23, 2020 at 08:03:38PM +0200, Maximilian Luz wrote: > > > On 9/23/20 6:14 PM, Greg Kroah-Hartman wrote: > > [...] > > > > So the -EFAULT returned by put_user should have

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Maximilian Luz
On 9/23/20 8:51 PM, Arnd Bergmann wrote: On Wed, Sep 23, 2020 at 8:29 PM Maximilian Luz wrote: On 9/23/20 6:48 PM, Arnd Bergmann wrote: + * struct ssam_debug_request - Controller request IOCTL argument. + * @target_category: Target category of the SAM request. + * @target_id: Target ID o

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Maximilian Luz
On 9/23/20 8:29 PM, Greg Kroah-Hartman wrote: On Wed, Sep 23, 2020 at 08:03:38PM +0200, Maximilian Luz wrote: On 9/23/20 6:14 PM, Greg Kroah-Hartman wrote: [...] So the -EFAULT returned by put_user should have precedence? I was aiming for "in case it fails, return with the first error". -E

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Arnd Bergmann
On Wed, Sep 23, 2020 at 8:29 PM Maximilian Luz wrote: > On 9/23/20 6:48 PM, Arnd Bergmann wrote: > >> + * struct ssam_debug_request - Controller request IOCTL argument. > >> + * @target_category: Target category of the SAM request. > >> + * @target_id: Target ID of the SAM request. > >> + *

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Maximilian Luz
On 9/23/20 6:48 PM, Arnd Bergmann wrote: Versioned interfaces are basically always a mess, try to avoid them. I'd much rather see this done in one of two ways: a) make it a proper documented interface, in this case probably a misc character device, and then maintain the interface forever, withou

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Greg Kroah-Hartman
On Wed, Sep 23, 2020 at 08:03:38PM +0200, Maximilian Luz wrote: > On 9/23/20 6:14 PM, Greg Kroah-Hartman wrote: > > On Wed, Sep 23, 2020 at 05:15:10PM +0200, Maximilian Luz wrote: > [...] > > > > +// SPDX-License-Identifier: GPL-2.0-or-later > > > > Are you sure about -or-later? I have to ask. >

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Maximilian Luz
On 9/23/20 6:14 PM, Greg Kroah-Hartman wrote: On Wed, Sep 23, 2020 at 05:15:10PM +0200, Maximilian Luz wrote: [...] +// SPDX-License-Identifier: GPL-2.0-or-later Are you sure about -or-later? I have to ask. Fairly, unless there are any complications with integration of this code that I'm

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Arnd Bergmann
On Wed, Sep 23, 2020 at 5:15 PM Maximilian Luz wrote: >> + * - ``0xA5`` > + - ``1`` > + - ``WR`` > + - ``REQUEST`` > + - Perform synchronous SAM request. > + > + > +``GETVERSION`` > +-- > + > +Defined as ``_IOR(0xA5, 0, __u32)``. > + > +Gets the current interface vers

Re: [RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Greg Kroah-Hartman
On Wed, Sep 23, 2020 at 05:15:10PM +0200, Maximilian Luz wrote: > Add a DebugFS device-file providing user-space access to the Surface > Aggregator EC, intended for debugging, testing, and reverse-engineering. > Specifically, this interface gives user-space applications the ability > to send reques

[RFC PATCH 8/9] surface_aggregator: Add DebugFS interface

2020-09-23 Thread Maximilian Luz
Add a DebugFS device-file providing user-space access to the Surface Aggregator EC, intended for debugging, testing, and reverse-engineering. Specifically, this interface gives user-space applications the ability to send requests to the EC and receive the corresponding responses. The device-file i