From patchwork Fri Apr 26 03:12:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10917993 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 6AA6E76 for ; Fri, 26 Apr 2019 03:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58BE828D86 for ; Fri, 26 Apr 2019 03:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AC3E28D89; Fri, 26 Apr 2019 03:12:37 +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 A945B28D86 for ; Fri, 26 Apr 2019 03:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbfDZDMf (ORCPT ); Thu, 25 Apr 2019 23:12:35 -0400 Received: from mail-eopbgr720102.outbound.protection.outlook.com ([40.107.72.102]:29715 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbfDZDMf (ORCPT ); Thu, 25 Apr 2019 23:12:35 -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=+OHZ5rlRaicsBsxaWc8nSs7RekTCg5UGSYxv3mjxYN0=; b=IaeHT1B/cERs8pWGnQGblqQXLYAuKWnasfsgdy+p171LMyEYHO/2G7iMIme1R1x3+nnVV6jaxdQkbuaYi519eLvKaNLaQS2cqRSNJOV2mjj/3YpgmJOpbKXpzwD952bxjq+vC3CN94JZHuUiDestIsuB14+8FHUUcfLIwVglZSw= Received: from MN2PR06MB5806.namprd06.prod.outlook.com (20.179.145.207) by MN2PR06MB6253.namprd06.prod.outlook.com (20.178.246.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Fri, 26 Apr 2019 03:12:32 +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; Fri, 26 Apr 2019 03:12:32 +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 v3] brcmfmac: send mailbox interrupt twice for specific hardware device Thread-Topic: [PATCH v3] brcmfmac: send mailbox interrupt twice for specific hardware device Thread-Index: AQHU+93jhlFeXo5BSkq18cF+pcABDQ== Date: Fri, 26 Apr 2019 03:12:32 +0000 Message-ID: <1556248345-146837-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: SN6PR04CA0103.namprd04.prod.outlook.com (2603:10b6:805:f2::44) 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: b67be936-7ed6-44d7-aad8-08d6c9f505c7 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:MN2PR06MB6253; x-ms-traffictypediagnostic: MN2PR06MB6253: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1388; x-forefront-prvs: 001968DD50 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(376002)(346002)(366004)(39860400002)(199004)(189003)(3846002)(71200400001)(52116002)(73956011)(386003)(6116002)(71190400001)(102836004)(26005)(478600001)(6506007)(64756008)(53936002)(316002)(6636002)(14444005)(6486002)(6436002)(6512007)(15650500001)(66556008)(66446008)(256004)(2201001)(72206003)(66476007)(66946007)(54906003)(110136005)(99286004)(86362001)(14454004)(4326008)(186003)(486006)(44832011)(476003)(2906002)(97736004)(25786009)(2501003)(50226002)(5660300002)(81156014)(81166006)(36756003)(66066001)(68736007)(8676002)(7736002)(8936002)(305945005)(2616005);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR06MB6253;H:MN2PR06MB5806.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: KzsNHh6e0Xydkb0tExP3b44WqUk1TRZy8JY1vEeDv/2jdC3rWPPJFSch1a1j4ZkhgnSPrnotdFigMhG25vhW5SVU7LrYRHP/V6bDUMxYNEcDYXupBtDI7IHGLfv1qdCO+7gon2yKJhova9GDy3n44aEEgCqsJsqKi5JaBdVsvd+GKPjEOvZxQfoYbd3IKRmOw/eJNFKzEj2mLpQW/5wJ6sZf0CwnsjWMixdhcgab/65KNnMY0hmqThSufaPuxq03d0TNH1RzW4Zm8BwoZGsXfhT5OLd5QcX68esSYL0GFTa4kBj9v9DF9up42RdC66gy5fI+3H9xx7+mZgVWsiQy1XblApuoXUEMunW0m18nwwN5ekkks8c1kvtLPoM0Cm74NMl35Qq8RsAbw1EAJTpVCksBVtuJALl95m9nWsDzlqQ= MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: b67be936-7ed6-44d7-aad8-08d6c9f505c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2019 03:12:32.4628 (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: MN2PR06MB6253 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 --- v2: add comment and check for PCIE core revision v3: fix compile error --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 7 ++++++- 1 file changed, 6 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..d7d3e93 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -675,6 +675,7 @@ static int brcmf_pcie_send_mb_data(struct brcmf_pciedev_info *devinfo, u32 htod_mb_data) { struct brcmf_pcie_shared_info *shared; + struct brcmf_core *core; u32 addr; u32 cur_htod_mb_data; u32 i; @@ -698,7 +699,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; }