From patchwork Tue Dec 26 02:36:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 852903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z5Ks80nr7z9s0g for ; Tue, 26 Dec 2017 13:37:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750857AbdLZChc (ORCPT ); Mon, 25 Dec 2017 21:37:32 -0500 Received: from regular1.263xmail.com ([211.150.99.132]:40004 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbdLZCh3 (ORCPT ); Mon, 25 Dec 2017 21:37:29 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.230]) by regular1.263xmail.com (Postfix) with ESMTP id 34EDE9407; Tue, 26 Dec 2017 10:37:26 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 059103E0; Tue, 26 Dec 2017 10:36:50 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <760c7a6782e2027dbb310969078eb77a> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 12886Z9HRUX; Tue, 26 Dec 2017 10:37:15 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org, bhelgaas@google.com Cc: linux-pm@vger.kernel.org, tony@atomide.com, shawn.lin@rock-chips.com, briannorris@chromium.org, rjw@rjwysocki.net, dianders@chromium.org, Jeffy Chen , Xinming Hu , linux-pci@vger.kernel.org, Rob Herring , Catalin Marinas , Kalle Valo , Heiko Stuebner , linux-rockchip@lists.infradead.org, Nishant Sarmukadam , Will Deacon , Matthias Kaehlcke , devicetree@vger.kernel.org, Ganapathi Bhat , Frank Rowand , Amitkumar Karwar , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Klaus Goger , Mark Rutland Subject: [RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core Date: Tue, 26 Dec 2017 10:36:41 +0800 Message-Id: <20171226023646.17722-1-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Currently we are handling wake irq in mrvl wifi driver. Move it into pci core. Tested on my chromebook bob(with cros 4.4 kernel and mrvl wifi). Changes in v13: Fix compiler error reported by kbuild test robot Changes in v12: Only add irq definitions for PCI devices and rewrite the commit message. Enable the wake irq in noirq stage to avoid possible irq storm. Changes in v11: Address Brian's comments. Only support 1-per-device PCIe WAKE# pin as suggested. Move to pcie port as Brian suggested. Changes in v10: Use device_set_wakeup_capable() instead of device_set_wakeup_enable(), since dedicated wakeirq will be lost in device_set_wakeup_enable(false). Changes in v9: Add section for PCI devices and rewrite the commit message. Fix check error in .cleanup(). Move dedicated wakeirq setup to setup() callback and use device_set_wakeup_enable() to enable/disable. Rewrite the commit message. Changes in v8: Add optional "pci", and rewrite commit message. Add pci-of.c and use platform_pm_ops to handle the PCIe WAKE# signal. Rewrite the commit message. Changes in v7: Move PCIE_WAKE handling into pci core. Changes in v6: Fix device_init_wake error handling, and add some comments. Changes in v5: Move to pci.txt Rebase. Use "wakeup" instead of "wake" Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (5): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts mwifiex: Disable wakeup irq handling for pcie PCI / PM: Add support for the PCIe WAKE# signal for OF arm64: dts: rockchip: Move PCIe WAKE# irq to pcie port for Gru Documentation/devicetree/bindings/pci/pci.txt | 10 ++++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 11 ++-- drivers/net/wireless/marvell/mwifiex/main.c | 4 ++ drivers/of/of_pci_irq.c | 71 +++++++++++++++++++++++-- drivers/pci/Makefile | 1 + drivers/pci/pci-driver.c | 10 ++++ drivers/pci/pci-of.c | 75 +++++++++++++++++++++++++++ include/linux/of_pci.h | 9 ++++ 8 files changed, 183 insertions(+), 8 deletions(-) create mode 100644 drivers/pci/pci-of.c