From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: David Sin <davidsin@ti.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
Hari Kanigeri <h-kanigeri2@ti.com>,
Ohad Ben-Cohen <ohad@wizery.com>,
Vaibhav Hiremath <hvaibhav@ti.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Lajos Molnar <molnar@ti.com>
Subject: Re: [RFC 7/8] TILER-DMM: Main TILER driver implementation.
Date: Sat, 24 Jul 2010 08:55:24 +0100 [thread overview]
Message-ID: <20100724075524.GA15064@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1279927348-21750-8-git-send-email-davidsin@ti.com>
On Fri, Jul 23, 2010 at 06:22:27PM -0500, David Sin wrote:
> +struct platform_driver tiler_driver_ldm = {
> + .driver = {
> + .owner = THIS_MODULE,
> + .name = "tiler",
> + },
> + .probe = NULL,
> + .shutdown = NULL,
> + .remove = NULL,
> +};
What's the purpose of this apparantly stub driver?
> +static s32 refill_pat(struct tmm *tmm, struct tcm_area *area, u32 *ptr)
> +{
> + s32 res = 0;
> + struct pat_area p_area = {0};
> +
> + p_area.x0 = area->p0.x;
> + p_area.y0 = area->p0.y;
> + p_area.x1 = area->p1.x;
> + p_area.y1 = area->p1.y;
> +
> + memcpy(dmac_va, ptr, sizeof(*ptr) * tcm_sizeof(*area));
> +
> + if (tmm_map(tmm, p_area, dmac_pa))
> + res = -EFAULT;
What's wrong with making tmm_map return an error code and propagating it?
This can be a simple:
return tmm_map(tmm, p_area, dmac_pa);
In any case, I'm not sure I like all this layered code - it makes it much
harder to follow what's going on when you have to look at multiple files
to find out what X does.
If tmm_map() is only used here, move the contents of tmm_map here.
> +/* verify input params and calculate tiler container params for a block */
> +static s32 __analize_area(enum tiler_fmt fmt, u32 width, u32 height,
> + u16 *x_area, u16 *y_area, u16 *align, u16 *offs)
Analyze is spelt like that, not with an i.
> +/* driver initialization */
> +static s32 __init tiler_init(void)
> +{
> + s32 r = -1;
> + struct tcm *sita = NULL;
> + struct tmm *tmm_pat = NULL;
> +
> + tiler_geom_init(&tiler);
> +
> + /* check module parameters for correctness */
> + if (default_align > PAGE_SIZE ||
> + default_align & (default_align - 1) ||
> + granularity < 1 || granularity > PAGE_SIZE ||
> + granularity & (granularity - 1))
> + return -EINVAL;
> +
> + /*
> + * Array of physical pages for PAT programming, which must be a 16-byte
> + * aligned physical address.
> + */
> + dmac_va = dma_alloc_coherent(NULL, tiler.width * tiler.height *
> + sizeof(*dmac_va), &dmac_pa, GFP_ATOMIC);
Why GFP_ATOMIC? Surely GFP_KERNEL will work here?
What if there ends up being more than one tiler at some point in the future
and you need two of these? Shouldn't this be in some driver probe function
so you have a struct device to use with it?
next prev parent reply other threads:[~2010-07-24 7:55 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 23:22 [RFC 0/8] TI TILER-DMM driver David Sin
2010-07-23 23:22 ` [RFC 1/8] TILER-DMM: DMM-PAT driver for TI TILER David Sin
2010-07-23 23:22 ` [RFC 2/8] TILER-DMM: Container manager interface and utility definitons David Sin
2010-07-23 23:22 ` [RFC 3/8] TILER-DMM: Sample TCM implementation: Simple TILER Allocator David Sin
2010-07-23 23:22 ` [RFC 4/8] TILER-DMM: TILER Memory Manager interface and implementation David Sin
2010-07-23 23:22 ` [RFC 5/8] TILER-DMM: TILER interface file and documentation David Sin
2010-07-23 23:22 ` [RFC 6/8] TILER-DMM: Geometry and view manipulation functions David Sin
2010-07-23 23:22 ` [RFC 7/8] TILER-DMM: Main TILER driver implementation David Sin
2010-07-23 23:22 ` [RFC 8/8] TILER-DMM: Linking TILER driver into the Linux kernel build David Sin
2010-07-24 7:32 ` [RFC 7/8] TILER-DMM: Main TILER driver implementation Shilimkar, Santosh
2010-07-24 13:41 ` Hari Kanigeri
2010-07-24 13:53 ` Shilimkar, Santosh
2010-07-24 7:55 ` Russell King - ARM Linux [this message]
2010-07-24 7:21 ` [RFC 5/8] TILER-DMM: TILER interface file and documentation Shilimkar, Santosh
2010-07-24 8:01 ` [RFC 4/8] TILER-DMM: TILER Memory Manager interface and implementation Russell King - ARM Linux
2010-07-26 19:34 ` Sin, David
2010-08-02 14:40 ` Sin, David
2010-08-02 14:44 ` Shilimkar, Santosh
2010-08-02 14:49 ` Sin, David
2010-08-02 14:52 ` Shilimkar, Santosh
2010-08-02 14:55 ` Sin, David
[not found] ` <9DCA1E44C5805D4EB7C1626D5FD1739E048EDA223B@dlee02.ent.ti.com>
2010-08-03 19:49 ` Sin, David
2010-07-28 5:53 ` Hiremath, Vaibhav
2010-07-24 7:13 ` [RFC 3/8] TILER-DMM: Sample TCM implementation: Simple TILER Allocator Shilimkar, Santosh
2010-07-25 15:45 ` Molnar, Lajos
2010-07-26 19:33 ` Sin, David
2010-07-27 20:41 ` Hiremath, Vaibhav
2010-07-24 6:56 ` [RFC 2/8] TILER-DMM: Container manager interface and utility definitons Shilimkar, Santosh
2010-07-27 20:21 ` Hiremath, Vaibhav
2010-07-24 6:51 ` [RFC 1/8] TILER-DMM: DMM-PAT driver for TI TILER Shilimkar, Santosh
2010-07-24 8:09 ` Russell King - ARM Linux
2010-07-24 10:15 ` Russell King - ARM Linux
2010-07-26 19:28 ` Sin, David
2010-07-27 18:37 ` Hiremath, Vaibhav
2010-07-27 19:05 ` Sin, David
2010-07-27 19:53 ` Hiremath, Vaibhav
2010-07-28 10:00 ` Laurent Pinchart
2010-07-28 14:39 ` Sin, David
2010-07-28 15:46 ` Hiremath, Vaibhav
2010-07-28 9:45 ` Laurent Pinchart
2010-07-24 7:44 ` [RFC 0/8] TI TILER-DMM driver Shilimkar, Santosh
2010-07-26 19:20 ` Sin, David
2010-07-24 11:12 ` Hans Verkuil
2010-07-28 15:23 ` Sin, David
2010-07-28 17:30 ` Hiremath, Vaibhav
2010-07-28 19:15 ` Sin, David
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=20100724075524.GA15064@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=davidsin@ti.com \
--cc=h-kanigeri2@ti.com \
--cc=hvaibhav@ti.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
--cc=molnar@ti.com \
--cc=ohad@wizery.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.com \
/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).