* [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes
@ 2023-08-23 9:47 Nikita Shubin via B4 Relay
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-23 9:47 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal; +Cc: linux-ide, linux-kernel, Nikita Shubin
Sending some fixes in prior to "ep93xx device tree conversion" series,
as per Sergey request:
- simple replacement s/-ENXIO/-ENOMEM/ as it suits better.
- second is s/ep93xx_chip_revision()/soc_device_match(), so i can drop
ep93xx_chip_revision() entirely in later series.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
Nikita Shubin (2):
ata: pata_ep93xx: fix error return code in probe
ata: pata_ep93xx: use soc_device_match for UDMA modes
drivers/ata/pata_ep93xx.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
---
base-commit: 89bf6209cad66214d3774dac86b6bbf2aec6a30d
change-id: 20230823-ep93xx_pata_fixes-56e6678cd6f1
Best regards,
--
Nikita Shubin <nikita.shubin@maquefel.me>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe
2023-08-23 9:47 [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Nikita Shubin via B4 Relay
@ 2023-08-23 9:47 ` Nikita Shubin via B4 Relay
2023-08-23 15:05 ` Sergey Shtylyov
2023-08-23 23:07 ` Damien Le Moal
2023-08-23 9:47 ` [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes Nikita Shubin via B4 Relay
2023-08-25 13:15 ` [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Damien Le Moal
2 siblings, 2 replies; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-23 9:47 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal; +Cc: linux-ide, linux-kernel, Nikita Shubin
From: Nikita Shubin <nikita.shubin@maquefel.me>
Return -ENOMEM from ep93xx_pata_probe() if devm_kzalloc() or
ata_host_alloc() fails.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
drivers/ata/pata_ep93xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index c6e043e05d43..4ce0f37c7a89 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -939,7 +939,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
drv_data = devm_kzalloc(&pdev->dev, sizeof(*drv_data), GFP_KERNEL);
if (!drv_data) {
- err = -ENXIO;
+ err = -ENOMEM;
goto err_rel_gpio;
}
@@ -952,7 +952,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
/* allocate host */
host = ata_host_alloc(&pdev->dev, 1);
if (!host) {
- err = -ENXIO;
+ err = -ENOMEM;
goto err_rel_dma;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes
2023-08-23 9:47 [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Nikita Shubin via B4 Relay
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
@ 2023-08-23 9:47 ` Nikita Shubin via B4 Relay
2023-08-23 15:19 ` Sergey Shtylyov
2023-08-25 13:15 ` [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Damien Le Moal
2 siblings, 1 reply; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-23 9:47 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal; +Cc: linux-ide, linux-kernel, Nikita Shubin
From: Nikita Shubin <nikita.shubin@maquefel.me>
Replace ep93xx_chip_revision() with soc_device_match(), so
ep93xx_chip_revision() can be safetly dropped from exported functions.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
drivers/ata/pata_ep93xx.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index 4ce0f37c7a89..3f91b6cff353 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -40,6 +40,7 @@
#include <linux/ata.h>
#include <linux/libata.h>
#include <linux/platform_device.h>
+#include <linux/sys_soc.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/ktime.h>
@@ -910,6 +911,12 @@ static struct ata_port_operations ep93xx_pata_port_ops = {
.port_start = ep93xx_pata_port_start,
};
+static const struct soc_device_attribute ep93xx_soc_table[] = {
+ { .revision = "E1", .data = (void *)ATA_UDMA3 },
+ { .revision = "E2", .data = (void *)ATA_UDMA4 },
+ { /* sentinel */ }
+};
+
static int ep93xx_pata_probe(struct platform_device *pdev)
{
struct ep93xx_pata_data *drv_data;
@@ -976,12 +983,11 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
* so this driver supports only UDMA modes.
*/
if (drv_data->dma_rx_channel && drv_data->dma_tx_channel) {
- int chip_rev = ep93xx_chip_revision();
+ const struct soc_device_attribute *match;
- if (chip_rev == EP93XX_CHIP_REV_E1)
- ap->udma_mask = ATA_UDMA3;
- else if (chip_rev == EP93XX_CHIP_REV_E2)
- ap->udma_mask = ATA_UDMA4;
+ match = soc_device_match(ep93xx_soc_table);
+ if (match)
+ ap->udma_mask = (unsigned int) match->data;
else
ap->udma_mask = ATA_UDMA2;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
@ 2023-08-23 15:05 ` Sergey Shtylyov
2023-08-23 23:07 ` Damien Le Moal
1 sibling, 0 replies; 9+ messages in thread
From: Sergey Shtylyov @ 2023-08-23 15:05 UTC (permalink / raw)
To: nikita.shubin, Damien Le Moal; +Cc: linux-ide, linux-kernel
On 8/23/23 12:47 PM, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Return -ENOMEM from ep93xx_pata_probe() if devm_kzalloc() or
> ata_host_alloc() fails.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes
2023-08-23 9:47 ` [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes Nikita Shubin via B4 Relay
@ 2023-08-23 15:19 ` Sergey Shtylyov
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Shtylyov @ 2023-08-23 15:19 UTC (permalink / raw)
To: nikita.shubin, Damien Le Moal; +Cc: linux-ide, linux-kernel
On 8/23/23 12:47 PM, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Replace ep93xx_chip_revision() with soc_device_match(), so
> ep93xx_chip_revision() can be safetly dropped from exported functions.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
2023-08-23 15:05 ` Sergey Shtylyov
@ 2023-08-23 23:07 ` Damien Le Moal
2023-08-25 8:05 ` Nikita Shubin
1 sibling, 1 reply; 9+ messages in thread
From: Damien Le Moal @ 2023-08-23 23:07 UTC (permalink / raw)
To: nikita.shubin, Sergey Shtylyov; +Cc: linux-ide, linux-kernel
On 8/23/23 18:47, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Return -ENOMEM from ep93xx_pata_probe() if devm_kzalloc() or
> ata_host_alloc() fails.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Doesn't this need a Fixes tag and Cc: stable ?
This is not really a bug fix, but might as well be complete with the fix :)
> ---
> drivers/ata/pata_ep93xx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
> index c6e043e05d43..4ce0f37c7a89 100644
> --- a/drivers/ata/pata_ep93xx.c
> +++ b/drivers/ata/pata_ep93xx.c
> @@ -939,7 +939,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
>
> drv_data = devm_kzalloc(&pdev->dev, sizeof(*drv_data), GFP_KERNEL);
> if (!drv_data) {
> - err = -ENXIO;
> + err = -ENOMEM;
> goto err_rel_gpio;
> }
>
> @@ -952,7 +952,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
> /* allocate host */
> host = ata_host_alloc(&pdev->dev, 1);
> if (!host) {
> - err = -ENXIO;
> + err = -ENOMEM;
> goto err_rel_dma;
> }
>
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe
2023-08-23 23:07 ` Damien Le Moal
@ 2023-08-25 8:05 ` Nikita Shubin
2023-08-25 8:10 ` Damien Le Moal
0 siblings, 1 reply; 9+ messages in thread
From: Nikita Shubin @ 2023-08-25 8:05 UTC (permalink / raw)
To: Damien Le Moal, Sergey Shtylyov; +Cc: linux-ide, linux-kernel
Hi Damien!
On Thu, 2023-08-24 at 08:07 +0900, Damien Le Moal wrote:
> On 8/23/23 18:47, Nikita Shubin via B4 Relay wrote:
> > From: Nikita Shubin <nikita.shubin@maquefel.me>
> >
> > Return -ENOMEM from ep93xx_pata_probe() if devm_kzalloc() or
> > ata_host_alloc() fails.
> >
> > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Doesn't this need a Fixes tag and Cc: stable ?
>
> This is not really a bug fix, but might as well be complete with the
> fix :)
Well... This would be fix for:
```
commit 2fff27512600f9ad91335577e485a8552edb0abf
Author: Rafal Prylowski <prylowski@metasoft.pl>
Date: Thu Apr 12 14:13:16 2012 +0200
```
v3.4-rc6-6-g2fff27512600
Are you sure we wanna tag so solid and time proven commit as Fixes: :)
?
>
> > ---
> > drivers/ata/pata_ep93xx.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
> > index c6e043e05d43..4ce0f37c7a89 100644
> > --- a/drivers/ata/pata_ep93xx.c
> > +++ b/drivers/ata/pata_ep93xx.c
> > @@ -939,7 +939,7 @@ static int ep93xx_pata_probe(struct
> > platform_device *pdev)
> >
> > drv_data = devm_kzalloc(&pdev->dev, sizeof(*drv_data),
> > GFP_KERNEL);
> > if (!drv_data) {
> > - err = -ENXIO;
> > + err = -ENOMEM;
> > goto err_rel_gpio;
> > }
> >
> > @@ -952,7 +952,7 @@ static int ep93xx_pata_probe(struct
> > platform_device *pdev)
> > /* allocate host */
> > host = ata_host_alloc(&pdev->dev, 1);
> > if (!host) {
> > - err = -ENXIO;
> > + err = -ENOMEM;
> > goto err_rel_dma;
> > }
> >
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe
2023-08-25 8:05 ` Nikita Shubin
@ 2023-08-25 8:10 ` Damien Le Moal
0 siblings, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2023-08-25 8:10 UTC (permalink / raw)
To: Nikita Shubin, Sergey Shtylyov; +Cc: linux-ide, linux-kernel
On 8/25/23 17:05, Nikita Shubin wrote:
> Hi Damien!
>
> On Thu, 2023-08-24 at 08:07 +0900, Damien Le Moal wrote:
>> On 8/23/23 18:47, Nikita Shubin via B4 Relay wrote:
>>> From: Nikita Shubin <nikita.shubin@maquefel.me>
>>>
>>> Return -ENOMEM from ep93xx_pata_probe() if devm_kzalloc() or
>>> ata_host_alloc() fails.
>>>
>>> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
>>
>> Doesn't this need a Fixes tag and Cc: stable ?
>>
>> This is not really a bug fix, but might as well be complete with the
>> fix :)
>
> Well... This would be fix for:
>
> ```
> commit 2fff27512600f9ad91335577e485a8552edb0abf
> Author: Rafal Prylowski <prylowski@metasoft.pl>
> Date: Thu Apr 12 14:13:16 2012 +0200
> ```
>
> v3.4-rc6-6-g2fff27512600
>
> Are you sure we wanna tag so solid and time proven commit as Fixes: :)
> ?
Yeah, this is fine without the fixes tag. As I said, not exactly a bug fix but
rather an improvement :)
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes
2023-08-23 9:47 [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Nikita Shubin via B4 Relay
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
2023-08-23 9:47 ` [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes Nikita Shubin via B4 Relay
@ 2023-08-25 13:15 ` Damien Le Moal
2 siblings, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2023-08-25 13:15 UTC (permalink / raw)
To: nikita.shubin, Sergey Shtylyov; +Cc: linux-ide, linux-kernel
On 8/23/23 18:47, Nikita Shubin via B4 Relay wrote:
> Sending some fixes in prior to "ep93xx device tree conversion" series,
> as per Sergey request:
>
> - simple replacement s/-ENXIO/-ENOMEM/ as it suits better.
> - second is s/ep93xx_chip_revision()/soc_device_match(), so i can drop
> ep93xx_chip_revision() entirely in later series.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
> Nikita Shubin (2):
> ata: pata_ep93xx: fix error return code in probe
> ata: pata_ep93xx: use soc_device_match for UDMA modes
Applied to for-6.6. Thanks !
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-08-25 13:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23 9:47 [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Nikita Shubin via B4 Relay
2023-08-23 9:47 ` [PATCH 1/2] ata: pata_ep93xx: fix error return code in probe Nikita Shubin via B4 Relay
2023-08-23 15:05 ` Sergey Shtylyov
2023-08-23 23:07 ` Damien Le Moal
2023-08-25 8:05 ` Nikita Shubin
2023-08-25 8:10 ` Damien Le Moal
2023-08-23 9:47 ` [PATCH 2/2] ata: pata_ep93xx: use soc_device_match for UDMA modes Nikita Shubin via B4 Relay
2023-08-23 15:19 ` Sergey Shtylyov
2023-08-25 13:15 ` [PATCH 0/2] ata: pata_ep93xx: dt convert preparation fixes Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox