mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Auger Eric <eric.auger@redhat.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Sinan Kaya <okaya@codeaurora.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Baptiste Reynal <b.reynal@virtualopensystems.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	KVM list <kvm@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] vfio: platform: Add generic DT reset support
Date: Fri, 13 Apr 2018 12:05:37 +0200	[thread overview]
Message-ID: <07cab40d-c170-d5a9-2665-447d4a2f1538@redhat.com> (raw)
In-Reply-To: <1523611347.3396.3.camel@pengutronix.de>

Hi Philipp,

On 13/04/18 11:22, Philipp Zabel wrote:
[..]
> That also means it is impossible to use just one of the devices that
> share a reset line for vfio individually, while the other ones are still
> in use by the host. Currently the reset line is a shared resource
> similar to the iommu for devices in the same iommu_group.
> 
> Is there any mechanism in vfio that would allow modeling other shared
> resources apart from iommu?

No we only check the VFIO group viability at IOMMU level.
> 
> [...]
>>> For some of those it may be possible, but that is basically just a work-
>>> around for reality not matching expectations. There may be other cases
>>> where devices sharing a reset line are not even in the same parent node
>>> because they are controlled via a different bus. In general, I don't
>>> think it is feasible or desirable to force grouping of devices that
>>> share the same reset line into a common parent node.
>>
>> At least for Renesas R-Car SoCs, I think this is feasible, as all affected
>> devices are currently grouped under the same /soc node.
>> I added subnodes for all devices sharing resets (one for pwm, 4 for USB2,
>> and one for USB3; display doesn't have resets yet), and it still boots ;-)
> 
> Is this grouping enough to make sure all of the pwm/usb2/usb3 devices
> are only ever configured for vfio use together?
> 
> Assuming I have pwm[1-4] all sharing the same reset line, and I want
> pwm2 to be used by a vfio guest, I first have to make sure that all of
> pwm[1-4] are unbound, releasing their shared resets, before vfio-
> platform can request the same reset line as exclusive.
> 
> Thinking about it, if the pwm drivers keep their requested reset control
> around for the duration the device is bound, the reset controller
> framework should already kind of handle this - while any of the shared
> reset control handles is kept around, any exclusive request for the same
> reset control will fail with -EBUSY (and the other way around).
> But that requires all drivers to request the reset control during probe
> and release it during remove.
> 
>> However, ehci_platform_probe() cannot get its (optional) resets anymore.
>> Probably the reset controller framework needs to be taught to look for
>> shared resets in the parent node, too?
> 
> Hm, a generic framework shouldn't do such a thing, the parent node could
> be covered by a completely different binding.
> 
>>> My suggestion would be to relax the language in the reset.txt DT
>>> bindings doc.
>>
>> Which is fine to keep the status quo with the hardware designers, but makes
>> it less likely for non-whitelisted generic reset controller support to
>> become acceptable for the vfio people...
> 
> I still may be missing context, but I fail to see how
> 
> 	pwm@0 {
> 		resets = <&shared_reset_control>;
> 	};
> 
> 	pwm@1 {
> 		resets = <&shared_reset_control>;
> 	};
> 
> ->
> 
> 	pwms {
> 		resets = <&shared_reset_control>;
> 
> 		pwm@0 {
> 		};
> 
> 		pwm@1 {
> 		};
> 	};
> 
> makes any difference here, unless pwms gets bound to an actual driver
> that is used for vfio?

I don't think we are ready to assign pwms with VFIO as Alex emphasized
VFIO was meant to be used with IOMMU and I guess those devices do not
belong to any iommu group.

Thanks

Eric
> 
> regards
> Philipp
> 

  reply	other threads:[~2018-04-13 10:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11  9:15 [PATCH] vfio: platform: Fix using devices in PM Domains Geert Uytterhoeven
2018-04-11  9:15 ` [PATCH v3 0/2] vfio: platform: Improve reset support Geert Uytterhoeven
2018-04-11  9:15 ` [PATCH v3 1/2] vfio: platform: Fix reset module leak in error path Geert Uytterhoeven
2018-04-13  8:55   ` Auger Eric
2018-05-11 19:45   ` Alex Williamson
2018-04-11  9:15 ` [PATCH v3 2/2] vfio: platform: Add generic DT reset support Geert Uytterhoeven
2018-04-12  7:00   ` Simon Horman
2018-04-12 10:31   ` Auger Eric
2018-04-12 11:32     ` Geert Uytterhoeven
2018-04-12 11:49       ` Auger Eric
2018-04-12 12:36         ` Sinan Kaya
2018-04-12 13:12           ` Geert Uytterhoeven
2018-04-12 14:10             ` Philipp Zabel
2018-04-12 16:02               ` Geert Uytterhoeven
2018-04-13  8:52                 ` Auger Eric
2018-04-13  9:02                   ` Geert Uytterhoeven
2018-04-13  9:22                 ` Philipp Zabel
2018-04-13 10:05                   ` Auger Eric [this message]
2018-04-13 11:56                   ` Geert Uytterhoeven
2018-04-11  9:21 ` [PATCH] vfio: platform: Fix using devices in PM Domains Geert Uytterhoeven

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=07cab40d-c170-d5a9-2665-447d4a2f1538@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=b.reynal@virtualopensystems.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=okaya@codeaurora.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.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

all inboxes | Powered by JetHome®