bna: misc bugfixes
Subsystems (3)
cover bna: misc bugfixes
These patches fix several bugs found during device initialization debugging.
Ivan Vecera (3):
bna: fix firmware loading on big-endian machines
bna: remove unreasonable iocpf timer start
bna: fix soft lock-up during firmware initialization failure
drivers/net/ethernet/brocade/bna/bfa_ioc.c | 4 ++-- drivers/net/ethernet/brocade/bna/bnad.c | 4 ---- drivers/net/ethernet/brocade/bna/cna_fwimg.c | 7 +++++++ 3 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.3.6
PATCH 1/3 bna: fix firmware loading on big-endian machines
Firmware required by bna is stored in appropriate files as sequence of LE32 integers. After loading by request_firmware() they need to be byte-swapped on big-endian arches. Without this conversion the NIC is unusable on big-endian machines.
--- drivers/net/ethernet/brocade/bna/cna_fwimg.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/brocade/bna/cna_fwimg.c +7 -0
@@ -30,6 +30,7 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image, u32 *bfi_image_size, char *fw_name) {const struct firmware *fw; +u32 n;if (request_firmware (&fw, fw_name, &pdev->dev)) {pr_alert ("Can't locate firmware %s\n" , fw_name);
@@ -40,6 +41,12 @@ cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image, *bfi_image_size = fw->size/sizeof (u32); bfi_fw = fw; +/* Convert loaded firmware to host order as it is stored in file +* as sequence of LE32 integers. +*/ +for (n =0 ; n < *bfi_image_size; n++) +le32_to_cpus (*bfi_image + n); +return *bfi_image; error:return NULL ;
Signature · 1 line
2.3.6
PATCH 2/3 bna: remove unreasonable iocpf timer start
In reply to Ivan VeceraDriver starts iocpf timer prior bnad_ioceth_enable() call and this is unreasonable. This piece of code probably originates from Brocade/Qlogic out-of-box driver during initial import into upstream. This driver uses only one timer and queue to implement multiple timers and this timer is started at this place. The upstream driver uses multiple timers instead of this.
--- drivers/net/ethernet/brocade/bna/bnad.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/brocade/bna/bnad.c +0 -4
@@ -3701,10 +3701,6 @@ bnad_pci_probe(struct pci_dev *pdev,setup_timer (&bnad->bna.ioceth.ioc.sem_timer, bnad_iocpf_sem_timeout, ((unsigned long )bnad)); -/* Now start the timer before calling IOC */ -mod_timer (&bnad->bna.ioceth.ioc.iocpf_timer, - jiffies +msecs_to_jiffies (BNA_IOC_TIMER_FREQ )); -/* * Start the chip * If the call back comes with error, we bail out.
Signature · 1 line
2.3.6
PATCH 3/3 bna: fix soft lock-up during firmware initialization failure
In reply to Ivan VeceraBug in the driver initialization causes soft-lockup if firmware initialization timeout is reached. Polling function bfa_ioc_poll_fwinit() incorrectly calls bfa_nw_iocpf_timeout() when the timeout is reached. The problem is that bfa_nw_iocpf_timeout() calls again bfa_ioc_poll_fwinit()... etc. The bfa_ioc_poll_fwinit() should directly send timeout event for iocpf and the same should be done if firmware download into HW fails.
--- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/brocade/bna/bfa_ioc.c +2 -2
@@ -2414,7 +2414,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, enum bfi_fwboot_type boot_type,if (status ==BFA_STATUS_OK )bfa_ioc_lpu_start (ioc);else -bfa_nw_iocpf_timeout (ioc); +bfa_fsm_send_event (&ioc->iocpf,IOCPF_E_TIMEOUT );return status; }
@@ -3029,7 +3029,7 @@ bfa_ioc_poll_fwinit(struct bfa_ioc *ioc) }if (ioc->iocpf.poll_time >=BFA_IOC_TOV ) { -bfa_nw_iocpf_timeout (ioc); +bfa_fsm_send_event (&ioc->iocpf,IOCPF_E_TIMEOUT ); }else { ioc->iocpf.poll_time +=BFA_IOC_POLL_TOV ; mod_timer(&ioc->iocpf_timer, jiffies +
Signature · 1 line
2.3.6
Quoted 12 lines
From: Ivan Vecera [mailto:[email protected]]
Sent: Thursday, May 28, 2015 2:10 PMThese patches fix several bugs found during device initialization debugging.
Cc Rasesh Mody <[email protected]>Ivan Vecera (3):
bna: fix firmware loading on big-endian machines
bna: remove unreasonable iocpf timer start
bna: fix soft lock-up during firmware initialization failure
Quoted 4 lines
drivers/net/ethernet/brocade/bna/bfa_ioc.c | 4 ++-- drivers/net/ethernet/brocade/bna/bnad.c | 4 ---- drivers/net/ethernet/brocade/bna/cna_fwimg.c | 7 +++++++ 3 files changed, 9 insertions(+), 6 deletions(-)
Thanks!
-Rasesh
From: Ivan Vecera <[email protected]>
Date: Thu, 28 May 2015 23:10:05 +0200
Quoted 1 line
These patches fix several bugs found during device initialization debugging.
Applied, thanks Ivan.