From patchwork Sat Jan 21 11:11:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Kumar Gogada X-Patchwork-Id: 9530231 X-Patchwork-Delegate: bhelgaas@google.com 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 15E0A60431 for ; Sat, 21 Jan 2017 11:26:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF17728618 for ; Sat, 21 Jan 2017 11:26:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C129828638; Sat, 21 Jan 2017 11:26:39 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E1CE28618 for ; Sat, 21 Jan 2017 11:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751108AbdAUL0e (ORCPT ); Sat, 21 Jan 2017 06:26:34 -0500 Received: from mail-sn1nam01on0059.outbound.protection.outlook.com ([104.47.32.59]:36414 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751064AbdAUL0d (ORCPT ); Sat, 21 Jan 2017 06:26:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=g89aimQ7POVaaqEW9EAGioIqr+c2UjMGVUeOvtcANIM=; b=plNmazPzXsxxPn3bBTVw2XOLH5UyWeARiv4GNgU9iCtqKY3mwuZYmYmv3YvPqOvuTh8ypxJS80zZA/+D12eEzLfXa/plHYCb3b8OVB2ckXYANyhy81Aw3PTQxNIR9TW6gEBIASXOSVtmSQwxCHijWAFBrXUEgyAP29Wr9inQg70= Received: from BN1PR02CA0050.namprd02.prod.outlook.com (10.141.56.50) by CY1PR0201MB0761.namprd02.prod.outlook.com (10.160.141.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Sat, 21 Jan 2017 11:11:26 +0000 Received: from CY1NAM02FT030.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by BN1PR02CA0050.outlook.office365.com (2a01:111:e400:2a::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Sat, 21 Jan 2017 11:11:25 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; windriver.com; dkim=none (message not signed) header.d=none;windriver.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT030.mail.protection.outlook.com (10.152.75.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Sat, 21 Jan 2017 11:11:24 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:55633 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1cUtZr-0000V5-QN; Sat, 21 Jan 2017 03:11:23 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cUtZr-0000b6-Mx; Sat, 21 Jan 2017 03:11:23 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v0LBBFbo030882; Sat, 21 Jan 2017 03:11:16 -0800 Received: from [172.23.64.217] (helo=xhd-lin64re105.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cUtZj-0000aQ-IY; Sat, 21 Jan 2017 03:11:15 -0800 Received: by xhd-lin64re105.xilinx.com (Postfix, from userid 45489) id B9BBDCA1DBF; Sat, 21 Jan 2017 16:41:14 +0530 (IST) From: Bharat Kumar Gogada To: , , , , , CC: , , , , , Bharat Kumar Gogada Subject: [PATCH 2/4] PCI: Xilinx NWL: Modifying irq chip for legacy interrupts Date: Sat, 21 Jan 2017 16:41:10 +0530 Message-ID: <1484997072-19276-2-git-send-email-bharatku@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1484997072-19276-1-git-send-email-bharatku@xilinx.com> References: <1484997072-19276-1-git-send-email-bharatku@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22836.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39850400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(438002)(199003)(189002)(33646002)(356003)(106466001)(36756003)(2201001)(626004)(50226002)(47776003)(38730400001)(8936002)(305945005)(54906002)(5003940100001)(46386002)(50986999)(2906002)(42186005)(2950100002)(6666003)(36386004)(52956003)(92566002)(81166006)(45336002)(76176999)(90966002)(81156014)(8676002)(103686003)(107886002)(63266004)(4326007)(4001430100002)(50466002)(48376002)(5660300001)(189998001)(5001770100001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0761; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT030; 1:x2mdZzvf+EHHBXHojMZoXqMSa1i5tzA7sFZvjXE7pBAiPFlCnR66cwAUT1GQL5c8wZrWCtRlKs+prTPsN0Gq6OEMpxmVOl9zNVdk1VFYNB248LKlHdALqD1WNslL5HjEvno3ehASs9yV4uHOxKgrQ6kTGG0UTj7CVxXlo52KAuVbuYcClp4JYCAD2CNbPsbN4k3MlW4XJcdNKyTR/Rtri9axZ6PG4xm8U3qZ4HFyZpA5AVVUyIWw4wJrnPgj3AJGIeIMPNMnAF3Jt9wPvyLCnaL+GxYpnlCZFxbLE69WuhPlYNmejxZhfix+gQERAeWDmBudGDRXJ6OsCaJywWT4+eU6Uph9femq38mwq/44renp3mcKy1tseyKNf5vTPbfICflMtTQlGil42QCtNusYkvB3u/9QS2/Tllw9eNsYkHidEWyAIL16HZgaxgPpKDDbP2ZQem83bX58FZR4AesMrVzKIXT9HPj7Jc1T9OwEYC5dq3qdccGnkBn4zpyrSIOoIYbtxv8MMwE1o29020xEL8V7cXCm5H+qnMulbaznRRbLsS9t/pLwSZLettOIYBzPeT358kma5xmQw/i1/WwEiM1d/i2p27yGkhvyvhyHXDA= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 94a0806d-dff5-4d50-05ba-08d441ee3d3a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY1PR0201MB0761; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0761; 3:eHLiR40q4umlGmp2/bfZ7oOh8aUmlIvRk3rpevMIDbiVrteGk3PSSDCDXYC+8bjL5JV1iywv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WrT+OTr+gXEnv9bxp/BKkeLNX3nTapV4CBvlA==; 20:Bu5cl6esZ9ExOh3Sc95rfg6yVjIKB2wbn51ZuTgx2J061t9jt+RK/KWBbc4uC1YA3BmggBn9FCXi6FxXCQk6yYDbAA3MJPk5BOGISrE3wxuF5VT+3CEIP53CddpmtDLv4Ua3t1Pn+iaOb+8BQf4xcRTCebf8NCiUz8wNv4fDtw9IW+7mHR030F1k1x7TOv/58TW5RWVIEQmaw7+0tjchsnlcssbT3qY4RoMURnqLRVbCrqhYao4XW37t1sCGhx7SEhaoAXSVs4Gl1o4KrcXPyNN/h9UsYHo5X6Y3icYej9KJ2uG5rrOQ0xxk6FW6wNAt8oZfMsRTzHxXcNjUVXwI7sgF2OHityxg3BHOEU/o6c56I/SDbvS4ltkvG/LZ+tJU37WwBTDgNxKW5ocrYfe2cU8MtV3xgV9fIWD2YpJaVE8AgHqDHhYqSvR70r4RDSjxjTiubcu5YhU9ddCjPXdxQegWHBZpWQrsOYyKH7g1n3gpqixduJ3atbPldlkfS0az X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(154291594099940); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13015025)(13017025)(13023025)(13018025)(13024025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:CY1PR0201MB0761; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0761; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0761; 4:K2bvTMIEYSrlgHdJzaz0cVebla2/VILFfR97fxLJyeFWd2KqLlx7RUNdqDxjArCLZdFfqptuVkyy4Y8rNmgC5TkAfp+DH2j9GUWYK9VqbEy1RXwuOKN9OMjrV5freS0/PA1EZ8BMz5Mv3RojHjixzjcABRjyMZWbIjcTaJoPeNztqrLCp9p/K3aAe5H/yMY+PsACA6nlMIkkotabjsI0jWx69jJ2iyOpMvrETwqlu7kbENc6ygUhsgfdD+2nrmUBG0WqP1WzpE3wCpl4bIwHwckI069/NNGgc3vQc3TO62IDG678nClqMYqLrptn25uw3URHIfh2QG8ONhCvXM6LoD6ObkbvTPNJi8/mI3UexZD7ZG6atSFTTAcTwupC64UYRGp2IOHo55XTtShq0ITiIkbTdOmHmcwka3vk/7Qm8qHtSRUtI9TZfHX28D4yQu1ZkW1Zvx209FDiEZg6wgqmCZcUo7wHVKUrWNQGQyAxMMeAoZrD7AlqXx/2h8WGuqhkodvZfQOUxUHoF630y73LkRnRYV30qYBwU4prly7AA+bn57dUfn1NEQfbkIzYDaqi2Uz+ZcIag5E9CmHR7nzwWkK2kUNAYf7yDQVNDLbYxdyVLKe1ePCcKefhinZwQlbm1uIH3WfZe/AOwzyQNyvRbPiUgXtkzo/GqEStI6d9ECSVUFLOOa7yuKpHZg29tlsb72JxebiUeICZllcLoZ5DretA0oYUqp3DTXC8ivKSXd7Yup3Q2dI4QcL5c7BBmSveL1h2HW5xxZHy5VTQ9r/oGA== X-Forefront-PRVS: 01949FE337 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB0761; 23:DS9tugA686482kj05po4PUe9s6rp78WHrcK1rYr?= =?us-ascii?Q?HQas8Gudv4pz7dR1V7LX91fHiXfGVV1fzE4oylT0yisuY5wT+PfZFT/Ayhhd?= =?us-ascii?Q?qkLngkTLqcccxVwwQkZaG5QkVhFztQJ2Ha7NmkklQShwIDvcNSaD+hbWTtlU?= =?us-ascii?Q?v+N2dvgrvKGz1pGqwIBcwn22FK65YbAumKfopo6N4tsqB+tKuALrfJZO+vNv?= =?us-ascii?Q?DVGNCZNwQgbuhTIUxsHyCt5VEsT5KDZiWDQcZoEZlWFUBSusAUiCk82rNuUQ?= =?us-ascii?Q?MyvIfJ1qLTpaqCvqJejDmEu82/EUmIUVpn4wcVBGJTxoBglH6X/meYlmN4u7?= =?us-ascii?Q?GtL9B9mGVO0GJjfWF8f1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SnsC?= =?us-ascii?Q?0azP12vLLFLUb/47LbuGx3+xs5yJlW1qte14JZEFt?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0761; 6:nXVewzQnop4+EDnYRK6TtVFbXgUDPQw161X1IlyLbY/TUdxv1XDYVZQhu53ZBTBMgga08vggrfQOlCNf00CTJvSJNuZaYWQ5v7xMZKfbuQ8NYfLoEXdbz8kvoe0ol48JNABNjsjfY2PfrLLUlJb5Ic6qacmZYk3Wf0PUbEL79nX0vfnX2yIeokReCa5tydZv94BGTMVmb+6lRjru0HYEH6MHjOM2KTdM9bLX0cRJ7snP1c0McnUMHeFvr+eSauXoQsxCY5iibk6eQQUzq1ncfR/hOb8jeP4ow2ST2PcaJJwtT2Fy3ajImYRUU4axaR2q6J6aXJ5ZUH7Ha7e9jv9PKnX8lykMFFrJNfirC+DMsVTNP1C5xe5rcxnIfr+HG3H5var5KrjG78nJ1tNzYmhFimV3pY6NO6B4TaQeWE9EanLA8IgbZPmiq6ldXXbVMlhqIyPFATltJwtpS+Te5OteGg==; 5:xS4AAePy0FEh/KNxepW/lKrRmXGffHQ1tEBKnq/bW4GdewyMeswwnxhfLZ3ZKlJuS9oIc+kOlqMXEHzGyf9TQgNCbtwRpsQNywMGDRjyIGzfZp5FUiHuV6SudbUqg5R7dcc0x7WrMuFROzyK5U522RzeQd39Hb06t/DYmqQZLXQ=; 24:XLBtoYrPtp1QEUCusA6m0DtZ3lp2FO7NL+4TL5xmnkHSQGnUyzGLNZ2E6nqVcs691DZ+mIKkuI6q4djwHFiWr8mdBbeINytoCuGLzrPtIhQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0761; 7:vVKa+yPoVJS90gl4r/D7hWIcHflIplBKC18IRrwPg18McOx3svXA1b59n9WrI81ti3BvTYMTGxRUkeLL+MyvxiUlIAJeg+wt6HMgdgooge2fAOgS67nNHPkz5fFf99iAmM8wATFSq64SGPy4QfMXvNFInDh9svA1OghipuNJbUcHMr8rjccrDwBojYGfR7jH7G9sOPXOSMMMpcErFZ80cycbmdLrnBz03GUc2bQYO+jpGsJGGCRWx5ohbkXw2rzVEpjzrndLVRS/ltw1ln8M5HtCHISVW+Z8AOPyxGAZTQzkL43YwIHunMPjOQppqoWTyUHscdij8wORkDpHYv+8cAzHmHUxbBzcMpzZQ8iLcPFVgyYDl5waonaoMFgADG4Mq63sX1CzwKhzjJAKg3xORt15sNTvE5Lybu+mvNuQs7bYCSiEAXbC2oH/jBZOlmhWCLc9V4/VAUmvCxCjjvdBsQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2017 11:11:24.5379 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0761 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Few wifi end points which only support legacy interrupts, performs hardware reset functionalities after disabling interrupts by invoking disable_irq and then re-enable using enable_irq, they enable hardware interrupts first and then virtual irq line later. - The legacy irq line goes low only after DEASSERT_INTx is received.As the legacy irq line is high immediately after hardware interrupts are enabled but virq of EP is still in disabled state and EP handler is never executed resulting no DEASSERT_INTx.If dummy irq chip is used, interrutps are not masked and system is hanging with CPU stall. - Adding irq chip functions instead of dummy irq chip for legacy interrupts. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index c8b5a33..e1809f9 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -396,10 +396,44 @@ static void nwl_pcie_msi_handler_low(struct irq_desc *desc) chained_irq_exit(chip, desc); } +static void nwl_mask_leg_irq(struct irq_data *data) +{ + struct irq_desc *desc = irq_to_desc(data->irq); + struct nwl_pcie *pcie; + unsigned int mask = 0; + + pcie = irq_desc_get_chip_data(desc); + mask = 1 << (data->hwirq - 1); + nwl_bridge_writel(pcie, ((u32)MSGF_LEG_SR_MASKALL & (~mask)), + MSGF_LEG_MASK); + +} + +static void nwl_unmask_leg_irq(struct irq_data *data) +{ + struct irq_desc *desc = irq_to_desc(data->irq); + struct nwl_pcie *pcie; + unsigned int mask = 0; + + pcie = irq_desc_get_chip_data(desc); + mask = 1 << (data->hwirq - 1); + nwl_bridge_writel(pcie, ((u32)MSGF_LEG_SR_MASKALL | mask), + MSGF_LEG_MASK); + +} + +static struct irq_chip nwl_leg_irq_chip = { + .name = "nwl_pcie:legacy", + .irq_enable = nwl_unmask_leg_irq, + .irq_disable = nwl_mask_leg_irq, + .irq_mask = nwl_mask_leg_irq, + .irq_unmask = nwl_unmask_leg_irq, +}; + static int nwl_legacy_map(struct irq_domain *domain, unsigned int irq, irq_hw_number_t hwirq) { - irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq); + irq_set_chip_and_handler(irq, &nwl_leg_irq_chip, handle_simple_irq); irq_set_chip_data(irq, domain->host_data); return 0;