voltage sum register, if all shunt resistors are equivalent.
Signed-off-by: Nicolin Chen
---
Hi Guenter,
I know my previous questions haven't been answered yet, so nodes
for enabling bits aren't decided completely. But this patch only
adds voltage and its current, and we had a conclusion
On Sun, Oct 20, 2019 at 09:36:28AM -0700, Guenter Roeck wrote:
> On Wed, Oct 16, 2019 at 04:57:02PM -0700, Nicolin Chen wrote:
> > This patch implements the summation feature of INA3221, mainly the
> > SCC (enabling) and SF (warning flag) bits of MASK_ENABLE register,
> &
odes.
Signed-off-by: Nicolin Chen
---
Documentation/hwmon/ina3221 | 3 +
drivers/hwmon/ina3221.c | 109
2 files changed, 112 insertions(+)
diff --git a/Documentation/hwmon/ina3221 b/Documentation/hwmon/ina3221
index 4b82cbfb551c..b03f4ad901ee 100644
--- a
Hi Guenter,
On Mon, Nov 12, 2018 at 08:32:48PM -0800, Guenter Roeck wrote:
> On Mon, Nov 12, 2018 at 08:23:53PM -0800, Nicolin Chen wrote:
> > INA3221 supports both continuous and single-shot modes. When
> > running in the continuous mode, it keeps measuring the inputs
> > a
Hi Guenter,
On Tue, Nov 13, 2018 at 09:21:02AM -0800, Guenter Roeck wrote:
> > > > INA3221 supports both continuous and single-shot modes. When
> > > > running in the continuous mode, it keeps measuring the inputs
> > > > and converting them to the data register even if there are no
> > > > users
Hello Guenter,
On Wed, Nov 14, 2018 at 09:23:30AM -0800, Guenter Roeck wrote:
> > An alternative way (without the sysfs node), after looking at
> > other hwmon code, could be to have a timed polling thread and
> > read data using an update_interval value from ABI. This might
> > turn out to be mor
There are a few sysfs entries being exposed to user space by the
ina2xx hwmon driver while not getting explicitly documented. So
this patch just adds a description section for them.
Signed-off-by: Nicolin Chen
---
Documentation/hwmon/ina2xx | 15 +++
1 file changed, 15 insertions
On Mon, Nov 19, 2018 at 09:45:59AM -0800, Guenter Roeck wrote:
> > In short, other than exposing it via a generic ABI to the user
> > space, how about defining some policy to maintaining it within
> > the driver?
> I think that would be a bad idea. It changes timing for everyone
> curently using t
mA
power1_input = 62800 uW (expected 62965 uW)
=== Summary ===
- "shunt_resistor" attribute sets rshunt and "max_curr" boundaries
- "max_curr" sysfs attribute decides current_lsb_uA and power_lsb_uW
- ina2xx_init() still uses 4096|2048 as default calibration setting
* Al
(Removing "m.pur...@samsung.com" since it's not reachable any more)
Hi Stefan,
Thank you for the comments.
On Wed, Nov 21, 2018 at 04:13:01PM +, Brüns, Stefan wrote:
> > === Problem ===
> > Both methods simplify software routine by fixing one factor, which
> > sacrifices the precision of the
Hi Stefan,
Sorry for a super late reply. I took a long vacation.
On Wed, Nov 21, 2018 at 10:16:09PM +, Brüns, Stefan wrote:
> > > Another concern may be voltage drop over the shunt, but for this case you
> > > have a nominal voltage of 1.8V, so 30uV are 0.001%.
> > >
> > > > When measuring a
On Fri, Jan 04, 2019 at 05:26:42PM -0800, Nicolin Chen wrote:
> Hi Stefan,
>
> Sorry for a super late reply. I took a long vacation.
>
> On Wed, Nov 21, 2018 at 10:16:09PM +, Brüns, Stefan wrote:
> > > > Another concern may be voltage drop over the shunt, but
Hi Guenter,
On Thu, Jan 17, 2019 at 03:13:23PM -0800, Guenter Roeck wrote:
> I have one claim stating that your change won't make a difference,
> and your claim that it would. That leaves me with no choice but to
> spend a large amount of time with the datasheet, and possibly with
> my evaluation
This series adds a initial DT binding doc for ina3221. It defines
a child node to describe the input source of each ina3221 channel.
Then it changes the driver to handle the information properly.
Changelog
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Dropped channel name properties
* Added child node definitions.
* * Added shunt resistor property in the child n
From: Nicolin Chen
An ina3221 chip has three input ports. Each port is used
to measure the voltage and current of its input source.
The DT binding now has defined bindings for their input
sources, so the driver should read these information and
handle accordingly.
This patch adds a new
Found two mistakes at this doc, sending v3.
On Fri, Sep 21, 2018 at 1:12 PM Nicolin Chen wrote:
> +++ b/Documentation/devicetree/bindings/hwmon/ina3221.txt
> @@ -0,0 +1,38 @@
> +ina3221 properties
> +
Should be a description of the doc.
> + VDD_GPU {
> + s
ndings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 38 ++
Documentation/hwmon/i
From: Nicolin Chen
An ina3221 chip has three input ports. Each port is used
to measure the voltage and current of its input source.
The DT binding now has defined bindings for their input
sources, so the driver should read these information and
handle accordingly.
This patch adds a new
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3:
* Added a simple subject in the line 1
* Fixed the shunt resistor value in the example
v1->v2:
* Dropped channe
> >+2) child nodes
> >+ The names of child nodes should indicate input source names
> >+
> >+ Required properties:
> >+ - input-id: Must be 1, 2 or 3
> >+
> >+ Optional properties:
> >+ - shunt-resistor: Shunt resistor value in micro-Ohm
> >+ - status: Should be "disabled" if no input source
> >This patch adds a new structure of input source specific
> >information including input source label, shunt resistor
> >value and its connection status. It exposes these labels
> >via sysfs and also disables those channels where there's
> >no input source being connected.
> >
>
> I see you have
On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote:
> > > > + /* Disable channels if their inputs are disconnected */
> > > > + for (i = 0, mask = 0; i < INA3221_NUM_CHANNELS; i++) {
> > > > + if (ina->inputs[i].disconnected)
> > > > + mas
On Sat, Sep 22, 2018 at 05:38:41PM -0700, Nicolin Chen wrote:
> On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote:
>
> > > > > + /* Disable channels if their inputs are disconnected */
> > > > > + for (i = 0, m
On Sat, Sep 22, 2018 at 07:07:02PM -0700, Guenter Roeck wrote:
> On 09/22/2018 05:38 PM, Nicolin Chen wrote:
> >On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote:
> >
> >>>>>+/* Disable channels if their inputs are disconnected */
> &
On Sat, Sep 22, 2018 at 08:33:00PM -0700, Nicolin Chen wrote:
> On Sat, Sep 22, 2018 at 07:07:02PM -0700, Guenter Roeck wrote:
> > On 09/22/2018 05:38 PM, Nicolin Chen wrote:
> > >On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote:
> > >
> > >>
ver accordingly and added is_visible (PATCH-2)
v2->v3:
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Rea
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v3->v4:
* Removed the attempt of putting labels in the node names
* Added a new optional label property in the child node
* Upda
specific
information including input source label, shunt resistor
value and its connection status. It exposes these labels
via sysfs if available and also disables those channels
where there's no input source being connected.
Signed-off-by: Nicolin Chen
---
Changelog
v3->v4:
* Added is
Thank you for the quick response!
On Sat, Sep 22, 2018 at 10:11:26PM -0700, Guenter Roeck wrote:
> >+static umode_t ina3221_attr_is_visible(struct kobject *kobj,
> >+ struct attribute *attr, int n)
> >+{
> >+const int max_attrs = ARRAY_SIZE(ina3221_attrs) - 1;
On Sat, Sep 22, 2018 at 10:19:42PM -0700, Guenter Roeck wrote:
> >+2) child nodes
> >+ Required properties:
> >+ - input-id: Must be 1, 2 or 3
> >+
> >+ Optional properties:
> >+ - input-label: Name of the input source
> >+ - shunt-resistor: Shunt resistor value in micro-Ohm
> >+ - status: Sh
On Sat, Sep 22, 2018 at 10:45:49PM -0700, Guenter Roeck wrote:
> On 09/22/2018 10:31 PM, Nicolin Chen wrote:
> > On Sat, Sep 22, 2018 at 10:19:42PM -0700, Guenter Roeck wrote:
> > > > +2) child nodes
> > > > + Required properties:
> &g
On Sat, Sep 22, 2018 at 11:36:22PM -0700, Guenter Roeck wrote:
> >+ Optional properties:
> >+ - input-label: Name of the input source
>
> Just noticed the "input-" here. Please just use "label".
Will fix in v5.
> >+ input1 {
> >+ input-id = <0x1>;
>
> We'll h
specific
information including input source label, shunt resistor
value and its connection status. It exposes these labels
via sysfs if available and also disables those channels
where there's no input source being connected.
Signed-off-by: Nicolin Chen
---
Changelog
v4->v5:
* Replace
d the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 49 ++
Documentation/hwmon/ina3221 | 1 +
drivers/hwm
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v4->v5:
* Replaced "input-id" with "reg" and added address-cells and size-cells
* Replaced "input-lab
Hello Guenter,
On Tue, Sep 25, 2018 at 06:52:29PM -0700, Guenter Roeck wrote:
> > +2) child nodes
> > + Required properties:
> > + - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> > INA3221
> > +
> > + Optional properties:
> > + - label: Name of the input source
> > + -
On Tue, Sep 25, 2018 at 08:40:59PM -0700, Guenter Roeck wrote:
> >>>+2) child nodes
> >>>+ Required properties:
> >>>+ - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> >>>INA3221
> >>>+ input@0 {
> >>>+ reg = <0x0>;
> >>>+ status = "disabled";
> >>saying
The hwmon sysfs ABI supports powerX_input and powerX_crit. This
can ease user space programs who care more about power in total
than voltage or current individually.
So this patch adds these two sysfs nodes for INA3221 driver.
Signed-off-by: Nicolin Chen
---
Documentation/hwmon/ina3221 | 4
ds to check if the attribute is
read-only to make sure it's not reading a configuration but the
sensor data.
Signed-off-by: Nicolin Chen
---
Documentation/hwmon/ina3221 | 1 +
drivers/hwmon/ina3221.c | 85 +
2 files changed, 86 insertions(+)
di
As this patch is still under review (waiting for an ack from DT
binding side), these two patches can only go through review at
this point -- needs to wait for the patch above getting merged
first.
Nicolin Chen (2):
hwmon: ina3221: Add power sysfs nodes
hwmon: ina3221: Add en
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > The inX_enable interface allows user space to enable or disable
> > the corresponding channel. Meanwhile, according to hwmon ABI, a
> > disabled channel/sensor shou
On Wed, Sep 26, 2018 at 05:34:53AM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > The hwmon sysfs ABI supports powerX_input and powerX_crit. This
> > can ease user space programs who care more about power in total
> &
Hello Guenter,
On Wed, Sep 26, 2018 at 12:45:34PM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On Wed, Sep 26, 2018 at 11:20:06AM -0700, Nicolin Chen wrote:
> > On Wed, Sep 26, 2018 at 05:34:53AM -0700, Guenter Roeck wrote:
> > > Hi Nicolin,
> > >
> >
Hello,
On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote:
> On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote:
> > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> > > On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > > > The in
On Wed, Sep 26, 2018 at 01:44:55PM -0700, Guenter Roeck wrote:
> On Wed, Sep 26, 2018 at 01:25:20PM -0700, Nicolin Chen wrote:
> > Hello,
> >
> > On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote:
> > > On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin C
Hello Guenter,
On Thu, Sep 27, 2018 at 09:05:09AM -0700, Guenter Roeck wrote:
> > > Point is that I don't _know_ how this is going to be used, so I'd
> > > rather keep it flexible.
> >
> > Well, taking one step back, I am okay to follow your way if you
> > are really firm about it. Just please gi
On Thu, Sep 27, 2018 at 12:44:13PM -0500, Rob Herring wrote:
> > +2) child nodes
> > + Required properties:
> > + - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> > INA3221
> > +
> > + Optional properties:
> > + - label: Name of the input source
> > + - shunt-resistor-micr
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v5->v6:
* Removed status property as no need to explicitly list it.
* Combined all examples into a complete one.
v4->v5:
* Re
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v5->v6:
* Removed the code of hiding disconnected channels
* Added in[123]_label sysfs nodes to control channels
* Added -ENODATA ret
On Thu, Sep 27, 2018 at 03:38:44PM -0500, Rob Herring wrote:
> On Thu, Sep 27, 2018 at 2:49 PM Nicolin Chen wrote:
> >
> > Texas Instruments INA3221 is a triple-channel shunt and bus
> > voltage monitor. This patch adds a DT binding doc for it.
> >
>
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v6->v7:
* N/A
v5->v6:
* Removed the code of hiding disconnected channels
* Added in[123]_label sysfs nodes to control channels
*
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status property as no n
d the driver accordingly and added is_visible (PATCH-2)
v2->v3:
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hw
On Thu, Sep 27, 2018 at 03:06:20PM -0700, Guenter Roeck wrote:
> I am quite sure I asked to use kstrtobool(). Did that get lost or do you have
> some reason to not use it ?
>
> I can understand if you don't want to change ina3221_is_enable() to
> ina3221_is_enabled(), since that is POV, but I do
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> > +static inline bool ina3221_is_enable(struct ina3221_data *ina, int channel)
>
> s/is_enable/is_enabled/, maybe ?
Fixing.
> > + return (config & INA3221_CONFIG_CHx_EN(channel)) > 0;
>
> The "> 0" is unnecessary. Conversion to
On Thu, Sep 27, 2018 at 03:52:00PM -0700, Guenter Roeck wrote:
> The proper fix for this problem would be to add support for suspend /
> resume to the driver. At resume time, all channels will have been
> re-enabled if the chip was powered off, even if they were explicitly
> disabled by devicetree
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v8:
* Rebased the change after the new suspend-resume patch
* * Please apply suspend-resume patch prior to this one
* Rena
ed one place in child DT node bindings (PATCH-1)
* Changed the driver accordingly and added is_visible (PATCH-2)
v2->v3:
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Ch
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v8:
* N/A
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status prope
On Sun, Sep 30, 2018 at 01:55:18PM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On 09/28/2018 06:39 PM, Nicolin Chen wrote:
> >An ina3221 chip has three input ports. Each port is used
> >to measure the voltage and current of its input source.
> >
> >The DT bin
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v9:
* N/A
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status prope
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v8->v9:
* Renamed the subject by following hwmon naming convention
* Rebased the patch after the merged ina3221 changes
* Fixed
driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: (ina3221) Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 44
Documentation/hwmon/ina3221 | 2 +
On Tue, Oct 02, 2018 at 10:05:18AM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On Mon, Oct 01, 2018 at 06:05:22PM -0700, Nicolin Chen wrote:
> > Texas Instruments INA3221 is a triple-channel shunt and bus
> > voltage monitor. This patch adds a DT binding doc for it.
&
Add operating mode support in the core and ina3221.
Nicolin Chen (2):
hwmon: (core) Add hwmon_mode structure and mode sysfs node
hwmon: (ina3221) Add operating mode support
Documentation/hwmon/sysfs-interface | 15 +
drivers/hwmon/hwmon.c | 87
The hwmon core now has a new optional mode interface. So this patch
just implements this mode support so that user space can check and
configure via sysfs node its operating modes: power-down, one-shot,
and continuous modes.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 64
"mode" and "available_modes" for user to check
and configure the operating mode. For hwmon device drivers that
implemented the _with_info API, the change also adds an optional
hwmon_mode structure in hwmon_chip_info structure so that those
drivers can pass mode related information
Hi Guenter,
On Wed, Oct 10, 2018 at 06:08:30AM -0700, Guenter Roeck wrote:
> > +available_modes The available operating modes of the chip.
> > + This should be short, lowercase string, not containing
> > + whitespace, or the wildcard character '*'.
> > + This attribut
kind of support though.
> I am open to help explore adding support for runtime power management
> to the hwmon subsystem, but that would be less than straightforward and
> require an actual use case to warrant the effort.
Is there any feasible solution from your point of view?
Thanks
Nico
Hi Guenter,
On Wed, Oct 10, 2018 at 04:43:00PM -0700, Guenter Roeck wrote:
> > > The effort to do all this using CPU cycles would in most if not all cases
> > > outweigh any perceived power savings. As such, I just don't see the
> > > practical use case.
> >
> > It really depends on the use case
On Thu, Oct 11, 2018 at 12:31:52PM -0700, Guenter Roeck wrote:
> > One more question here, and this might sound a bit abuse of using
> > the existing hwmon ABI: would it sound plausible to you that the
> > driver powers down the chip when all three channels get disabled
> > via in[123]_enable node
On Thu, Oct 11, 2018 at 12:50:25PM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On Thu, Oct 11, 2018 at 12:36:59PM -0700, Nicolin Chen wrote:
> > On Thu, Oct 11, 2018 at 12:31:52PM -0700, Guenter Roeck wrote:
> >
> > > > One more question here, and this
IOMMU_INVALIDATE uAPI; Instead, reuse the HWPT one
* Reworked mock_viommu_cache_invalidate() using the new iommu helper
* Reordered details of set/unset_vdev_id handlers for proper lockings
v1
https://lore.kernel.org/all/cover.1723061377.git.nicol...@nvidia.com/
Thanks!
Nicolin
Nicolin Chen (
remaining
to be selectable for drivers to build the existing iova_bitmap.c file.
Suggested-by: Jason Gunthorpe
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/Kconfig | 4 +++
drivers/iommu/iommufd/Makefile | 1 +
drivers/iommu/iommufd
;
};
It has to expose struct iommufd_object and enum iommufd_object_type from
the core-level private header to the public iommufd header.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 25
more robust to verify if
the xarray slot indexed by the input obj->id is having an XA_ZERO_ENTRY,
which is the reserved value stored by xa_alloc via iommufd_object_alloc.
Suggested-by: Jason Gunthorpe
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/mai
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/Makefile | 3 +-
drivers/iommu/iommufd/iommufd_private.h | 3 +
include/uapi/linux/iommufd.h| 40
drivers/iommu/iommufd/main.c| 6 ++
drivers/iommu/iommufd/viommu.c
iommu_domain_ops my_driver_domain_ops = {
.viommu_alloc = my_driver_viommu_alloc,
};
Suggested-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommu.h | 14 ++
include/lin
. Since a vIOMMU object holds the parent hwpt's
refcount already, increase the refcount of the vIOMMU only.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 1 +
include/uapi/linux/iommufd.h| 14 +++--
drivers/iommu/io
refcount is unbalanced. The refcount inc/dec will be added
in the following patch.
Suggested-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/selftest.c | 39 +---
1 file changed, 31 inse
Allow IOMMU driver to use a vIOMMU object that holds a nesting parent
hwpt/domain to allocate a nested domain.
Suggested-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h | 9 +
1 file changed, 9
Use these inline helpers to shorten those container_of lines.
Note that one of them goes back and forth between iommu_domain and
mock_iommu_domain, which isn't necessary. So drop its container_of.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
dr
With the introduction of the new object and its infrastructure, update the
doc to reflect that and add a new graph.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
Documentation/userspace-api/iommufd.rst | 69 -
1 file changed, 68
Add a new iommufd_viommu FIXTURE and setup it up with a vIOMMU object.
Any new vIOMMU feature will be added as a TEST_F under that.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
tools/testing/selftests/iommu/iommufd_utils.h | 28
tools/testing/selftests/iommu/iommufd.c
Implement the viommu alloc/free functions to increase/reduce refcount of
its dependent mock iommu device. User space can verify this loop via the
IOMMU_VIOMMU_TYPE_SELFTEST.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd
A nested domain now can be allocated for a parent domain or for a vIOMMU
object. Rework the existing allocators to prepare for the latter case.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/selftest.c | 89
This per-vIOMMU cache_invalidate op is like the cache_invalidate_user op
in struct iommu_domain_ops, but wider, supporting device cache (e.g. PCI
ATC invaldiations).
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h | 10 ++
1
iommu_copy_struct_from_user_array kdoc
accordingly.
Signed-off-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommu.h | 48 ++-
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/include
Add a vdevice_alloc op to the viommu mock_viommu_ops for the coverage of
IOMMU_VIOMMU_TYPE_SELFTEST allocations. Then, add a vdevice_alloc TEST_F
to cover the IOMMU_VDEVICE_ALLOC ioctl.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
tools/testing
iommu helper
* Reordered details of set/unset_vdev_id handlers for proper lockings
v1
https://lore.kernel.org/all/cover.1723061377.git.nicol...@nvidia.com/
Thanks!
Nicolin
Jason Gunthorpe (1):
iommu: Add iommu_copy_struct_from_full_user_array helper
Nicolin Chen (9):
iommufd/viommu: Ad
tl handler.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 18 ++
include/linux/iommufd.h | 4 ++
include/uapi/linux/iommufd.h| 22 +++
drivers/iommu/iommufd/main.c| 6 ++
drivers/iommu/iommufd/viommu.c
Similar to IOMMU_TEST_OP_MD_CHECK_IOTLB verifying a mock_domain's iotlb,
IOMMU_TEST_OP_DEV_CHECK_CACHE will be used to verify a mock_dev's cache.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h | 5 +
Similar to the coverage of cache_invalidate_user for iotlb invalidation,
add a device cache and a viommu_cache_invalidate function to test it out.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h | 25 +
drivers/iommu/iommufd/selftest.c
This avoids a bigger trouble of exposing struct iommufd_device and struct
iommufd_vdevice in the public header.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h| 8
drivers/iommu/iommufd/driver.c | 13
.
Update the uAPI, kdoc, and selftest case accordingly.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
include/uapi/linux/iommufd.h| 9 --
drivers/iommu/iommufd/hw_pagetable.c| 40 +++--
tools/testing/selftests/iommu
Add a viommu_cache test function to cover vIOMMU invalidations using the
updated IOMMU_HWPT_INVALIDATE ioctl, which now allows passing in a vIOMMU
via its hwpt_id field.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
tools/testing/selftests/iommu
With the introduction of the new object and its infrastructure, update the
doc and the vIOMMU graph to reflect that.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
Documentation/userspace-api/iommufd.rst | 41 +++--
1 file changed, 32
On Thu, Oct 31, 2024 at 09:38:17AM -0700, Nicolin Chen wrote:
> On Thu, Oct 31, 2024 at 10:16:37AM -0300, Jason Gunthorpe wrote:
> > On Wed, Oct 30, 2024 at 02:34:38PM -0700, Nicolin Chen wrote:
> > > +FIXTURE_SETUP(iommufd_viommu)
...
> > > +
1 - 100 of 328 matches
Mail list logo