From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Thu, 04 Apr 2013 10:29:34 +0200 Subject: [U-Boot] [PATCH] spi: mxc_spi: Fix ECSPI reset handling In-Reply-To: <515C5EDC.8000109@gmail.com> References: <1363853024-26432-1-git-send-email-dirk.behme@de.bosch.com> <515BF27F.2030404@denx.de> <515C5EDC.8000109@gmail.com> Message-ID: <515D39EE.6000608@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/04/2013 18:54, Dirk Behme wrote: > Am 03.04.2013 11:12, schrieb Stefano Babic: >> On 21/03/2013 09:03, Dirk Behme wrote: >>> Reviewing the ECSPI reset handling shows two issues: >>> >> >> Hi Dirk, >> >> >> agree completely, only a very minor question.. >> >> >>> + >>> + reg_ctrl = reg_read(®s->ctrl); >> >> As you says, it makes no sense to read back the value of the register, >> also because reg_ctrl is overwritten some lines later ;-) > > Hmm, sorry if I overlooked something, but we have to initialize the > variable 'reg_ctrl' with the recent register content because it is first > used and _then_ overwritten in the next step: > > reg_ctrl = (reg_ctrl & ~MXC_CSPICTRL_SELCHAN(3)) | > MXC_CSPICTRL_SELCHAN(cs); What I meant is that we know already the value of the register. Your patch set it to MXC_CSPICTRL_EN, and this could be put in or later when you set again the register ;-) Nevermind, your patch is ok and fixes a real problem. What I commented are more or less style-related. I merge it and push for the release. Best regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================