From patchwork Thu Jul 20 12:51:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9854903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84E72602BA for ; Thu, 20 Jul 2017 12:51:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 765BC28756 for ; Thu, 20 Jul 2017 12:51:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B5A7287A0; Thu, 20 Jul 2017 12:51:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F0B528756 for ; Thu, 20 Jul 2017 12:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936441AbdGTMvQ (ORCPT ); Thu, 20 Jul 2017 08:51:16 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37299 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936208AbdGTMvP (ORCPT ); Thu, 20 Jul 2017 08:51:15 -0400 Received: by mail-wm0-f68.google.com with SMTP id m4so3435916wmi.4 for ; Thu, 20 Jul 2017 05:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=yXasxfPgY5S5FhwjOQSeiM3Js5lKCMp/Sru3Yd1M+Fs=; b=SzsU6NMbKoF/BiDfgApb2vooDS+acqinebPTloo7NCPpRGFR+U/k5XlVJSKbX1O5Ej 25SXX0kpYbQPcNrXIWJMeqnhHTFJN8qGQ0Mrb3Gvg3JUNdtiEwBXDjWpQ5vUvG4njJvD UF6MdhpY/NPwLoICCG3si77IbIYbOknLsRXxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yXasxfPgY5S5FhwjOQSeiM3Js5lKCMp/Sru3Yd1M+Fs=; b=KqaxZZ4KoKN6hF25GxMok3QM3MXSd4z3AQG4IUhrFKC3514/HUAnHgTgKMMSJuhoHn B09c3AyIcK8TzTJUPVYw5Oy5EixnDvo/b0VryQowP7ce/h360n5L/bRTFeUbg6OziZMz gUWYl8t5Y3xb8kluAYMkhrO4ULQyykseFzNJgLENNKYAX/zJ7DX2vn0yyQ7+4NybBD0f k08stsvq/XrFpoiP6cMO3/RbieWfjOYp2TGtmhlsOi17E8ytGuv8W/AagrK85NjNP49B 4IvF4HLsxhwxpCPSWVhwV4KyPxo1yEePf5NaMfF2Y7QPIU/pH8qUADRKNA6APJTQXIJO HhAQ== X-Gm-Message-State: AIVw1124ldXfk4iVrB8P4rH4JmAiqsynpfE2HyusGETyDTEePRkUIBU7 kE1eUf364teZD3W4+7E= X-Received: by 10.80.137.220 with SMTP id h28mr1633931edh.153.1500555074179; Thu, 20 Jul 2017 05:51:14 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id g32sm1443388edc.69.2017.07.20.05.51.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 05:51:13 -0700 (PDT) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , Daniel Vetter , Daniel Vetter , Sumit Semwal , Gustavo Padovan , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH] dma-fence: Don't BUG_ON when not absolutely needed Date: Thu, 20 Jul 2017 14:51:07 +0200 Message-Id: <20170720125107.26693-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It makes debugging a massive pain. Signed-off-by: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Reviewed-by: Lucas Stach --- drivers/dma-buf/dma-fence.c | 4 ++-- include/linux/dma-fence.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 56e0a0e1b600..9a302799040e 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -48,7 +48,7 @@ static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(0); */ u64 dma_fence_context_alloc(unsigned num) { - BUG_ON(!num); + WARN_ON(!num); return atomic64_add_return(num, &dma_fence_context_counter) - num; } EXPORT_SYMBOL(dma_fence_context_alloc); @@ -172,7 +172,7 @@ void dma_fence_release(struct kref *kref) trace_dma_fence_destroy(fence); - BUG_ON(!list_empty(&fence->cb_list)); + WARN_ON(!list_empty(&fence->cb_list)); if (fence->ops->release) fence->ops->release(fence); diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index 9342cf0dada4..171895072435 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -431,8 +431,8 @@ int dma_fence_get_status(struct dma_fence *fence); static inline void dma_fence_set_error(struct dma_fence *fence, int error) { - BUG_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)); - BUG_ON(error >= 0 || error < -MAX_ERRNO); + WARN_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)); + WARN_ON(error >= 0 || error < -MAX_ERRNO); fence->error = error; }