From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Subject: Re: [PATCH] sparc64: fix OF path names for sun4v systems
Date: Wed, 17 Feb 2016 06:24:27 +0300 [thread overview]
Message-ID: <56C3E7EB.7080606@gmail.com> (raw)
In-Reply-To: <A929A9FD-A74B-4EE8-B1E4-FE4050FAC19B@oracle.com>
17.02.2016 05:02, Eric Snowberg пишет:
>
>> On Feb 16, 2016, at 1:16 AM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
>> On Mon, Feb 15, 2016 at 10:11 PM, Eric Snowberg
>> <eric.snowberg@oracle.com> 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.
>>>
>>> Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
>>> ---
>>> grub-core/osdep/linux/ofpath.c | 192 +++++++++++++++++++++++++++++++++++++++-
>>> 1 files changed, 190 insertions(+), 2 deletions(-)
>>>
>>> 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 = 0, device_id = 0;
>>> + check_hba_identifiers(sysfs_path, &vendor, &device_id);
>>> +
>>> + if (vendor == 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 */
>>
>> 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?
>>
>
> 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’t scale that well, but new HBAs for SPARC with OF support don't come out that often.
>
> Before this patch, there isn’t 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’t 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’t a standard. This code only gets run during setup/install (not boot) to return the path for OBP to use.
>
> 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:
>
> /pci@308/pci@1/usb@0/hub@1/storage@1/disk@0
>
> So the function that runs during boot: check_string_removable does not identify the cdrom properly.
>
> I’m 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.
>
I mean to read device aliases created by OBP (those displayed by
devalias OBP command).
disk0 /pci@308/pci@1/usb@0/hub@1/storage@1/disk@0
...
next prev parent reply other threads:[~2016-02-17 3:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 19:11 [PATCH] sparc64: fix OF path names for sun4v systems Eric Snowberg
2016-02-16 8:16 ` Andrei Borzenkov
2016-02-17 2:02 ` Eric Snowberg
2016-02-17 3:24 ` Andrei Borzenkov [this message]
2016-02-17 6:21 ` Andrei Borzenkov
2016-02-17 18:05 ` Eric Snowberg
2016-02-17 6:45 ` Seth Goldberg
2016-02-17 9:50 ` Toomas Soome
2016-02-17 18:11 ` Eric Snowberg
-- strict thread matches above, loose matches on Subject: below --
2017-12-06 23:53 Eric Snowberg
2017-12-18 15:22 ` Daniel Kiper
2017-12-18 21:30 ` Eric Snowberg
2017-12-18 22:58 ` John Paul Adrian Glaubitz
2017-12-19 21:36 ` Daniel Kiper
2018-01-29 12:20 ` John Paul Adrian Glaubitz
2017-12-19 20:56 ` Daniel Kiper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C3E7EB.7080606@gmail.com \
--to=arvidjaar@gmail.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.