Skip to content

Commit

Permalink
Revert "staging: fsl-mc: decouple the mc-bus public headers from dprc.h"
Browse files Browse the repository at this point in the history
This reverts commit c6ce019.

The whole series is broken, so back it all out.

Reported-by: kbuild test robot <[email protected]>
Cc: Laurentiu Tudor <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jun 26, 2017
1 parent e903e20 commit 2246ad1
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 71 deletions.
38 changes: 19 additions & 19 deletions drivers/staging/fsl-mc/bus/dprc-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

#define FSL_MC_DPRC_DRIVER_NAME "fsl_mc_dprc"

struct fsl_mc_child_objs {
struct dprc_child_objs {
int child_count;
struct fsl_mc_obj_desc *child_array;
struct dprc_obj_desc *child_array;
};

static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev,
struct fsl_mc_obj_desc *obj_desc)
struct dprc_obj_desc *obj_desc)
{
return !strcmp(mc_dev->obj_desc.type, obj_desc->type) &&
mc_dev->obj_desc.id == obj_desc->id;
Expand All @@ -36,7 +36,7 @@ static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev,
static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)
{
int i;
struct fsl_mc_child_objs *objs;
struct dprc_child_objs *objs;
struct fsl_mc_device *mc_dev;

WARN_ON(!dev);
Expand All @@ -45,7 +45,7 @@ static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)
objs = data;

