From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH V6 5/8] vfio: platform: call _RST method when using ACPI Date: Thu, 9 Jun 2016 00:31:36 +0200 Message-ID: References: <1464472878-27176-1-git-send-email-okaya@codeaurora.org> <1464472878-27176-6-git-send-email-okaya@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1464472878-27176-6-git-send-email-okaya@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: Sinan Kaya Cc: kvm@vger.kernel.org, Timur Tabi , Christopher Covington , Jon Masters , eric.auger@linaro.org, ACPI Devel Maling List , Andy Gross , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Baptiste Reynal , Alex Williamson , Linux Kernel Mailing List List-Id: linux-arm-msm@vger.kernel.org On Sun, May 29, 2016 at 12:01 AM, Sinan Kaya wrote: > The device tree code checks for the presence of a reset driver and calls > the of_reset function pointer by looking up the reset driver as a module. > > ACPI defines _RST method to perform device level reset. After the _RST > method is executed, the OS can resume using the device. _RST method is > expected to stop DMA transfers and IRQs. > > This patch checks the presence of _RST method and calls the _RST > method when reset is requested. You could check if _RST is present at probe time and store the ACPI handle of it instead of the HID pointer. This way you wouldn't need to repeat that check every time reset is used. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425229AbcFHWbn (ORCPT ); Wed, 8 Jun 2016 18:31:43 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36312 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424960AbcFHWbj (ORCPT ); Wed, 8 Jun 2016 18:31:39 -0400 MIME-Version: 1.0 In-Reply-To: <1464472878-27176-6-git-send-email-okaya@codeaurora.org> References: <1464472878-27176-1-git-send-email-okaya@codeaurora.org> <1464472878-27176-6-git-send-email-okaya@codeaurora.org> From: "Rafael J. Wysocki" Date: Thu, 9 Jun 2016 00:31:36 +0200 X-Google-Sender-Auth: 0VTRBggQevsVvCIvsSGUN2e8pHY Message-ID: Subject: Re: [PATCH V6 5/8] vfio: platform: call _RST method when using ACPI To: Sinan Kaya Cc: kvm@vger.kernel.org, Timur Tabi , Christopher Covington , Jon Masters , eric.auger@linaro.org, ACPI Devel Maling List , Andy Gross , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Baptiste Reynal , Alex Williamson , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 29, 2016 at 12:01 AM, Sinan Kaya wrote: > The device tree code checks for the presence of a reset driver and calls > the of_reset function pointer by looking up the reset driver as a module. > > ACPI defines _RST method to perform device level reset. After the _RST > method is executed, the OS can resume using the device. _RST method is > expected to stop DMA transfers and IRQs. > > This patch checks the presence of _RST method and calls the _RST > method when reset is requested. You could check if _RST is present at probe time and store the ACPI handle of it instead of the HID pointer. This way you wouldn't need to repeat that check every time reset is used. From mboxrd@z Thu Jan 1 00:00:00 1970 From: rafael@kernel.org (Rafael J. Wysocki) Date: Thu, 9 Jun 2016 00:31:36 +0200 Subject: [PATCH V6 5/8] vfio: platform: call _RST method when using ACPI In-Reply-To: <1464472878-27176-6-git-send-email-okaya@codeaurora.org> References: <1464472878-27176-1-git-send-email-okaya@codeaurora.org> <1464472878-27176-6-git-send-email-okaya@codeaurora.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sun, May 29, 2016 at 12:01 AM, Sinan Kaya wrote: > The device tree code checks for the presence of a reset driver and calls > the of_reset function pointer by looking up the reset driver as a module. > > ACPI defines _RST method to perform device level reset. After the _RST > method is executed, the OS can resume using the device. _RST method is > expected to stop DMA transfers and IRQs. > > This patch checks the presence of _RST method and calls the _RST > method when reset is requested. You could check if _RST is present at probe time and store the ACPI handle of it instead of the HID pointer. This way you wouldn't need to repeat that check every time reset is used.