From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77C12C433F5 for ; Tue, 10 May 2022 02:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234933AbiEJCrm (ORCPT ); Mon, 9 May 2022 22:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233220AbiEJCrh (ORCPT ); Mon, 9 May 2022 22:47:37 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19A827F11C; Mon, 9 May 2022 19:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652150621; x=1683686621; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=InTny3n7yeTKHBypR3lvOVYf18pf04hsVskSXrNlYf0=; b=yOmnkI6MWqYkfM8CbKLTrSW4rWd1a1WLJcVMTCQcVMw18WZGOAAT+z2a bJwMzLNfupEWZASLBUpHp5ey72cHmglxT3igTJNMLC2d+O2qlodbhZrBa 7d/LHUAxt/FMKLHVYXW1GLEvQd3u/YRc65TuIS+JUBVT8s/30XtVidGVA g=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 09 May 2022 19:43:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 19:43:41 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 19:43:41 -0700 Received: from [10.216.42.221] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 19:43:37 -0700 Message-ID: <51bc6d33-c5f5-2a6e-fd83-ffebbe2e0202@quicinc.com> Date: Tue, 10 May 2022 08:13:31 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] dma-buf: call dma_buf_stats_setup after dmabuf is in valid list Content-Language: en-US To: "T.J. Mercier" CC: Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , Hridya Valsaraju , , Greg Kroah-Hartman , , , , References: <1652125797-2043-1-git-send-email-quic_charante@quicinc.com> From: Charan Teja Kalla In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Mercier, On 5/10/2022 3:19 AM, T.J. Mercier wrote: > On Mon, May 9, 2022 at 12:50 PM Charan Teja Kalla > wrote: >> From: Charan Teja Reddy >> >> When dma_buf_stats_setup() fails, it closes the dmabuf file which >> results into the calling of dma_buf_file_release() where it does >> list_del(&dmabuf->list_node) with out first adding it to the proper >> list. This is resulting into panic in the below path: >> __list_del_entry_valid+0x38/0xac >> dma_buf_file_release+0x74/0x158 >> __fput+0xf4/0x428 >> ____fput+0x14/0x24 >> task_work_run+0x178/0x24c >> do_notify_resume+0x194/0x264 >> work_pending+0xc/0x5f0 >> >> Fix it by moving the dma_buf_stats_setup() after dmabuf is added to the >> list. >> >> Fixes: bdb8d06dfefd ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs") >> Signed-off-by: Charan Teja Reddy > Tested-by: T.J. Mercier > Acked-by: T.J. Mercier > Thanks for the Ack. Also Realized that it should have: Cc: # 5.15.x+ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD806C433FE for ; Tue, 10 May 2022 06:49:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2A4E10EF43; Tue, 10 May 2022 06:48:51 +0000 (UTC) Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5299510E03F for ; Tue, 10 May 2022 02:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652150625; x=1683686625; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=InTny3n7yeTKHBypR3lvOVYf18pf04hsVskSXrNlYf0=; b=ON71lEWx7mghutuiVCTO5SsDDB/l6tbsql9bWuy1VHk2vzzOsGMfOClN 6QbS9ZXprcm+EQcHfXT5RkeCJDrWfQ1eVf+D7LLv4kE4XQ3kejZwuFNQr fqisUfDD8pMnm5su6naUPObVKq+t5/MBpFz+BLgHa5xjI+jHukw1RMNTd 4=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 09 May 2022 19:43:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 19:43:41 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 19:43:41 -0700 Received: from [10.216.42.221] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 19:43:37 -0700 Message-ID: <51bc6d33-c5f5-2a6e-fd83-ffebbe2e0202@quicinc.com> Date: Tue, 10 May 2022 08:13:31 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] dma-buf: call dma_buf_stats_setup after dmabuf is in valid list Content-Language: en-US To: "T.J. Mercier" References: <1652125797-2043-1-git-send-email-quic_charante@quicinc.com> From: Charan Teja Kalla In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Mailman-Approved-At: Tue, 10 May 2022 06:48:43 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?UTF-8?Q?Christian_K=c3=b6nig?= , linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , Hridya Valsaraju , Sumit Semwal , linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello Mercier, On 5/10/2022 3:19 AM, T.J. Mercier wrote: > On Mon, May 9, 2022 at 12:50 PM Charan Teja Kalla > wrote: >> From: Charan Teja Reddy >> >> When dma_buf_stats_setup() fails, it closes the dmabuf file which >> results into the calling of dma_buf_file_release() where it does >> list_del(&dmabuf->list_node) with out first adding it to the proper >> list. This is resulting into panic in the below path: >> __list_del_entry_valid+0x38/0xac >> dma_buf_file_release+0x74/0x158 >> __fput+0xf4/0x428 >> ____fput+0x14/0x24 >> task_work_run+0x178/0x24c >> do_notify_resume+0x194/0x264 >> work_pending+0xc/0x5f0 >> >> Fix it by moving the dma_buf_stats_setup() after dmabuf is added to the >> list. >> >> Fixes: bdb8d06dfefd ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs") >> Signed-off-by: Charan Teja Reddy > Tested-by: T.J. Mercier > Acked-by: T.J. Mercier > Thanks for the Ack. Also Realized that it should have: Cc: # 5.15.x+