Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp4206578rwi; Wed, 2 Nov 2022 08:03:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40ZhHK+aJkLdEFYG5RcbtETurv5Wu6DeAbypEVNig2qwBItxqzsJLDCWQ1tubMvy1j6Zya X-Received: by 2002:a17:902:ce0d:b0:178:bd1e:e8da with SMTP id k13-20020a170902ce0d00b00178bd1ee8damr25589551plg.103.1667401399908; Wed, 02 Nov 2022 08:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667401399; cv=none; d=google.com; s=arc-20160816; b=zJLMVOVPDourEcQFu3L5qUrCFwK9xnXA64OA78mCd8xkxWVOaIMVnWRorsgl/j9ueZ Vws7A17JKzPnBfUShZT1j41AVkypDnZcLP7r/3VxcnVrmf00ma2YlZmSAbW7teD0V4uG S/GAEs9h6pbsuT7ghTyIhMIed/aAwg0ielo/SGxQx485opWBwb+MxlM3vJcu1Z7kanEH CwOjiCgV41JbSElHUzWT1ptEmtnKKNHOasOFMa0SpIbfLr35iY9fVjnzLxqhSZ3ux3N4 FBMFhhNa+W0WDcqL9lJ1a1kxzdMynTGLybipXcc2A71tjJtvpipSd4MlDrZ5GnVndMNY Nm2A== 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=ZTCzzUlAs7lP0WPgchiZSQjLw3mn6mgVX0yuFMEKxro=; b=qS6ArJbAIF8UP9RIqp9ky2oZiHzbg/RqbzMFK1tiObVMVEKIkowAXvTukvZC3xb02o S7KO6ApiMkJcyNuLUUBPu5QVR+OgJICHlaapDyOz7KsYx+1gUh+fDGcT9dXoMGBbcCZx Eoka4kZXOE+dTpuI4gESf39TECmnQP7dKDsNdHYnAQtr7JJxCEFrUoSfEJtx0DEJPzjP Ac6h7ZZPY4T0bsES1uOSIyBTwOEYz+23v7N6VyqH6p4eTCWn1qC/xGCBovpJbZnD41WX yjuK1KzNJ+Nb1HCWZ5DfvFaanVONws56cuDcS6zrEZng/0mLbNkrbVE3uxtsj5P2Er1H 4IEA== 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 g6-20020a655806000000b0046ebb8fc292si16501278pgr.7.2022.11.02.08.03.00; Wed, 02 Nov 2022 08:03:19 -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 S231583AbiKBOUY (ORCPT + 98 others); Wed, 2 Nov 2022 10:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231487AbiKBOTw (ORCPT ); Wed, 2 Nov 2022 10:19:52 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E203322B1C; Wed, 2 Nov 2022 07:19:50 -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 2A2DEL63007910; Wed, 2 Nov 2022 10:19:49 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3kjn9tusnp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 10:19:48 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 2A2EJlYl017357 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 2 Nov 2022 10:19:47 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX8.ad.analog.com (10.64.17.5) 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:46 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 2 Nov 2022 10:19:46 -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 2A2EJWOp005631; Wed, 2 Nov 2022 10:19:40 -0400 From: Ramona Bolboaca To: , , CC: Ramona Bolboaca Subject: [PATCH 3/8] iio: gyro: adis16136: Fix deadlock in probe Date: Wed, 2 Nov 2022 16:18:38 +0200 Message-ID: <20221102141843.122182-4-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: E5fOyeBy_VRmL5RvVSq-YiL0LCvpRknu X-Proofpoint-ORIG-GUID: E5fOyeBy_VRmL5RvVSq-YiL0LCvpRknu 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/gyro/adis16136.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/adis16136.c b/drivers/iio/gyro/adis16136.c index 71295709f2b9..c95cf41be34b 100644 --- a/drivers/iio/gyro/adis16136.c +++ b/drivers/iio/gyro/adis16136.c @@ -429,7 +429,7 @@ static int adis16136_initial_setup(struct iio_dev *indio_dev) uint16_t prod_id; int ret; - ret = adis_initial_startup(&adis16136->adis); + ret = __adis_initial_startup(&adis16136->adis); if (ret) return ret; -- 2.25.1