Allocate msis such that each time a new interrupt is requested, the SRS (MSIR register select) to be used is allocated in a round-robin fashion. The end result is that the msi interrupts will be spread across distinct MSIRs with the main benefit that now users can set affinity to each msi int through the mpic irq backing up the MSIR register. This is achieved with the help of a newly introduced msi bitmap api that allows specifying the starting point when searching for a free msi interrupt. Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#ifndef _POWERPC_SYSDEV_MSI_BITMAP_H
|
|
#define _POWERPC_SYSDEV_MSI_BITMAP_H
|
|
|
|
/*
|
|
* Copyright 2008, Michael Ellerman, IBM Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; version 2 of the
|
|
* License.
|
|
*
|
|
*/
|
|
|
|
#include <linux/of.h>
|
|
#include <asm/irq.h>
|
|
|
|
struct msi_bitmap {
|
|
struct device_node *of_node;
|
|
unsigned long *bitmap;
|
|
spinlock_t lock;
|
|
unsigned int irq_count;
|
|
};
|
|
|
|
int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
|
|
void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
|
|
unsigned int num);
|
|
void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
|
|
int msi_bitmap_alloc_hwirqs_from_offset(struct msi_bitmap *bmp, int offset,
|
|
int num);
|
|
|
|
int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
|
|
|
|
int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
|
|
struct device_node *of_node);
|
|
void msi_bitmap_free(struct msi_bitmap *bmp);
|
|
|
|
#endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */
|