From patchwork Wed Nov 15 04:56:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 10058857 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 E24CD604D4 for ; Wed, 15 Nov 2017 05:02:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D565829BE2 for ; Wed, 15 Nov 2017 05:02:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9BCB29DBD; Wed, 15 Nov 2017 05:02:36 +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 CA79929DBA for ; Wed, 15 Nov 2017 05:02:35 +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=GwV9kE7iLYEmAjU28yB3qrsVciplVcHc7oIQHH5K0XM=; b=TXR/5ev8pOciQZ6eH6VqRvDF9r DesK88Pb27XpL6TpZV3oDqztM+/kcCmT/7stPzM3S2d9P8EOewXPPGUAzoeqzTRs0qpIZkS3FyNFu vMBxKjsm7qCP3I5tmhquMZ6Dla2PqQXd8cdbe6iMoM8e0DIsOhdKztU+nUKjc6MEV35bLo21r20BO gnJWVedCyahBw450DyDhenz8ImKuoj3bq2+4RCtDr8BCew1g/517GmM5djHl0pC5iN+MMsZLugqa2 go4RFTv7PXfDDkadMo+465lWXlQhuqUMwzKyY9sBAxKSpt5hVp78qIPO1xzRWj0lLh2Lo/TSxb+ol ze5CYisg==; 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 1eEpqL-00049G-6v; Wed, 15 Nov 2017 05:02:33 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEplL-00008m-Sn for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2017 04:57:26 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E65756086B; Wed, 15 Nov 2017 04:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510721825; bh=0yIXsetSK0NaBHRFwpm6ZKl7jfHo2UpODO72sDKu9yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bKy75TMkICc7AMmCsZ8+j7W02i+iJirbol6f5/6Q1p5E7trRQRwYPuas50ImibOpN nAdND/htJ2LBExZSoSWdilPOy1+ZrzamKVT8HSPUfKq3Ua2xXHggxy5ebdBVvi0UBw ZDbp+/4pTC5pkwnHaU6ao1hgj9xdRnuDHMYDjRc8= 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 E30ED60860; Wed, 15 Nov 2017 04:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510721824; bh=0yIXsetSK0NaBHRFwpm6ZKl7jfHo2UpODO72sDKu9yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k60tgfQidL6X1FLdeS6US8Bw8I48TzJr/Vkv7m20uKHFMDT6Vw1qGFdxNd6laEcrt wTkuZIGnXHQfDcM7k0OX+Ffj7IHiY0MBjMPVdut1rySd+lMVikER5CJ3iH0d37yPtJ xj+xc8IunoZl77X9WGiF/IBZumuvLSe0etd81xIA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E30ED60860 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: Oza Pawandeep To: linux-pci@vger.kernel.org, okaya@codeaurora.org, timur@codeaurora.org Subject: [PATCH v2 2/4] PCI/portdrv: Add/Remove port services to the list Date: Wed, 15 Nov 2017 10:26:46 +0530 Message-Id: <1510721808-27164-3-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510721808-27164-1-git-send-email-poza@codeaurora.org> References: <1510721808-27164-1-git-send-email-poza@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171114_205724_098013_4D5A50F1 X-CRM114-Status: GOOD ( 10.38 ) 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 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)