From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756953AbcC2L0b (ORCPT ); Tue, 29 Mar 2016 07:26:31 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:49162 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751299AbcC2L02 convert rfc822-to-8bit (ORCPT ); Tue, 29 Mar 2016 07:26:28 -0400 From: Arnd Bergmann To: okaya@codeaurora.org Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com, eric.auger@linaro.org, mark.rutland@arm.com, devicetree@vger.kernel.org, Baptiste Reynal , vikrams@codeaurora.org, marc.zyngier@arm.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, vinod.koul@intel.com, Alex Williamson , agross@codeaurora.org, Dan Carpenter , shankerd@codeaurora.org Subject: Re: [PATCH V3 1/3] vfio, platform: add support for ACPI while detecting the reset driver Date: Tue, 29 Mar 2016 13:25:42 +0200 Message-ID: <147496989.L43SVC7xRY@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1459172124-6730-1-git-send-email-okaya@codeaurora.org> <98854818.NJS35fvhsb@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="utf-8" X-Provags-ID: V03:K0:WOlE09qH4/kt0nPAnVq8liXpZIBlax5E2069xcjkxo5hxANkZlW lidmnlPWLqRbqOCciEetPASBgqkw+Ek8PhQCJZ4Gi/YL6MEreNn3hOZKvBR5o6DUkyua93J 6v2VdGPWUPh8W9BOimPdjdEB0/PfuA1CRSAGqnT1uOOTAiDCOGW1ZwRTxADiJEMJGpcVfdd U58dpKDUS9OO2Wamqnl2A== X-UI-Out-Filterresults: notjunk:1;V01:K0:RIwOTH9oujI=:jCl5QNUKr/zlGnTIpGIMxc yS+dTPuBv61beAnzOfWtL1lOLVBXz3a4Rsj8hFfGeoBqZDhOOvyqQN60t31hGNzcfZjYdh7Qq PXe8Wrvd890SuJawOkh8c0siy3kSm8ycUb0HVOHsJWXIdEAHFXAn9LdtHPcEV2DKqkmpeItsU 2iZ9TZcQSdgI+RHY60mMcbsiGR8PM/KEVj47aG/Jk9/jfaUaUSMv8tkCNgY7I7cm8p7Qn8zQQ +kCTCogTQ7snIW1CZ8wCiIgpv5PVuRLSvXEQvbBG6UbDNV47NPhVxVL3PXfC5IgP2GwELiK+F bvEhZNTNvfWWQmhwZzL1CiSeP01qymr6QOIwzkgr97pks3LeH33aeqWV1YKdZYQpgY/Vyzco4 xyw6LL89eD+5ldAz0Q4jPERjNJgP17YJT2HBUGSNdn1qRhZfDt/2IrYt97yvNP9C0Z8XU3a7g Ys3vRYmNeVv0ISowPHds2HtIK0vmcenYs7ykA8bmbubVBIue3L5+s0wmwjR3MnFrf6AVal0Sr aPe49pN3PyG7BvbDQNl7T9rDzrwQhrd8WNdfe4YPja8B8xQQ+k38JD4ubJ+lc3JWYbHZTTAVn Sv1hi1JVhNaYCyDB7LkyFAGzUWT/CHBMC3PM5rHI304MnzJ90O/M1itcLrZvef3lnIGyQuzBK rnfya0XQWB5xSpPBN6TFwmQdz3c6t+MFoiWC5jT6I5GMBtsQ2bhQNh85FyHQ3xgmHkArSP0CF B9gPirOUG945H5ck Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 29 March 2016 06:59:15 okaya@codeaurora.org wrote: > On 2016-03-29 05:25, Arnd Bergmann wrote: > > On Monday 28 March 2016 09:35:22 Sinan Kaya wrote: > >> The code is using the compatible DT string to associate a reset driver > >> with > >> the actual device itself. The compatible string does not exist on ACPI > >> based systems. HID is the unique identifier for a device driver > >> instead. > >> The change allows a driver to register with DT compatible string or > >> ACPI > >> HID and then match the object with one of these conditions. > >> > >> Rules for loading the reset driver are as follow: > >> - ACPI HID needs match for ACPI systems > >> - DT compat needs to match for OF systems > >> > >> Tested-by: Eric Auger (device tree only) > >> Tested-by: Shanker Donthineni (ACPI only) > >> Signed-off-by: Sinan Kaya > >> > > > > > > This really feels wrong for two reasons: > > > > * device assignment of non-PCI devices is really special and doesn't > > seem to make sense on general purpose servers that would be the > > target > > for ACPI normally > > > Why is it special? Acpi is not equal to pci. Platform devices are first > class devices too. Especially, _cls was introduced for this reason. It still feels like a hack. The normal design for a server is to have all internal devices show up on the PCI host bridge, next to the PCIe ports, to have a simple way to manage any device, both internal and off-chip. Putting a device on random MMIO registers outside of the discoverable buses and have the firmware work around the lack of discoverability will always be inferior. > > > > * If there is indeed a requirement for ACPI to handle something like > > this, > > it should be part of the ACPI spec, with a well-defined method of > > handling > > reset, rather than having to add a device specific hack for each > > device separately. > > > > I see. Normally, this is done by calling _rst method. AFAIK, Linux > doesn’t support _rst. I can check its presence and call it if it is > there. Yes, that sounds reasonable: In patch 2 where you check for the presence of the reset method, just keep the existing logic for DT based systems, and use _rst on ACPI based systems instead, then you can drop both patches 1 and 3. Arnd