Received: by 10.192.165.156 with SMTP id m28csp1843175imm; Thu, 12 Apr 2018 04:36:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/6KLZWdkQ1xrxjvlO+44gg5BxRoBRH28hltLEAyihzO1z5m/rBAlFDeyKcig03GhaR30E+ X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr612011pll.319.1523532999843; Thu, 12 Apr 2018 04:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523532999; cv=none; d=google.com; s=arc-20160816; b=A7BrsarSheEthyYLR53amYLJ6jVG+1g2ncozqNIOiIhRMvZob4e6iJg7IOIJ3of008 Gp3apDqHsnL1I3l9vc9+mKzurxnQZMepnwdguT/iejmsi/28ytQTakKBuonkEgAHOz8L zmEVzZdi9HrS81BJ01gSX2k6cjDYcSIFvFk3gxmGuaqOEMX+9fbewJi/GtNl2y0Lqkti 58HjRsIwZS26/tCG943WN6OgMCtz/cXkJPZA0GaVOWz+P+TEVZsOTmQX25q4Obx/+2vD XxKdTczhoVxeDYbhy82X+oEqv40wSbth4PNp+T2B6+HmGPBL3Ak6MqHLwYxXWVwz5nQp YzCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Gfb5QW4zyNyxQWuMCG2m6V2t7+oRgHJ5BleF01Unpuk=; b=bjQTdeN1JmGRQUeD7/KhsXycv+4vUMfuEUkallKYjH7UpZWodi+4fHcSJBGKOfHebC h9ChlHTckc8+Q7mJNmA+F45ZOvud0jYXKsOi2tD4RcznOKOWslCfpnBD/gm2lsq+qpgy +ZQVKG1ek2ZQzKYSVtLiaYv+pPMrKM63/56Hlks/4xiN3VToRx4viE8eKqhrNd3QF9/8 PkRNOxGF11h+nH/QqmP8kA8upxlkchHaFpmvg/7zqyXfIkoQOaQtzl9ggQRLtIy7go2y aFAn5TniiiIlLAQArD3yoDhMQ8R1XzwRDhMTwFjbcvkwUqTzuUa8zAHM/ZHYl0dE+dBn XKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mJLNKloG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62si2137568pgc.453.2018.04.12.04.36.02; Thu, 12 Apr 2018 04:36:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mJLNKloG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbeDLLcw (ORCPT + 99 others); Thu, 12 Apr 2018 07:32:52 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:39961 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbeDLLct (ORCPT ); Thu, 12 Apr 2018 07:32:49 -0400 Received: by mail-qt0-f196.google.com with SMTP id g5so5734826qth.7; Thu, 12 Apr 2018 04:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Gfb5QW4zyNyxQWuMCG2m6V2t7+oRgHJ5BleF01Unpuk=; b=mJLNKloGwCf1PqFbq4iSo4fqZ5Qe7tm+oi6x/0q52857UwRXwmBaRMpLHQ50emva6L 1fhqsW/+pwb0pz/VLpthV9P8uPeOwv7DqvGvzrDHbSi5Vblg5fj9wBFgcDKZNL445JAI xLMWHCkgGIbak6D9zORwK7M2etVTP7QANcUSbnU2riI72XP9EeI3at1YtbtK8zZwcsa8 sYzxaRrgtJF7I0hL66FcPiWGqeeEIJ/RM3CPeIFt2F61Yncl5ChBJaor0iaxzCAhVmde xNxzmgV4nIdcb+I+Rl3tL9At0qOga4GjzInXeuNFsDOCE+NQixC36bF6TXiEnSUMFKnF oxxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Gfb5QW4zyNyxQWuMCG2m6V2t7+oRgHJ5BleF01Unpuk=; b=L2x4gd4aIk8mHaaL4StAfJeZ+Soipz8KfcgwWbYoQp7YHHcIBLBjdOVfFn5OQPDAHZ 528FtBSuVaUaTY5JqkJcWHudyWkKhpyrxl/Wiednl7emgeFVbf/3kijzZQX7bxNckAQA x6zHfRSa7lTwK5lZSl4rKc+qnoRJElMheZptfV0MUeZAayslX6XzJQb9nr2UXGbFkxdo lkyn4djvzh33tt1RptAgb/LVJSkJv6g6ohHHH404rvS9elZrXDGDBsqoP/v6WZwmTx0l vule5bgO1xICy4d1oJF4PrJUy4FQUrs7RAECbG7UJnYA2NwSXe7jYwHnv/iNIaLdk0cs HLWQ== X-Gm-Message-State: ALQs6tBh7iBomWFj7+RNiIkHwPCPpYOLq6M0ejEZ8/Q1hNilHwh7aVCo 7H6IRowN1wfmdykUBcjKRnttAres8ng1QAMB5Zc= X-Received: by 10.200.27.3 with SMTP id y3mr708223qtj.161.1523532768926; Thu, 12 Apr 2018 04:32:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.23.67 with HTTP; Thu, 12 Apr 2018 04:32:48 -0700 (PDT) In-Reply-To: References: <1523438149-16433-1-git-send-email-geert+renesas@glider.be> <1523438149-16433-4-git-send-email-geert+renesas@glider.be> From: Geert Uytterhoeven Date: Thu, 12 Apr 2018 13:32:48 +0200 X-Google-Sender-Auth: 4-OnAPfGfXosih6mLZ3Pjo8MD_M Message-ID: Subject: Re: [PATCH v3 2/2] vfio: platform: Add generic DT reset support To: Auger Eric Cc: Geert Uytterhoeven , Baptiste Reynal , Alex Williamson , Philipp Zabel , Rob Herring , Mark Rutland , KVM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-Renesas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On Thu, Apr 12, 2018 at 12:31 PM, Auger Eric wrote: > On 11/04/18 11:15, Geert Uytterhoeven wrote: >> Vfio-platform requires reset support, provided either by ACPI, or, on DT >> platforms, by a device-specific reset driver matching against the >> device's compatible value. >> >> On many SoCs, devices are connected to an SoC-internal reset controller. >> If the reset hierarchy is described in DT using "resets" properties, >> such devices can be reset in a generic way through the reset controller >> subsystem. Hence add support for this, avoiding the need to write >> device-specific reset drivers for each single device on affected SoCs. >> >> Devices that do require a more complex reset procedure can still provide >> a device-specific reset driver, as that takes precedence. >> >> Note that this functionality depends on CONFIG_RESET_CONTROLLER=y, and >> becomes a no-op (as in: "No reset function found for device") if reset >> controller support is disabled. >> >> Signed-off-by: Geert Uytterhoeven >> Reviewed-by: Philipp Zabel >> --- a/drivers/vfio/platform/vfio_platform_common.c >> +++ b/drivers/vfio/platform/vfio_platform_common.c >> @@ -127,8 +130,16 @@ static int vfio_platform_get_reset(struct vfio_platform_device *vdev) >> vdev->of_reset = vfio_platform_lookup_reset(vdev->compat, >> &vdev->reset_module); >> } >> + if (vdev->of_reset) >> + return 0; >> + >> + rstc = of_reset_control_get_exclusive(vdev->device->of_node, NULL); > > Shouldn't we prefer the top level reset_control_get_exclusive()? I guess that should work, too. > To make sure about the exclusive/shared terminology, does > get_reset_control_get_exclusive() check we have an exclusive wire > between this device and the reset controller? AFAIU, the "exclusive" means that only a single user can obtain access to the reset, and it does not guarantee that we have an exclusive wire between the device and the reset controller. The latter depends on the SoC's reset topology. If a reset wire is shared by multiple devices (e.g. resets shared by PWM or Display Unit devices on R-Car SoCs), exporting a subset of these devices to a guest is a bad idea, indeed. I guess the same thing can happen with the ACPI "_RST" method? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds