Skip to contentSkip to conversation

sparc64: Don't use devspec to determine the OBP path

PATCH In review Eric Snowberg 2 participants 3 messages May 18, 2017 – May 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: Don't use devspec to determine the OBP path

Don't use devspec to determine the OBP path on SPARC hardware. Within all versions of Linux on SPARC, the devspec returns one of three values:
"none", "vnet-port", or "vdisk". Unlike on PPC, none of these values are useful in determining the OBP path.

Before this patch grub-ofpathname always returned the wrong value for a virtual disk. For example:

% grub-ofpathname /dev/vdiskc2
vdisk/disk@2:b

After this patch it now returns the correct value:

% grub-ofpathname /dev/vdiskc2
/virtual-devices@100/channel-devices@200/disk@2:b

Orabug: 24459765

---
 grub-core/osdep/linux/ofpath.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
grub-core/osdep/linux/ofpath.c +2 -0
index a79682a..3a8bc95 100644
@@ -120,6 +120,7 @@ find_obppath (const char *sysfs_path_orig)
 #endif
 
       fd = open(path, O_RDONLY);
+#ifndef __sparc__
       if (fd < 0 || fstat (fd, &st) < 0)
 	{
 	  if (fd >= 0)
@@ -128,6 +129,7 @@ find_obppath (const char *sysfs_path_orig)
 	  fd = open(path, O_RDONLY);
 	}
 
+#endif
       if (fd < 0 || fstat (fd, &st) < 0)
 	{
 	  if (fd >= 0)
Signature · 1 line
1.7.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Snowberg

Don't use devspec to determine the OBP path on SPARC hardware. Within all versions of Linux on SPARC, the devspec returns one of three values:
"none", "vnet-port", or "vdisk". Unlike on PPC, none of these values are useful in determining the OBP path.

Before this patch grub-ofpathname always returned the wrong value for a virtual disk. For example:

% grub-ofpathname /dev/vdiskc2
vdisk/disk@2:b

Quoted 8 lines

After this patch it now returns the correct value:

% grub-ofpathname /dev/vdiskc2
/virtual-devices@100/channel-devices@200/disk@2:b

Orabug: 24459765

Daniel

#2 lore raw
Quoted 14 lines · Daniel Kiper
Quoted 13 lines · Eric Snowberg

Don't use devspec to determine the OBP path on SPARC hardware. Within all versions of Linux on SPARC, the devspec returns one of three values:
"none", "vnet-port", or "vdisk". Unlike on PPC, none of these values are useful in determining the OBP path.

Before this patch grub-ofpathname always returned the wrong value for a virtual disk. For example:

% grub-ofpathname /dev/vdiskc2
vdisk/disk@2:b

After this patch it now returns the correct value:

Quoted 8 lines
Quoted 6 lines

% grub-ofpathname /dev/vdiskc2
/virtual-devices@100/channel-devices@200/disk@2:b

Orabug: 24459765

Pushed!

Daniel