* [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter
[not found] <20220909193621.17380-1-Sergey.Semin@baikalelectronics.ru>
@ 2022-09-09 19:36 ` Serge Semin
2022-09-19 21:50 ` Guenter Roeck
0 siblings, 1 reply; 4+ messages in thread
From: Serge Semin @ 2022-09-09 19:36 UTC (permalink / raw)
To: Damien Le Moal, Hans de Goede, Jens Axboe, Hannes Reinecke,
Matthias Brugger, Patrice Chotard
Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
Rob Herring, Krzysztof Kozlowski, linux-ide, linux-kernel,
devicetree, linux-arm-kernel, linux-mediatek
The ports-implemented property is mainly used on the OF-based platforms
with no ports mapping initialized by a bootloader/BIOS firmware. Seeing
the same of_property_read_u32()-based pattern has already been implemented
in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI
drivers let's move the property read procedure to the generic
ahci_platform_get_resources() method. Thus we'll have the forced ports
mapping feature supported for each OF-based platform which requires that,
and stop re-implementing the same pattern in there a bit simplifying the
code.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
drivers/ata/ahci_mtk.c | 2 --
drivers/ata/ahci_platform.c | 3 ---
drivers/ata/ahci_st.c | 3 ---
drivers/ata/libahci_platform.c | 3 +++
4 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
index 1f6c85fde983..c056378e3e72 100644
--- a/drivers/ata/ahci_mtk.c
+++ b/drivers/ata/ahci_mtk.c
@@ -118,8 +118,6 @@ static int mtk_ahci_parse_property(struct ahci_host_priv *hpriv,
SYS_CFG_SATA_EN);
}
- of_property_read_u32(np, "ports-implemented", &hpriv->force_port_map);
-
return 0;
}
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 28a8de5b48b9..9b56490ecbc3 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -56,9 +56,6 @@ static int ahci_probe(struct platform_device *pdev)
if (rc)
return rc;
- of_property_read_u32(dev->of_node,
- "ports-implemented", &hpriv->force_port_map);
-
if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
index 7526653c843b..068621099c00 100644
--- a/drivers/ata/ahci_st.c
+++ b/drivers/ata/ahci_st.c
@@ -168,9 +168,6 @@ static int st_ahci_probe(struct platform_device *pdev)
st_ahci_configure_oob(hpriv->mmio);
- of_property_read_u32(dev->of_node,
- "ports-implemented", &hpriv->force_port_map);
-
err = ahci_platform_init_host(pdev, hpriv, &st_ahci_port_info,
&ahci_platform_sht);
if (err) {
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index bacb974c1b16..085f99b2eb5a 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -485,6 +485,9 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
goto err_out;
}
+ of_property_read_u32(dev->of_node,
+ "ports-implemented", &hpriv->force_port_map);
+
if (child_nodes) {
for_each_child_of_node(dev->of_node, child) {
u32 port;
--
2.37.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter
2022-09-09 19:36 ` [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter Serge Semin
@ 2022-09-19 21:50 ` Guenter Roeck
2022-09-19 23:55 ` Damien Le Moal
0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2022-09-19 21:50 UTC (permalink / raw)
To: Serge Semin
Cc: Damien Le Moal, Hans de Goede, Jens Axboe, Hannes Reinecke,
Matthias Brugger, Patrice Chotard, Serge Semin, Alexey Malahov,
Pavel Parkhomenko, Rob Herring, Krzysztof Kozlowski, linux-ide,
linux-kernel, devicetree, linux-arm-kernel, linux-mediatek
On Fri, Sep 09, 2022 at 10:36:07PM +0300, Serge Semin wrote:
> The ports-implemented property is mainly used on the OF-based platforms
> with no ports mapping initialized by a bootloader/BIOS firmware. Seeing
> the same of_property_read_u32()-based pattern has already been implemented
> in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI
> drivers let's move the property read procedure to the generic
> ahci_platform_get_resources() method. Thus we'll have the forced ports
> mapping feature supported for each OF-based platform which requires that,
> and stop re-implementing the same pattern in there a bit simplifying the
> code.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
> drivers/ata/ahci_mtk.c | 2 --
> drivers/ata/ahci_platform.c | 3 ---
> drivers/ata/ahci_st.c | 3 ---
> drivers/ata/libahci_platform.c | 3 +++
> 4 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
> index 1f6c85fde983..c056378e3e72 100644
> --- a/drivers/ata/ahci_mtk.c
> +++ b/drivers/ata/ahci_mtk.c
> @@ -118,8 +118,6 @@ static int mtk_ahci_parse_property(struct ahci_host_priv *hpriv,
> SYS_CFG_SATA_EN);
> }
>
> - of_property_read_u32(np, "ports-implemented", &hpriv->force_port_map);
> -
> return 0;
> }
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index 28a8de5b48b9..9b56490ecbc3 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -56,9 +56,6 @@ static int ahci_probe(struct platform_device *pdev)
> if (rc)
> return rc;
>
> - of_property_read_u32(dev->of_node,
> - "ports-implemented", &hpriv->force_port_map);
> -
> if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
> hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
>
> diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
> index 7526653c843b..068621099c00 100644
> --- a/drivers/ata/ahci_st.c
> +++ b/drivers/ata/ahci_st.c
> @@ -168,9 +168,6 @@ static int st_ahci_probe(struct platform_device *pdev)
>
> st_ahci_configure_oob(hpriv->mmio);
>
> - of_property_read_u32(dev->of_node,
> - "ports-implemented", &hpriv->force_port_map);
> -
With arm:allmodconfig, this results in:
CC [M] drivers/ata/ahci_st.o
drivers/ata/ahci_st.c: In function 'st_ahci_probe':
drivers/ata/ahci_st.c:147:24: error: unused variable 'dev' [-Werror=unused-variable]
147 | struct device *dev = &pdev->dev;
Guenter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter
2022-09-19 21:50 ` Guenter Roeck
@ 2022-09-19 23:55 ` Damien Le Moal
2022-09-25 16:19 ` Serge Semin
0 siblings, 1 reply; 4+ messages in thread
From: Damien Le Moal @ 2022-09-19 23:55 UTC (permalink / raw)
To: Guenter Roeck, Serge Semin
Cc: Hans de Goede, Jens Axboe, Hannes Reinecke, Matthias Brugger,
Patrice Chotard, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
Rob Herring, Krzysztof Kozlowski, linux-ide, linux-kernel,
devicetree, linux-arm-kernel, linux-mediatek
On 9/20/22 06:50, Guenter Roeck wrote:
> On Fri, Sep 09, 2022 at 10:36:07PM +0300, Serge Semin wrote:
>> The ports-implemented property is mainly used on the OF-based platforms
>> with no ports mapping initialized by a bootloader/BIOS firmware. Seeing
>> the same of_property_read_u32()-based pattern has already been implemented
>> in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI
>> drivers let's move the property read procedure to the generic
>> ahci_platform_get_resources() method. Thus we'll have the forced ports
>> mapping feature supported for each OF-based platform which requires that,
>> and stop re-implementing the same pattern in there a bit simplifying the
>> code.
>>
>> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>> ---
>> drivers/ata/ahci_mtk.c | 2 --
>> drivers/ata/ahci_platform.c | 3 ---
>> drivers/ata/ahci_st.c | 3 ---
>> drivers/ata/libahci_platform.c | 3 +++
>> 4 files changed, 3 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
>> index 1f6c85fde983..c056378e3e72 100644
>> --- a/drivers/ata/ahci_mtk.c
>> +++ b/drivers/ata/ahci_mtk.c
>> @@ -118,8 +118,6 @@ static int mtk_ahci_parse_property(struct ahci_host_priv *hpriv,
>> SYS_CFG_SATA_EN);
>> }
>>
>> - of_property_read_u32(np, "ports-implemented", &hpriv->force_port_map);
>> -
>> return 0;
>> }
>>
>> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
>> index 28a8de5b48b9..9b56490ecbc3 100644
>> --- a/drivers/ata/ahci_platform.c
>> +++ b/drivers/ata/ahci_platform.c
>> @@ -56,9 +56,6 @@ static int ahci_probe(struct platform_device *pdev)
>> if (rc)
>> return rc;
>>
>> - of_property_read_u32(dev->of_node,
>> - "ports-implemented", &hpriv->force_port_map);
>> -
>> if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
>> hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
>>
>> diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
>> index 7526653c843b..068621099c00 100644
>> --- a/drivers/ata/ahci_st.c
>> +++ b/drivers/ata/ahci_st.c
>> @@ -168,9 +168,6 @@ static int st_ahci_probe(struct platform_device *pdev)
>>
>> st_ahci_configure_oob(hpriv->mmio);
>>
>> - of_property_read_u32(dev->of_node,
>> - "ports-implemented", &hpriv->force_port_map);
>> -
>
> With arm:allmodconfig, this results in:
>
> CC [M] drivers/ata/ahci_st.o
> drivers/ata/ahci_st.c: In function 'st_ahci_probe':
> drivers/ata/ahci_st.c:147:24: error: unused variable 'dev' [-Werror=unused-variable]
> 147 | struct device *dev = &pdev->dev;
>
> Guenter
Just pushed a fix for this in ata tree for-next and for-6.1 branches. The
problem should be resolved with the next linux-next merge.
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter
2022-09-19 23:55 ` Damien Le Moal
@ 2022-09-25 16:19 ` Serge Semin
0 siblings, 0 replies; 4+ messages in thread
From: Serge Semin @ 2022-09-25 16:19 UTC (permalink / raw)
To: Damien Le Moal
Cc: Guenter Roeck, Serge Semin, Hans de Goede, Jens Axboe,
Hannes Reinecke, Matthias Brugger, Patrice Chotard,
Alexey Malahov, Pavel Parkhomenko, Rob Herring,
Krzysztof Kozlowski, linux-ide, linux-kernel, devicetree,
linux-arm-kernel, linux-mediatek
On Tue, Sep 20, 2022 at 08:55:59AM +0900, Damien Le Moal wrote:
> On 9/20/22 06:50, Guenter Roeck wrote:
> > On Fri, Sep 09, 2022 at 10:36:07PM +0300, Serge Semin wrote:
> >> The ports-implemented property is mainly used on the OF-based platforms
> >> with no ports mapping initialized by a bootloader/BIOS firmware. Seeing
> >> the same of_property_read_u32()-based pattern has already been implemented
> >> in the generic AHCI LLDD (glue) driver and in the Mediatek, St AHCI
> >> drivers let's move the property read procedure to the generic
> >> ahci_platform_get_resources() method. Thus we'll have the forced ports
> >> mapping feature supported for each OF-based platform which requires that,
> >> and stop re-implementing the same pattern in there a bit simplifying the
> >> code.
> >>
> >> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >> ---
> >> drivers/ata/ahci_mtk.c | 2 --
> >> drivers/ata/ahci_platform.c | 3 ---
> >> drivers/ata/ahci_st.c | 3 ---
> >> drivers/ata/libahci_platform.c | 3 +++
> >> 4 files changed, 3 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
> >> index 1f6c85fde983..c056378e3e72 100644
> >> --- a/drivers/ata/ahci_mtk.c
> >> +++ b/drivers/ata/ahci_mtk.c
> >> @@ -118,8 +118,6 @@ static int mtk_ahci_parse_property(struct ahci_host_priv *hpriv,
> >> SYS_CFG_SATA_EN);
> >> }
> >>
> >> - of_property_read_u32(np, "ports-implemented", &hpriv->force_port_map);
> >> -
> >> return 0;
> >> }
> >>
> >> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> >> index 28a8de5b48b9..9b56490ecbc3 100644
> >> --- a/drivers/ata/ahci_platform.c
> >> +++ b/drivers/ata/ahci_platform.c
> >> @@ -56,9 +56,6 @@ static int ahci_probe(struct platform_device *pdev)
> >> if (rc)
> >> return rc;
> >>
> >> - of_property_read_u32(dev->of_node,
> >> - "ports-implemented", &hpriv->force_port_map);
> >> -
> >> if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
> >> hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
> >>
> >> diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
> >> index 7526653c843b..068621099c00 100644
> >> --- a/drivers/ata/ahci_st.c
> >> +++ b/drivers/ata/ahci_st.c
> >> @@ -168,9 +168,6 @@ static int st_ahci_probe(struct platform_device *pdev)
> >>
> >> st_ahci_configure_oob(hpriv->mmio);
> >>
> >> - of_property_read_u32(dev->of_node,
> >> - "ports-implemented", &hpriv->force_port_map);
> >> -
> >
> > With arm:allmodconfig, this results in:
> >
> > CC [M] drivers/ata/ahci_st.o
> > drivers/ata/ahci_st.c: In function 'st_ahci_probe':
> > drivers/ata/ahci_st.c:147:24: error: unused variable 'dev' [-Werror=unused-variable]
> > 147 | struct device *dev = &pdev->dev;
> >
> > Guenter
>
> Just pushed a fix for this in ata tree for-next and for-6.1 branches. The
> problem should be resolved with the next linux-next merge.
Once again thanks for sending the fix for my mistake.
Regards,
-Sergey
>
> --
> Damien Le Moal
> Western Digital Research
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-25 16:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220909193621.17380-1-Sergey.Semin@baikalelectronics.ru>
2022-09-09 19:36 ` [PATCH v8 09/23] ata: libahci_platform: Parse ports-implemented property in resources getter Serge Semin
2022-09-19 21:50 ` Guenter Roeck
2022-09-19 23:55 ` Damien Le Moal
2022-09-25 16:19 ` Serge Semin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).