From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V7 7/9] vfio, platform: make reset driver a requirement by default
Date: Thu, 16 Jun 2016 13:08:35 -0400 [thread overview]
Message-ID: <5762DD13.8010501@codeaurora.org> (raw)
In-Reply-To: <8eaecc6e-aece-e859-281a-b02e2b6eced7@redhat.com>
On 6/16/2016 4:15 AM, Auger Eric wrote:
> Unfortunately this causes a crash when the reset module is not
> available. You should do the vfio_add_group_dev at the end. Something
> like below.
>
Thanks for testing. I'll post v8 with this change.
> Best Regards
>
> Eric
>
> ---
> drivers/vfio/platform/vfio_platform_common.c | 26
> ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/vfio/platform/vfio_platform_common.c
> b/drivers/vfio/platform/vfio_platform_common.c
> index d84c399..0928f7d 100644
> --- a/drivers/vfio/platform/vfio_platform_common.c
> +++ b/drivers/vfio/platform/vfio_platform_common.c
> @@ -664,6 +664,14 @@ int vfio_platform_probe_common(struct
> vfio_platform_device *vdev,
> return ret;
>
> vdev->device = dev;
> + mutex_init(&vdev->igate);
> +
> + ret = vfio_platform_get_reset(vdev);
> + if (ret && vdev->reset_required) {
> + pr_err("vfio: no reset function found for device %s\n",
> + vdev->name);
> + return ret;
> + }
>
> group = iommu_group_get(dev);
> if (!group) {
> @@ -672,22 +680,12 @@ int vfio_platform_probe_common(struct
> vfio_platform_device *vdev,
> }
>
> ret = vfio_add_group_dev(dev, &vfio_platform_ops, vdev);
> - if (ret)
> - goto out;
> -
> - ret = vfio_platform_get_reset(vdev);
> - if (ret && vdev->reset_required) {
> - pr_err("vfio: no reset function found for device %s\n",
> - vdev->name);
> - goto out;
> - }
> -
> - mutex_init(&vdev->igate);
> + if (ret) {
> + iommu_group_put(group);
> + return ret;
> + }
>
> return 0;
> -out:
> - iommu_group_put(group);
> - return ret;
> }
> EXPORT_SYMBOL_GPL(vfio_platform_probe_common);
>
>
>
>>
>> mutex_init(&vdev->igate);
>>
>> return 0;
>> +out:
>> + iommu_group_put(group);
>> + return ret;
>> }
>> EXPORT_SYMBOL_GPL(vfio_platform_probe_common);
>>
>> diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h
>> index ba9e4f8..68fbc00 100644
>> --- a/drivers/vfio/platform/vfio_platform_private.h
>> +++ b/drivers/vfio/platform/vfio_platform_private.h
>> @@ -50,6 +50,7 @@ struct vfio_platform_region {
>> };
>>
>> struct vfio_platform_device {
>> + bool reset_required;
>> struct vfio_platform_region *regions;
>> u32 num_regions;
>> struct vfio_platform_irq *irqs;
>>
--
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-06-16 17:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 4:26 [PATCH V7 0/9] vfio, platform: add ACPI support Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 1/9] vfio: platform: rename reset function Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 2/9] vfio: platform: move reset call to a common function Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 3/9] vfio: platform: determine reset capability Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 4/9] vfio: platform: add support for ACPI probe Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 5/9] vfio: platform: add extra debug info argument to call reset Sinan Kaya
2016-06-13 4:26 ` [PATCH V7 6/9] vfio: platform: call _RST method when using ACPI Sinan Kaya
2016-06-23 18:59 ` Alex Williamson
2016-06-23 19:07 ` Alex Williamson
2016-06-23 19:14 ` Sinan Kaya
2016-07-13 19:39 ` Sinan Kaya
2016-07-13 20:11 ` Alex Williamson
2016-06-13 4:26 ` [PATCH V7 7/9] vfio, platform: make reset driver a requirement by default Sinan Kaya
2016-06-16 8:15 ` Auger Eric
2016-06-16 17:08 ` Sinan Kaya [this message]
2016-06-13 4:26 ` [PATCH V7 8/9] vfio: platform: check reset call return code during open Sinan Kaya
2016-06-15 20:08 ` Auger Eric
2016-06-13 4:26 ` [PATCH V7 9/9] vfio: platform: check reset call return code during release Sinan Kaya
2016-06-13 16:08 ` [PATCH V7 0/9] vfio, platform: add ACPI support Sinan Kaya
2016-06-14 15:29 ` Baptiste Reynal
2016-06-14 15:38 ` Sinan Kaya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5762DD13.8010501@codeaurora.org \
--to=okaya@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).