Commit Graph

15 Commits

Author SHA1 Message Date
Viresh Kumar
c2a97d5edd
Merge branch 'main' into remove-tryfrom-use 2022-08-31 08:36:52 +05:30
Obei Sideg
870546c06d Remove use std::convert::TryFrom
Signed-off-by: Obei Sideg <obei.sideg@gmail.com>
2022-08-30 17:00:22 +03:00
Viresh Kumar
f5d74d4e9c gpio: Update test's while loop to avoid test failure
The "test_gpio_process_events_multi_success" test currently hangs with
an update to a newer version of Rust. The code here tries to read the
value, locked, for each GPIO one by one. The values are updated in
another thread with the help of write lock.

More discussion around this issue can be found here.

https://github.com/rust-lang/rust/issues/101194

Taking the lock only once fixes it for now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-08-30 17:01:55 +05:30
Mathieu Poirier
843a03590b Preparation for upgrade to Rust version to 1.63.0
In preparation to upgrade to Rust version 1.63.0, address clippy
warning demanding that 'Eq' be derived when 'PartialEq' is.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-08-29 15:37:02 -06:00
Viresh Kumar
e50d717be5 Update code based on virtio-queue update to 0.5.0
virtio-queue update has API interface changes, adapt to them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-08-03 17:27:07 +05:30
Viresh Kumar
c037e60442 Update versions of rust-vmm dependency crates
Update a number of rust-vmm crates to align to the common version of
vm-memory.

Also update the tests to fix the build.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-07-11 13:33:47 +05:30
Viresh Kumar
66225683dd gpio: Update to a newer version of libgpiod
libgpiod received few updates, migrate to that.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-05-13 15:30:55 +05:30
Viresh Kumar
b5408666f1 gpio: Enable REPLY_ACK protocol feature
The virtio-gpio driver at the guest performs virtio transaction right
from its probe() routine and without this patch, there is a chance that
the backend may miss the notification from the guest, as the
notification may be sent before the eventfd is set at the backend. This
flag makes the master side wait for reply from backend before proceeding
further for each operation.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-05-04 12:36:19 +05:30
Viresh Kumar
413a840d0b gpio: Fix get_config()
get_config() must return only the relevant part of the config, as
requested by the caller, instead of returning entire config structure.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-04-29 16:00:36 +05:30
Viresh Kumar
131464787d gpio: Skip musl builds
Disable builds for musl, where libgpiod build fails on
rust-vmm-container due to missing tools and headers.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-04-04 12:38:51 +05:30
Viresh Kumar
cc6d1e608f gpio: Add tests
Add tests to validate functionality of the GPIO crate.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-04-04 12:38:51 +05:30
Viresh Kumar
679224af8d gpio: Add support for interrupts
Add support for GPIO interrupts. Only edge interrupts are supported by
libgpiod.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-03-31 09:09:32 +05:30
Viresh Kumar
8a021c704f gpio: Process virtio requests
This patch implements process_queue() to process incoming requests.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-03-31 09:09:32 +05:30
Viresh Kumar
472870d44d gpio: Implement low level GPIO helpers
This patch implements the low level GPIO helpers responsible for pin
level functioning.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-03-31 09:09:32 +05:30
Viresh Kumar
5caff0a8ad gpio: Add boilerplate code
This adds the boilerplate code and its dependencies to get the basic
structure for the gpio crate.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-03-31 09:09:32 +05:30