From patchwork Sun Jul 22 21:46:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10539435 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 4F70E174A for ; Sun, 22 Jul 2018 21:46:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A1928437 for ; Sun, 22 Jul 2018 21:46:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C3D62844C; Sun, 22 Jul 2018 21:46:46 +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,FREEMAIL_FROM,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 48B3428437 for ; Sun, 22 Jul 2018 21:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730327AbeGVWos (ORCPT ); Sun, 22 Jul 2018 18:44:48 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:42646 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730261AbeGVWos (ORCPT ); Sun, 22 Jul 2018 18:44:48 -0400 Received: by mail-lj1-f193.google.com with SMTP id f1-v6so13576250ljc.9 for ; Sun, 22 Jul 2018 14:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aYLUfH/GetcELz+xSMB04rao7o2QJblaq72GIgfiUtI=; b=TJYkfdkpc3Aaj9w3YFBCAUtN2ZMrA7ZeZUZme1Sz3KlKQCejVtgPCQETSmz9ZpgvRO m80AfpZ74VuxI0/HiCxPPbzwiqdoM1uYv6uNboSgjtP6h+v4NUOBc89dml5iLxsvvDya G/zKAvCcy0nZkv9Ul5TI75DBLlJ7TRDh1184qR1riRAfTunKmuLWZhe8CrvPq8xIFgjK lpyEdFgu3E/SNOS1lhahJdwzEm9S1HDpB3ysDFR3w5vl6W4php6XHSkHOae3/w73OAl9 4Uqy0uGwMtCNeoyCjl70mQdKx3BmbozYevXDBuAAW6gn4HCRc6rItVMVx61k1BO2Obvl LpHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aYLUfH/GetcELz+xSMB04rao7o2QJblaq72GIgfiUtI=; b=SBXinHRfJBSVe5C9V3UCEO3rR3nhiEzj0BeM/oVpQH2WCT6E9520kadQVsc2rcnU5p Xco5ZvpSOY4+qymoe2usLZ+fDRRDpZPM70G/geAFw6ePlPp7LELORO8D+anDDP7t9EPQ DU4LVCuWIiT4ZNRnXcpg646TE7VUDVQ2bLSiZTUVKwO3aCW8AlrPc0fE3PLMpVFrtHQi kxUcB9Fs2uvwf7XNvOZI7jLCB9fxRXywu7zlXolZCfWR/HrEO8Cqcf854BFxayUob9Yk +6F7nR93G3MHTb5hO4wAAX9+i3UWXvYejIRvk93NH05Z70QphaEVoN/7Fr4qimXxL/Lk thGQ== X-Gm-Message-State: AOUpUlHCOm+HzrzxJfF1qAlk4iGII2lREa7FPw4xc+E0M6ZCn5LY7q5J 7wQNpkA7cB5dfDfVVdertXo= X-Google-Smtp-Source: AAOMgpceLEZV7OzUS81I2ZI5OwYMT+8Nxg+INgsXpANdV+7610uOcFciB4zZeRo9y3LlVA93Dw1WIQ== X-Received: by 2002:a2e:9854:: with SMTP id e20-v6mr7019985ljj.143.1532296000485; Sun, 22 Jul 2018 14:46:40 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id h24-v6sm1533681ljg.55.2018.07.22.14.46.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jul 2018 14:46:39 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Kalle Valo , Arend van Spriel Cc: Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , Chung-Hsien Hsu , Aditya Xavier , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH] brcmfmac: fix regression in parsing NVRAM for multiple devices Date: Sun, 22 Jul 2018 23:46:25 +0200 Message-Id: <20180722214625.12101-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 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 From: Rafał Miłecki NVRAM is designed to work with Broadcom's SDK Linux kernel which fakes PCI domain 0 for all internal MMIO devices. Since official Linux kernel uses platform devices for that purpose there is a mismatch in numbering PCI domains. There used to be a fix for that problem but it was accidentally dropped during the last firmware loading rework. That resulted in brcmfmac not being able to extract device specific NVRAM content and all kind of calibration problems. Reported-by: Aditya Xavier Fixes: 2baa3aaee27f ("brcmfmac: introduce brcmf_fw_alloc_request() function") Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 45928b5b8d97..4fffa6988087 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1785,7 +1785,8 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo) fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY; fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM; fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL; - fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus); + /* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */ + fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1; fwreq->bus_nr = devinfo->pdev->bus->number; return fwreq;