* [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result)
@ 2010-11-03 22:28 Rafał Miłecki
2010-11-03 22:28 ` [PATCH] ssb: fail registration for unknown SPROM revision Rafał Miłecki
2010-11-03 22:31 ` [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
0 siblings, 2 replies; 13+ messages in thread
From: Rafał Miłecki @ 2010-11-03 22:28 UTC (permalink / raw)
To: linux-wireless, John W. Linville, Michael Büsch
Cc: b43-dev, Rafał Miłecki
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
John: it's for 2.6.38.
---
drivers/ssb/pci.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index 3226832..b5343ac 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -619,7 +619,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
struct ssb_sprom *sprom)
{
const struct ssb_sprom *fallback;
- int err = -ENOMEM;
+ int err;
u16 *buf;
if (!ssb_is_sprom_available(bus)) {
@@ -646,7 +646,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL);
if (!buf)
- goto out;
+ return -ENOMEM;
bus->sprom_size = SSB_SPROMSIZE_WORDS_R123;
sprom_do_read(bus, buf);
err = sprom_check_crc(buf, bus->sprom_size);
@@ -656,7 +656,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
GFP_KERNEL);
if (!buf)
- goto out;
+ return -ENOMEM;
bus->sprom_size = SSB_SPROMSIZE_WORDS_R4;
sprom_do_read(bus, buf);
err = sprom_check_crc(buf, bus->sprom_size);
@@ -678,7 +678,6 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
out_free:
kfree(buf);
-out:
return err;
}
--
1.6.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH] ssb: fail registration for unknown SPROM revision
2010-11-03 22:28 [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
@ 2010-11-03 22:28 ` Rafał Miłecki
2010-11-03 22:36 ` Michael Büsch
2010-11-16 21:23 ` John W. Linville
2010-11-03 22:31 ` [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
1 sibling, 2 replies; 13+ messages in thread
From: Rafał Miłecki @ 2010-11-03 22:28 UTC (permalink / raw)
To: linux-wireless, John W. Linville, Michael Büsch
Cc: b43-dev, Rafał Miłecki
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
As noticed my Michael we have this left from old times of limited amount of
revisions. It's not reliable to treat unknown as rev1.
Michael: would you like to add Reported-by?
John: it's for 2.6.38.
---
drivers/ssb/pci.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index b5343ac..41a7337 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -600,11 +600,9 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
sprom_extract_r8(out, in);
break;
default:
- ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
- " revision %d detected. Will extract"
- " v1\n", out->revision);
- out->revision = 1;
- sprom_extract_r123(out, in);
+ ssb_printk(KERN_ERR PFX "Unsupported SPROM revision %d"
+ " detected\n", out->revision);
+ return -EINVAL;
}
if (out->boardflags_lo == 0xFFFF)
--
1.6.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] ssb: fail registration for unknown SPROM revision
2010-11-03 22:28 ` [PATCH] ssb: fail registration for unknown SPROM revision Rafał Miłecki
@ 2010-11-03 22:36 ` Michael Büsch
2010-11-16 21:23 ` John W. Linville
1 sibling, 0 replies; 13+ messages in thread
From: Michael Büsch @ 2010-11-03 22:36 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-wireless, John W. Linville, b43-dev
On Wed, 2010-11-03 at 23:28 +0100, Rafa? Mi?ecki wrote:
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
> As noticed my Michael we have this left from old times of limited amount of
> revisions. It's not reliable to treat unknown as rev1.
>
> Michael: would you like to add Reported-by?
Isn't that only for bugs? This isn't a bug.
But you can add my acked-by, if that's desired.
> John: it's for 2.6.38.
> ---
> drivers/ssb/pci.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
> index b5343ac..41a7337 100644
> --- a/drivers/ssb/pci.c
> +++ b/drivers/ssb/pci.c
> @@ -600,11 +600,9 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
> sprom_extract_r8(out, in);
> break;
> default:
> - ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
> - " revision %d detected. Will extract"
> - " v1\n", out->revision);
> - out->revision = 1;
> - sprom_extract_r123(out, in);
> + ssb_printk(KERN_ERR PFX "Unsupported SPROM revision %d"
> + " detected\n", out->revision);
> + return -EINVAL;
> }
>
> if (out->boardflags_lo == 0xFFFF)
--
Greetings Michael.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ssb: fail registration for unknown SPROM revision
2010-11-03 22:28 ` [PATCH] ssb: fail registration for unknown SPROM revision Rafał Miłecki
2010-11-03 22:36 ` Michael Büsch
@ 2010-11-16 21:23 ` John W. Linville
2010-11-17 17:12 ` Michael Büsch
[not found] ` <20101118162617.GA2468@tuxdriver.com>
1 sibling, 2 replies; 13+ messages in thread
From: John W. Linville @ 2010-11-16 21:23 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-wireless, Michael Büsch, b43-dev
On Wed, Nov 03, 2010 at 11:28:46PM +0100, Rafa? Mi?ecki wrote:
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
> As noticed my Michael we have this left from old times of limited amount of
> revisions. It's not reliable to treat unknown as rev1.
>
> Michael: would you like to add Reported-by?
>
> John: it's for 2.6.38.
> ---
> drivers/ssb/pci.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
> index b5343ac..41a7337 100644
> --- a/drivers/ssb/pci.c
> +++ b/drivers/ssb/pci.c
> @@ -600,11 +600,9 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
> sprom_extract_r8(out, in);
> break;
> default:
> - ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
> - " revision %d detected. Will extract"
> - " v1\n", out->revision);
> - out->revision = 1;
> - sprom_extract_r123(out, in);
> + ssb_printk(KERN_ERR PFX "Unsupported SPROM revision %d"
> + " detected\n", out->revision);
> + return -EINVAL;
> }
>
> if (out->boardflags_lo == 0xFFFF)
I think this is going to make my b43 PCI-E card not work...I'll try
it and get back to you...
John
--
John W. Linville Someday the world will need a hero, and you
linville at tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH] ssb: fail registration for unknown SPROM revision
2010-11-16 21:23 ` John W. Linville
@ 2010-11-17 17:12 ` Michael Büsch
[not found] ` <20101118162748.GB2468@tuxdriver.com>
[not found] ` <20101118162617.GA2468@tuxdriver.com>
1 sibling, 1 reply; 13+ messages in thread
From: Michael Büsch @ 2010-11-17 17:12 UTC (permalink / raw)
To: John W. Linville; +Cc: Rafał Miłecki, linux-wireless, b43-dev
On Tue, 2010-11-16 at 16:23 -0500, John W. Linville wrote:
> > - ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
> > - " revision %d detected. Will extract"
> > - " v1\n", out->revision);
> > - out->revision = 1;
> > - sprom_extract_r123(out, in);
> > + ssb_printk(KERN_ERR PFX "Unsupported SPROM revision %d"
> > + " detected\n", out->revision);
> > + return -EINVAL;
> > }
> >
> > if (out->boardflags_lo == 0xFFFF)
>
> I think this is going to make my b43 PCI-E card not work...I'll try
> it and get back to you...
Hm, what version does it report?
--
Greetings Michael.
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <20101118162617.GA2468@tuxdriver.com>]
* [PATCH] ssb: fail registration for unknown SPROM revision
[not found] ` <20101118162617.GA2468@tuxdriver.com>
@ 2010-11-18 16:35 ` Rafał Miłecki
0 siblings, 0 replies; 13+ messages in thread
From: Rafał Miłecki @ 2010-11-18 16:35 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Michael Büsch, b43-dev
2010/11/18 John W. Linville <linville@tuxdriver.com>:
> On Tue, Nov 16, 2010 at 04:23:21PM -0500, John W. Linville wrote:
>> On Wed, Nov 03, 2010 at 11:28:46PM +0100, Rafa? Mi?ecki wrote:
>> > Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
>> > ---
>> > As noticed my Michael we have this left from old times of limited amount of
>> > revisions. It's not reliable to treat unknown as rev1.
>> >
>> > Michael: would you like to add Reported-by?
>> >
>> > John: it's for 2.6.38.
>> > ---
>> > ?drivers/ssb/pci.c | ? ?8 +++-----
>> > ?1 files changed, 3 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
>> > index b5343ac..41a7337 100644
>> > --- a/drivers/ssb/pci.c
>> > +++ b/drivers/ssb/pci.c
>> > @@ -600,11 +600,9 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
>> > ? ? ? ? ? ? sprom_extract_r8(out, in);
>> > ? ? ? ? ? ? break;
>> > ? ? default:
>> > - ? ? ? ? ? ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
>> > - ? ? ? ? ? ? ? ? ? ? ?" ?revision %d detected. Will extract"
>> > - ? ? ? ? ? ? ? ? ? ? ?" v1\n", out->revision);
>> > - ? ? ? ? ? out->revision = 1;
>> > - ? ? ? ? ? sprom_extract_r123(out, in);
>> > + ? ? ? ? ? ssb_printk(KERN_ERR PFX "Unsupported SPROM revision %d"
>> > + ? ? ? ? ? ? ? ? ? ? ?" detected\n", out->revision);
>> > + ? ? ? ? ? return -EINVAL;
>> > ? ? }
>> >
>> > ? ? if (out->boardflags_lo == 0xFFFF)
>>
>> I think this is going to make my b43 PCI-E card not work...I'll try
>> it and get back to you...
>
> Yeah...
>
> [ ?125.520348] b43-pci-bridge 0000:04:00.0: enabling device (0000 -> 0002)
> [ ?125.520359] b43-pci-bridge 0000:04:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
> [ ?125.520373] b43-pci-bridge 0000:04:00.0: setting latency timer to 64
> [ ?125.529241] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x11, vendor 0x4243)
> [ ?125.529255] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0A, vendor 0x4243)
> [ ?125.529268] ssb: Core 2 found: USB 1.1 Host (cc 0x817, rev 0x03, vendor 0x4243)
> [ ?125.529280] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x01, vendor 0x4243)
> [ ?125.545750] ssb: WARNING: Invalid SPROM CRC (corrupt SPROM)
> [ ?125.545752] ssb: Unsupported SPROM revision 255 detected
> [ ?125.545797] ssb: Failed to register PCI version of SSB with error -22
> [ ?125.545810] b43-pci-bridge 0000:04:00.0: PCI INT A disabled
> [ ?125.545827] b43-pci-bridge: probe of 0000:04:00.0 failed with error -22
Hm, now I wonder if we should create sth like list of devices with
invalid SPROM, or maybe we should keep current fallback method?
--
Rafa?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result)
2010-11-03 22:28 [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
2010-11-03 22:28 ` [PATCH] ssb: fail registration for unknown SPROM revision Rafał Miłecki
@ 2010-11-03 22:31 ` Rafał Miłecki
1 sibling, 0 replies; 13+ messages in thread
From: Rafał Miłecki @ 2010-11-03 22:31 UTC (permalink / raw)
To: linux-wireless, John W. Linville, Michael Büsch
Cc: b43-dev, Rafał Miłecki
W dniu 3 listopada 2010 23:28 u?ytkownik Rafa? Mi?ecki
<zajec5@gmail.com> napisa?:
> 1.6.0.4
Whoops, that old git doesn't nicely numerate patches like 1/2, 2/2. Sorry.
--
Rafa?
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2010-11-18 17:29 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-03 22:28 [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
2010-11-03 22:28 ` [PATCH] ssb: fail registration for unknown SPROM revision Rafał Miłecki
2010-11-03 22:36 ` Michael Büsch
2010-11-16 21:23 ` John W. Linville
2010-11-17 17:12 ` Michael Büsch
[not found] ` <20101118162748.GB2468@tuxdriver.com>
2010-11-18 16:35 ` Michael Büsch
2010-11-18 16:44 ` Rafał Miłecki
2010-11-18 16:47 ` Michael Büsch
2010-11-18 17:02 ` Larry Finger
2010-11-18 17:07 ` Michael Büsch
2010-11-18 17:29 ` Larry Finger
[not found] ` <20101118162617.GA2468@tuxdriver.com>
2010-11-18 16:35 ` Rafał Miłecki
2010-11-03 22:31 ` [PATCH] ssb: return -ENOMEM on alloc fail (instead of CRC check's result) Rafał Miłecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).