Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp21409pxb; Wed, 1 Sep 2021 20:36:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHpLYI4fUxZHUqF5Btelej2uooCer+yFmL3IF/EkNcbPf6uTKAhF6PybZM+JD1/n8HvVy X-Received: by 2002:a05:6602:340a:: with SMTP id n10mr1013776ioz.188.1630553818099; Wed, 01 Sep 2021 20:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630553818; cv=none; d=google.com; s=arc-20160816; b=Bm32ZRa+Di0Ig3IQEum/ESylblkOeNTrjaXfQMVdNAydShGrNt7ueVYwBgef37tbJp 0W96pY5aSxk0ST1Ih/i79VjPa/uulW9wziwshYBXO23/F4A+Pyb1NRsw6PZ3y2v9ZmKJ /tGRRlHQghMNXGn2NbAIVLTBLkIeBPTcx1zjV7udk4xjyfqkP4XuunRL1mH/GRfiGg6u PTWbPrSsJf3S+dYDDJwWkoWYjr1MgMDR20L+V4HQSijVqoReJibUP3LAEtzVqke8U27Y 9wzfhnVmNLhY4wC9mPL99C1cuVrvOqTHggSjnDvDsV1GDslL2P7/u4WWddXGyp80zMVD hDRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=CLFuhMweg8KB1Abe6Agdc9jAJ/5SmIszNAeDDYBZUiU=; b=oVh06+WLyG1g4lxsZft6x0whplAgqmxaQ9peODenj6vkXm5oKA9rpLChmfLdfY4sKw dugBQ3YaKLIYeOrKWRMwnZjAbX6YiWO9pVlEinGLFGB9ltvYVggXcqpKihEVsrCTIBtL iTwlE39zdkUoI6yAcbRjgMIi79e0iD6XAA8hBTzzZ9Pnc4F/T0VfQjR5ZmIivAU2RRxp 2yljRYPDmKi6HPPJRIvJ2e1EJ4dopNbWJbx/h4aVGgK2I5sz1Ab5rTcnhjZu/xD5jO+Q Dz/VQb+axpZ8wrIwXfuK5J0UpwVeYWOXNUpvImlnJB99Ku7If5OM4GPSkIzZ3kof2Snr cxZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si729074ilg.98.2021.09.01.20.36.45; Wed, 01 Sep 2021 20:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233464AbhIBDap (ORCPT + 99 others); Wed, 1 Sep 2021 23:30:45 -0400 Received: from pi.codeconstruct.com.au ([203.29.241.158]:52978 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhIBDao (ORCPT ); Wed, 1 Sep 2021 23:30:44 -0400 Received: from [172.16.66.18] (unknown [49.255.141.98]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id AF9A620164; Thu, 2 Sep 2021 11:29:37 +0800 (AWST) Message-ID: <20c13b9bb023091758cac3a07fb4037b7d796578.camel@codeconstruct.com.au> Subject: Re: [PATCH v4 3/4] soc: aspeed: Add eSPI driver From: Jeremy Kerr To: Chia-Wei Wang , robh+dt@kernel.org, joel@jms.id.au, 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 Cc: ryan_chen@aspeedtech.com Date: Thu, 02 Sep 2021 11:29:35 +0800 In-Reply-To: <20210901033015.910-4-chiawei_wang@aspeedtech.com> References: <20210901033015.910-1-chiawei_wang@aspeedtech.com> <20210901033015.910-4-chiawei_wang@aspeedtech.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chiawei, > 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. I'm still not confinced this raw packet user-ABI is the right approach for this. The four channels that you're exposing would be much more useful to use existing kernel subsystems. Specifically: 1) The VW channel is essentially a GPIO interface, and we have a kernel subsystem to expose GPIOs. We might want to add additional support for in-kernel system event handlers, but that's a minor addition that can be done separately if we don't want that handled by a gpio consumer in userspace. 2) The out-of-band (OOB) channel provides a way to issue SMBus transactions, so could well provide an i2c controller interface. Additionally, the eSPI specs imply that this is intended to support MCTP - in which case, you'll *need* a kernel i2c controller device to be able to use the new kernel MCTP stack. 3) The flash channel exposes read/write/erase operations, which would be much more useful as an actual flash-type device, perhaps using the existing mtd interface? Or is there additional functionality expected for this? 4) The peripheral channel is the only one that would seem to require arbitrary cycle access, but we'll still need a proper uapi definition to support that. At the minimum, your ioctl definitions should go under include/uapi/ - you shouldn't need to duplicate the header into each userspace repo, as you've done for the test examples. Cheers, Jeremy