From patchwork Fri Oct 23 12:37:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 55490 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 49D7620581 for ; Fri, 23 Oct 2015 12:37:43 +0000 (UTC) Received: by lffz202 with SMTP id z202sf48247928lff.3 for ; Fri, 23 Oct 2015 05:37:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=BW4iHubS1gQ+ShGZ3b+hmDbSlZ7O+K4Aag741lHClaM=; b=DmD/U48MecqDuKKZv0urzdUU7BiYWNgJLfsURhfJigK6U+B3qjwci8PJFzkXQnYzwa OgtiHE48QcMov0zHDeSeKjtBVImg6dRUYn4l58f3Llu1NIhsj0p0UEtJLbf6ZRyTnWg0 VTc8LgJ6Jw3CH4JCOgIfxk+4w914VlCx0UVJBBibidZzLkOLS1W7p4Q5+uUHVMgZfsnj ULWVlVscpclOF4QL9XPDv3xa0bNDK9ckmtMbNv6N124ViOAyR95tjMqP2X4GpGy5drH3 Q15HSd7RErdEDFPBTn/IWWQrygDLzkyi42TZnNww148056nh5Zi6sZ+Co5Jco0PzIHm+ HuZQ== X-Gm-Message-State: ALoCoQlzXp+ZgdosdNsxrbCweE7zApBJF0jePxCi3PVrjExUr5m1sQXfghzZLmuftSHWrGfvblp4 X-Received: by 10.180.210.212 with SMTP id mw20mr813713wic.3.1445603862234; Fri, 23 Oct 2015 05:37:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.83.197 with SMTP id h188ls372579lfb.76.gmail; Fri, 23 Oct 2015 05:37:42 -0700 (PDT) X-Received: by 10.25.28.131 with SMTP id c125mr5854241lfc.99.1445603862087; Fri, 23 Oct 2015 05:37:42 -0700 (PDT) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id sg5si12512010lbb.162.2015.10.23.05.37.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 05:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lffv3 with SMTP id v3so81818351lff.0 for ; Fri, 23 Oct 2015 05:37:42 -0700 (PDT) X-Received: by 10.25.20.24 with SMTP id k24mr7396162lfi.117.1445603861826; Fri, 23 Oct 2015 05:37:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1204462lbq; Fri, 23 Oct 2015 05:37:41 -0700 (PDT) X-Received: by 10.180.160.197 with SMTP id xm5mr4567165wib.58.1445603853579; Fri, 23 Oct 2015 05:37:33 -0700 (PDT) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com. [209.85.212.171]) by mx.google.com with ESMTPS id f3si24655154wje.74.2015.10.23.05.37.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 05:37:33 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.171 as permitted sender) client-ip=209.85.212.171; Received: by wicll6 with SMTP id ll6so29450161wic.0 for ; Fri, 23 Oct 2015 05:37:33 -0700 (PDT) X-Received: by 10.195.13.38 with SMTP id ev6mr4446593wjd.150.1445603853361; Fri, 23 Oct 2015 05:37:33 -0700 (PDT) Received: from gnx2579.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id s16sm2837652wik.16.2015.10.23.05.37.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 05:37:31 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, alex.williamson@redhat.com, b.reynal@virtualopensystems.com, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: christoffer.dall@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH v3 7/7] vfio: platform: add dev_info on device reset Date: Fri, 23 Oct 2015 14:37:15 +0200 Message-Id: <1445603835-14506-8-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445603835-14506-1-git-send-email-eric.auger@linaro.org> References: <1445603835-14506-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , It might be helpful for the end-user to check the device reset function was found by the vfio platform reset framework. Lets store a pointer to the struct device in vfio_platform_device and trace when the reset function is called or not found. Signed-off-by: Eric Auger --- v3: creation --- drivers/vfio/platform/vfio_platform_common.c | 14 ++++++++++++-- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index de3fb33..207fab6 100644 --- a/drivers/vfio/platform/vfio_platform_common.c +++ b/drivers/vfio/platform/vfio_platform_common.c @@ -144,8 +144,12 @@ static void vfio_platform_release(void *device_data) mutex_lock(&driver_lock); if (!(--vdev->refcnt)) { - if (vdev->reset) + if (vdev->reset) { + dev_info(vdev->device, "reset\n"); vdev->reset(vdev); + } else { + dev_warn(vdev->device, "no reset function found!\n"); + } vfio_platform_regions_cleanup(vdev); vfio_platform_irq_cleanup(vdev); } @@ -174,8 +178,12 @@ static int vfio_platform_open(void *device_data) if (ret) goto err_irq; - if (vdev->reset) + if (vdev->reset) { + dev_info(vdev->device, "reset\n"); vdev->reset(vdev); + } else { + dev_warn(vdev->device, "no reset function found!\n"); + } } vdev->refcnt++; @@ -551,6 +559,8 @@ int vfio_platform_probe_common(struct vfio_platform_device *vdev, return -EINVAL; } + vdev->device = dev; + group = iommu_group_get(dev); if (!group) { pr_err("VFIO: No IOMMU group for device %s\n", vdev->name); diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h index e505c15..ccb99b4 100644 --- a/drivers/vfio/platform/vfio_platform_private.h +++ b/drivers/vfio/platform/vfio_platform_private.h @@ -59,6 +59,7 @@ struct vfio_platform_device { struct module *parent_module; const char *compat; struct module *reset_module; + struct device *device; /* * These fields should be filled by the bus specific binder