for (i = 0; i < objs->child_count; i++) {
struct fsl_mc_obj_desc *obj_desc = &objs->child_array[i];
struct dprc_obj_desc *obj_desc = &objs->child_array[i];

if (strlen(obj_desc->type) != 0 &&
fsl_mc_device_match(mc_dev, obj_desc))
Expand Down Expand Up @@ -79,15 +79,15 @@ static int __fsl_mc_device_remove(struct device *dev, void *data)
* been dynamically removed in the physical DPRC.
*/
static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev,
struct fsl_mc_obj_desc *obj_desc_array,
struct dprc_obj_desc *obj_desc_array,
int num_child_objects_in_mc)
{
if (num_child_objects_in_mc != 0) {
/*
* Remove child objects that are in the DPRC in Linux,
* but not in the MC:
*/
struct fsl_mc_child_objs objs;
struct dprc_child_objs objs;

objs.child_count = num_child_objects_in_mc;
objs.child_array = obj_desc_array;
Expand All @@ -105,13 +105,13 @@ static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev,

static int __fsl_mc_device_match(struct device *dev, void *data)
{
struct fsl_mc_obj_desc *obj_desc = data;
struct dprc_obj_desc *obj_desc = data;
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);

return fsl_mc_device_match(mc_dev, obj_desc);
}

static struct fsl_mc_device *fsl_mc_device_lookup(struct fsl_mc_obj_desc
static struct fsl_mc_device *fsl_mc_device_lookup(struct dprc_obj_desc
*obj_desc,
struct fsl_mc_device
*mc_bus_dev)
Expand All @@ -136,24 +136,24 @@ static struct fsl_mc_device *fsl_mc_device_lookup(struct fsl_mc_obj_desc
* device is unbound from the corresponding device driver.
*/
static void check_plugged_state_change(struct fsl_mc_device *mc_dev,
struct fsl_mc_obj_desc *obj_desc)
struct dprc_obj_desc *obj_desc)
{
int error;
u32 plugged_flag_at_mc =
obj_desc->state & FSL_MC_OBJ_STATE_PLUGGED;
obj_desc->state & DPRC_OBJ_STATE_PLUGGED;

if (plugged_flag_at_mc !=
(mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED)) {
(mc_dev->obj_desc.state & DPRC_OBJ_STATE_PLUGGED)) {
if (plugged_flag_at_mc) {
mc_dev->obj_desc.state |= FSL_MC_OBJ_STATE_PLUGGED;
mc_dev->obj_desc.state |= DPRC_OBJ_STATE_PLUGGED;
error = device_attach(&mc_dev->dev);
if (error < 0) {
dev_err(&mc_dev->dev,
"device_attach() failed: %d\n",
error);
}
} else {
mc_dev->obj_desc.state &= ~FSL_MC_OBJ_STATE_PLUGGED;
mc_dev->obj_desc.state &= ~DPRC_OBJ_STATE_PLUGGED;
device_release_driver(&mc_dev->dev);
}
}
Expand All @@ -172,15 +172,15 @@ static void check_plugged_state_change(struct fsl_mc_device *mc_dev,
* in the physical DPRC.
*/
static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
struct fsl_mc_obj_desc *obj_desc_array,
struct dprc_obj_desc *obj_desc_array,
int num_child_objects_in_mc)
{
int error;
int i;

for (i = 0; i < num_child_objects_in_mc; i++) {
struct fsl_mc_device *child_dev;
struct fsl_mc_obj_desc *obj_desc = &obj_desc_array[i];
struct dprc_obj_desc *obj_desc = &obj_desc_array[i];

if (strlen(obj_desc->type) == 0)
continue;
Expand Down Expand Up @@ -227,7 +227,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
int dprc_get_obj_failures;
int error;
unsigned int irq_count = mc_bus_dev->obj_desc.irq_count;
struct fsl_mc_obj_desc *child_obj_desc_array = NULL;
struct dprc_obj_desc *child_obj_desc_array = NULL;

error = dprc_get_obj_count(mc_bus_dev->mc_io,
0,
Expand All @@ -254,7 +254,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
*/
dprc_get_obj_failures = 0;
for (i = 0; i < num_child_objects; i++) {
struct fsl_mc_obj_desc *obj_desc =
struct dprc_obj_desc *obj_desc =
&child_obj_desc_array[i];

error = dprc_get_obj(mc_bus_dev->mc_io,
Expand Down Expand Up @@ -282,7 +282,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
if ((strcmp(obj_desc->type, "dpseci") == 0) &&
(obj_desc->ver_major < 4))
obj_desc->flags |=
FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY;
DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY;

irq_count += obj_desc->irq_count;
dev_dbg(&mc_bus_dev->dev,
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/fsl-mc/bus/dprc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "../include/mc.h"
#include "../include/mc-sys.h"
#include "../include/mc-cmd.h"
#include "../include/dprc.h"
Expand Down Expand Up @@ -497,7 +496,7 @@ int dprc_get_obj(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
int obj_index,
struct fsl_mc_obj_desc *obj_desc)
struct dprc_obj_desc *obj_desc)
{
struct mc_command cmd = { 0 };
struct dprc_cmd_get_obj *cmd_params;
Expand Down
12 changes: 6 additions & 6 deletions drivers/staging/fsl-mc/bus/fsl-mc-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv)
* If the object is not 'plugged' don't match.
* Only exception is the root DPRC, which is a special case.
*/
if ((mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED) == 0 &&
if ((mc_dev->obj_desc.state & DPRC_OBJ_STATE_PLUGGED) == 0 &&
!fsl_mc_is_root_dprc(&mc_dev->dev))
goto out;

Expand Down Expand Up @@ -339,7 +339,7 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev,
int i;
int error;
struct resource *regions;
struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc;
struct dprc_obj_desc *obj_desc = &mc_dev->obj_desc;
struct device *parent_dev = mc_dev->dev.parent;
enum dprc_region_type mc_region_type;

Expand Down Expand Up @@ -432,7 +432,7 @@ static void fsl_mc_device_release(struct device *dev)
/**
* Add a newly discovered fsl-mc device to be visible in Linux
*/
int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
struct fsl_mc_io *mc_io,
struct device *parent_dev,
struct fsl_mc_device **new_mc_dev)
Expand Down Expand Up @@ -534,7 +534,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
}

/* Objects are coherent, unless 'no shareability' flag set. */
if (!(obj_desc->flags & FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY))
if (!(obj_desc->flags & DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY))
arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true);

/*
Expand Down Expand Up @@ -687,7 +687,7 @@ static int get_mc_addr_translation_ranges(struct device *dev,
*/
static int fsl_mc_bus_probe(struct platform_device *pdev)
{
struct fsl_mc_obj_desc obj_desc;
struct dprc_obj_desc obj_desc;
int error;
struct fsl_mc *mc;
struct fsl_mc_device *mc_bus_dev = NULL;
Expand Down Expand Up @@ -746,7 +746,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
goto error_cleanup_mc_io;
}

memset(&obj_desc, 0, sizeof(struct fsl_mc_obj_desc));
memset(&obj_desc, 0, sizeof(struct dprc_obj_desc));
error = dprc_get_api_version(mc_io, 0,
&obj_desc.ver_major,
&obj_desc.ver_minor);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/fsl-mc/bus/fsl-mc-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "../include/mc.h"

int __must_check fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
int __must_check fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
struct fsl_mc_io *mc_io,
struct device *parent_dev,
struct fsl_mc_device **new_mc_dev);
Expand Down
46 changes: 43 additions & 3 deletions drivers/staging/fsl-mc/include/dprc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
*/

struct fsl_mc_io;
struct fsl_mc_obj_desc;

int dprc_open(struct fsl_mc_io *mc_io,
u32 cmd_flags,
Expand Down Expand Up @@ -168,18 +167,59 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io,
u16 token,
int *obj_count);

/* Objects Attributes Flags */

/* Opened state - Indicates that an object is open by at least one owner */
#define DPRC_OBJ_STATE_OPEN 0x00000001
/* Plugged state - Indicates that the object is plugged */
#define DPRC_OBJ_STATE_PLUGGED 0x00000002

/**
* Shareability flag - Object flag indicating no memory shareability.
* the object generates memory accesses that are non coherent with other
* masters;
* user is responsible for proper memory handling through IOMMU configuration.
*/
#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001

/**
* struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj()
* @type: Type of object: NULL terminated string
* @id: ID of logical object resource
* @vendor: Object vendor identifier
* @ver_major: Major version number
* @ver_minor: Minor version number
* @irq_count: Number of interrupts supported by the object
* @region_count: Number of mappable regions supported by the object
* @state: Object state: combination of DPRC_OBJ_STATE_ states
* @label: Object label
* @flags: Object's flags
*/
struct dprc_obj_desc {
char type[16];
int id;
u16 vendor;
u16 ver_major;
u16 ver_minor;
u8 irq_count;
u8 region_count;
u32 state;
char label[16];
u16 flags;
};

int dprc_get_obj(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
int obj_index,
struct fsl_mc_obj_desc *obj_desc);
struct dprc_obj_desc *obj_desc);

int dprc_get_obj_desc(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token,
char *obj_type,
int obj_id,
struct fsl_mc_obj_desc *obj_desc);
struct dprc_obj_desc *obj_desc);

int dprc_set_obj_irq(struct fsl_mc_io *mc_io,
u32 cmd_flags,
Expand Down
41 changes: 1 addition & 40 deletions drivers/staging/fsl-mc/include/mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,45 +104,6 @@ struct fsl_mc_device_irq {
#define to_fsl_mc_irq(_mc_resource) \
container_of(_mc_resource, struct fsl_mc_device_irq, resource)

/* Opened state - Indicates that an object is open by at least one owner */
#define FSL_MC_OBJ_STATE_OPEN 0x00000001
/* Plugged state - Indicates that the object is plugged */
#define FSL_MC_OBJ_STATE_PLUGGED 0x00000002

/**
* Shareability flag - Object flag indicating no memory shareability.
* the object generates memory accesses that are non coherent with other
* masters;
* user is responsible for proper memory handling through IOMMU configuration.
*/
#define FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001

/**
* struct fsl_mc_obj_desc - Object descriptor
* @type: Type of object: NULL terminated string
* @id: ID of logical object resource
* @vendor: Object vendor identifier
* @ver_major: Major version number
* @ver_minor: Minor version number
* @irq_count: Number of interrupts supported by the object
* @region_count: Number of mappable regions supported by the object
* @state: Object state: combination of FSL_MC_OBJ_STATE_ states
* @label: Object label: NULL terminated string
* @flags: Object's flags
*/
struct fsl_mc_obj_desc {
char type[16];
int id;
u16 vendor;
u16 ver_major;
u16 ver_minor;
u8 irq_count;
u8 region_count;
u32 state;
char label[16];
u16 flags;
};

/**
* Bit masks for a MC object device (struct fsl_mc_device) flags
*/
Expand Down Expand Up @@ -189,7 +150,7 @@ struct fsl_mc_device {
u16 icid;
u16 mc_handle;
struct fsl_mc_io *mc_io;
struct fsl_mc_obj_desc obj_desc;
struct dprc_obj_desc obj_desc;
struct resource *regions;
struct fsl_mc_device_irq **irqs;
struct fsl_mc_resource *resource;
Expand Down

0 comments on commit 2246ad1

Please sign in to comment.