All of lore.kernel.org
 help / color / mirror / Atom feed
* Enable module aliases for vio on sparc/sparc64
@ 2016-04-11  7:30 John Paul Adrian Glaubitz
  2016-04-11 19:04 ` David Miller
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: John Paul Adrian Glaubitz @ 2016-04-11  7:30 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hi Dave!

We have had issues when installing Debian's sparc64 port on SPARC
machines with virtualization support. In order to be able to install
Linux into an LDOM container, both the modules sunvdc and sunvnet
need to be loaded to enable block device and networking support
within the virtual machine.

Unfortunately, these modules are never loaded automatically despite
being present and the hardware supporting it. After some discussion
in Debian's bug tracker [1], Ben Hutchings, Debian's kernel maintainer,
mentioned that this is a result of the VIO bus implementation on
sparc/sparc64 not supporting module aliases and consequently automatic
loading.

Ben has provided a minimal and dirty patch which enables aliases
for vio on sparc/sparc64, but he says the better solution would
be to merge VIO implementations on both sparc/sparc64 and PowerPC,
the latter already supporting module aliases and auto loading.

A quick hotfix as Ben suggested would be great for the time being
as it would unbreak the Debian installation within LDOMs, so
I was wondering whether you could merge the patch?

Any other suggestion?

Thanks,
Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815977#40

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

[-- Attachment #2: sparc-vio-add-modalias-attribute-to-support-auto-loading-drivers.patch --]
[-- Type: text/x-patch, Size: 1141 bytes --]

From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 11 Apr 2016 00:30:34 +0100
Subject: sparc: vio: Add modalias attribute to support auto-loading drivers
Bug-Debian: https://bugs.debian.org/815977

Add a modalias attribute for vio devices, matching the syntax
supported by file2alias and the PowerPC vio implementation.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -105,9 +105,31 @@ static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+			     char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+	struct device_node *dn;
+	const char *cp;
+
+	dn = dev->of_node;
+	if (!dn) {
+		strcpy(buf, "\n");
+		return strlen(buf);
+	}
+	cp = of_get_property(dn, "compatible", NULL);
+	if (!cp) {
+		strcpy(buf, "\n");
+		return strlen(buf);
+	}
+
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, cp);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(devspec),
 	__ATTR_RO(type),
+	__ATTR_RO(modalias),
 	__ATTR_NULL
 };
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-04-14 16:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11  7:30 Enable module aliases for vio on sparc/sparc64 John Paul Adrian Glaubitz
2016-04-11 19:04 ` David Miller
2016-04-12  9:29 ` John Paul Adrian Glaubitz
2016-04-13 15:33 ` John Paul Adrian Glaubitz
2016-04-13 22:23 ` David Miller
2016-04-13 22:35 ` John Paul Adrian Glaubitz
2016-04-13 22:36 ` David Miller
2016-04-13 22:37 ` David Miller
2016-04-13 22:44 ` John Paul Adrian Glaubitz
2016-04-13 23:01 ` David Miller
2016-04-13 23:04 ` John Paul Adrian Glaubitz
2016-04-13 23:22 ` John Paul Adrian Glaubitz
2016-04-14  1:52 ` David Miller
2016-04-14  1:52 ` David Miller
2016-04-14  1:53 ` David Miller
2016-04-14  9:00 ` John Paul Adrian Glaubitz
2016-04-14  9:10 ` John Paul Adrian Glaubitz
2016-04-14 10:27 ` Sam Ravnborg
2016-04-14 10:52 ` John Paul Adrian Glaubitz
2016-04-14 13:30 ` Sam Ravnborg
2016-04-14 16:00 ` John Paul Adrian Glaubitz
2016-04-14 16:02 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.