From: Arend van Spriel <arend@broadcom.com>
To: Hauke Mehrtens <hauke@hauke-m.de>
Cc: "linville@tuxdriver.com" <linville@tuxdriver.com>,
"zajec5@gmail.com" <zajec5@gmail.com>,
"b43-dev@lists.infradead.org" <b43-dev@lists.infradead.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"m@bues.ch" <m@bues.ch>,
"ralf@linux-mips.org" <ralf@linux-mips.org>
Subject: [PATCH v2 07/11] bcma: add support for sprom not found on the device
Date: Tue, 6 Mar 2012 14:27:30 +0100 [thread overview]
Message-ID: <4F5610C2.3030101@broadcom.com> (raw)
In-Reply-To: <1330386974-4056-8-git-send-email-hauke@hauke-m.de>
On 02/28/2012 12:56 AM, Hauke Mehrtens wrote:
> if (!bus->drv_cc.core)
> return -EOPNOTSUPP;
>
> - if (!(bus->drv_cc.capabilities& BCMA_CC_CAP_SPROM))
> - return -ENOENT;
> -
> - if (bus->drv_cc.core->id.rev>= 32) {
> - sromctrl = bcma_read32(bus->drv_cc.core, BCMA_CC_SROM_CONTROL);
> - if (!(sromctrl& BCMA_CC_SROM_CONTROL_PRESENT))
> - return -ENOENT;
> + if (!bcma_is_sprom_available(bus)) {
> + /*
> + * Maybe there is no SPROM on the device?
> + * Now we ask the arch code if there is some sprom
> + * available for this device in some other storage.
> + */
> + err = bcma_fill_sprom_with_fallback(bus,&bus->sprom);
> + if (err) {
> + pr_warn("Using fallback SPROM failed (err %d)\n", err);
Hi Hauke,
I just noticed in this patch that the code continues when sprom fallback
fails. Does that make sense? I have corrected it in my OTP patch. So if
you agree or disagree you can comment on that patch.
> + } else {
> + pr_debug("Using SPROM revision %d provided by"
> + " platform.\n", bus->sprom.revision);
> + return 0;
> + }
> }
>
> sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
Gr. AvS
WARNING: multiple messages have this Message-ID (diff)
From: "Arend van Spriel" <arend@broadcom.com>
To: "Hauke Mehrtens" <hauke@hauke-m.de>
Cc: "linville@tuxdriver.com" <linville@tuxdriver.com>,
"zajec5@gmail.com" <zajec5@gmail.com>,
"b43-dev@lists.infradead.org" <b43-dev@lists.infradead.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"m@bues.ch" <m@bues.ch>,
"ralf@linux-mips.org" <ralf@linux-mips.org>
Subject: Re: [PATCH v2 07/11] bcma: add support for sprom not found on the device
Date: Tue, 6 Mar 2012 14:27:30 +0100 [thread overview]
Message-ID: <4F5610C2.3030101@broadcom.com> (raw)
In-Reply-To: <1330386974-4056-8-git-send-email-hauke@hauke-m.de>
On 02/28/2012 12:56 AM, Hauke Mehrtens wrote:
> if (!bus->drv_cc.core)
> return -EOPNOTSUPP;
>
> - if (!(bus->drv_cc.capabilities& BCMA_CC_CAP_SPROM))
> - return -ENOENT;
> -
> - if (bus->drv_cc.core->id.rev>= 32) {
> - sromctrl = bcma_read32(bus->drv_cc.core, BCMA_CC_SROM_CONTROL);
> - if (!(sromctrl& BCMA_CC_SROM_CONTROL_PRESENT))
> - return -ENOENT;
> + if (!bcma_is_sprom_available(bus)) {
> + /*
> + * Maybe there is no SPROM on the device?
> + * Now we ask the arch code if there is some sprom
> + * available for this device in some other storage.
> + */
> + err = bcma_fill_sprom_with_fallback(bus,&bus->sprom);
> + if (err) {
> + pr_warn("Using fallback SPROM failed (err %d)\n", err);
Hi Hauke,
I just noticed in this patch that the code continues when sprom fallback
fails. Does that make sense? I have corrected it in my OTP patch. So if
you agree or disagree you can comment on that patch.
> + } else {
> + pr_debug("Using SPROM revision %d provided by"
> + " platform.\n", bus->sprom.revision);
> + return 0;
> + }
> }
>
> sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
Gr. AvS
next prev parent reply other threads:[~2012-03-06 13:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 23:56 [PATCH v2 00/11] ssb/bcma/BCM47XX: sprom fixes and extensions Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 01/11] ssb: sprom fix some sizes / signedness Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 02/11] ssb: remove 5GHz antenna gain from sprom Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 03/11] ssb: fix per path sprom vars Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 04/11] ssb: add alpha2 Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 05/11] ssb: add some missing sprom attributes Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 06/11] bcma: export bcma_find_core Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 07/11] bcma: add support for sprom not found on the device Hauke Mehrtens
2012-03-06 13:27 ` Arend van Spriel [this message]
2012-03-06 13:27 ` Arend van Spriel
2012-02-27 23:56 ` [PATCH v2 08/11] MIPS: BCM47XX: return number of written bytes in nvram_getenv Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 09/11] MIPS: BCM47XX: fix signature of nvram_parse_macaddr Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 10/11] MIPS: BCM47XX: move and extend sprom parsing Hauke Mehrtens
2012-02-27 23:56 ` [PATCH v2 11/11] MIPS: BCM47XX: provide sprom to bcma bus Hauke Mehrtens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F5610C2.3030101@broadcom.com \
--to=arend@broadcom.com \
--cc=b43-dev@lists.infradead.org \
--cc=hauke@hauke-m.de \
--cc=linux-mips@linux-mips.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=m@bues.ch \
--cc=ralf@linux-mips.org \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.