From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH] drm/i915: add check for valid init_clock_gating-pointer Date: Thu, 16 Jun 2011 08:15:57 -0700 Message-ID: <20110616081557.5f64f603@jbarnes-desktop> References: <1308176679-13766-1-git-send-email-w.sang@pengutronix.de> <20110615153000.00438750@jbarnes-desktop> <20110616132846.GE23579@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy5-pub.bluehost.com (oproxy5-pub.bluehost.com [67.222.38.55]) by gabe.freedesktop.org (Postfix) with SMTP id 47D589E7FD for ; Thu, 16 Jun 2011 08:16:08 -0700 (PDT) In-Reply-To: <20110616132846.GE23579@pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Wolfram Sang Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Thu, 16 Jun 2011 15:28:46 +0200 Wolfram Sang wrote: > > > Commit 6067aa (drm/i915: split clock gating init into per-chipset > > > functions) unconditionally calls the newly created > > > init_clock_gating-pointer. There is one case, however, where it does > > > not get set: > > > > > > if (HAS_PCH_SPLIT(dev)) { > > > ... > > > } else > > > dev_priv->display.update_wm = NULL; > > > } > > > > We'll only hit this path on non-existent hardware. Since a clock > > gating routine is required I'd rather just see the panic and add a new > > routine at that time (i.e. what we normally do during bringup). > > How about BUG_ON(!ptr) in the init-routine for a bit more grace? And/or > a warning in the else-block? It seems to happen to users... Yeah, a BUG_ON would be fine. -- Jesse Barnes, Intel Open Source Technology Center