Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3334299pxb; Mon, 6 Sep 2021 19:10:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt/4qEtuna51Y7D0kWIaGnQlJQ6ukaK72CjcP1Bu8FDRdVUq+kzTk03kuHvE+UOe9ywpiP X-Received: by 2002:a17:906:a044:: with SMTP id bg4mr15999396ejb.312.1630980611261; Mon, 06 Sep 2021 19:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630980611; cv=none; d=google.com; s=arc-20160816; b=vAO5ZcCtnVQHk+XaVeQIEvjzw5eWsZPvsvUOhf4jZSvggmTiNa/xmG3xIPPMIQgez8 YNCPlgU2PhbP5uDJ6EX1ZR5VmdzFwW6kV1R/dcEejJI6seK0/JLHe990Lztl9f+lY0zA gMf+2xBh+tf/2oVs3Vk4zfumb/hfAW4GNsdiaCj5m/X2r8y+2KwzHiNYhZ15OKLtU3hz yPC5339Pp88ENF7xjIq8ay68iK+UeLSLfCxZDDxaHW10dUp4MLdAVg/Jq9dHJuqGCEcF 0JJXLgKYZE3/MyoNHZkoE6AjlmKm11wmhQY2ljDjq5mVMOjzidIjpdUMVNB+iKJcLlRY 8qiw== 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=Cs7mCMI8BIob2gIpwkwVdKulQz4rvKjl/wf+ynJ6z9Y=; b=bw+dMYFigBIGvf8HQarKZhXdPyeJm1NgdsIdHGrYzWkgkUqMGpVAk5bqR7jH7AczoH QuYWrI46TpX9pWlrhnIhpZDy+sTpIWe8CpEaovG4xo0+lXPY6ekl/Qkput0WB/BE9A5K wYnPCy8xISwefze75DJqtIxuLI9oVAMFL9ppvmve1V/WMmX+KpDR4X++4h1TBh/uPeem I8Pywc1+JG1StR2ErbYe6N1mLzMAmrEceYGzubrB2mwbXnlu5I7HO9P3Iy5y23rQScTM EnWe0qu3Li73MTG4rESwRELtEYpIg1HVTzna0h/0WvHUuXZjcTHfPydRvmaWfLxI027b 5DKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HDcmens1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si9913734edv.438.2021.09.06.19.09.47; Mon, 06 Sep 2021 19:10:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HDcmens1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbhIGCFx (ORCPT + 99 others); Mon, 6 Sep 2021 22:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbhIGCFx (ORCPT ); Mon, 6 Sep 2021 22:05:53 -0400 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93730C061575; Mon, 6 Sep 2021 19:04:47 -0700 (PDT) Received: by mail-qk1-x735.google.com with SMTP id b64so8653605qkg.0; Mon, 06 Sep 2021 19:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cs7mCMI8BIob2gIpwkwVdKulQz4rvKjl/wf+ynJ6z9Y=; b=HDcmens1LBj3rKlpU88n/WQYdnrYpD37I8npnEyNuzee+6ZEblyd/Lr4TAgkqwMK6K R6hWuXJdkfWY9YsSrqKtNMelU45wevTKv4D3KGpqlE4aXcYgE+eBMk06rf9+vIcqvK65 f6LIFboepPzZnEyOj08SsrrxZtUVy/RuJ54rs2JpyXwEworSh0cHJry4qFPQItAtFHzO rtp5xbXTmJYDHtaj9OYRWdIR9coIM0wC15tyRm0CcVTue4uH6/8HHgSowpVMJvyWr3Lr PjTTvD2VGBc5WESZaojfSJCRBFe3b6UqaIZJw2x8e/UuHtt//oOeB76EttA7HL2G5olL dyVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cs7mCMI8BIob2gIpwkwVdKulQz4rvKjl/wf+ynJ6z9Y=; b=dQWe42En+HA+wENPmqKUviut75OoPmfLSKcL0l1aG+rXD77afMonm8HQOKnJZ4PJ86 vrHDmS6XGkPOhTcfwZdSQDl/Wy1lvjLSM7LrlBDbRfPze7Hlr+Fbel4QA6m7BfGZjKGj neWCu4/wWkNSyaEYQOMuAPKCBOXTz6IQ4tua5S90Phhskza7k9YamJHDR4whykZxLZYL DlfgE2uYgUrvvEZmLlxY7ZtKovGKqIyG8Bn+Nx+tyGdM2F3krXrl15crbNrkxngiO91A yNqrfl1UUJizLTOfLGcbj2xxySIDZikaaI4pXEwaCWDZwv9TxE2FAhL4yqVcAs6+affY X1FQ== X-Gm-Message-State: AOAM5310CHKrSL3s57ll9YhFQf4BARTxOEpPwpUzso1cyBCPJmn/B7KQ UsRosmHrObOTi1kpw+4xNxf01otvkUJgG9GBpNE= X-Received: by 2002:a05:620a:1299:: with SMTP id w25mr13651420qki.391.1630980286653; Mon, 06 Sep 2021 19:04:46 -0700 (PDT) MIME-Version: 1.0 References: <20210906094927.524106-1-schnelle@linux.ibm.com> In-Reply-To: <20210906094927.524106-1-schnelle@linux.ibm.com> From: "Oliver O'Halloran" Date: Tue, 7 Sep 2021 12:04:35 +1000 Message-ID: Subject: Re: [PATCH 0/5] s390/pci: automatic error recovery To: Niklas Schnelle Cc: Bjorn Helgaas , Linas Vepstas , Russell Currey , linuxppc-dev , Linux Kernel Mailing List , linux-s390@vger.kernel.org, Matthew Rosato , Pierre Morel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 6, 2021 at 7:49 PM Niklas Schnelle wrote: > > Patch 3 I already sent separately resulting in the discussion below but without > a final conclusion. > > https://lore.kernel.org/lkml/20210720150145.640727-1-schnelle@linux.ibm.com/ > > I believe even though there were some doubts about the use of > pci_dev_is_added() by arch code the existing uses as well as the use in the > final patch of this series warrant this export. The use of pci_dev_is_added() in arch/powerpc was because in the past pci_bus_add_device() could be called before pci_device_add(). That was fixed a while ago so It should be safe to remove those calls now. > Patch 4 "PCI: Export pci_dev_lock()" is basically an extension to commit > e3a9b1212b9d ("PCI: Export pci_dev_trylock() and pci_dev_unlock()") which > already exported pci_dev_trylock(). In the final patch we make use of > pci_dev_lock() to wait for any other exclusive uses of the pdev to be finished > before starting recovery. Hmm, I noticed the EEH (arch/powerpc/kernel/eeh_driver.c:eeh_pe_report_edev()) and the generic PCIe error recovery code (see drivers/pci/pcie/err.c:report_error_detected()) only call device_lock() before entering the driver's error handling callbacks. I wonder if they should be using pci_dev_lock() instead. The only real difference is that pci_dev_lock() will also block user space from accessing the device's config space while error recovery is in progress which seems sensible enough.