Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1244995 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2015-10-12 20:50 +0200 |
| Last post | 2015-10-13 14:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 12/25] scsi: hisi_sas: add v1 HW initialisation code Arnd Bergmann <arnd@arndb.de> - 2015-10-12 20:50 +0200
Re: [PATCH 12/25] scsi: hisi_sas: add v1 HW initialisation code Arnd Bergmann <arnd@arndb.de> - 2015-10-13 14:50 +0200
Re: [PATCH 12/25] scsi: hisi_sas: add v1 HW initialisation code John Garry <john.garry@huawei.com> - 2015-10-13 14:50 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-10-12 20:50 +0200 |
| Subject | Re: [PATCH 12/25] scsi: hisi_sas: add v1 HW initialisation code |
| Message-ID | <qiQkx-7rT-9@gated-at.bofh.it> |
On Monday 12 October 2015 23:20:24 John Garry wrote: > @@ -387,6 +392,21 @@ static int hisi_sas_probe(struct platform_device *pdev) > } > > hisi_sas_init_add(hisi_hba); > + > + rc = hw_init_v1_hw(hisi_hba); > + if (rc) > + goto err_out_ha; > + > + rc = interrupt_init_v1_hw(hisi_hba); > + if (rc) > + goto err_out_ha; > + > + rc = interrupt_openall_v1_hw(hisi_hba); > + if (rc) > + goto err_out_ha; > + > + phys_init_v1_hw(hisi_hba); > + > rc = scsi_add_host(shost, &pdev->dev); > if (rc) > goto err_out_ha; > As the probe function matches against the "hisilicon,sas-controller-v1" compatible string and contains mostly code that is specific to v1, I think it would be cleaner to move that to the hisi_sas_v1_hw.c as well and make the functions above static but make the common functions called here (hisi_sas_init_add etc) global. That would also include the hisi_sas_driver structure. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-10-13 14:50 +0200 |
| Message-ID | <qj7bI-6QI-7@gated-at.bofh.it> |
| In reply to | #1244995 |
On Tuesday 13 October 2015 13:44:26 John Garry wrote: > Hello, > > Just to be clear, are you saying that you would prefer hisi_sas_probe() > and struct hisi_sas_driver to be relocated to hisi_sas_v1_hw.c? Correct. > I wanted to keep hisi_sas_v1_hw.c containing only code which accesses HW. > > I could consoldate the calls of hw_init_v1_hw(), interrupt_init_v1_hw(), > interrupt_openall_v1_hw(), and phys_init_v1_hw() to a single function hw > init function call. Then most of the code in the probe function will not > be specific to v1. This is more about correct layering of the code. Generally we want the more specific modules on top to call into the more general code in the bottom of the stack. Shared code should know as little as possible about the specific implementations it is shared with. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | John Garry <john.garry@huawei.com> |
|---|---|
| Date | 2015-10-13 14:50 +0200 |
| Message-ID | <qj7bI-6QI-9@gated-at.bofh.it> |
| In reply to | #1244995 |
On 12/10/2015 19:46, Arnd Bergmann wrote: > On Monday 12 October 2015 23:20:24 John Garry wrote: >> @@ -387,6 +392,21 @@ static int hisi_sas_probe(struct platform_device *pdev) >> } >> >> hisi_sas_init_add(hisi_hba); >> + >> + rc = hw_init_v1_hw(hisi_hba); >> + if (rc) >> + goto err_out_ha; >> + >> + rc = interrupt_init_v1_hw(hisi_hba); >> + if (rc) >> + goto err_out_ha; >> + >> + rc = interrupt_openall_v1_hw(hisi_hba); >> + if (rc) >> + goto err_out_ha; >> + >> + phys_init_v1_hw(hisi_hba); >> + >> rc = scsi_add_host(shost, &pdev->dev); >> if (rc) >> goto err_out_ha; >> > > As the probe function matches against the "hisilicon,sas-controller-v1" > compatible string and contains mostly code that is specific to v1, I > think it would be cleaner to move that to the hisi_sas_v1_hw.c as well > and make the functions above static but make the common functions > called here (hisi_sas_init_add etc) global. > > That would also include the hisi_sas_driver structure. > > Arnd > > . > Hello, Just to be clear, are you saying that you would prefer hisi_sas_probe() and struct hisi_sas_driver to be relocated to hisi_sas_v1_hw.c? I wanted to keep hisi_sas_v1_hw.c containing only code which accesses HW. I could consoldate the calls of hw_init_v1_hw(), interrupt_init_v1_hw(), interrupt_openall_v1_hw(), and phys_init_v1_hw() to a single function hw init function call. Then most of the code in the probe function will not be specific to v1. Regards, John -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web