Commit 2f6bd4da authored by Dave Airlie's avatar Dave Airlie

Merge tag 'amdkfd-fixes-2014-12-30' of git://people.freedesktop.org/~gabbayo/linux into linus

Highlights:

- Link order changes in drm/Makefile and drivers/Makefile to fix issue
  when amdkfd, radeon and amd_iommu_v2 are compiled inside the kernel
  image.

- Consider kernel configuration (using #IFDEFs) when radeon initializes
  amdkfd, due to a specific configuration that makes symbol_request()
  return a non-NULL value when a symbol doesn't exists. Rusty Russel
  is helping me to find the root cause, but it may take a while because
  of year-end so I'm sending this as a band-aid solution.

* tag 'amdkfd-fixes-2014-12-30' of git://people.freedesktop.org/~gabbayo/linux:
  drm/radeon: Init amdkfd only if it was compiled
  amdkfd: actually allocate longs for the pasid bitmask
  drm: Put amdkfd before radeon in drm Makefile
  drivers: Move iommu/ before gpu/ in Makefile
  amdkfd: Remove duplicate include
  amdkfd: Fixing topology bug in building sysfs nodes
  amdkfd: Fix accounting of device queues
parents 379a2d31 38c2adfb
...@@ -50,7 +50,10 @@ obj-$(CONFIG_RESET_CONTROLLER) += reset/ ...@@ -50,7 +50,10 @@ obj-$(CONFIG_RESET_CONTROLLER) += reset/
obj-y += tty/ obj-y += tty/
obj-y += char/ obj-y += char/
# gpu/ comes after char for AGP vs DRM startup # iommu/ comes before gpu as gpu are using iommu controllers
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/ obj-y += gpu/
obj-$(CONFIG_CONNECTOR) += connector/ obj-$(CONFIG_CONNECTOR) += connector/
...@@ -141,7 +144,6 @@ obj-y += clk/ ...@@ -141,7 +144,6 @@ obj-y += clk/
obj-$(CONFIG_MAILBOX) += mailbox/ obj-$(CONFIG_MAILBOX) += mailbox/
obj-$(CONFIG_HWSPINLOCK) += hwspinlock/ obj-$(CONFIG_HWSPINLOCK) += hwspinlock/
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
obj-$(CONFIG_REMOTEPROC) += remoteproc/ obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/ obj-$(CONFIG_RPMSG) += rpmsg/
......
...@@ -37,6 +37,7 @@ obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o ...@@ -37,6 +37,7 @@ obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
obj-$(CONFIG_DRM_TTM) += ttm/ obj-$(CONFIG_DRM_TTM) += ttm/
obj-$(CONFIG_DRM_TDFX) += tdfx/ obj-$(CONFIG_DRM_TDFX) += tdfx/
obj-$(CONFIG_DRM_R128) += r128/ obj-$(CONFIG_DRM_R128) += r128/
obj-$(CONFIG_HSA_AMD) += amd/amdkfd/
obj-$(CONFIG_DRM_RADEON)+= radeon/ obj-$(CONFIG_DRM_RADEON)+= radeon/
obj-$(CONFIG_DRM_MGA) += mga/ obj-$(CONFIG_DRM_MGA) += mga/
obj-$(CONFIG_DRM_I810) += i810/ obj-$(CONFIG_DRM_I810) += i810/
...@@ -67,4 +68,3 @@ obj-$(CONFIG_DRM_IMX) += imx/ ...@@ -67,4 +68,3 @@ obj-$(CONFIG_DRM_IMX) += imx/
obj-y += i2c/ obj-y += i2c/
obj-y += panel/ obj-y += panel/
obj-y += bridge/ obj-y += bridge/
obj-$(CONFIG_HSA_AMD) += amd/amdkfd/
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <uapi/linux/kfd_ioctl.h> #include <uapi/linux/kfd_ioctl.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/uaccess.h>
#include <uapi/asm-generic/mman-common.h> #include <uapi/asm-generic/mman-common.h>
#include <asm/processor.h> #include <asm/processor.h>
#include "kfd_priv.h" #include "kfd_priv.h"
......
...@@ -320,6 +320,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) ...@@ -320,6 +320,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
{ {
int retval; int retval;
struct mqd_manager *mqd; struct mqd_manager *mqd;
bool prev_active = false;
BUG_ON(!dqm || !q || !q->mqd); BUG_ON(!dqm || !q || !q->mqd);
...@@ -330,10 +331,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) ...@@ -330,10 +331,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
return -ENOMEM; return -ENOMEM;
} }
retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
if (q->properties.is_active == true) if (q->properties.is_active == true)
prev_active = true;
/*
*
* check active state vs. the previous state
* and modify counter accordingly
*/
retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
if ((q->properties.is_active == true) && (prev_active == false))
dqm->queue_count++; dqm->queue_count++;
else else if ((q->properties.is_active == false) && (prev_active == true))
dqm->queue_count--; dqm->queue_count--;
if (sched_policy != KFD_SCHED_POLICY_NO_HWS) if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
......
...@@ -32,7 +32,7 @@ int kfd_pasid_init(void) ...@@ -32,7 +32,7 @@ int kfd_pasid_init(void)
{ {
pasid_limit = max_num_of_processes; pasid_limit = max_num_of_processes;
pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL); pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
if (!pasid_bitmap) if (!pasid_bitmap)
return -ENOMEM; return -ENOMEM;
......
...@@ -921,7 +921,7 @@ static int kfd_build_sysfs_node_tree(void) ...@@ -921,7 +921,7 @@ static int kfd_build_sysfs_node_tree(void)
uint32_t i = 0; uint32_t i = 0;
list_for_each_entry(dev, &topology_device_list, list) { list_for_each_entry(dev, &topology_device_list, list) {
ret = kfd_build_sysfs_node_entry(dev, 0); ret = kfd_build_sysfs_node_entry(dev, i);
if (ret < 0) if (ret < 0)
return ret; return ret;
i++; i++;
......
...@@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd; ...@@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd;
bool radeon_kfd_init(void) bool radeon_kfd_init(void)
{ {
#if defined(CONFIG_HSA_AMD_MODULE)
bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*, bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*,
const struct kgd2kfd_calls**); const struct kgd2kfd_calls**);
...@@ -117,6 +118,17 @@ bool radeon_kfd_init(void) ...@@ -117,6 +118,17 @@ bool radeon_kfd_init(void)
} }
return true; return true;
#elif defined(CONFIG_HSA_AMD)
if (!kgd2kfd_init(KFD_INTERFACE_VERSION, &kfd2kgd, &kgd2kfd)) {
kgd2kfd = NULL;
return false;
}
return true;
#else
return false;
#endif
} }
void radeon_kfd_fini(void) void radeon_kfd_fini(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment