mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J. German Rivera" <German.Rivera@freescale.com>
To: <gregkh@linuxfoundation.org>, <arnd@arndb.de>,
	<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Cc: <stuart.yoder@freescale.com>, <Kim.Phillips@freescale.com>,
	<scottwood@freescale.com>, <agraf@suse.de>,
	<bhamciu1@freescale.com>, <R89243@freescale.com>,
	<bhupesh.sharma@freescale.com>, <nir.erez@freescale.com>,
	<richard.schmitt@freescale.com>,
	"J. German Rivera" <German.Rivera@freescale.com>
Subject: [PATCH 2/6] staging: fsl-mc: Removed reordering of MC objects during bus scan
Date: Fri, 27 Mar 2015 16:01:05 -0500	[thread overview]
Message-ID: <1427490069-3142-3-git-send-email-German.Rivera@freescale.com> (raw)
In-Reply-To: <1427490069-3142-1-git-send-email-German.Rivera@freescale.com>

MC objects discovered during an MC bus scan were being reordered
to ensure that all allocatable objects are probed before all
non-allocatable objects. However, this is not necessary, as
drivers of non-allocatable objects, that allocate allocatable
objects in their probe function, can return -EPROBE_DEFER
if such allocations fail.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
---
 drivers/staging/fsl-mc/bus/dprc-driver.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
index 65de1d75..f02e5e4 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -205,36 +205,6 @@ static void dprc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
 		dprc_cleanup_resource_pool(mc_bus_dev, pool_type);
 }
 
-static void reorder_obj_desc_array(struct dprc_obj_desc *obj_desc_array,
-				   int num_devs)
-{
-	struct dprc_obj_desc tmp;
-	struct dprc_obj_desc *top_cursor = &obj_desc_array[0];
-	struct dprc_obj_desc *bottom_cursor = &obj_desc_array[num_devs - 1];
-
-	/*
-	 * Reorder entries in obj_desc_array so that all allocatable devices
-	 * are placed before all non-allocatable devices:
-	 *
-	 * Loop Invariant: everything before top_cursor is allocatable and
-	 * everything after bottom_cursor is non-allocatable.
-	 */
-	while (top_cursor < bottom_cursor) {
-		if (FSL_MC_IS_ALLOCATABLE(top_cursor->type)) {
-			top_cursor++;
-		} else {
-			if (FSL_MC_IS_ALLOCATABLE(bottom_cursor->type)) {
-				tmp = *bottom_cursor;
-				*bottom_cursor = *top_cursor;
-				*top_cursor = tmp;
-				top_cursor++;
-			}
-
-			bottom_cursor--;
-		}
-	}
-}
-
 /**
  * dprc_scan_objects - Discover objects in a DPRC
  *
@@ -313,8 +283,6 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev)
 				"%d out of %d devices could not be retrieved\n",
 				dprc_get_obj_failures, num_child_objects);
 		}
-
-		reorder_obj_desc_array(child_obj_desc_array, num_child_objects);
 	}
 
 	dprc_remove_devices(mc_bus_dev, child_obj_desc_array,
-- 
2.3.3


  parent reply	other threads:[~2015-03-27 21:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 21:01 [PATCH 0/6] staging: fsl-mc: cleanup and minor corrections J. German Rivera
2015-03-27 21:01 ` [PATCH 1/6] staging: fsl-mc: Name MC object devices using decimal numbers J. German Rivera
2015-03-27 21:01 ` J. German Rivera [this message]
2015-03-27 21:01 ` [PATCH 3/6] staging: fsl-mc: Bind/unbind driver when MC object is plugged/unplugged J. German Rivera
2015-03-27 21:01 ` [PATCH 4/6] staging: fsl-mc: Fix crash in fsl_mc_device_remove() J. German Rivera
2015-03-27 21:01 ` [PATCH 5/6] staging: fsl-mc: Refactored fsl_mc_object_allocator driver init/exit J. German Rivera
2015-03-27 21:01 ` [PATCH 6/6] staging: fsl-mc: Changed version matching rules for MC object drivers J. German Rivera
2015-04-08 23:11   ` Alexander Graf
2015-04-08 23:11 ` [PATCH 0/6] staging: fsl-mc: cleanup and minor corrections Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427490069-3142-3-git-send-email-German.Rivera@freescale.com \
    --to=german.rivera@freescale.com \
    --cc=Kim.Phillips@freescale.com \
    --cc=R89243@freescale.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=bhamciu1@freescale.com \
    --cc=bhupesh.sharma@freescale.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nir.erez@freescale.com \
    --cc=richard.schmitt@freescale.com \
    --cc=scottwood@freescale.com \
    --cc=stuart.yoder@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®