Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aW6Ug-0004b8-WC for mharc-grub-devel@gnu.org; Wed, 17 Feb 2016 13:06:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW6Ue-0004b0-DW for grub-devel@gnu.org; Wed, 17 Feb 2016 13:06:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW6Ub-00067b-5N for grub-devel@gnu.org; Wed, 17 Feb 2016 13:06:28 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW6Ua-00067G-SW for grub-devel@gnu.org; Wed, 17 Feb 2016 13:06:25 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1HI6MDs006795 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Feb 2016 18:06:24 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1HI6M6Z010989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 17 Feb 2016 18:06:22 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1HI6IPv007754 for ; Wed, 17 Feb 2016 18:06:22 GMT Received: from xterra.us.oracle.com (/10.135.62.107) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Feb 2016 10:06:17 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [PATCH] sparc64: fix OF path names for sun4v systems From: Eric Snowberg In-Reply-To: Date: Wed, 17 Feb 2016 11:11:11 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1455563481-87543-1-git-send-email-eric.snowberg@oracle.com> <56C3E7EB.7080606@gmail.com> To: The development of GNU GRUB X-Mailer: Apple Mail (2.2104) X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2016 18:06:29 -0000 > On Feb 16, 2016, at 11:45 PM, Seth Goldberg = wrote: >=20 >=20 >=20 >> On Feb 16, 2016, at 7:24 PM, Andrei Borzenkov = wrote: >>=20 >> 17.02.2016 05:02, Eric Snowberg =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>=20 >>>> On Feb 16, 2016, at 1:16 AM, Andrei Borzenkov = wrote: >>>>=20 >>>> On Mon, Feb 15, 2016 at 10:11 PM, Eric Snowberg >>>> wrote: >>>>> Fix the open firmware path property for sun4v SPARC systems. These >>>>> platforms do not have a /sas/ within their path. Over time >>>>> different OF addressing schemes have been supported. There >>>>> is no generic addressing scheme that works across every HBA. >>>>>=20 >>>>> Signed-off-by: Eric Snowberg >>>>> --- >>>>> grub-core/osdep/linux/ofpath.c | 192 = +++++++++++++++++++++++++++++++++++++++- >>>>> 1 files changed, 190 insertions(+), 2 deletions(-) >>>>>=20 >>>>> diff --git a/grub-core/osdep/linux/ofpath.c = b/grub-core/osdep/linux/ofpath.c >>>>> index a79682a..de51c57 100644 >>>>> --- a/grub-core/osdep/linux/ofpath.c >>>>> +++ b/grub-core/osdep/linux/ofpath.c >>>> ... >>>>> @@ -444,6 +525,111 @@ of_path_of_scsi(const char *sys_devname = __attribute__((unused)), const char *dev >>>>> } >>>>> else >>>>> { >>>>> +#ifdef __sparc__ >>>>> + int vendor =3D 0, device_id =3D 0; >>>>> + check_hba_identifiers(sysfs_path, &vendor, &device_id); >>>>> + >>>>> + if (vendor =3D=3D 0x1000) /* LSI Logic Vendor ID */ >>>>> + { >>>>> + /* Over time different OF addressing schemes have been = supported */ >>>>> + /* There is no generic addressing scheme that works = across */ >>>>> + /* every HBA */ >>>>> + switch (device_id) >>>>> + { >>>>> + case 0x30: /* Rhea, Jasper 320, LSI53C1020/1030 */ >>>>> + case 0x50: /* SAS-1068E */ >>>>> + case 0x56: /* SAS-1064E */ >>>>> + case 0x58: /* Pandora SAS-1068E */ >>>>> + case 0x5d: /* Aspen, Invader, LSI SAS-3108 */ >>>>> + case 0x79: /* Niwot, SAS 2108 */ >>>>=20 >>>> That really does not scale. Can we enumerate device aliases and = take >>>> diskN and cdromN? So that we do not need to duplicate OBP logic? >>>=20 >>> Do you have an idea in mind on how to do this differently to make it = scale better? This patch will default to the old disk@N for unknown = HBAs. I agree it doesn=E2=80=99t scale that well, but new HBAs for = SPARC with OF support don't come out that often.=20 >>>=20 >>> Before this patch, there isn=E2=80=99t a single SAS HBA that is = enumerated correctly on SPARC. I went back 10 years and believe I have = added every HBA with OF support. This isn=E2=80=99t duplicating OBP = logic. The final part of the device path is vendor specific. OBP does = not control that part of the path, it just uses it. Unfortunately there = isn=E2=80=99t a standard. This code only gets run during setup/install = (not boot) to return the path for OBP to use. >>>=20 >>> You mentioned cdroms being enumerated with cdromN. I believe that = type of enumeration stopped with IDE drives. A USB cdrom would be = enumerated something like this: >>>=20 >>> /pci@308/pci@1/usb@0/hub@1/storage@1/disk@0 >>>=20 >>> So the function that runs during boot: check_string_removable does = not identify the cdrom properly. >>>=20 >>> I=E2=80=99m open to making any changes to this patch if you have = some ideas in mind. I tried to base it off of what was already in = ofpath.c and I have some follow on patches coming the rely on this path = being correct. >>=20 >> I mean to read device aliases created by OBP (those displayed by >> devalias OBP command). >>=20 >> disk0 /pci@308/pci@1/usb@0/hub@1/storage@1/disk@0 >=20 > Devaliases are not guaranteed to be there for all devices. It is = highly dependent on the system vendor to create them and we certainly = have systems with disk drives that have no aliases. >=20 > =E2=80=94S And we also have systems with pre-populated devaliases for disks that = don=E2=80=99t exist (that could be added in the future). This is part = of the reason why it can take 20 - 30 minutes to get to the grub menu on = some SPARC systems. On boot, grub builds a tree from the devaliases and = then tries to open and close disks that don=E2=80=99t exist. The HBA = finally times out.=20 But we are getting ahead of things here, since the patch I submitted = only starts to solve this problem. This will be fixed in later patches. >=20 >=20 >=20 >> ... >>=20 >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel