From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-f180.google.com ([74.125.82.180]:64473 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593AbaHSJjV convert rfc822-to-8bit (ORCPT ); Tue, 19 Aug 2014 05:39:21 -0400 Received: by mail-we0-f180.google.com with SMTP id w61so6163954wes.25 for ; Tue, 19 Aug 2014 02:39:20 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140819082325.16842.18721.stgit@potku.adurom.net> References: <20140819082038.16842.46876.stgit@potku.adurom.net> <20140819082325.16842.18721.stgit@potku.adurom.net> Date: Tue, 19 Aug 2014 11:39:20 +0200 Message-ID: (sfid-20140819_113924_795478_7CC282BA) Subject: Re: [PATCH v7 6/8] ath10k: save firmware RAM and ROM BSS sections on crash From: Michal Kazior To: Kalle Valo Cc: "ath10k@lists.infradead.org" , linux-wireless Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 19 August 2014 10:23, Kalle Valo wrote: > From: Ben Greear > > This can be used to get a useful back trace out of a firmware > crash that involves an interrupt handler. For instance, a > null-pointer-exception would be this kind of trace. A user-space > tool can read the debugfs file and decode things as wished. > > This requires a packaged firmware with a new IE to describe the > BSS section starts and length. > > Signed-off-by: Ben Greear > Signed-off-by: Kalle Valo > --- [...] > +static void ath10k_pci_dump_bss_ram(struct ath10k *ar, > + struct ath10k_fw_crash_data *crash_data) { > + int ret; > + > + lockdep_assert_held(&ar->data_lock); > + > + if (!ar->fw.ram_bss_addr) > + return; > + > + if (!ar->fw.ram_bss_len) > + return; > + > + ret = ath10k_pci_diag_read_mem(ar, ar->fw.ram_bss_addr, > + crash_data->ram_bss_buf, > + ar->fw.ram_bss_len); > + if (ret) > + ath10k_warn("failed to read firmware RAM BSS memory from %d (%d B): %d\n", > + ar->fw.ram_bss_addr, ar->fw.ram_bss_len, ret); > +} > + > +static void ath10k_pci_dump_bss_rom(struct ath10k *ar, > + struct ath10k_fw_crash_data *crash_data) > +{ > + int ret; > + > + lockdep_assert_held(&ar->data_lock); > + > + if (!ar->fw.rom_bss_addr) > + return; > + > + if (!ar->fw.rom_bss_len) > + return; > + > + ret = ath10k_pci_diag_read_mem(ar, ar->fw.rom_bss_addr, > + crash_data->rom_bss_buf, > + ar->fw.rom_bss_len); > + if (ret) > + ath10k_warn("failed to read firmware ROM BSS memory from %d (%d B): %d\n", > + ar->fw.rom_bss_addr, ar->fw.rom_bss_len, ret); > +} Ditto as with other patches - endianess mess. MichaƂ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XJftG-00038o-DF for ath10k@lists.infradead.org; Tue, 19 Aug 2014 09:39:43 +0000 Received: by mail-wi0-f181.google.com with SMTP id bs8so4976672wib.8 for ; Tue, 19 Aug 2014 02:39:20 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140819082325.16842.18721.stgit@potku.adurom.net> References: <20140819082038.16842.46876.stgit@potku.adurom.net> <20140819082325.16842.18721.stgit@potku.adurom.net> Date: Tue, 19 Aug 2014 11:39:20 +0200 Message-ID: Subject: Re: [PATCH v7 6/8] ath10k: save firmware RAM and ROM BSS sections on crash From: Michal Kazior List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Kalle Valo Cc: linux-wireless , "ath10k@lists.infradead.org" T24gMTkgQXVndXN0IDIwMTQgMTA6MjMsIEthbGxlIFZhbG8gPGt2YWxvQHFjYS5xdWFsY29tbS5j b20+IHdyb3RlOgo+IEZyb206IEJlbiBHcmVlYXIgPGdyZWVhcmJAY2FuZGVsYXRlY2guY29tPgo+ Cj4gVGhpcyBjYW4gYmUgdXNlZ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ICsKPiArICAgICAgIHJldCA9IGF0aDEwa19wY2lfZGlhZ19y ZWFkX21lbShhciwgYXItPmZ3LnJhbV9ic3NfYWRkciwKPiArICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjcmFzaF9kYXRhLT5yYW1fYnNzX2J1ZiwKPiArICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhci0+ZncucmFtX2Jzc19sZW4pOwo+ICsgICAgICAg aWYgKHJldCkKPiArICAgICAgICAgICAgICAgYXRoMTBrX3dhcm4oImZhaWxlZCB0byByZWFkIGZp cm13YXJlIFJBTSBCU1MgbWVtb3J5IGZyb20gJWQgKCVkIEIpOiAlZFxuIiwKPiArICAgICAgICAg ICAgICAgICAgICAgICAgICAgYXItPmZ3LnJhbV9ic3NfYWRkciwgYXItPmZ3LnJhbV9ic3NfbGVu LCByZXQpOwo+ICt9Cj4gKwo+ICtzdGF0aWMgdm9pZCBhdGgxMGtfcGNpX2R1bXBfYnNzX3JvbShz dHJ1Y3QgYXRoMTBrICphciwKPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgYXRoMTBrX2Z3X2NyYXNoX2RhdGEgKmNyYXNoX2RhdGEpCj4gK3sKPiArICAgICAgIGlu dCByZXQ7Cj4gKwo+ICsgICAgICAgbG9ja2RlcF9hc3NlcnRfaGVsZCgmYXItPmRhdGFfbG9jayk7 Cj4gKwo+ICsgICAgICAgaWYgKCFhci0+Zncucm9tX2Jzc19hZGRyKQo+ICsgICAgICAgICAgICAg ICByZXR1cm47Cj4gKwo+ICsgICAgICAgaWYgKCFhci0+Zncucm9tX2Jzc19sZW4pCj4gKyAgICAg ICAgICAgICAgIHJldHVybjsKPiArCj4gKyAgICAgICByZXQgPSBhdGgxMGtfcGNpX2RpYWdfcmVh ZF9tZW0oYXIsIGFyLT5mdy5yb21fYnNzX2FkZHIsCj4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Jhc2hfZGF0YS0+cm9tX2Jzc19idWYsCj4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYXItPmZ3LnJvbV9ic3NfbGVuKTsKPiArICAgICAgIGlm IChyZXQpCj4gKyAgICAgICAgICAgICAgIGF0aDEwa193YXJuKCJmYWlsZWQgdG8gcmVhZCBmaXJt d2FyZSBST00gQlNTIG1lbW9yeSBmcm9tICVkICglZCBCKTogJWRcbiIsCj4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIGFyLT5mdy5yb21fYnNzX2FkZHIsIGFyLT5mdy5yb21fYnNzX2xlbiwg cmV0KTsKPiArfQoKRGl0dG8gYXMgd2l0aCBvdGhlciBwYXRjaGVzIC0gZW5kaWFuZXNzIG1lc3Mu CgoKTWljaGHFggoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X18KYXRoMTBrIG1haWxpbmcgbGlzdAphdGgxMGtAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8v bGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2F0aDEwawo=