All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Jarkko Nikula <jhnikula@gmail.com>,
	linux-omap@vger.kernel.org,
	Peter Ujfalusi <peter.ujfalusi@nokia.com>
Subject: Re: [RFC][RFT][PATCH 3/4 v6] OMAP: McBSP: Introduce caching in register write operations
Date: Tue, 8 Dec 2009 08:59:31 -0800	[thread overview]
Message-ID: <20091208165931.GR24013@atomide.com> (raw)
In-Reply-To: <20091208164028.GQ24013@atomide.com>

* Tony Lindgren <tony@atomide.com> [091208 08:39]:
> > @@ -391,6 +405,31 @@ int omap_mcbsp_request(unsigned int id)
> >  	}
> >  	mcbsp = id_to_mcbsp_ptr(id);
> >  
> > +	if (cpu_is_omap7xx()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u16) *
> > +				OMAP7XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap15xx()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u16) *
> > +				OMAP15XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap16xx()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u16) *
> > +				OMAP16XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap2420()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u16) *
> > +				OMAP24XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap2430()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u32) *
> > +				OMAP24XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap34xx()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u32) *
> > +				OMAP34XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	} else if (cpu_is_omap44xx()) {
> > +		mcbsp->reg_cache = kzalloc(sizeof(u32) *
> > +				OMAP44XX_MCBSP_REG_NUM, GFP_KERNEL);
> > +	}
> 
> How about just set the cache size above based on the processor,
> then do kzalloc here:
> 
> mcbsp->reg_cache = kzalloc(size, GFP_KERNEL);
> > +	if (!mcbsp->reg_cache)
> > +		return -ENOMEM;
> > +
> 
> That way the kzalloc and error checking are in the same place.

Actually since we already have mach-omap1/mcbsp.c and mach-omap2/mcbsp.c,
it would be best to pass the cache size from omap1_mcbsp_init and
omap2_mcbsp_init. That leaves some of the if cpu_is_omapxxxx() else
stuff.

Regards,

Tony

  reply	other threads:[~2009-12-08 16:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  3:10 [PATCH v3 0/4] OMAP: McBSP: Use register cache Janusz Krzysztofik
2009-12-01  3:12 ` [PATCH v3 1/4] OMAP: McBSP: Use macros for all register read/write operations Janusz Krzysztofik
2009-12-01  3:26   ` [Resend] " Janusz Krzysztofik
2009-12-01  3:14 ` [PATCH v3 2/4] OMAP: McBSP: Prepare register read/write macros API for caching Janusz Krzysztofik
2009-12-01  3:15 ` [PATCH v3 3/4] OMAP: McBSP: Introduce caching in register write operations Janusz Krzysztofik
2009-12-03  7:49   ` Jarkko Nikula
2009-12-03 12:30     ` [PATCH 3/4 v4] " Janusz Krzysztofik
2009-12-03 20:03       ` Tony Lindgren
2009-12-03 23:18         ` Janusz Krzysztofik
2009-12-04 12:57           ` Janusz Krzysztofik
2009-12-04 19:17             ` Tony Lindgren
2009-12-05 13:46               ` [PATCH 3/4 v5a] " Janusz Krzysztofik
2009-12-05 13:47               ` [RFC][RFT][PATCH 3/4 v5b] " Janusz Krzysztofik
2009-12-07 17:55                 ` Tony Lindgren
2009-12-07 19:39                   ` Janusz Krzysztofik
2009-12-07 21:06                     ` Tony Lindgren
2009-12-08  7:35                       ` Jarkko Nikula
2009-12-08 16:07                         ` [RFC][RFT][PATCH 3/4 v6] " Janusz Krzysztofik
2009-12-08 16:40                           ` Tony Lindgren
2009-12-08 16:59                             ` Tony Lindgren [this message]
2009-12-08 19:46                               ` Janusz Krzysztofik
2009-12-08 23:32                                 ` Tony Lindgren
2009-12-08 23:39                                   ` Tony Lindgren
2009-12-01  3:17 ` [PATCH v3 4/4] OMAP: McBSP: Use cache when modifying individual register bits Janusz Krzysztofik
2009-12-03 12:31   ` [PATCH 4/4 v4] " Janusz Krzysztofik
2009-12-03  7:49 ` [PATCH v3 0/4] OMAP: McBSP: Use register cache Jarkko Nikula
2009-12-03  9:35   ` Peter Ujfalusi
2009-12-03 12:31     ` Janusz Krzysztofik
2009-12-04  6:58       ` Peter Ujfalusi

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=20091208165931.GR24013@atomide.com \
    --to=tony@atomide.com \
    --cc=jhnikula@gmail.com \
    --cc=jkrzyszt@tis.icnet.pl \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@nokia.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 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.