Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1569728pxb; Tue, 8 Feb 2022 22:37:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaSY5RAQhxPgV+QA5BXLXrSmUlJi2sQwz2N0TF7xBmYyy57ewlwr/DGKvsJCcrRNlxHsmh X-Received: by 2002:aa7:9e4a:: with SMTP id z10mr840384pfq.53.1644388633495; Tue, 08 Feb 2022 22:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644388633; cv=none; d=google.com; s=arc-20160816; b=RfPvwmbgW1nB9IPLIUQAuh2ZC1T+ekPprlnk5B5WlCW++iYYiu73j3bPR/CkEYyfVS DJmNAUjIDE0Sewubs9n3wUpk7dsZm56eZpPq8iQBphN0/U8jfgc8HjFe/B5vlvlXBRiI S5zbFsJRpOpaOqCcrx/+NiFlB7i9M4gu2ysZdxhIguZPNsPpTRl5xItA4fAlp8RI9I14 cB1p8yjSwVdzy26MAYdZgxIt0GZXDW8/6SPMfBKL00P7n+HKB2SYQS5PadPuSGxbozCy z6kJTiyMLePIowkh83UJfOTpeQBUFyl6k31LMW1wa4O0/UOEQwuoXboDhvXTsd4LbFnB JnlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:cc:subject:from:to :dkim-signature; bh=yGdvePtA5J3T6k1Kw9exNjT0dNJZhtguuHy3n/iDjLY=; b=xYCopQlp1JeNx9RSkWtDfqtacFFGIzte7fizlNt6nIT5MeEwSClJxJoTgbGLZGwAP7 Tq0brtC+7YzbX9aOyHrfQlKQiJZGTqafU5XS47Kx1tIvn58YRW2aZ5sQ1FEEcL+uto4M 3m6K/mHVsxVT7D+532K3+g56x9TETtvxcyxwm6SwvojcmvX6qCmOs/KIA6lk5zMHK3aG R5Gwks1pW8RNQ4XpeprO2o9VLfKTZJL0hgzr1ZSlzqtL0ioeXn1bGfh2oKpnetbLM0jE onp7Owyj/5Jri5LdDo4UO6CWnjaM4r/3uB93KK67GjIfUPjQl3BWXJLL+DXKExk5T09V GH2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hr8wTdnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v15si13239776pfn.62.2022.02.08.22.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 22:37:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hr8wTdnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45400E0332D8; Tue, 8 Feb 2022 22:15:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358842AbiBHLgm (ORCPT + 99 others); Tue, 8 Feb 2022 06:36:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiBHLXG (ORCPT ); Tue, 8 Feb 2022 06:23:06 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2AEC03FEC0; Tue, 8 Feb 2022 03:23:05 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id m7so15894133pjk.0; Tue, 08 Feb 2022 03:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:from:subject:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=yGdvePtA5J3T6k1Kw9exNjT0dNJZhtguuHy3n/iDjLY=; b=Hr8wTdnT0O/0KmLlu487Qb/smC8jLqUcQsEX+G/dEgowpk3OTwYmXeDqiUOJpYrqKO QY/XWRsLEwFCRIqQ0QabaOlDkfBiAK0dr3Dr8VOxX+l/iOiWzi6OngzUa8SrrdwSH02m IdF0zT5OuQbiB3Cic3wycyEzIi6jMlK1Lekth1+wi/TQp55IwHgucgjpKn2F04xedVC1 inSUvte4ZyZjszTKJtllQL4VjLvAzuVLeJnzulIZdeznsr29VzrZ55nyXc5wTlR7JzL2 XwBPQihX1k8gBTfbraXTFuz35qX5YIgJdxGwF6tnkmRLa+8Cifcl/8knjpJvdZXFcced SVlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:from:subject:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=yGdvePtA5J3T6k1Kw9exNjT0dNJZhtguuHy3n/iDjLY=; b=Wl8/C7WZMEicbmD4s45A2IA/f9o7z7wvO+rY5kPwElHnlDP54c91VUnIzStB3rVxtB RnAe56Bz7kaHymY8PXS6TOFJXQr1oxpKmggSpwSZzN647uUT+lxTTHTiwklkpn4WlEL8 k4umEhVyT8pXbFado9Qy6eoLW+5TOPkA4J9u4F2bUCdZjaQhotsA32/f9Hg8teV4gv6I Q6h9ega0eing1uV1yGpU6XrNkQfFWt+ULigVpwNLuiMpWqU30xlLW0/Fd79gYcD7oi1c scD8bg9ccN/6lXb3wCQfuNVLGtyuyfXuFRzHHHyagJfYC+4LjI7agDjHjHCsKUgdLxHO cY0Q== X-Gm-Message-State: AOAM5320Xl9KScxlmX/BJi1atNJzM2c4zhx8EfQ3HABsLyxAn72X+LTI BFeNQzFYRcrK0e/PTdVy2JbTcrUxlnY= X-Received: by 2002:a17:902:cec4:: with SMTP id d4mr3923507plg.158.1644319384555; Tue, 08 Feb 2022 03:23:04 -0800 (PST) Received: from [192.168.1.100] ([166.111.139.99]) by smtp.gmail.com with ESMTPSA id c7sm15437310pfp.164.2022.02.08.03.23.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 03:23:03 -0800 (PST) To: njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com From: Jia-Ju Bai Subject: [BUG] scsi: qedi: possible ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() Cc: linux-scsi@vger.kernel.org, linux-kernel Message-ID: Date: Tue, 8 Feb 2022 19:23:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hello, My static analysis tool reports a possible ABBA deadlock in the qedi driver in Linux 5.16: qedi_process_tmf_resp()   spin_lock(&session->back_lock); --> Line 201 (Lock A)   spin_lock(&qedi_conn->tmf_work_lock); --> Line 230 (Lock B) qedi_process_cmd_cleanup_resp()   spin_lock_bh(&qedi_conn->tmf_work_lock); --> Line 752 (Lock B)   spin_lock_bh(&conn->session->back_lock); --> Line 784 (Lock A) When qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() are concurrently executed, the deadlock can occur. I am not quite sure whether this possible deadlock is real and how to fix it if it is real. Any feedback would be appreciated, thanks :) Reported-by: TOTE Robot Best wishes, Jia-Ju Bai