All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
	joel@jms.id.au,  robh+dt@kernel.org, andrew@aj.id.au,
	linux-aspeed@lists.ozlabs.org,  openbmc@lists.ozlabs.org,
	devicetree@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Date: Fri, 27 Aug 2021 11:08:31 +0800	[thread overview]
Message-ID: <b20caf97be2a35fa30d08e7b258187e1ef9e2e57.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20210826061623.6352-4-chiawei_wang@aspeedtech.com>

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

Hi Chia-Wei,

> The Aspeed eSPI controller is slave device to communicate with
> the master through the Enhanced Serial Peripheral Interface (eSPI).
> All of the four eSPI channels, namely peripheral, virtual wire,
> out-of-band, and flash are supported.

Great to have this added submitted upstream! A few comments though:

> ---
>  drivers/soc/aspeed/Kconfig             |  11 +
>  drivers/soc/aspeed/Makefile            |   1 +
>  drivers/soc/aspeed/aspeed-espi-ctrl.c  | 205 +++++++++
>  drivers/soc/aspeed/aspeed-espi-ctrl.h  | 304 ++++++++++++
>  drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++++++
>  drivers/soc/aspeed/aspeed-espi-ioc.h   | 153 +++++++
>  drivers/soc/aspeed/aspeed-espi-oob.h   | 611 +++++++++++++++++++++++++
>  drivers/soc/aspeed/aspeed-espi-perif.h | 539 ++++++++++++++++++++++
>  drivers/soc/aspeed/aspeed-espi-vw.h    | 142 ++++++

This structure is a bit odd - you have the one -crtl.c file, which
defines the actual driver, but then a bunch of headers that contain more
code than header-type definitions.

Is there any reason that -flash, -ioc, -oob, -perif and -vw components
can't be standard .c files?

Then, for the userspace ABI: it looks like you're exposing everything
through new device-specific ioctls. Would it not make more sense to use
existing interfaces? For example, the virtual wire bits could be regular
GPIOs; the flash interface could be a mtd or block device.

I understand that we'll likely still need some level of custom device
control, but the more we can use generic interfaces for, the less custom
code (and interfaces) we'll need on the userspace side.

Cheers,


Jeremy

[-- Attachment #2: Type: text/html, Size: 2470 bytes --]

  parent reply	other threads:[~2021-08-27  3:09 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  6:16 [PATCH v3 0/4] arm: aspeed: Add eSPI support Chia-Wei Wang
2021-08-26  6:16 ` Chia-Wei Wang
2021-08-26  6:16 ` [PATCH v3 1/4] dt-bindings: aspeed: Add eSPI controller Chia-Wei Wang
2021-08-26  6:16   ` Chia-Wei Wang
2021-08-26 13:26   ` Rob Herring
2021-08-26 13:26     ` Rob Herring
2021-08-26 13:26     ` Rob Herring
2021-08-27  3:08     ` ChiaWei Wang
2021-08-27  3:08       ` ChiaWei Wang
2021-08-27  3:08       ` ChiaWei Wang
2021-08-26  6:16 ` [PATCH v3 2/4] MAINTAINER: Add ASPEED eSPI driver entry Chia-Wei Wang
2021-08-26  6:16   ` Chia-Wei Wang
2021-08-26  6:16 ` [PATCH v3 3/4] soc: aspeed: Add eSPI driver Chia-Wei Wang
2021-08-26  6:16   ` Chia-Wei Wang
2021-08-26 20:05   ` kernel test robot
2021-08-26 20:05     ` kernel test robot
2021-08-26 20:05     ` kernel test robot
2021-08-26 23:30   ` kernel test robot
2021-08-26 23:30     ` kernel test robot
2021-08-26 23:30     ` kernel test robot
2021-08-27  3:52     ` ChiaWei Wang
2021-08-27  3:52     ` ChiaWei Wang
2021-08-27  3:52       ` ChiaWei Wang
2021-08-27  3:52       ` ChiaWei Wang
2021-08-27  5:48       ` Joel Stanley
2021-08-27  5:48         ` Joel Stanley
2021-08-27  5:48         ` Joel Stanley
2021-08-27  5:48         ` Joel Stanley
2021-08-27  8:49         ` ChiaWei Wang
2021-08-27  8:49           ` ChiaWei Wang
2021-08-27  8:49           ` ChiaWei Wang
2021-08-27  8:49         ` ChiaWei Wang
2021-08-27  3:08   ` Jeremy Kerr [this message]
2021-08-27  3:20   ` Jeremy Kerr
2021-08-27  3:20     ` Jeremy Kerr
2021-08-27  3:20     ` Jeremy Kerr
2021-08-27  3:48     ` ChiaWei Wang
2021-08-27  3:48       ` ChiaWei Wang
2021-08-27  3:48       ` ChiaWei Wang
2021-08-27  4:36       ` Jeremy Kerr
2021-08-27  4:36         ` Jeremy Kerr
2021-08-27  4:36         ` Jeremy Kerr
2021-08-27  8:49         ` ChiaWei Wang
2021-08-27  8:49           ` ChiaWei Wang
2021-08-27  8:49           ` ChiaWei Wang
2021-08-26  6:16 ` [PATCH v3 4/4] ARM: dts: aspeed: Add eSPI node Chia-Wei Wang
2021-08-26  6:16   ` Chia-Wei Wang

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=b20caf97be2a35fa30d08e7b258187e1ef9e2e57.camel@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=andrew@aj.id.au \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.