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 35C87EB64DC for ; Mon, 26 Jun 2023 11:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbjFZLEO (ORCPT ); Mon, 26 Jun 2023 07:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbjFZLDv (ORCPT ); Mon, 26 Jun 2023 07:03:51 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18A7E5; Mon, 26 Jun 2023 04:03:46 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="447625173" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="447625173" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2023 04:03:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="786115027" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="786115027" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 26 Jun 2023 04:03:44 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qDk0U-006jwT-2z; Mon, 26 Jun 2023 14:03:42 +0300 Date: Mon, 26 Jun 2023 14:03:42 +0300 From: "andy@kernel.org" To: YE Chengfeng Cc: Linus Walleij , Bartosz Golaszewski , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/2] gpiolib: cdev: Fix &lr->wait.lock deadlock issue Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 10:39:56AM +0000, YE Chengfeng wrote: > linereq_put_event is called from both interrupt context (e.g., When we refer to the functions we use func() format. This applies to the entire commit message and to the other patch in the series. > edge_irq_thread) and process context (process_hw_ts_thread). > Therefore, interrupt should be disabled before acquiring lock > &lr->wait.lock inside linereq_put_event to avoid deadlock when > the lock is held in process context and edge_irq_thread comes. > > Similarly, linereq_read_unlocked running in process context > also acquies the same lock. It also need to disable interrupt > otherwise deadlock could happen if the irq edge_irq_thread > comes to execution while the lock is held. > > Fix the two potential deadlock issues by spin_lock_bh() and > spin_lock_irq() separately. ... So, I suggest to fix the commit messages and send a v2 as a real series (--thread implied). -- With Best Regards, Andy Shevchenko