From: Daniel Walker <dwalker@codeaurora.org>
To: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: davidb@codeaurora.org, bryanh@codeaurora.org,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] msm: iommu: Rework clock logic and add IOMMU bus clock control
Date: Tue, 23 Nov 2010 06:33:24 -0800 [thread overview]
Message-ID: <1290522804.9053.14.camel@m0nster> (raw)
In-Reply-To: <4CEB2FAC.8040305@codeaurora.org>
On Mon, 2010-11-22 at 19:06 -0800, Stepan Moskovchenko wrote:
> On 11/22/2010 3:51 PM, Daniel Walker wrote:
> > On Fri, 2010-11-19 at 19:02 -0800, Stepan Moskovchenko wrote:
> >> Clean up the clock control code in the probe calls, and add
> >> support for controlling the clock for the IOMMU bus
> >> interconnect. With the (proper) clock driver in place, the
> >> clock control logic in the probe function can be made much
> >> cleaner since it does not have to deal with the placeholder
> >> driver anymore.
> >>
> >> Change-Id: I1040bc4e18f4ab4b7cc0dd5fe667f9df83b9f1f5
> > You need to remove this Change-Id ..
> Fixed in v2.
>
> >
> >> + pr_err("Could not request memory region: start=%p, len=%d\n",
> >> + (void *) r->start, len);(void *) r->start, len);
> > You usually just tab over till you get to the " like this,
> >
> > pr_err("Could not request memory region: start=%p, len=%d\n",
> > (void *) r->start, len);
> Fixed in v2.
>
> >> drv = platform_get_drvdata(pdev);
> >> if (drv) {
> >> - memset(drv, 0, sizeof(struct msm_iommu_drvdata));
> >> + if (drv->clk)
> >> + clk_put(drv->clk);
> >> + clk_put(drv->pclk);
> >> + memset(drv, 0, sizeof(*drv));
> > Do you really need the memset ?
> I guess not.. it seemed like good practice to poison the memory in case
> someone else had a stale reference to it. I guess I can remove them.
The memory allocator already has a poison debugging option. If you
suspect memory issues you can always turn that on.
> >> + if (ret)
> >> + goto fail;
> >> +
> >> + if (drvdata->clk) {
> >> + ret = clk_enable(drvdata->clk);
> >> + if (ret) {
> >> + clk_disable(drvdata->pclk);
> >> + goto fail;
> >> + }
> >> + }
> > You did this in a prior patch also, you could combine them into a single
> > helper function. Maybe do the same for the disable side too.
> That was in a different file (where it gets used much more extensively
> than just in the one case here). I would rather not make a bunch of my
> internal stuff visible to the global namespace if I can help it, and
> it's a trivial enough operation to enable two clocks.
I was meaning making it a static inline inside a header.. You wouldn't
want this to be a global function. If you can it's usually a good idea
to combine code that's similar, that way there's only one place to make
modifications.
Daniel
--
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum.
WARNING: multiple messages have this Message-ID (diff)
From: dwalker@codeaurora.org (Daniel Walker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] msm: iommu: Rework clock logic and add IOMMU bus clock control
Date: Tue, 23 Nov 2010 06:33:24 -0800 [thread overview]
Message-ID: <1290522804.9053.14.camel@m0nster> (raw)
In-Reply-To: <4CEB2FAC.8040305@codeaurora.org>
On Mon, 2010-11-22 at 19:06 -0800, Stepan Moskovchenko wrote:
> On 11/22/2010 3:51 PM, Daniel Walker wrote:
> > On Fri, 2010-11-19 at 19:02 -0800, Stepan Moskovchenko wrote:
> >> Clean up the clock control code in the probe calls, and add
> >> support for controlling the clock for the IOMMU bus
> >> interconnect. With the (proper) clock driver in place, the
> >> clock control logic in the probe function can be made much
> >> cleaner since it does not have to deal with the placeholder
> >> driver anymore.
> >>
> >> Change-Id: I1040bc4e18f4ab4b7cc0dd5fe667f9df83b9f1f5
> > You need to remove this Change-Id ..
> Fixed in v2.
>
> >
> >> + pr_err("Could not request memory region: start=%p, len=%d\n",
> >> + (void *) r->start, len);(void *) r->start, len);
> > You usually just tab over till you get to the " like this,
> >
> > pr_err("Could not request memory region: start=%p, len=%d\n",
> > (void *) r->start, len);
> Fixed in v2.
>
> >> drv = platform_get_drvdata(pdev);
> >> if (drv) {
> >> - memset(drv, 0, sizeof(struct msm_iommu_drvdata));
> >> + if (drv->clk)
> >> + clk_put(drv->clk);
> >> + clk_put(drv->pclk);
> >> + memset(drv, 0, sizeof(*drv));
> > Do you really need the memset ?
> I guess not.. it seemed like good practice to poison the memory in case
> someone else had a stale reference to it. I guess I can remove them.
The memory allocator already has a poison debugging option. If you
suspect memory issues you can always turn that on.
> >> + if (ret)
> >> + goto fail;
> >> +
> >> + if (drvdata->clk) {
> >> + ret = clk_enable(drvdata->clk);
> >> + if (ret) {
> >> + clk_disable(drvdata->pclk);
> >> + goto fail;
> >> + }
> >> + }
> > You did this in a prior patch also, you could combine them into a single
> > helper function. Maybe do the same for the disable side too.
> That was in a different file (where it gets used much more extensively
> than just in the one case here). I would rather not make a bunch of my
> internal stuff visible to the global namespace if I can help it, and
> it's a trivial enough operation to enable two clocks.
I was meaning making it a static inline inside a header.. You wouldn't
want this to be a global function. If you can it's usually a good idea
to combine code that's similar, that way there's only one place to make
modifications.
Daniel
--
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum.
next prev parent reply other threads:[~2010-11-23 14:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-20 3:02 [PATCH 0/3] msm: iommu: Further improvements to the MSM IOMMU driver Stepan Moskovchenko
2010-11-20 3:02 ` Stepan Moskovchenko
2010-11-20 3:02 ` [PATCH 1/3] msm: iommu: Add bus clocks to platform data Stepan Moskovchenko
2010-11-20 3:02 ` Stepan Moskovchenko
2010-11-20 3:02 ` [PATCH 2/3] msm: iommu: Clock control for the IOMMU driver Stepan Moskovchenko
2010-11-20 3:02 ` Stepan Moskovchenko
2010-11-22 23:32 ` Daniel Walker
2010-11-22 23:32 ` Daniel Walker
2010-11-22 23:54 ` Stepan Moskovchenko
2010-11-22 23:54 ` Stepan Moskovchenko
2010-11-23 3:14 ` [PATCH v2 " Stepan Moskovchenko
2010-11-23 3:14 ` Stepan Moskovchenko
2010-11-23 3:14 ` [PATCH v2 3/3] msm: iommu: Rework clock logic and add IOMMU bus clock control Stepan Moskovchenko
2010-11-23 3:14 ` Stepan Moskovchenko
2010-11-20 3:02 ` [PATCH " Stepan Moskovchenko
2010-11-20 3:02 ` Stepan Moskovchenko
2010-11-22 23:51 ` Daniel Walker
2010-11-22 23:51 ` Daniel Walker
2010-11-23 3:06 ` Stepan Moskovchenko
2010-11-23 3:06 ` Stepan Moskovchenko
2010-11-23 14:33 ` Daniel Walker [this message]
2010-11-23 14:33 ` Daniel Walker
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=1290522804.9053.14.camel@m0nster \
--to=dwalker@codeaurora.org \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stepanm@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.