From: Santosh Shilimkar <santosh.shilimkar@ti.com> To: Andrei Warkentin <andreiw@motorola.com>, Catalin Marinas <catalin.marinas@arm.com>, Russell King - ARM Linux <linux@arm.linux.org.uk> Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Kevin Hilman <khilman@ti.com>, tony@atomide.com Subject: RE: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way operation can cause data corruption Date: Tue, 15 Feb 2011 15:00:11 +0530 [thread overview] Message-ID: <b10e9b5cef20f3f01035d7ffaa465387@mail.gmail.com> (raw) In-Reply-To: <AANLkTinSOUPZuDikusgnT99Qmqv8p+DNQu2Hu42N=yJb@mail.gmail.com> > -----Original Message----- > From: Andrei Warkentin [mailto:andreiw@motorola.com] > Sent: Tuesday, February 15, 2011 2:40 PM > To: Santosh Shilimkar > Cc: linux-arm-kernel@lists.infradead.org; linux- > omap@vger.kernel.org; Kevin Hilman; tony@atomide.com; Catalin > Marinas > Subject: Re: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way > operation can cause data corruption > > On Tue, Feb 15, 2011 at 1:14 AM, Santosh Shilimkar > <santosh.shilimkar@ti.com> wrote: > >> -----Original Message----- > >> From: Santosh Shilimkar [mailto:santosh.shilimkar@ti.com] > >> Sent: Monday, February 14, 2011 10:39 AM > >> To: Andrei Warkentin > >> Cc: linux-omap@vger.kernel.org; Kevin Hilman; tony@atomide.com; > >> linux-arm-kernel@lists.infradead.org; Catalin Marinas > >> Subject: RE: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way > >> operation can cause data corruption > >> > > [....] > > > > Why set by default to NULL, why not have a normal l2x0_set_debug > which > just does a write to L2X0_DEBUG_CTRL, and then just invoke the > function pointer when you wish to manipulate the DCR? That way you > don't need the runtime check, and it's just clearer, I think. > I though about it. There more changes in the file and hence I avoided it. This can be done though. > Also, why not do something like - > .... > do_stuff(); > #ifdef CONFIG_NEED_ERRATA_1234 > do_errata_stuff(); > #endif > do_more_stuff(); > ... > Which makes code completely ugly. > instead of - > > ... > #ifdef CONFIG_NEED_ERRATA_1234 > do_some_stuf() { > bar(); > } > #else > { > do_some_stuff() { > } > // nothing > } > We have already discussed this. The code becomes ugly. If you are interested in the reasoning, please check archives. Russell and Catalin has suggested above. If you understand the errata in first place, you could understand the comment. I let Catalin, Russell comment on it more, but unnecessary CONFIG options and polluting every function with #If, else checks don't make sense. Rest of your comments are related to this. Regards, Santosh
WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Santosh Shilimkar) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way operation can cause data corruption Date: Tue, 15 Feb 2011 15:00:11 +0530 [thread overview] Message-ID: <b10e9b5cef20f3f01035d7ffaa465387@mail.gmail.com> (raw) In-Reply-To: <AANLkTinSOUPZuDikusgnT99Qmqv8p+DNQu2Hu42N=yJb@mail.gmail.com> > -----Original Message----- > From: Andrei Warkentin [mailto:andreiw at motorola.com] > Sent: Tuesday, February 15, 2011 2:40 PM > To: Santosh Shilimkar > Cc: linux-arm-kernel at lists.infradead.org; linux- > omap at vger.kernel.org; Kevin Hilman; tony at atomide.com; Catalin > Marinas > Subject: Re: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way > operation can cause data corruption > > On Tue, Feb 15, 2011 at 1:14 AM, Santosh Shilimkar > <santosh.shilimkar@ti.com> wrote: > >> -----Original Message----- > >> From: Santosh Shilimkar [mailto:santosh.shilimkar at ti.com] > >> Sent: Monday, February 14, 2011 10:39 AM > >> To: Andrei Warkentin > >> Cc: linux-omap at vger.kernel.org; Kevin Hilman; tony at atomide.com; > >> linux-arm-kernel at lists.infradead.org; Catalin Marinas > >> Subject: RE: [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way > >> operation can cause data corruption > >> > > [....] > > > > Why set by default to NULL, why not have a normal l2x0_set_debug > which > just does a write to L2X0_DEBUG_CTRL, and then just invoke the > function pointer when you wish to manipulate the DCR? That way you > don't need the runtime check, and it's just clearer, I think. > I though about it. There more changes in the file and hence I avoided it. This can be done though. > Also, why not do something like - > .... > do_stuff(); > #ifdef CONFIG_NEED_ERRATA_1234 > do_errata_stuff(); > #endif > do_more_stuff(); > ... > Which makes code completely ugly. > instead of - > > ... > #ifdef CONFIG_NEED_ERRATA_1234 > do_some_stuf() { > bar(); > } > #else > { > do_some_stuff() { > } > // nothing > } > We have already discussed this. The code becomes ugly. If you are interested in the reasoning, please check archives. Russell and Catalin has suggested above. If you understand the errata in first place, you could understand the comment. I let Catalin, Russell comment on it more, but unnecessary CONFIG options and polluting every function with #If, else checks don't make sense. Rest of your comments are related to this. Regards, Santosh
next prev parent reply other threads:[~2011-02-15 9:30 UTC|newest] Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-12 11:29 [PATCH 0/5] ARM: omap4 related fixes for 2.6.39 Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-12 11:29 ` [PATCH 1/5] ARM: smp: Select local timers vs dummy timer support runtime Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-15 4:13 ` David Brown 2011-02-15 4:13 ` David Brown 2011-02-15 4:15 ` David Brown 2011-02-15 4:15 ` David Brown 2011-02-16 12:45 ` Santosh Shilimkar 2011-02-16 12:45 ` Santosh Shilimkar 2011-02-20 11:03 ` Russell King - ARM Linux 2011-02-20 11:03 ` Russell King - ARM Linux 2011-02-20 11:07 ` [PATCH 1/5] ARM: smp: Select local timers vs dummy timersupport runtime Santosh Shilimkar 2011-02-20 11:07 ` Santosh Shilimkar 2011-02-23 16:36 ` Russell King - ARM Linux 2011-02-23 16:36 ` Russell King - ARM Linux 2011-02-23 16:38 ` [PATCH 1/5] ARM: smp: Select local timers vs dummytimersupport runtime Santosh Shilimkar 2011-02-23 16:38 ` Santosh Shilimkar 2011-02-23 17:58 ` Santosh Shilimkar 2011-02-23 17:58 ` Santosh Shilimkar 2011-02-23 19:03 ` Russell King - ARM Linux 2011-02-23 19:03 ` Russell King - ARM Linux 2011-02-23 19:11 ` [PATCH 1/5] ARM: smp: Select local timers vs dummytimersupportruntime Santosh Shilimkar 2011-02-23 19:11 ` Santosh Shilimkar 2011-02-23 19:55 ` Russell King - ARM Linux 2011-02-23 19:55 ` Russell King - ARM Linux 2011-02-23 20:04 ` [PATCH 1/5] ARM: smp: Select local timers vsdummytimersupportruntime Santosh Shilimkar 2011-02-23 20:04 ` Santosh Shilimkar 2011-02-12 11:29 ` [PATCH 2/5] omap4: Enable ARM local timers with OMAP4430 es1.0 exception Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-14 21:08 ` Tony Lindgren 2011-02-14 21:08 ` Tony Lindgren 2011-02-18 18:11 ` Santosh Shilimkar 2011-02-18 18:11 ` Santosh Shilimkar 2011-02-12 11:29 ` [PATCH 3/5] ARM: l2x0: Errata fix for flush by Way operation can cause data corruption Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-12 17:50 ` Andrei Warkentin 2011-02-12 17:50 ` Andrei Warkentin 2011-02-12 17:59 ` Santosh Shilimkar 2011-02-12 17:59 ` Santosh Shilimkar 2011-02-12 23:17 ` Andrei Warkentin 2011-02-12 23:17 ` Andrei Warkentin 2011-02-14 5:08 ` Santosh Shilimkar 2011-02-14 5:08 ` Santosh Shilimkar 2011-02-14 19:33 ` Andrei Warkentin 2011-02-14 19:33 ` Andrei Warkentin 2011-02-14 21:06 ` Andrei Warkentin 2011-02-14 21:06 ` Andrei Warkentin 2011-02-15 7:14 ` Santosh Shilimkar 2011-02-15 7:14 ` Santosh Shilimkar 2011-02-15 9:10 ` Andrei Warkentin 2011-02-15 9:10 ` Andrei Warkentin 2011-02-15 9:30 ` Santosh Shilimkar [this message] 2011-02-15 9:30 ` Santosh Shilimkar 2011-02-16 12:32 ` Santosh Shilimkar 2011-02-16 12:32 ` Santosh Shilimkar 2011-02-16 15:53 ` Catalin Marinas 2011-02-16 15:53 ` Catalin Marinas 2011-02-16 15:58 ` Santosh Shilimkar 2011-02-16 15:58 ` Santosh Shilimkar 2011-02-18 12:02 ` Santosh Shilimkar 2011-02-18 12:02 ` Santosh Shilimkar 2011-02-12 11:29 ` [PATCH 4/5] omap2plus: omap4: Set NR_CPU to 2 instead of default 4 Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-14 21:09 ` Tony Lindgren 2011-02-14 21:09 ` Tony Lindgren 2011-02-12 11:29 ` [PATCH 5/5] omap4: Remove 'FIXME: omap44xx_sram_init not implemented' Santosh Shilimkar 2011-02-12 11:29 ` Santosh Shilimkar 2011-02-14 21:09 ` Tony Lindgren 2011-02-14 21:09 ` Tony Lindgren
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=b10e9b5cef20f3f01035d7ffaa465387@mail.gmail.com \ --to=santosh.shilimkar@ti.com \ --cc=andreiw@motorola.com \ --cc=catalin.marinas@arm.com \ --cc=khilman@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --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: linkBe 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.