Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3012550imm; Sun, 1 Jul 2018 10:16:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdpzjuMd5RzctBcRSYmj5pBenz4AwEGiLGbA+Zu4BBpliwGgiJ6xf+w/8tpQjqJoEfv4Ud7 X-Received: by 2002:a62:642:: with SMTP id 63-v6mr22525221pfg.222.1530465410821; Sun, 01 Jul 2018 10:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465410; cv=none; d=google.com; s=arc-20160816; b=ldbqZGM9wLPMhnwl9V97E9hIMVjS4RF3tx+g6+zmP0A49vgfSMd4hX6R2JanGXBdyv 8+eldTdJ/6zqA3LsjNJAJHuq8Tk2iN6KEDqGq6R6VwhQXLpfDPVWaFQhFgP1UEC7UgO7 txadivEU4NP48Re43qokaqzYozQloNzE7ZzKU14IIx8FDp+iuNxwvnjF4vbCesJGKHi0 t8/R+ZVqMRIuyeuQI/W1RY/3ejoGBR3/cfH5xxz4IVKEui0CRwrtzf9NYX+VJV+TnfJl zU2FgujiYnIJuGUFHOiy9Hvyz3ISpaYCD/n514a0h+oeatgb2yPh2iZ+JtlmtcD1+WBm svJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=USfBxp0JiDrRjBVsH0/ZMgt00nWgRZmYBJsTJMBp5dE=; b=hZYZ3McFj1weFxi9BcildqP5F69EASve//luLnWRnfGr8pLFEWAFSe4JcnBaDAUiup k3mD+HzfJ7tGzrI3LY/IJX0gqypC8bMXCy/atmTozb6fVI8RvIlp4vILokWANWqZdGqk LpjjDlmR7H3t4WhAE4DV9CcQzc8wSxc8B8onNoR3X8heUvf4XiAFuVeZdXg2Dv/IRHRt gbjZZbUhouhwmkuxsD67fq4LvJhvVKxFFay2QcFdSj193M/H/vNz4Uln7W33GHWo5lno RujQS0RsUt9N7ifRi/gvZPuKufUo/E2gRbL0DGVZbMYqkC58jYldVtNFadt+UGO/Znzn ZkoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si13699021plr.56.2018.07.01.10.16.36; Sun, 01 Jul 2018 10:16:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965529AbeGAROs (ORCPT + 99 others); Sun, 1 Jul 2018 13:14:48 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:42125 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933613AbeGAROp (ORCPT ); Sun, 1 Jul 2018 13:14:45 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 9EFC8300002CC; Sun, 1 Jul 2018 19:14:43 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 5B03A7878D; Sun, 1 Jul 2018 19:14:43 +0200 (CEST) Date: Sun, 1 Jul 2018 19:14:43 +0200 From: Lukas Wunner To: Sinan Kaya Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , Andy Shevchenko , Mika Westerberg , Greg Kroah-Hartman , Oza Pawandeep , Keith Busch , open list Subject: Re: [PATCH V4 7/7] PCI: Handle link reset via hotplug if supported Message-ID: <20180701171443.GA28249@wunner.de> References: <1530214274-21139-1-git-send-email-okaya@codeaurora.org> <1530214274-21139-7-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530214274-21139-7-git-send-email-okaya@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 03:31:05PM -0400, Sinan Kaya wrote: > +static pci_ers_result_t pciehp_reset_link(struct pci_dev *pdev) > +{ > + struct pcie_device *pciedev; > + struct controller *ctrl; > + struct device *devhp; > + struct slot *slot; > + int rc; > + > + devhp = pcie_port_find_device(pdev, PCIE_PORT_SERVICE_HP); > + pciedev = to_pcie_device(devhp); > + ctrl = get_service_data(pciedev); > + slot = ctrl->slot; > + > + rc = reset_slot(slot->hotplug_slot, 0); > + > + return !rc ? PCI_ERS_RESULT_RECOVERED : PCI_ERS_RESULT_DISCONNECT; > +} This looks like a bit of a detour. There's a "struct pci_slot *slot" pointer in struct pci_dev. Any reason not to simply call: rc = reset_slot(pdev->slot->hotplug_slot) Lukas