drm-next 98faa78ce7f1f986e11e7805d31b409782a6d2d4

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bar: ioremap only the areas that we're actually using

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core: pass related object into notify constructor

The event source types/index might need to be derived from it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
disp/nv50-: add support for completion events

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc: drop workaround for an interrupt storm that no longer happens

This is really the wrong thing to do, but at the time it was our only
option to prevent worse issues.

We no longer cause quite so much anger from LTC, so it's not needed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc/gf100: translate interrupt status into more meaningful names

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: make it clearer what (type == 0) means

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: modify test for if building a mm with holes in it

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: dump mm when trying to tear one down that still has allocations

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: fill in holes with "allocated" nodes

The allocation algorithm doesn't expect there to be holes in the mm, which
causes its alignment/cutoff calculations to choke (and go negative) when
encountering the last chunk of a block before a hole.

The least expensive solution is to simply fill in any holes with nodes
that are pre-marked as being allocated.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
core/mm: allow allocation to be confined to a specific slice of heap

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ltc: allocate tagram from memory that spans all partitions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bios/fan: add support for maxwell's fan management table v2

Re-use the therm-exported fan structure with only two minor modifications:
- pwm_freq: u16 -> u32;
- add fan_type (toggle or PWM)

v2:
- Do not memset the table to 0 as it erases the pre-set default values

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
therm/fan: do not use the pwm mode when the vbios tells us to use toggle

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
gm107/therm: add PWM fan support v2

v2: change the copyright ownership from "Nouveau Community" to myself, as per
Illia's recommendation.

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ppwr: enable ppwr on gm107

For some reason, it is now required to wait a 20 µs after the 0x200 reset of
the engine.

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr: fix the timers implementation with concurent processes

The problem with the current implementation is that adding a timer improperly
checked which process would time up first by not taking into account how much
time elapsed since their timer got scheduled. Rework the re-scheduling
decision t fix this.

The catch with this fix is that we are limited to scheduling timers of up to
2^31 ticks to avoid any potential overflow. Since we are unlikely to need to
wait for more than a second, this won't be a problem :)

Another possible fix would be to decrement the timeouts of all processes but
it would duplicate a lot of code and dealing with edge cases wasn't pretty
last time I checked.

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr: add some arith functions (mul32_32_64, subu64 and addu64)

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr: add helpers for delay-to-ticks and ticks-to-delay

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pwr/fuc: add ld/st macros

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>