linux/drivers/infiniband/hw/hfi1/aspm.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
   2/*
   3 * Copyright(c) 2015-2017 Intel Corporation.
   4 */
   5
   6#ifndef _ASPM_H
   7#define _ASPM_H
   8
   9#include "hfi.h"
  10
  11extern uint aspm_mode;
  12
  13enum aspm_mode {
  14        ASPM_MODE_DISABLED = 0, /* ASPM always disabled, performance mode */
  15        ASPM_MODE_ENABLED = 1,  /* ASPM always enabled, power saving mode */
  16        ASPM_MODE_DYNAMIC = 2,  /* ASPM enabled/disabled dynamically */
  17};
  18
  19void aspm_init(struct hfi1_devdata *dd);
  20void aspm_exit(struct hfi1_devdata *dd);
  21void aspm_hw_disable_l1(struct hfi1_devdata *dd);
  22void __aspm_ctx_disable(struct hfi1_ctxtdata *rcd);
  23void aspm_disable_all(struct hfi1_devdata *dd);
  24void aspm_enable_all(struct hfi1_devdata *dd);
  25
  26static inline void aspm_ctx_disable(struct hfi1_ctxtdata *rcd)
  27{
  28        /* Quickest exit for minimum impact */
  29        if (likely(!rcd->aspm_intr_supported))
  30                return;
  31
  32        __aspm_ctx_disable(rcd);
  33}
  34
  35#endif /* _ASPM_H */
  36