Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15989141rwd; Mon, 26 Jun 2023 04:22:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YsGv0l7yjYhZACV3OUlxKn4055B0/vl6oeF2OBs4/rJkaz+pTo38wE17LQ4sFEMHSpAQF X-Received: by 2002:a05:6a00:84e:b0:66a:3289:5c03 with SMTP id q14-20020a056a00084e00b0066a32895c03mr14514090pfk.33.1687778576456; Mon, 26 Jun 2023 04:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687778576; cv=none; d=google.com; s=arc-20160816; b=zUHsKP7VSe7YchjjqBlt0RYhSd56tNksta0lxzAsZ6neKeB4T1NrAVlb3e8d4D8HfZ 2z0Su9ykgUIGyGyXiShE0UsdNSwNb6l2upKHyjm7zyFVC/chFN+hV1ZV7O+tbif7We/N 92EvW6RdOLdYzSOBBVCggjueqf3W0k/VSGq4Oikm5di45mJMnN4ycNLVomNvKYyQ/uID dM2xoKvGa5YSXRhH9BCgPMtuj5dykIZiDri43UvBpI10yZo+khoJTo1MqqYqpN0n+1qp k/Ov9pp6cRnbukeDr/RtrM+k6BW2I92OF5ax/FgLtvgsmqtdOyeBQquaosSs7rQTnBND matQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=g6u4p45x7AS5f7ZTkywRja1me7ghXu++p+D3mTItGBs=; fh=5FHHPoJNgBMOED62Fi/DP/wnMuVrMi60Jzr2OkEZ+vI=; b=oj0iTB3PqKKQGKSsrf09g38WGbgr07INA6bnMrb/hNHVlYcYHHiBawzATeR8aRbuOM 5puJ7R2zYPv0boLQRf3BEW6xvRjipjBsl4Oq4buHhuxS/CYSQBMZJPldq9ivUBk6GBNR 2IDuEOYMF0JiPPw2TgnBU59gpx3jI7z8FkA42qzERV7CvjFMZMVnjaXz63lS+mmGLtkF 9Iz1mVHOEEbRmS0lYbYnwIl4u5php9GXXqVT5w1xvfJ9HljF2iTKoTn6tcPr1/yY0gxb vj9zuM+ouCHRsG+hSmt+ToDhqw8xVR96P4JA3U1dIIxh2tFe8e8s5eVobseziJ+DQbli xUBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cu12-20020a056a00448c00b00672ad8f038csi3054679pfb.184.2023.06.26.04.22.44; Mon, 26 Jun 2023 04:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjFZLEN (ORCPT + 99 others); Mon, 26 Jun 2023 07:04:13 -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 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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