From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Mon, 28 Aug 2017 20:23:12 +0200 Subject: [U-Boot] [PATCH] video: ipuv3_fb: skip IPU shutdown if IPU was not enabled before In-Reply-To: <1d1ff220-f225-7d32-061f-6b9c738a52bf@denx.de> References: <1503666643-15848-1-git-send-email-agust@denx.de> <1d1ff220-f225-7d32-061f-6b9c738a52bf@denx.de> Message-ID: <20170828202312.3f7e3ec7@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefano, On Mon, 28 Aug 2017 18:54:39 +0200 Stefano Babic sbabic at denx.de wrote: ... > > + /* > > + * Check if IPU clock was enabled before. Won't access > > + * IPU registers if clock is not enabled. > > + */ > > + reg = readl(&mxc_ccm->CCGR3); > > + if ((reg & MXC_CCM_CCGR3_IPU1_IPU_MASK) == 0) > > + return; > > > > It looks to me quite weak to simply check if clock is gated. On some > board clock is gated even if IPU is not active. Do you have a way > reading inside IPU itself ? Then we can better decide if it was really > acrive. For example, checking if ipu_enable_channel() was called (and > DMA registers are set). we cannot access IPU registers when IPU clock is disabled (register access will hang the CPU). Thanks, Anatolij