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


Groups > linux.kernel > #1652423

Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info()

From John Garry <john.garry@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info()
Date 2017-05-29 13:20 +0200
Message-ID <tMqSl-7ws-3@gated-at.bofh.it> (permalink)
References <tKZhv-7An-3@gated-at.bofh.it> <tKZhy-7An-71@gated-at.bofh.it> <tMqyZ-77t-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


  is
On 29/05/2017 11:53, Arnd Bergmann wrote:
> On Thu, May 25, 2017 at 2:04 PM, John Garry <john.garry@huawei.com> wrote:
>> Move the functionality to retrieve the fw info into
>> a dedicated device type-agnostic function,
>> hisi_sas_get_fw_info().
>>
>> The reasoning is that this function will be required
>> for future pci-based platforms.
>>
>
>> -
>>         if (device_property_read_u8_array(dev, "sas-addr", hisi_hba->sas_addr,
>> -                                         SAS_ADDR_SIZE))
>> -               goto err_out;
>> +                                         SAS_ADDR_SIZE)) {
>> +               dev_err(dev, "could not get property sas-addr\n");
>> +               return -ENOENT;
>> +       }
>>
>>         if (np) {
>>                 hisi_hba->ctrl = syscon_regmap_lookup_by_phandle(np,
>>                                         "hisilicon,sas-syscon");
>> -               if (IS_ERR(hisi_hba->ctrl))
>> -                       goto err_out;
>> +               if (IS_ERR(hisi_hba->ctrl)) {
>> +                       dev_err(dev, "could not get syscon\n");
>> +                       return -ENOENT;
>> +               }
>
> If I read this right, it will fail to work for a PCI-based driver trying to read
> "sas-addr" but not the other properties that would now be hardcoded from
> the PCI ID.
>
> Maybe you just need

Hi Arnd,

So we only require these properties for platform device with DT 
firmware. This code is same as before (apart from adding the comments), 
but I'll consider adding a verbose comment.

As for the check, effectively I already have what you recommend in how 
np is evaluated:
+	struct platform_device *pdev = hisi_hba->platform_dev;
+	struct device_node *np = pdev ? pdev->dev.of_node : NULL;
  	struct clk *refclk;

Much appreciated,
John



>
> -          if (np) {
> +         if (np && is_platform_device) {
>
>        Arnd
>
> .
>

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


Thread

[PATCH v2 00/22] hisi_sas: hip08 support John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info() John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
    Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info() Arnd Bergmann <arnd@arndb.de> - 2017-05-29 13:00 +0200
      Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info() John Garry <john.garry@huawei.com> - 2017-05-29 13:20 +0200
        Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info() Arnd Bergmann <arnd@arndb.de> - 2017-05-29 13:30 +0200
  [PATCH v2 22/22] scsi: hisi_sas: modify internal abort dev flow for v3 hw John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 01/22] scsi: hisi_sas: fix timeout check in hisi_sas_internal_task_abort() John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 20/22] scsi: hisi_sas: Add v3 code to support ECC and AXI bus fatal error John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 13/22] scsi: hisi_sas: add v3 cq interrupt handler John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 14/22] scsi: hisi_sas: add v3 code to send SSP frame John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 19/22] scsi: hisi_sas: add get_wideport_bitmap_v3_hw() John Garry <john.garry@huawei.com> - 2017-05-25 13:40 +0200
  [PATCH v2 05/22] scsi: hisi_sas: relocate get_ncq_tag_v2_hw() John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 09/22] scsi: hisi_sas: add initialisation for v3 pci-based controller John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 12/22] scsi: hisi_sas: add phy up/down/bcast and channel ISR John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 08/22] scsi: hisi_sas: add skeleton v3 hw driver John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 06/22] scsi: hisi_sas: add pci_dev in hisi_hba struct John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 10/22] scsi: hisi_sas: add v3 hw init John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 11/22] scsi: hisi_sas: add v3 hw PHY init John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
  [PATCH v2 02/22] scsi: hisi_sas: optimise the usage of hisi_hba.lock John Garry <john.garry@huawei.com> - 2017-05-25 13:50 +0200
    Re: [PATCH v2 02/22] scsi: hisi_sas: optimise the usage of hisi_hba.lock Arnd Bergmann <arnd@arndb.de> - 2017-05-26 11:00 +0200

csiph-web