habanalabs: set max power according to card type
authorOded Gabbay <oded.gabbay@gmail.com>
Sat, 8 Aug 2020 20:34:47 +0000 (23:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:09 +0000 (19:14 +0200)
commit9a3acad9ae0ea859d6408bacbb7ffaf8adc5dcf2
tree6595b8c97b4b92e185005d9af847d8ccb7ad4510
parent3a24b9420ee0a0f146840c29883d671327e00f4c
habanalabs: set max power according to card type

[ Upstream commit 58361aae4b0eed388680a89ac153d27177f40510 ]

In Gaudi, the default max power setting is different between PCI and PMC
cards. Therefore, the driver need to set the default after knowing what is
the card type.

The current code has a bug where it limits the maximum power of the PMC
card to 200W after a reset occurs.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/gaudi/gaudiP.h
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/sysfs.c