From patchwork Mon Jul 2 22:52:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10502601 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 71D6460284 for ; Mon, 2 Jul 2018 22:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6051028BF1 for ; Mon, 2 Jul 2018 22:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 518E828BE1; Mon, 2 Jul 2018 22:53:34 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 D70D328BE1 for ; Mon, 2 Jul 2018 22:53:33 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=ADGiyBX4TDslh4ACchy5KX6rEZjFMJiMlokMQVe7Apk=; b=jeGyymu46e5KWy 9qG7XjKfJ5nzz/fYTsE9wNyWcSzW/9DZFAeYFw/KvaRVQi4QcY3NHcgoDn/WKxRWYNwQOV8oh/Pzv sbZMkCx26M2UB8MjAy9aqrqyIraBuZwDniY/dii05TokIKU1u7IUdSNbMhikfLT3QRPQaLCF3dMeD PV3zgt1WXbaWGiQLY7/sThy8X/w56UvPhY6qw43woTe71OyP75fvKfFeJ1O5bZgcuDUkTCfOS4hnr WXx+R6PVvhH4dh1VXA7jFTJ/hO3k2gwRsJqbXCQGbyyRo2TCM9N8pmmjoSj1f/fKPMjVmhEODxl+O KEI6vupz1pyD8w0tuvqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa7hG-0004Q0-Va; Mon, 02 Jul 2018 22:53:26 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa7h5-0004A7-5K for linux-arm-kernel@lists.infradead.org; Mon, 02 Jul 2018 22:53:20 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 36E4860B25; Mon, 2 Jul 2018 22:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530571987; bh=cghsNNqcVbuCBkI4WhSV76kRpbS6n544RnT2zRlX1Ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XjuI4aGzGtKXINKv29OgoJcCD9+MNnhaJ7iResJDmdVuCfIiU5A6miY6ggL7DeHgA kXZjVl2/dXuNqMpzgKHoGSVrdNJvJu20Mu3artKRpZOwnqofMi/4Z65HBz4ZLWT4mq RHxQa6+chcjMuHrhCM6SZKR5AO6DjdgvzNOp6Yx0= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B1934607EB; Mon, 2 Jul 2018 22:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530571986; bh=cghsNNqcVbuCBkI4WhSV76kRpbS6n544RnT2zRlX1Ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VEdkralyPtDityh9M+kQYKT7s6lO/vjMqBWvaWJPtNSx0vQTyURdHkujqO9ouB9px mLGl95ax8jSPiOl5ridvf5b0L1RgD5I1BNNKNNNHrvaIdEPBl8YcNr6XUj6W0c0gm0 ynOOt8OFNwWU/ublH4vPT01O+p0B6k0pRbjMjlk0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B1934607EB 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=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org Subject: [PATCH V5 2/3] PCI: pciehp: reuse pciehp_mask/unmask_irq() in reset_slot() Date: Mon, 2 Jul 2018 18:52:46 -0400 Message-Id: <1530571967-19099-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530571967-19099-1-git-send-email-okaya@codeaurora.org> References: <1530571967-19099-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180702_155315_635793_817C3CCF X-CRM114-Status: GOOD ( 13.13 ) 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: Keith Busch , Oza Pawandeep , Kees Cook , linux-arm-msm@vger.kernel.org, open list , Sinan Kaya , Lukas Wunner , Bjorn Helgaas , Mika Westerberg , Markus Elfring , linux-arm-kernel@lists.infradead.org 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 Now that we have individual functions to mask/unmask hotplug interrupts avoid code duplication and reuse the new API in multiple places. Signed-off-by: Sinan Kaya --- drivers/pci/hotplug/pciehp_hpc.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index d44e2c6..ebf9b3b 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -726,34 +726,15 @@ static void pcie_disable_notification(struct controller *ctrl) int pciehp_reset_slot(struct slot *slot, int probe) { struct controller *ctrl = slot->ctrl; - struct pci_dev *pdev = ctrl_dev(ctrl); - u16 stat_mask = 0, ctrl_mask = 0; int rc; if (probe) return 0; - if (!ATTN_BUTTN(ctrl)) { - ctrl_mask |= PCI_EXP_SLTCTL_PDCE; - stat_mask |= PCI_EXP_SLTSTA_PDC; - } - ctrl_mask |= PCI_EXP_SLTCTL_DLLSCE; - stat_mask |= PCI_EXP_SLTSTA_DLLSC; - - pcie_write_cmd(ctrl, 0, ctrl_mask); - ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, - pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, 0); - if (pciehp_poll_mode) - del_timer_sync(&ctrl->poll_timer); - + pciehp_mask_irq(slot); rc = pci_bridge_secondary_bus_reset(ctrl->pcie->port); + pciehp_unmask_irq(slot); - pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, stat_mask); - pcie_write_cmd_nowait(ctrl, ctrl_mask, ctrl_mask); - ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, - pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, ctrl_mask); - if (pciehp_poll_mode) - int_poll_timeout(&ctrl->poll_timer); return rc; }