From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] pcmcia: pxa2xx: convert memory allocation to devm_* API
Date: Sat, 28 Mar 2015 22:06:23 +0000 [thread overview]
Message-ID: <20150328220623.GA24899@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <87zj6wvm3z.fsf@free.fr>
On Sat, Mar 28, 2015 at 10:38:24PM +0100, Robert Jarzmik wrote:
> Russell King <rmk+kernel@arm.linux.org.uk> writes:
>
> > Convert the pxa2xx socket driver memory allocation to use devm_kzalloc()
> > to simplify the cleanup path.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > ---
> > drivers/pcmcia/pxa2xx_base.c | 8 +++-----
> > 1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
> > index 197c77a64ce0..dfcf07828605 100644
> > --- a/drivers/pcmcia/pxa2xx_base.c
> > +++ b/drivers/pcmcia/pxa2xx_base.c
> > @@ -302,7 +302,8 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
> >
> > pxa2xx_drv_pcmcia_ops(ops);
> >
> > - sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
> > + sinfo = devm_kzalloc(&pdev->dev, SKT_DEV_INFO_SIZE(ops->nr),
> There is a typo here : &pdev->dev should be &dev->dev.
>
> Now given that fix, you can add my :
> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> This test of mine is rather cheap :
> - it relies on 4.0-rc4
> - I don't have any PCMCIA card to insert in the lubbock, hence the "cheap"
> - I judge that pcmcia is working because :
> - cat /proc/iomem gives:
> 10000000-10001fff : sa1111
> 10000400-100005ff : 0400
> 10000800-100009ff : 0800
> 10000a00-10000bff : 0a00
> 10000a00-10000bff : sa1111-ps2
> 10000c00-10000dff : 0c00
> 10000c00-10000dff : sa1111-ps2
> 10001600-100017ff : irq
> 10001800-100019ff : 1800
> 10001800-100019ff : sa1111-pcmcia
> - I don't see any error message in kernel log
>
> As a side note mainly to myself, the pcmcia is broken on pxa2xx architectures
> and panics the kernel at boot time because :
> - in drivers/pcmcia/sa1111_lubbock.c I see :
> pcmcia_lubbock_init()
> pxa2xx_configure_sockets(&sadev->dev);
> here it is expected that platform_data contains the pcmcia ops, but it's
> NULL, and the dereferencing in pxa2xx_configure_sockets() of ops->first
> panics.
I guess it's broken as a result of 5b703683b6cc3cb97bbe6b1b14898b273eb59279
which added that call without really understanding the call path. I
don't see any solution other than partially reverting that commit.
As can be seen from the commit message, this was done blindly with no
testing - so it's no surprise that it broke.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-03-28 22:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 11:22 [PATCH 0/8] sa11x0 PCMCIA updates Russell King - ARM Linux
2015-03-26 11:23 ` [PATCH 1/8] pcmcia: sa11x0: fix missing clk_put() in sa11x0 socket drivers Russell King
2015-03-26 11:23 ` [PATCH 2/8] pcmcia: sa11x0: convert memory allocation to devm_* API Russell King
2015-03-26 11:23 ` [PATCH 3/8] pcmcia: pxa2xx: update socket driver to use devm_clk_get() API Russell King
2015-03-26 11:23 ` [PATCH 4/8] pcmcia: pxa2xx: convert memory allocation to devm_* API Russell King
2015-03-28 21:38 ` Robert Jarzmik
2015-03-28 22:06 ` Russell King - ARM Linux [this message]
2015-03-26 11:23 ` [PATCH 5/8] pcmcia: sa1111: update socket driver to use devm_clk_get() API Russell King
2015-03-26 11:23 ` [PATCH 6/8] pcmcia: sa1111: simplify clk handing in sa1111_pcmcia_add() Russell King
2015-03-26 11:24 ` [PATCH 7/8] pcmcia: sa11xx_base.c: remove useless init/exit functions Russell King
2015-03-26 11:24 ` [PATCH 8/8] pcmcia: soc_common: remove skt_dev_info's clk pointer Russell King
2015-03-26 20:38 ` [PATCH 0/8] sa11x0 PCMCIA updates Robert Jarzmik
-- strict thread matches above, loose matches on Subject: below --
2015-07-15 18:03 Russell King - ARM Linux
2015-07-15 18:04 ` [PATCH 4/8] pcmcia: pxa2xx: convert memory allocation to devm_* API Russell King
2015-07-16 19:12 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150328220623.GA24899@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).