From patchwork Thu Apr 25 07:05:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10916093 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1735414DB for ; Thu, 25 Apr 2019 07:05:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071C928BA8 for ; Thu, 25 Apr 2019 07:05:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF0F828BCD; Thu, 25 Apr 2019 07:05:51 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 6614B28BA8 for ; Thu, 25 Apr 2019 07:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387648AbfDYHFu (ORCPT ); Thu, 25 Apr 2019 03:05:50 -0400 Received: from mail-eopbgr700097.outbound.protection.outlook.com ([40.107.70.97]:3937 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387520AbfDYHFu (ORCPT ); Thu, 25 Apr 2019 03:05:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9m3AOJLwpvxLfCxQqt86Ujv4p80fTUqawglJ9fa3dOc=; b=Ler6CjQUpoQcS/AaIBj1eXEdkd9q31DjWQ3ICFhEFLyzEgI1S3lt1hU2/DEJVFQbrRYD8UxZOX0w5iLHDyDvGrceYAuiTfQIsAi1di9JLkZwqU12ioSkzbS2tjebCWDTTYOibBdHvQruTdvGF3wgVhIpC8WAe7OyA28JcsL2kMc= Received: from MN2PR06MB5806.namprd06.prod.outlook.com (20.179.145.207) by MN2PR06MB5854.namprd06.prod.outlook.com (20.179.145.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.14; Thu, 25 Apr 2019 07:05:47 +0000 Received: from MN2PR06MB5806.namprd06.prod.outlook.com ([fe80::1ca6:d3b:6b7a:65cb]) by MN2PR06MB5806.namprd06.prod.outlook.com ([fe80::1ca6:d3b:6b7a:65cb%5]) with mapi id 15.20.1813.017; Thu, 25 Apr 2019 07:05:47 +0000 From: Wright Feng To: "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin CC: Wright Feng , "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH v2] brcmfmac: send mailbox interrupt twice for specific hardware device Thread-Topic: [PATCH v2] brcmfmac: send mailbox interrupt twice for specific hardware device Thread-Index: AQHU+zVOwI/gZmAwDkeXkV8XDkqnKA== Date: Thu, 25 Apr 2019 07:05:46 +0000 Message-ID: <1556175939-174559-1-git-send-email-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN6PR05CA0024.namprd05.prod.outlook.com (2603:10b6:805:de::37) To MN2PR06MB5806.namprd06.prod.outlook.com (2603:10b6:208:127::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.1.0 x-originating-ip: [12.110.209.245] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 28f0aa4d-de17-4cfd-7dba-08d6c94c70b8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:MN2PR06MB5854; x-ms-traffictypediagnostic: MN2PR06MB5854: x-microsoft-antispam-prvs: x-forefront-prvs: 0018A2705B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(376002)(396003)(346002)(366004)(39860400002)(189003)(199004)(71190400001)(2616005)(6512007)(52116002)(97736004)(486006)(8936002)(2501003)(26005)(99286004)(186003)(54906003)(6636002)(81156014)(8676002)(316002)(4326008)(14454004)(476003)(478600001)(110136005)(50226002)(81166006)(53936002)(72206003)(2201001)(66946007)(71200400001)(386003)(66066001)(86362001)(5660300002)(14444005)(2906002)(6506007)(256004)(102836004)(64756008)(15650500001)(66446008)(6436002)(73956011)(66556008)(6116002)(36756003)(25786009)(3846002)(7736002)(44832011)(305945005)(68736007)(66476007)(6486002);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR06MB5854;H:MN2PR06MB5806.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: b1JJiay6M6FcLfYFS7Xnz+tw6GHUBrZM8YB0Sj9uCXK4Mm0ZoVJKTV1R2pum56K914lycp5iwqMrO7JUT6FliTk5Fz78F0oamARY0MUwvHXkk/rBWAtbf5GF4nA3twm/R7+hQ9h3Ydm+PCU35PiynJ5R2PLHNg1piHL0qOgZI4Qal31fvvJj28Lskdk+s7zm8H4cx3gzVuiiULoPIFHcIXoPReFxoKIGYBH5vwh4HrZPUqpp7o88ai9TxaMW3Kt4+CwUb6dQTzogO7RPlbNj1nRqqmizHdePszY0lYER+xCmVaFx4HpThfCqbGb1pWtaWG8qwjWmZEIdlvGdHvtBos8NYDWWkRgeFR6CLNDxJF/dGj2fD4fv9yl9II21U9y70kdtj11wHJNJfm+yK/tyZcKzaGvhqM80BXm/5haip1I= MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28f0aa4d-de17-4cfd-7dba-08d6c94c70b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2019 07:05:46.9143 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR06MB5854 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For PCIE wireless device with core revision less than 14, device may miss PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending mail box interrupt twice as a hardware workaround. Signed-off-by: Wright Feng Reviewed-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index fd3968f..66ee92b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -698,7 +698,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pciedev_info *devinfo, u32 htod_mb_data) brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data); pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1); - pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1); + + /* Send mailbox interrupt twice as a hardware workaround */ + core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2); + if (core->rev <= 13) + pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1); return 0; }