From patchwork Thu Nov 9 20:46:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 10051871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92D8E601EA for ; Thu, 9 Nov 2017 20:48:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86D6A2B115 for ; Thu, 9 Nov 2017 20:48:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B86D2B118; Thu, 9 Nov 2017 20:48:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 028352B115 for ; Thu, 9 Nov 2017 20:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TQM5h28t//pmv0Hpw6FGyId72SKpAmzhfUtnE4o/csw=; b=YcFUagTZJKX02mg0g1nlVE0B0R TDEifNeDt3QAQwJ99RSmGdVVgNceX6WU0/3kFaGI0YNCNQY39iOmhMTseS3zIs9iQDHeJb/GPN3Ta OFpAOIuECNIF7U/l/rbxv37vVTTA9ug6JW2QGAOtX4RQ7Ptg4lxJiv2boQryV6ZMX711CzWgygYTI O+wkDyV23wUe6cZTpcGDK1zNhi5qa6EQ0gwa657cL1jMHyzDNzCVE29gP5LlrsJZzv+Djm6FCwMvL B07RG2ZQd2A7gA/kh0PxAU477WWpxoQCmOyv68k5BJE6bIa+bl3d0/VgSysncNGXrZ0Do7jyIZVxG 8pWtJRHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eCtkF-0001ak-0e; Thu, 09 Nov 2017 20:48:15 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eCtjb-0000q4-G8 for linux-arm-kernel@lists.infradead.org; Thu, 09 Nov 2017 20:47:38 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6F246607EB; Thu, 9 Nov 2017 20:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510260437; bh=zom8DpUt16vqlqjGyL5y4smtYbWYKkhjLk/lYnEeP0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B+m6OClgc1JQ3d3y6uaI5L+p2dsnVXtSwxInegtlTnzUcuZjr949yF4hgZvHJmhB1 /zjaZJ85pgJ1vHBpiF4NDHQWn70haX/CXfInVfDWfyC8f3kMO8cpYGCgQeTsmkK+hy ODcW/XJfewrOl7Vvle2AmxB53Yh20qLWHYT5jikI= Received: from blr-ubuntu-poza.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: poza@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 49CA460818; Thu, 9 Nov 2017 20:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510260436; bh=zom8DpUt16vqlqjGyL5y4smtYbWYKkhjLk/lYnEeP0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BuY+Z7B6ce06vaFw6KHdapRZvKkrrNnwoY7CBjfyGZblL9lSB+QBUPKcxz2u9+NhF ua3uflnmAhwiuvJZxW27SK0zQYo21oNxp8Hlv8EaZtl0cTjP9/y5ZKxBgdS+b4RBGk wfsvjmVabcU+aYuvojJxsyqV6O+3lglSZ3V1rbqI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 49CA460818 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=poza@codeaurora.org From: Pawandeep Oza To: linux-pci@vger.kernel.org, timur@codeaurora.org Subject: [PATCH 2/4] PCI/portdrv: Add/Remove port services to the list Date: Fri, 10 Nov 2017 02:16:37 +0530 Message-Id: <1510260399-14886-3-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510260399-14886-1-git-send-email-poza@codeaurora.org> References: <1510260399-14886-1-git-send-email-poza@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171109_124735_714242_1524F41B X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oza Pawandeep , Gabriele Paoloni , Greg Kroah-Hartman , Dongdong Liu , linux-arm-msm@vger.kernel.org, Bjorn Helgaas , Thomas Gleixner , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Oza Pawandeep This patch adds and removes the port service to the service list. Signed-off-by: Oza Pawandeep diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index a592103..6bfe986 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -454,6 +454,8 @@ static int pcie_port_probe_service(struct device *dev) if (status) return status; + list_add_tail(&pciedev->slist, &pciedev->port->service_list); + get_device(dev); return 0; } @@ -477,6 +479,9 @@ static int pcie_port_remove_service(struct device *dev) pciedev = to_pcie_device(dev); driver = to_service_driver(dev->driver); + + list_del(&pciedev->slist); + if (driver && driver->remove) { driver->remove(pciedev); put_device(dev); diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b69769d..9d05621 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h @@ -31,6 +31,7 @@ struct pcie_device { u32 service; /* Port service this device represents */ void *priv_data; /* Service Private Data */ struct device device; /* Generic Device Interface */ + struct list_head slist; /* List of services */ }; #define to_pcie_device(d) container_of(d, struct pcie_device, device)