Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643364

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

From John Garry <john.garry@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller
Date 2017-05-17 15:40 +0200
Message-ID <tI7lf-3Em-11@gated-at.bofh.it> (permalink)
References <tI4dH-1LO-3@gated-at.bofh.it> <tI4no-1Pa-35@gated-at.bofh.it> <tI6pc-35o-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 17/05/2017 13:37, Arnd Bergmann wrote:
> On Wed, May 17, 2017 at 12:49 PM, John Garry <john.garry@huawei.com> wrote:
>> > For a pci-based controller, retrieve the SAS address from the
>> > ACPI tables.
>> >
>> > The retrieval is based on the ACPI device node name. Sample is
>> > as follows:
>> > Scope(_SB)
>> > {
>> >     Device(SAS0) {
>> >                 Name(_HID, "HISI0163")
>> >                 Name (_DSD, Package () {
>> >               ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>> >               Package () {
>> >                                 Package (2) {"sas-addr", Package() {0x50, 0x01, 0x88, 0x20, 0x16, 00, 00, 0x00}},
>> >               }
>> >           })
>> >         }
>> > }
>> >
>> > If the ACPI node or node property is not available, then we fall
>> > back on a default address.
>> >
>> > Signed-off-by: John Garry <john.garry@huawei.com>
> Since this uses the _DSD information that was introduced for compatibility
> between device tree and ACPI based data, why not write the code so that
> it can work for both?
>
> Ideally this should just look up the property for pci_dev->fwnode, but I'm
> not entirely sure if this works the same way on ACPI and DT today.
>

Hi Arnd,

There is no relation at all between the pci device and the ACPI DSDT, 
apart from the fact that the device node name is known by the driver, 
that being "SAS0". I am not 100% comfortable with this, as we are 
introducing some sort of device indexing in the driver.

Please note that Cavium did something similar on their thunderx network 
driver:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/cavium/thunder/thunder_bgx.c?h=v4.12-rc1#n1162

As for your suggestion, in theory it could be ok to have a 
pci_dev->fwnode, and this would work for Unified Device Properties 
Interface (if that is indeed what you mean). But how to create/match 
this fwnode?

Thanks,
John

>          Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller John Garry <john.garry@huawei.com> - 2017-05-17 12:30 +0200
  Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller Arnd Bergmann <arnd@arndb.de> - 2017-05-17 14:40 +0200
    Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based  controller John Garry <john.garry@huawei.com> - 2017-05-17 15:40 +0200
      Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller Arnd Bergmann <arnd@arndb.de> - 2017-05-17 16:20 +0200
        Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based  controller John Garry <john.garry@huawei.com> - 2017-05-17 19:10 +0200
          Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller Arnd Bergmann <arnd@arndb.de> - 2017-05-17 21:30 +0200
            Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based  controller John Garry <john.garry@huawei.com> - 2017-05-18 11:10 +0200

csiph-web