Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eoE6J-0002GI-AJ for mharc-grub-devel@gnu.org; Tue, 20 Feb 2018 15:01:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoE6H-0002G5-LN for grub-devel@gnu.org; Tue, 20 Feb 2018 15:01:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoE6D-0007eQ-Oy for grub-devel@gnu.org; Tue, 20 Feb 2018 15:01:17 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:56556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eoE6D-0007dW-GK for grub-devel@gnu.org; Tue, 20 Feb 2018 15:01:13 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1KJutO1062958; Tue, 20 Feb 2018 20:01:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=jk80dOvFfcaFHiPXCcxbHFlF1lTyWgUEhGXrvqLlM0E=; b=vCEF65DhX8GkLWfLDNzxaCuXTT7y4yCDqHciVnSNTmndyp3C86CHu76BpmXG54WYsXg/ uaD0uAFnY1EpIULWzTZ4MYBMo0a6Zuyv3nRH7+fFixtuyuWQVRnjdrO2eQB2buiz8tEG PRzK7xknB1OKePAXs2TVYVkAqU9K8bLBB43t9ut0kJUhztJ8MRwSOjbD70rZLLyxfekV CeWCFKdfWiM6qdmAMw3oC4MBmdaZb9LSttt7WEojKlNPWCpg9uKopAWH7KMZJEFX3UZB frf/qHhVpPYzXVmOp2w3Pq1eMZy5uNZ6SyVkQvZtWDiT4lNe8qB+zG4YcbDveprt7FQU 0g== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2g8pvyha3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Feb 2018 20:01:11 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1KK1Af7015444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 20 Feb 2018 20:01:11 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1KK19kF017011; Tue, 20 Feb 2018 20:01:10 GMT Received: from olila.local.net-space.pl (/10.175.194.79) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Feb 2018 12:01:09 -0800 Date: Tue, 20 Feb 2018 21:01:05 +0100 From: Daniel Kiper To: Eric Snowberg Cc: grub-devel@gnu.org, glaubitz@physik.fu-berlin.de Subject: Re: [PATCH] ieee1275: add nvme support within ofpath Message-ID: <20180220200105.GR20614@olila.local.net-space.pl> References: <1519149434-38174-1-git-send-email-eric.snowberg@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519149434-38174-1-git-send-email-eric.snowberg@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8810 signatures=668675 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-1802200240 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 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: Tue, 20 Feb 2018 20:01:18 -0000 On Tue, Feb 20, 2018 at 09:57:14AM -0800, Eric Snowberg wrote: > Add NVMe support within ofpath. > > The Open Firmware text representation for a NVMe device contains the > Namespace ID. An invalid namespace ID is one whose value is zero or whose > value is greater than the value reported by the Number of Namespaces (NN) > field in the Identify Controller data structure. At the moment only a > single Namespace is supported, therefore the value is currently hard coded > to one. > > Signed-off-by: Eric Snowberg Just one nit pick... I will change this during commit. Otherwise Reviewed-by: Daniel Kiper > --- > grub-core/osdep/linux/ofpath.c | 47 ++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 47 insertions(+), 0 deletions(-) > > diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c > index 8d7d683..af068f9 100644 > --- a/grub-core/osdep/linux/ofpath.c > +++ b/grub-core/osdep/linux/ofpath.c > @@ -350,6 +350,50 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi > return ret; > } > > +static char * > +of_path_of_nvme(const char *sys_devname __attribute__((unused)), > + const char *device, > + const char *devnode __attribute__((unused)), > + const char *devicenode) > +{ > + char *sysfs_path, *of_path, disk[MAX_DISK_CAT]; > + const char *digit_string, *part_end; > + > + digit_string = trailing_digits (device); > + part_end = devicenode + strlen (devicenode) - 1; > + > + if ((digit_string != '\0') && (*part_end == 'p')) > + { > + /* We have a partition number, strip it off. */ > + int part; > + char *nvmedev, *end; > + > + nvmedev = strdup (devicenode); > + > + if (nvmedev == NULL) "if (!nvmedev)" is the convention in this file. Daniel