Displaying 8 results from an estimated 8 matches for "nvkm_i2c_bus_acquire".
Did you mean:
nvkm_i2c_aux_acquire
2018 Jul 17
2
[PATCH 4/5] drm/nouveau: Grab RPM ref when i2c bus is in use
...,28 @@ nvkm_i2c_bus_release(struct nvkm_i2c_bus *bus)
> BUS_TRACE(bus, "release");
> nvkm_i2c_pad_release(pad);
> mutex_unlock(&bus->mutex);
> + pm_runtime_put_autosuspend(pad->i2c->subdev.device->dev);
> }
>
> int
> nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *bus)
> {
> struct nvkm_i2c_pad *pad = bus->pad;
> + struct device *dev = pad->i2c->subdev.device->dev;
> int ret;
> +
> BUS_TRACE(bus, "acquire");
> +
> + ret = pm_runtime_get_sync(dev);
> +...
2019 Apr 09
2
[PATCH v2] drm/nouveau/i2c: Disable i2c bus access after ->fini()
...dev/i2c.h
index eef54e9b5d77..7957eafa5f0e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
@@ -38,6 +38,7 @@ struct nvkm_i2c_bus {
struct mutex mutex;
struct list_head head;
struct i2c_adapter i2c;
+ u8 enabled;
};
int nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *);
@@ -57,6 +58,7 @@ struct nvkm_i2c_aux {
struct mutex mutex;
struct list_head head;
struct i2c_adapter i2c;
+ u8 enabled;
u32 intr;
};
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
index 4c1f547da463..b4e...
2019 Apr 11
1
[PATCH v2] drm/nouveau/i2c: Disable i2c bus access after ->fini()
...t; +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
> > @@ -38,6 +38,7 @@ struct nvkm_i2c_bus {
> > struct mutex mutex;
> > struct list_head head;
> > struct i2c_adapter i2c;
> > + u8 enabled;
> > };
> >
> > int nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *);
> > @@ -57,6 +58,7 @@ struct nvkm_i2c_aux {
> > struct mutex mutex;
> > struct list_head head;
> > struct i2c_adapter i2c;
> > + u8 enabled;
> >
> > u32 intr;
> > };
> > diff --git...
2019 Apr 10
0
[PATCH v2] drm/nouveau/i2c: Disable i2c bus access after ->fini()
.../drm/nouveau/include/nvkm/subdev/i2c.h
> +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
> @@ -38,6 +38,7 @@ struct nvkm_i2c_bus {
> struct mutex mutex;
> struct list_head head;
> struct i2c_adapter i2c;
> + u8 enabled;
> };
>
> int nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *);
> @@ -57,6 +58,7 @@ struct nvkm_i2c_aux {
> struct mutex mutex;
> struct list_head head;
> struct i2c_adapter i2c;
> + u8 enabled;
>
> u32 intr;
> };
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux....
2018 Jul 16
0
[PATCH 4/5] drm/nouveau: Grab RPM ref when i2c bus is in use
.../drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c
@@ -119,18 +119,28 @@ nvkm_i2c_bus_release(struct nvkm_i2c_bus *bus)
BUS_TRACE(bus, "release");
nvkm_i2c_pad_release(pad);
mutex_unlock(&bus->mutex);
+ pm_runtime_put_autosuspend(pad->i2c->subdev.device->dev);
}
int
nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *bus)
{
struct nvkm_i2c_pad *pad = bus->pad;
+ struct device *dev = pad->i2c->subdev.device->dev;
int ret;
+
BUS_TRACE(bus, "acquire");
+
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0 && ret != -EACCES)
+ return ret;
+
mutex_lock(&...
2018 Jul 17
0
[PATCH 4/5] drm/nouveau: Grab RPM ref when i2c bus is in use
...i2c_bus *bus)
> > BUS_TRACE(bus, "release");
> > nvkm_i2c_pad_release(pad);
> > mutex_unlock(&bus->mutex);
> > + pm_runtime_put_autosuspend(pad->i2c->subdev.device->dev);
> > }
> >
> > int
> > nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *bus)
> > {
> > struct nvkm_i2c_pad *pad = bus->pad;
> > + struct device *dev = pad->i2c->subdev.device->dev;
> > int ret;
> > +
> > BUS_TRACE(bus, "acquire");
> > +
> > +...
2019 Apr 03
0
[PATCH] drm/nouveau/i2c: Disable i2c bus access after ->fini()
...s->mutex);
+ bus->enabled = true;
+ mutex_unlock(&bus->mutex);
+}
+
+void
+nvkm_i2c_bus_fini(struct nvkm_i2c_bus *bus)
+{
+ BUS_TRACE(bus, "fini");
+ mutex_lock(&bus->mutex);
+ bus->enabled = false;
+ mutex_unlock(&bus->mutex);
}
void
@@ -126,9 +139,15 @@ nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *bus)
{
struct nvkm_i2c_pad *pad = bus->pad;
int ret;
+
BUS_TRACE(bus, "acquire");
mutex_lock(&bus->mutex);
- ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_I2C);
+
+ if (bus->enabled)
+ ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_I2C);
+ else
+...
2018 Jul 16
9
[PATCH 0/5] drm/nouveau: Fix a lot of nasty RPM bugs and deadlocks
This fixes quite a number of runtime PM bugs I found that have been
causing some pretty nasty issues such as:
- Deadlocking on boot
- Connector probing potentially not working while the GPU is in runtime
suspend
- i2c char dev not working while the GPU is in runtime suspend
- aux char dev not working while the GPU is in runtime suspend
There's definitely more parts of nouveau that need