Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp274060rwb; Thu, 27 Jul 2023 12:30:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGibLD2zRepueyKLo2Xv/CHjea8XH0scelNxSzlhW3dXOf+gUEPsRYVB2ZZ6X+mKUuS/8jF X-Received: by 2002:a17:902:d2cd:b0:1b8:5bcc:2ffc with SMTP id n13-20020a170902d2cd00b001b85bcc2ffcmr306867plc.45.1690486244897; Thu, 27 Jul 2023 12:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690486244; cv=none; d=google.com; s=arc-20160816; b=hy+oLT+D+GQ/rjacz93DldRFlG2+FPTSkTIdbPN443VHNEyQlfyr2SfuFjLzu2Fm/G SmVen0Gy3EoDUgl0Ry5z3Hh7BvjfrHhJGNy6Ps62zmqLOPy6KHkkzTFHOOUTKezDvjAw Jybk4WxSuDfd5NHFib/haLJKKRVBTi2vCoW3qCIHhiMMuGvkbre//2iLUB8qaic4D7WS qaKiPSKZhe8rS0lycArAWGX1GP3QfVHAwvQ9hCSq0iIYDyRRAaocCMKE5AOV2adVWyob PvW3oLCE4GoYJ/Zng+WfDFsAM5Zu70UMU4ArP6kGk7zfQ5qnhenK4lIqDKMF2+BunXuO xaKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JMmySb+Q6S5Atcp9T/zvvEGDiyAp0JEH2fPGYD022Lg=; fh=3rj6BqudDkns51CxytWMIwIsQLfcERrhqLtWUS57kxg=; b=vQfk2pr5kYn9XJUdfaCwduQIgVW2aa8iypAKmWvAMBJirUleWuEQ26aALI5uWqxbK/ ZDhHxcH0gNZDozxALhJrAJNd2lM++V5TVuDUpii00AS87FHVxtoXhzoji1W5DzVlHBAo weFPu7bk9xhS64tMHKN4hUh/Rjct/+I51fooA0Xj6dUw7JhOyDj22kv3UycwYeQ6fc73 YS+8eSv8OrIAPQkG6kMbpZ4PAnQV86A2Ze7QuAFzB8+0bILAXbSgN9FJyUbjqb02+NIv c2XN0soYH+3nZ4d+7PpMfMbazB1Au+mPVqleWMQjA1cLGiRLTlTkoL9kzDko+1kcGfY2 ZTNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=fX4AohXM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz6-20020a170903430600b001bb02e4b739si1628795plb.475.2023.07.27.12.30.32; Thu, 27 Jul 2023 12:30:44 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=fX4AohXM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbjG0Rxh (ORCPT + 99 others); Thu, 27 Jul 2023 13:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjG0Rxg (ORCPT ); Thu, 27 Jul 2023 13:53:36 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F45C2685 for ; Thu, 27 Jul 2023 10:53:35 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbea14700bso12598505e9.3 for ; Thu, 27 Jul 2023 10:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1690480413; x=1691085213; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JMmySb+Q6S5Atcp9T/zvvEGDiyAp0JEH2fPGYD022Lg=; b=fX4AohXM+zZZCObdnIFEK374Lg1k7oUl/EDyfeqj73YnmRuJ+GvEzPKh5ptFK+K3Db a66T8MuCGL1sC63DsldIzP3LwGb76jNuPSzy8TSYB8h4huqTLid4NTAZUy1A5uyjq8/K OxIpSDViXzJUD5mNlyseLsX4ga0QWqEy7lnA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690480413; x=1691085213; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JMmySb+Q6S5Atcp9T/zvvEGDiyAp0JEH2fPGYD022Lg=; b=gUnZeajPwlShFAeMdTL8ezKyibolRn1vO7+IY3nbelmBgO1wHKzjY/J4ARV3FS7j1k NZ0iPrLyQLpwXYLcRXH6T010U1YThTdVweHff+nZTY87tTxW0C7NRQxC2oZAAWmWPFOK QSNTR9UPmal7CsumhcqOyDzae2Hw5/2Cj9yaR6c9fvK38m9IIYcPOnzXGQRrT+71q95T Yt9feT8hdI9ac7jtVH4hvKGZ+uf00FBGXJkxn1vIKw2Motq3L2Y0rUqPLb6T0EhMojNY RkrN7xXV6tbIWqPGB87+1h7BPDs49kigMLHDBLUirGgSGLO3GxyRXYUsxSsWJ3ALTiE3 s/Ng== X-Gm-Message-State: ABy/qLZEFEvOFgAexZ7Dt6Jv+3LggIAUbX/55oTtfRYXUDa1sHFoiuuD pJAEH5A5T4FuxbURh6iOvCEjUXq6BdfsxPHeRfJ8cC7lzN2zsh0tjvuxi5OLdY3QK4U10I+Cy47 FJj5OhdfQTpPD/sYU/i4z5ReHN7agdO0= X-Received: by 2002:a5d:4942:0:b0:314:d19:fc31 with SMTP id r2-20020a5d4942000000b003140d19fc31mr2204585wrs.51.1690480413442; Thu, 27 Jul 2023 10:53:33 -0700 (PDT) MIME-Version: 1.0 References: <20230726155342.51623-1-dg573847474@gmail.com> In-Reply-To: From: Justin Tee Date: Thu, 27 Jul 2023 10:53:21 -0700 Message-ID: Subject: Re: [PATCH] scsi: lpfc: Fix potential deadlock on &phba->hbalock To: Chengfeng Ye Cc: james.smart@broadcom.com, dick.kennedy@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000928c7e06017ba4da" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 --000000000000928c7e06017ba4da Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chengfeng, That=E2=80=99s still a unlikely scenario: /* Check device state for handling interrupt */ if (unlikely(lpfc_intr_state_check(phba))) { /* Check again for link_state with lock held */ spin_lock_irqsave(&phba->hbalock, iflag); if (phba->link_state < LPFC_LINK_DOWN) /* Flush, clear interrupt, and rearm the EQ */ lpfc_sli4_eqcq_flush(phba, fpeq); spin_unlock_irqrestore(&phba->hbalock, iflag); return IRQ_NONE; } In order to enter that if statement and obtain the hbalock, the PCI channel has to be offline or the HBA=E2=80=99s link is in not in an initialized state. If either of those were true, lpfc_cmpl_els_uvem would never get called to begin with. Thanks, Justin On Wed, Jul 26, 2023 at 10:40=E2=80=AFPM Chengfeng Ye wrote: > > Hi Justin, > > Thanks much for the reply, it is my negligence of not have noticed it, > and sorry for this. > > I inspect the bug report of my tool again and just find that actually > lpfc_sli4_intr_handler() also acquires that lock. > > lpfc_sli4_intr_handler() > -> lpfc_sli4_hba_intr_handler() > -> spin_lock_irqsave(&phba->hbalock, iflag); > > It seems like this isr is called on an SLI4 type HBA. If consider this > one could it be a deadlock problem? > > Thanks again, > Chengfeng --=20 This electronic communication and the information and any files transmitted= =20 with it, or attached to it, are confidential and are intended solely for=20 the use of the individual or entity to whom it is addressed and may contain= =20 information that is confidential, legally privileged, protected by privacy= =20 laws, or otherwise restricted from disclosure to anyone else. If you are=20 not the intended recipient or the person responsible for delivering the=20 e-mail to the intended recipient, you are hereby notified that any use,=20 copying, distributing, dissemination, forwarding, printing, or copying of= =20 this e-mail is strictly prohibited. If you received this e-mail in error,= =20 please return the e-mail to the sender, delete it from your computer, and= =20 destroy any printed copy of it. --000000000000928c7e06017ba4da Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQZwYJKoZIhvcNAQcCoIIQWDCCEFQCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2+MIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTa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