Skip to contentSkip to conversation

rapidio-update-enumerator-registration-mechanism.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 8, 2013 Rapidio

lore
Share & tools
lore
#0 lore raw

Subject: [merged] rapidio-update-enumerator-registration-mechanism.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 08 Jul 2013 12:36:39 -0700

The patch titled
Subject: rapidio: update enumerator registration mechanism
has been removed from the -mm tree. Its filename was
rapidio-update-enumerator-registration-mechanism.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Alexandre Bounine <[email protected]>
Subject: rapidio: update enumerator registration mechanism

Update enumeration/discovery method registration mechanism to allow loading enumeration/discovery methods before all mports are registered.

Existing statically linked RapidIO subsystem expects that all available RapidIO mport devices are initialized and registered before the enumeration/discovery method is registered. Switching to loadable mport device drivers creates situation when mport device driver can be loaded after enumeration/discovery method is attached (e.g., loadable mport driver in a system with statically linked RapidIO core and enumerator). This also will happen in a system with hot-pluggable RapidIO controllers.

To remove the dependency on the initialization/registration order this patch introduces enumeration/discovery registration mechanism that supports arbitrary registration order of mports and enumerator/discovery methods.

The following registration rules are implemented:
- only one enumeration/discovery method can be registered for given mport ID (including RIO_MPORT_ANY);
- when new enumeration/discovery methods tries to attach to the registered mport device, method with matching mport ID will replace a default method previously registered for given mport (if any);
- enumeration/discovery method with target ID=RIO_MPORT_ANY will be attached only to mports that do not have another enumerator attached to them;
- when new mport device is registered with RapidIO subsystem, registration routine searches for the enumeration/discovery method with the best matching mport ID;

Cc Matt Porter <[email protected]>
Cc Li Yang <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Andre van Herk <[email protected]>
Cc Micha Nelissen <[email protected]>
Cc Stef van Os <[email protected]>
Cc Jean Delvare <[email protected]>

---

 drivers/rapidio/rio-scan.c  |    1 
 drivers/rapidio/rio-sysfs.c |   17 ---
 drivers/rapidio/rio.c       |  176 ++++++++++++++++++++++++++++------
 drivers/rapidio/rio.h       |    3 
 include/linux/rio.h         |   15 ++
 5 files changed, 164 insertions(+), 48 deletions(-)
drivers/rapidio/rio-scan.c renamed from drivers/rapidio/rio-scan.c~rapidio-update-enumerator-registration-mechanism +1 -0
diff -puN drivers/rapidio/rio-scan.c~rapidio-update-enumerator-registration-mechanism drivers/rapidio/rio-scan.c
@@ -1162,6 +1162,7 @@ bail:
 }
 
 static struct rio_scan rio_scan_ops = {
+	.owner = THIS_MODULE,
 	.enumerate = rio_enum_mport,
 	.discover = rio_disc_mport,
 };
drivers/rapidio/rio-sysfs.c renamed from drivers/rapidio/rio-sysfs.c~rapidio-update-enumerator-registration-mechanism +1 -16
diff -puN drivers/rapidio/rio-sysfs.c~rapidio-update-enumerator-registration-mechanism drivers/rapidio/rio-sysfs.c
@@ -286,7 +286,6 @@ static ssize_t bus_scan_store(struct bus
 				size_t count)
 {
 	long val;
-	struct rio_mport *port = NULL;
 	int rc;
 
 	if (kstrtol(buf, 0, &val) < 0)
@@ -300,21 +299,7 @@ static ssize_t bus_scan_store(struct bus
 	if (val < 0 || val >= RIO_MAX_MPORTS)
 		return -EINVAL;
 
-	port = rio_find_mport((int)val);
-
-	if (!port) {
-		pr_debug("RIO: %s: mport_%d not available\n",
-			 __func__, (int)val);
-		return -EINVAL;
-	}
-
-	if (!port->nscan)
-		return -EINVAL;
-
-	if (port->host_deviceid >= 0)
-		rc = port->nscan->enumerate(port, 0);
-	else
-		rc = port->nscan->discover(port, RIO_SCAN_ENUM_NO_WAIT);
+	rc = rio_mport_scan((int)val);
 exit:
 	if (!rc)
 		rc = count;
drivers/rapidio/rio.c renamed from drivers/rapidio/rio.c~rapidio-update-enumerator-registration-mechanism +145 -31

261 lines not on this page · raw message

drivers/rapidio/rio.h renamed from drivers/rapidio/rio.h~rapidio-update-enumerator-registration-mechanism +2 -1
diff -puN drivers/rapidio/rio.h~rapidio-update-enumerator-registration-mechanism drivers/rapidio/rio.h
@@ -42,9 +42,10 @@ extern int rio_add_device(struct rio_dev
 extern int rio_enable_rx_tx_port(struct rio_mport *port, int local, u16 destid,
 				 u8 hopcount, u8 port_num);
 extern int rio_register_scan(int mport_id, struct rio_scan *scan_ops);
-extern int rio_unregister_scan(int mport_id);
+extern int rio_unregister_scan(int mport_id, struct rio_scan *scan_ops);
 extern void rio_attach_device(struct rio_dev *rdev);
 extern struct rio_mport *rio_find_mport(int mport_id);
+extern int rio_mport_scan(int mport_id);
 
 /* Structures internal to the RIO core code */
 extern struct device_attribute rio_dev_attrs[];
include/linux/rio.h renamed from include/linux/rio.h~rapidio-update-enumerator-registration-mechanism +15 -0
diff -puN include/linux/rio.h~rapidio-update-enumerator-registration-mechanism include/linux/rio.h
@@ -465,14 +465,29 @@ static inline struct rio_mport *dma_to_m
 
 /**
  * struct rio_scan - RIO enumeration and discovery operations
+ * @owner: The module owner of this structure
  * @enumerate: Callback to perform RapidIO fabric enumeration.
  * @discover: Callback to perform RapidIO fabric discovery.
  */
 struct rio_scan {
+	struct module *owner;
 	int (*enumerate)(struct rio_mport *mport, u32 flags);
 	int (*discover)(struct rio_mport *mport, u32 flags);
 };
 
+/**
+ * struct rio_scan_node - list node to register RapidIO enumeration and
+ * discovery methods with RapidIO core.
+ * @mport_id: ID of an mport (net) serviced by this enumerator
+ * @node: node in global list of registered enumerators
+ * @ops: RIO enumeration and discovery operations
+ */
+struct rio_scan_node {
+	int mport_id;
+	struct list_head node;
+	struct rio_scan *ops;
+};
+
 /* Architecture and hardware-specific functions */
 extern int rio_register_mport(struct rio_mport *);
 extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);

_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch