Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ejTuo-0007V7-E4 for mharc-grub-devel@gnu.org; Wed, 07 Feb 2018 12:53:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejTuk-0007ST-6m for grub-devel@gnu.org; Wed, 07 Feb 2018 12:53:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejTug-0003yc-6a for grub-devel@gnu.org; Wed, 07 Feb 2018 12:53:45 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:35716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ejTuf-0003xy-Ut for grub-devel@gnu.org; Wed, 07 Feb 2018 12:53:42 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w17HqVY4143905; Wed, 7 Feb 2018 17:53:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2017-10-26; bh=P1OqBWizRAkq4y4JWuzDuXiWPVAIRG0DMNRDdrQj5ps=; b=ufiSfYsuS4uFnftFDG51Op4xAe0tZBqFaj4TSVC9E68629rzvhEIY1froN+lgzeTrU1g 5YImpwR1iKfPNt+EGwhdNVXFrkJGsdKavqwopfFQpNZ4dtFnYJbAMydG+f2B4bSs8KdF Rkqr1FE3Dcz/hG98ppESb68TJE9y9fI5fauUVONfNI48DvzSh96BCL1FR4kRi34nrt7R WXghIT46tujDYX2Tw2E+gh34C/3Lapyyf+pBR/uaqj8Hx+r0s9w+pJTv7Tx/IknbrpBW h9yfGrmXI8mQL9C8Ftg7O+tMAO8A8r80vbT75wIZO/aBlpBRXtDhxx5ncJ3UuKpG+7De iA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2g064a03jb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Feb 2018 17:53:39 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w17Hd37r014135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Feb 2018 17:39:04 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w17Hd240029142; Wed, 7 Feb 2018 17:39:03 GMT Received: from [10.39.199.80] (/10.39.199.80) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 07 Feb 2018 09:39:02 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH V2] sparc64: fix OF path names for sun4v systems From: Eric Snowberg In-Reply-To: <20180207115313.GB31868@olila.local.net-space.pl> Date: Wed, 7 Feb 2018 10:39:00 -0700 Cc: John Paul Adrian Glaubitz , Daniel Kiper Content-Transfer-Encoding: quoted-printable Message-Id: <8E3B6E60-0D25-45AB-8CDC-0EB149FCB95D@oracle.com> References: <1517374188-175569-1-git-send-email-eric.snowberg@oracle.com> <20180207115313.GB31868@olila.local.net-space.pl> To: The development of GNU GRUB X-Mailer: Apple Mail (2.3273) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8798 signatures=668663 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802070226 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 17:53:47 -0000 > On Feb 7, 2018, at 4:53 AM, Daniel Kiper = wrote: >=20 > On Tue, Jan 30, 2018 at 08:49:48PM -0800, Eric Snowberg wrote: >> Fix the Open Firmware (OF) 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 >=20 > In general Reviewed-by: Daniel Kiper ... >=20 > Just a few comments below... >=20 >> --- >> V2: >> - Requested coding style changes >> --- >> grub-core/osdep/linux/ofpath.c | 148 = +++++++++++++++++++++++++++++++++++++++- >> 1 files changed, 145 insertions(+), 3 deletions(-) >>=20 >> diff --git a/grub-core/osdep/linux/ofpath.c = b/grub-core/osdep/linux/ofpath.c >> index dce4e59..5369508 100644 >> --- a/grub-core/osdep/linux/ofpath.c >> +++ b/grub-core/osdep/linux/ofpath.c >> @@ -38,6 +38,46 @@ >> #include >> #include >>=20 >> +#ifdef __sparc__ >=20 > I have discussed this with Vladimir. It looks that this will not > work if you try to cross-install SPARC GRUB2 binary using e.g. > x86 grub-install. By default it should work. However, we will also > have other issues here, like lack of access to OF firmware/paths, > which make such configs unusable anyway. So, I would leave this patch > as is for time being. If somebody cares then he/she should fix it. >=20 > Anyway, I will add something like that into the commit message before = committing. That is fine with me. >=20 >> +typedef enum >> + { >> + GRUB_OFPATH_SPARC_WWN_ADDR =3D 1, >> + GRUB_OFPATH_SPARC_TGT_LUN, >> + } ofpath_sparc_addressing; >> + >> +struct ofpath_sparc_hba >> +{ >> + grub_uint32_t device_id; >> + ofpath_sparc_addressing addressing; >> +}; >> + >> +static struct ofpath_sparc_hba sparc_lsi_hba[] =3D { >> + /* Rhea, Jasper 320, LSI53C1020/1030. */ >> + {0x30, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* SAS-1068E. */ >> + {0x50, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* SAS-1064E. */ >> + {0x56, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* Pandora SAS-1068E. */ >> + {0x58, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* Aspen, Invader, LSI SAS-3108. */ >> + {0x5d, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* Niwot, SAS 2108. */ >> + {0x79, GRUB_OFPATH_SPARC_TGT_LUN}, >> + /* Erie, Falcon, LSI SAS 2008. */ >> + {0x72, GRUB_OFPATH_SPARC_WWN_ADDR}, >> + /* LSI WarpDrive 6203. */ >> + {0x7e, GRUB_OFPATH_SPARC_WWN_ADDR}, >> + /* LSI SAS 2308. */ >> + {0x87, GRUB_OFPATH_SPARC_WWN_ADDR}, >> + /* LSI SAS 3008. */ >> + {0x97, GRUB_OFPATH_SPARC_WWN_ADDR}, >> + {0, 0} >> +}; >> + >> +static const int LSI_VENDOR_ID =3D 0x1000; >> +#endif >> + >> #ifdef OFPATH_STANDALONE >> #define xmalloc malloc >> void >> @@ -338,6 +378,67 @@ vendor_is_ATA(const char *path) >> return (memcmp(bufcont, "ATA", 3) =3D=3D 0); >> } >>=20 >> +#ifdef __sparc__ >> +static void >> +check_hba_identifiers (const char *sysfs_path, int *vendor, int = *device_id) >> +{ >> + char *ed =3D strstr (sysfs_path, "host"); >> + size_t path_size; >> + char *p, *path; >> + char buf[8]; >> + int fd; >> + >> + if (!ed) >> + return; >> + >> + p =3D xstrdup (sysfs_path); >> + ed =3D strstr (p, "host"); >> + >> + if (!ed) >> + goto out; >=20 > In normal circumstances this will never ever fail. > If you are OK I will drop this "if" before committing. I put that in for the case if the xstrdup above can not allocate memory. = Then p will be null, the strstr will fail and then we should jump to = out. >=20 > If there are no objections I will commit this patch in a week or so. Thanks=E2=80=A6 Is there some reason this patch is being held up too? http://lists.gnu.org/archive/html/grub-devel/2017-05/msg00045.html This is where things last left off: http://lists.gnu.org/archive/html/grub-devel/2017-10/msg00046.html We really need minimal GPT support in there for many of the follow on = patches in my queue.