Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1494923lqp; Fri, 22 Mar 2024 18:03:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMcBNrFNMWgK4/X74fKhCuMTYR/RtwxbDLzCZYU7AbDB1yftRXKFrnJi/eKwOVSFMzo2BumZ3Sre/7CK3J/l9+iF3RoGZNripL6jtdpg== X-Google-Smtp-Source: AGHT+IGKqObQQflgMWMvG0IrvSbS9eOtjrJogmFS9y3j5iXoLLCK3+kgmEOkqXpnge6rsr09gmdX X-Received: by 2002:a05:6a00:844:b0:6e7:117:c5d5 with SMTP id q4-20020a056a00084400b006e70117c5d5mr1351501pfk.23.1711155787078; Fri, 22 Mar 2024 18:03:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711155787; cv=pass; d=google.com; s=arc-20160816; b=DhcWF8ba/5L1a0ZrxGC64rQlpGaJ3h1EfH4OaIHODJYQ7JIKrQl0Xavf/p0UTHUEjG V+Up8t+661RVxxVFAe+9YqwNfXT1/WlYknfQuEkhGAhz1LMYtzmFrOf20f6QDOFdcIPk 70VDyDURoopiOX7004airGx15qT7p+Z5bNDNYYogi00Y4tU0m34c8K3mzwLb7jQD8uFO K7GN/ykmXtQP1be7rMeVc+gy3AZy+oGNIrJhELJwBiD3+IVRfkevP+1pay97GIPIPGfc hdZ1tssyeP3P6rgKp+hDpqz5wcMdyP2QZ0ytuZ59eBn1OwsDLh6FLPnWrbnqKW2FL1C7 vFQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=zQGhmaTz+212cAdp+y8J3GuQx94jKrboGaWKL2xBtsA=; fh=yJo69h2OxDIQQZb9FitpUMmtDSD5KuimY5NX2/8Xj0U=; b=kT0NbuKu1LjMn68FqeOBfWc8QFd6FsHhGCGSK6BDROgnOGpRL/1DUDsW3ra1enEaD4 B/vpnApezpJiQnKUH/uqY2sukyikcjX8s65YVovnQeDkeeIcb6qXzKvP7J90Xif9VrOo YdXFk0cFGnFHflnZs+ArFbIt+tvt7IMPOu9i4axIROwt/8CXZ90QbwFjZwddQYhdKxZm LujASU5qMjXoW4aR1G8aMKMO6YkDzqoBuVrvak3ixmRl6v6h5AR1/yRS8pZZthZo2M3q jy+KQA4RMxwwIroY8tMEmi4vOKkI8MRps1b01LWFPOsJNOPB0ZTENqpMZDR4TEBd5Gkh pv9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W3vh28u9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bx37-20020a056a02052500b005ceef3c53a1si3444155pgb.635.2024.03.22.18.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 18:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W3vh28u9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E659B283A43 for ; Sat, 23 Mar 2024 01:03:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DBB71113; Sat, 23 Mar 2024 01:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W3vh28u9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2848D7F; Sat, 23 Mar 2024 01:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711155773; cv=none; b=E5gB4Kh+GWXyTl5W/QXmTBSF+vhceQa8NokNnAJC1oO5iQiPr7V258xoGyE1bRc+Ixz3lgb22nil4tPfg91+LdCK8GFxnQ21iQScGpvtNgioU8ijCgI5LR0cu4o0ui3ImW4/eOAIlF5Jo5H+HF4eJWdkSEzwIndpJ6HtcBrDQ+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711155773; c=relaxed/simple; bh=zQGhmaTz+212cAdp+y8J3GuQx94jKrboGaWKL2xBtsA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t+N5na4cCN8KHdHaoYiIo9Bz/oG5kwiQb4R8/egMT2dheYm4froDNXNsuxjOGVz6B6oIoINs/RW+RnK4OLUn8QapoC7kJ1eyabYzopkENVpiZBKsEQMypshfFNHadHgCreDDu0oQCH1DhfayzAk7AwHOYcNejGpBhqpka9FuM9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W3vh28u9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41BD8C433C7; Sat, 23 Mar 2024 01:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711155772; bh=zQGhmaTz+212cAdp+y8J3GuQx94jKrboGaWKL2xBtsA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W3vh28u9q/GWv3n9CCWN5QDvL2cZNYDYw5t9cpwMu2uo9RM/ibB1SOMMnNEx+D3NM BnbSVSKfZ6G6WHalsMy7ZMW/qzE93BEGfEWfb0hTXiQNNA4MCvJodkUfvXNI3eaTcl sZtp3uiwhfJHUwfiBBXO5spivey6LqE4LLAVNP0xBUJf+KnTvjjgaOLAn8BZLs3EfE Tg99y2+1V7QMaDEYuwNKO5c0dYsWw12Lu7cOsIhKNSxJSnxsYSwT5e4rO1yKuQC38e tA2LYf/Uy73ss6sj/CkU6lW0ZmFX2yil/p/Mscjr3FCcgXyQUx/zabWBlBHy9fe54I UyoVhc0aHJbXg== Date: Fri, 22 Mar 2024 18:02:51 -0700 From: Jakub Kicinski To: Brett Creeley Cc: , , , , , Subject: Re: [PATCH net] pds_core: Fix pdsc_check_pci_health function to print warning Message-ID: <20240322180251.69167fd1@kernel.org> In-Reply-To: <20240321063954.18711-1-brett.creeley@amd.com> References: <20240321063954.18711-1-brett.creeley@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 20 Mar 2024 23:39:54 -0700 Brett Creeley wrote: > When the driver notices fw_status == 0xff it tries to perform a PCI > reset on itself via pci_reset_function() in the context of the driver's > health thread. However, pdsc_reset_prepare calls > pdsc_stop_health_thread(), which attempts to stop/flush the health > thread. This results in a deadlock because the stop/flush will never > complete since the driver called pci_reset_function() from the health > thread context. Fix this by changing the pdsc_check_pci_health_function() > to print a dev_warn() once every fw_down/fw_up cycle and requiring the > user to perform a reset on the device via sysfs's reset interface, > reloading the driver, rebinding the device, etc. Dunno, to call PCI reset you don't need much device context. Perhaps you could allocate a work entry, throw it onto a per-driver workqueue, and return. Basically some minimal viable way to "asynchronously" call pci_reset_function()? You can take a ref on the device so it doesn't disappear. And flush that queue on module unload.