* [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap
@ 2008-02-18 18:42 Saeed Bishara
2008-02-18 18:57 ` Mark Lord
2008-02-20 17:21 ` Jeff Garzik
0 siblings, 2 replies; 4+ messages in thread
From: Saeed Bishara @ 2008-02-18 18:42 UTC (permalink / raw)
To: jeff, mlord, htejun, linux-ide; +Cc: saeed.bishara, saeed, byron.bbradley, tbm
this will fix crash bug when doing rmmod to the driver, this is because the
port_stop function get called later and it could access the device's registers.
Signed-off-by: Saeed Bishara <saeed@marvell.com>
---
drivers/ata/sata_mv.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 9c9a5b0..f510448 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2951,7 +2951,8 @@ static int mv_platform_probe(struct platform_device *pdev)
hpriv->n_ports = n_ports;
host->iomap = NULL;
- hpriv->base = ioremap(res->start, res->end - res->start + 1);
+ hpriv->base = devm_ioremap(&pdev->dev, res->start,
+ res->end - res->start + 1);
hpriv->base -= MV_SATAHC0_REG_BASE;
rc = mv_create_dma_pools(hpriv, &pdev->dev);
@@ -2983,11 +2984,8 @@ static int __devexit mv_platform_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ata_host *host = dev_get_drvdata(dev);
- struct mv_host_priv *hpriv = host->private_data;
- void __iomem *base = hpriv->base;
ata_host_detach(host);
- iounmap(base);
return 0;
}
--
1.5.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap
2008-02-18 18:42 [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap Saeed Bishara
@ 2008-02-18 18:57 ` Mark Lord
2008-02-19 23:25 ` Tejun Heo
2008-02-20 17:21 ` Jeff Garzik
1 sibling, 1 reply; 4+ messages in thread
From: Mark Lord @ 2008-02-18 18:57 UTC (permalink / raw)
To: Saeed Bishara
Cc: jeff, mlord, htejun, linux-ide, saeed.bishara, byron.bbradley,
tbm
Saeed Bishara wrote:
> this will fix crash bug when doing rmmod to the driver, this is because the
> port_stop function get called later and it could access the device's registers.
>
> Signed-off-by: Saeed Bishara <saeed@marvell.com>
> ---
> drivers/ata/sata_mv.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index 9c9a5b0..f510448 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -2951,7 +2951,8 @@ static int mv_platform_probe(struct platform_device *pdev)
> hpriv->n_ports = n_ports;
>
> host->iomap = NULL;
> - hpriv->base = ioremap(res->start, res->end - res->start + 1);
> + hpriv->base = devm_ioremap(&pdev->dev, res->start,
> + res->end - res->start + 1);
> hpriv->base -= MV_SATAHC0_REG_BASE;
>
> rc = mv_create_dma_pools(hpriv, &pdev->dev);
> @@ -2983,11 +2984,8 @@ static int __devexit mv_platform_remove(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct ata_host *host = dev_get_drvdata(dev);
> - struct mv_host_priv *hpriv = host->private_data;
> - void __iomem *base = hpriv->base;
>
> ata_host_detach(host);
> - iounmap(base);
> return 0;
> }
>
..
Acked0by: Mark Lord <mlord@pobox.com>
Looks correct to me.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap
2008-02-18 18:57 ` Mark Lord
@ 2008-02-19 23:25 ` Tejun Heo
0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2008-02-19 23:25 UTC (permalink / raw)
To: Mark Lord
Cc: Saeed Bishara, jeff, mlord, linux-ide, saeed.bishara,
byron.bbradley, tbm
Mark Lord wrote:
> Saeed Bishara wrote:
>> this will fix crash bug when doing rmmod to the driver, this is
>> because the
>> port_stop function get called later and it could access the device's
>> registers.
>>
>> Signed-off-by: Saeed Bishara <saeed@marvell.com>
Acked-by: Tejun Heo <htejun@gmail.com>
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap
2008-02-18 18:42 [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap Saeed Bishara
2008-02-18 18:57 ` Mark Lord
@ 2008-02-20 17:21 ` Jeff Garzik
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2008-02-20 17:21 UTC (permalink / raw)
To: Saeed Bishara
Cc: mlord, htejun, linux-ide, saeed.bishara, byron.bbradley, tbm
Saeed Bishara wrote:
> this will fix crash bug when doing rmmod to the driver, this is because the
> port_stop function get called later and it could access the device's registers.
>
> Signed-off-by: Saeed Bishara <saeed@marvell.com>
> ---
> drivers/ata/sata_mv.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
applied
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-20 17:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-18 18:42 [PATCH] sata_mv: remove iounmap in mv_platform_remove and use devm_iomap Saeed Bishara
2008-02-18 18:57 ` Mark Lord
2008-02-19 23:25 ` Tejun Heo
2008-02-20 17:21 ` Jeff Garzik
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).