Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp4208365rwi; Wed, 2 Nov 2022 08:04:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yZ6qhXE48Xe2hO3puhOAz1S4bfjbOu2sHd7GePYzmTUzgmdGCiBym9mSZffyYU2Rjs4gm X-Received: by 2002:a05:6a00:2350:b0:541:b5bf:2774 with SMTP id j16-20020a056a00235000b00541b5bf2774mr24924012pfj.28.1667401452337; Wed, 02 Nov 2022 08:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667401452; cv=none; d=google.com; s=arc-20160816; b=zAIzzTFs9EnY31PqQgxxiwC9mVb0oAXbFUOi/cyaw92qEITYlDx1yYCNzrmj4i7Fla HJCaC07QfCcu2P/xltqWiCzOQXAtCmYoTUyL4E9RJjWGsLZXdWQexTX85xRqm7ryd7UW MhwljyHx356dwWWzK6M8J8OepGVZM33kqiG8aPcXevFI+gDJLiaqgdS16YeoALvab0Lg MJlfbhsC4xydBo67OxpZ3SrUbOGCDb55bm2GGXRFO8SuRWd2tH4oLn85Ft/hpAr+oH9X 46PgxYNYqQHZmkIHv9533h+doDae7myyDz5SfGuLzycsEeonicAFaT+KNXjqd311gOcs eL/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bf3yURUwBCjf6ClwtBJUxV5M8oem+9UEYQWB1N18A10=; b=RqiJZzNF8GnMoi0fKEIMlClX8O7BtCWKFCp7iG6QmS5Bi+XFwGPX0feqJKAB+QNNP4 ZIozjY57qgMIHx4yv1eg3lUjPDVgJSG2cyRawm8CRJJmF6SLXBu/ao0BSvkpgjL9F3av Rq+a/lbi4VQaB9fE6ICGl27S9nnyDhcgHRT+5LOAlnZovFpc65c0xAOzbL6frYYeUTHw hZjMxbWSGoStIGDCjJSOLp30+uQk7vculJsBIgym7AC9DLo0AAEIWsp1o1axCUfKkm8p Sft5kIczDQXehkInBv0lPhQOyEG3A2DpOBlmOBLlgxcfhNnCD9fOLhETjm2+D2RUdzGO q2gw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a635201000000b0046ace26186esi15099789pgb.117.2022.11.02.08.03.51; Wed, 02 Nov 2022 08:04:12 -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=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231577AbiKBOUB (ORCPT + 98 others); Wed, 2 Nov 2022 10:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbiKBOTv (ORCPT ); Wed, 2 Nov 2022 10:19:51 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B2A15FE2; Wed, 2 Nov 2022 07:19:47 -0700 (PDT) Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A2DEL5x007910; Wed, 2 Nov 2022 10:19:45 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3kjn9tusn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 10:19:45 -0400 Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 2A2EJilp003528 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 2 Nov 2022 10:19:44 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 2 Nov 2022 10:19:43 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 2 Nov 2022 10:19:43 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 2 Nov 2022 10:19:43 -0400 Received: from rbolboac.ad.analog.com ([10.48.65.139]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 2A2EJWOn005631; Wed, 2 Nov 2022 10:19:38 -0400 From: Ramona Bolboaca To: , , CC: Ramona Bolboaca Subject: [PATCH 1/8] iio: accel: adis16201: Fix deadlock in probe Date: Wed, 2 Nov 2022 16:18:36 +0200 Message-ID: <20221102141843.122182-2-ramona.bolboaca@analog.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221102141843.122182-1-ramona.bolboaca@analog.com> References: <20221102141843.122182-1-ramona.bolboaca@analog.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: HRg_R_olgPtKTyfxXBsvD84gGyet-OtH X-Proofpoint-ORIG-GUID: HRg_R_olgPtKTyfxXBsvD84gGyet-OtH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_10,2022-11-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 spamscore=0 impostorscore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211020091 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Use __adis_initial_startup instead of adis_initial_startup to avoid deadlock. When using adis_initial_startup mutex_lock is called twice, without releasing it (once inside adis_initial_startup and once inside adis_enable_irq). Fixes: 100bfa38c8cb ("iio: imu: adis[16480]: group RW into a single lock in adis_enable_irq()") Signed-off-by: Ramona Bolboaca --- drivers/iio/accel/adis16201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c index dfb8e2e5bdf5..d054721859b3 100644 --- a/drivers/iio/accel/adis16201.c +++ b/drivers/iio/accel/adis16201.c @@ -281,7 +281,7 @@ static int adis16201_probe(struct spi_device *spi) if (ret) return ret; - ret = adis_initial_startup(st); + ret = __adis_initial_startup(st); if (ret) return ret; -- 2.25.1