Re: cardbus panic: end address is not aligned

2011-07-14 Thread Doug Barton
On 07/14/2011 12:55, Doug Barton wrote:
> On 07/14/2011 11:39, John Baldwin wrote:
>> On Thursday, July 14, 2011 6:27:20 am Adrian Chadd wrote:
 Don't forget if_ath_pci.
>> Which I think is a bug for this very reason if it turns out to be the cause.
> 
> I have
> 
> MODULES_OVERRIDE=ath ...
> 
> in src.conf and I have an if_ath module, but no if_ath_pci module. There
> is no directory in /sys/modules for either, and no Makefile in
> /sys/dev/ath. Looking in GENERIC it seems I'm going to need ath_hal as
> well? Do _pci and _hal need to be compiled into the kernel
> unconditionally in order to use if_ath? Or am I missing something?

Adrian set me straight on /sys/modules/ath[_pci] being the proper places
to build the modules, and with if_ath_pci kldload'ed the cards are
recognized. There is a minor issue with one of the cards but I have some
other things to poke before I am sure it's FreeBSD at fault this time.

So it's likely this issue is closed. Thanks again John and Adrian for
your help.


Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-14 Thread Doug Barton
On 07/14/2011 11:39, John Baldwin wrote:
> On Thursday, July 14, 2011 6:27:20 am Adrian Chadd wrote:
>> > Don't forget if_ath_pci.
> Which I think is a bug for this very reason if it turns out to be the cause.

I have

MODULES_OVERRIDE=ath ...

in src.conf and I have an if_ath module, but no if_ath_pci module. There
is no directory in /sys/modules for either, and no Makefile in
/sys/dev/ath. Looking in GENERIC it seems I'm going to need ath_hal as
well? Do _pci and _hal need to be compiled into the kernel
unconditionally in order to use if_ath? Or am I missing something?


Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-14 Thread John Baldwin
On Thursday, July 14, 2011 6:27:20 am Adrian Chadd wrote:
> Don't forget if_ath_pci.

Which I think is a bug for this very reason if it turns out to be the cause.

> Adrian
> 
> On 14 July 2011 16:59, Doug Barton  wrote:
> > On 07/12/2011 07:22, John Baldwin wrote:
> >> On Monday, July 11, 2011 9:29:19 pm Doug Barton wrote:
> >>> On 07/08/2011 06:19, John Baldwin wrote:
> >>>
>  Hmm, well that's odd.  It didn't grow it enough it seems.
> 
> >> Also, can you boot your machine, then do 'sysctl 
debug.bootverbose=1', insert
> >> the card and record the messages in dmesg when it does?  (You can 
likely get
> >> those out of kgdb.)
> >>>
> >>> I tried your patch, and got some odd results. The good news is, no
> >>> crash. However it did not actually enable the cards, with or without
> >>> if_ath being loaded before inserting them. Here is the dmesg output with
> >>> debug.bootverbose=1. This is with inserting and removing first one card,
> >>> then the other.
> >>
> >> Hmm, can you try without NEW_PCIB just as a test?  (You'll need to add
> >> 'nooption NEW_PCIB' to your kernel config file.)
> >
> > No change. Still no panic, but the cards were not recognized with or
> > without if_ath loaded in advance.
> >
> >
> >
> > --
> >
> >Nothin' ever doesn't change, but nothin' changes much.
> >-- OK Go
> >
> >Breadth of IT experience, and depth of knowledge in the DNS.
> >Yours for the right price.  :)  http://SupersetSolutions.com/
> >
> > ___
> > freebsd-current@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
> >
> 

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-14 Thread Adrian Chadd
Don't forget if_ath_pci.


Adrian

On 14 July 2011 16:59, Doug Barton  wrote:
> On 07/12/2011 07:22, John Baldwin wrote:
>> On Monday, July 11, 2011 9:29:19 pm Doug Barton wrote:
>>> On 07/08/2011 06:19, John Baldwin wrote:
>>>
 Hmm, well that's odd.  It didn't grow it enough it seems.

>> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
>> insert
>> the card and record the messages in dmesg when it does?  (You can likely 
>> get
>> those out of kgdb.)
>>>
>>> I tried your patch, and got some odd results. The good news is, no
>>> crash. However it did not actually enable the cards, with or without
>>> if_ath being loaded before inserting them. Here is the dmesg output with
>>> debug.bootverbose=1. This is with inserting and removing first one card,
>>> then the other.
>>
>> Hmm, can you try without NEW_PCIB just as a test?  (You'll need to add
>> 'nooption NEW_PCIB' to your kernel config file.)
>
> No change. Still no panic, but the cards were not recognized with or
> without if_ath loaded in advance.
>
>
>
> --
>
>        Nothin' ever doesn't change, but nothin' changes much.
>                        -- OK Go
>
>        Breadth of IT experience, and depth of knowledge in the DNS.
>        Yours for the right price.  :)  http://SupersetSolutions.com/
>
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-14 Thread Doug Barton
On 07/12/2011 07:22, John Baldwin wrote:
> On Monday, July 11, 2011 9:29:19 pm Doug Barton wrote:
>> On 07/08/2011 06:19, John Baldwin wrote:
>>
>>> Hmm, well that's odd.  It didn't grow it enough it seems.
>>>
> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
> insert 
> the card and record the messages in dmesg when it does?  (You can likely 
> get 
> those out of kgdb.)
>>
>> I tried your patch, and got some odd results. The good news is, no
>> crash. However it did not actually enable the cards, with or without
>> if_ath being loaded before inserting them. Here is the dmesg output with
>> debug.bootverbose=1. This is with inserting and removing first one card,
>> then the other.
> 
> Hmm, can you try without NEW_PCIB just as a test?  (You'll need to add
> 'nooption NEW_PCIB' to your kernel config file.)

No change. Still no panic, but the cards were not recognized with or
without if_ath loaded in advance.



-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-12 Thread Doug Barton
On 07/12/2011 07:22, John Baldwin wrote:
> On Monday, July 11, 2011 9:29:19 pm Doug Barton wrote:
>> On 07/08/2011 06:19, John Baldwin wrote:
>>
>>> Hmm, well that's odd.  It didn't grow it enough it seems.
>>>
> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
> insert 
> the card and record the messages in dmesg when it does?  (You can likely 
> get 
> those out of kgdb.)
>>
>> I tried your patch, and got some odd results. The good news is, no
>> crash. However it did not actually enable the cards, with or without
>> if_ath being loaded before inserting them. Here is the dmesg output with
>> debug.bootverbose=1. This is with inserting and removing first one card,
>> then the other.
> 
> Hmm, can you try without NEW_PCIB just as a test?  (You'll need to add
> 'nooption NEW_PCIB' to your kernel config file.)

Yes, but not any sooner than this evening.

I see you committed the patch you sent me, so I'll update my srcs to the
latest HEAD, add the option you suggested, and rebuild ASAP.


Thanks again,

Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-12 Thread John Baldwin
On Monday, July 11, 2011 9:29:19 pm Doug Barton wrote:
> On 07/08/2011 06:19, John Baldwin wrote:
> 
> > Hmm, well that's odd.  It didn't grow it enough it seems.
> > 
> >>> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
> >>> insert 
> >>> the card and record the messages in dmesg when it does?  (You can likely 
> >>> get 
> >>> those out of kgdb.)
> 
> I tried your patch, and got some odd results. The good news is, no
> crash. However it did not actually enable the cards, with or without
> if_ath being loaded before inserting them. Here is the dmesg output with
> debug.bootverbose=1. This is with inserting and removing first one card,
> then the other.

Hmm, can you try without NEW_PCIB just as a test?  (You'll need to add
'nooption NEW_PCIB' to your kernel config file.)

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-11 Thread Doug Barton
On 07/08/2011 06:19, John Baldwin wrote:

> Hmm, well that's odd.  It didn't grow it enough it seems.
> 
>>> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
>>> insert 
>>> the card and record the messages in dmesg when it does?  (You can likely 
>>> get 
>>> those out of kgdb.)

I tried your patch, and got some odd results. The good news is, no
crash. However it did not actually enable the cards, with or without
if_ath being loaded before inserting them. Here is the dmesg output with
debug.bootverbose=1. This is with inserting and removing first one card,
then the other.

pcib5: attempting to grow memory window for (0x8800-0x,0x1)
back candidate range: 0x8800-0x8800
pcib5: grew memory window to 0x8000-0x880f
pcib5: allocated memory range (0x8800-0x8800) for rid 10 of
pci0:4:0:0
found-> vendor=0x168c, dev=0x0023, revid=0x01
domain=0, bus=4, slot=0, func=0
class=02-80-00, hdrtype=0x00, mfdev=0
cmdreg=0x, statreg=0x02b0, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=18
cardbus0:  at device 0.0 (no driver attached)
map[10]: type Memory, range 32, base 0, size 16, memory disabled
pcib5: allocated memory range (0x8800-0x8800) for rid 10 of
pci0:4:0:0
found-> vendor=0x168c, dev=0x0023, revid=0x01
domain=0, bus=4, slot=0, func=0
class=02-80-00, hdrtype=0x00, mfdev=0
cmdreg=0x, statreg=0x02b0, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=18
cardbus0:  at device 0.0 (no driver attached)
pcib5: allocated memory range (0x8800-0x8800) for rid 10 of
pci0:4:0:0
unknown: Lazy allocation of 0x1 bytes rid 0x10 type 3 at 0x8800
cbb0: Opening memory:
cbb0: Normal: 0x8800-0x8800
cbb0: Opening memory:
cbb0: Opening memory:
cbb0: Normal: 0x8800-0x8800
cbb0: Opening memory:
found-> vendor=0x168c, dev=0x0013, revid=0x01
domain=0, bus=4, slot=0, func=0
class=02-00-00, hdrtype=0x00, mfdev=0
cmdreg=0x0002, statreg=0x0290, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x0a (2500 ns), maxlat=0x1c (7000 ns)
intpin=a, irq=18
powerspec 2  supports D0 D3  current D0
cardbus0:  at device 0.0 (no driver attached)
pci0:4:0:0: Transition from D0 to D3


> The real messages I will want to see are in the dmesg.   Also, getting the
> output of 'devinfo -r' before you insert the card would also be helpful so
> I can see what it is growing from.

Attached.


Thanks for looking into this,

Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

nexus0
  apic0
  ram0
  I/O memory addresses:
  0x0-0x9efff
  0x10-0x7fe813ff
  acpi0
  Interrupt request lines:
  9
  I/O ports:
  0x20-0x21
  0x2e-0x2f
  0x4e-0x4f
  0x86
  0x92
  0xa0-0xa1
  0xb2
  0xb3
  0x4d0-0x4d1
  0x809
  0x910-0x91f
  0x920-0x92f
  0x930-0x97f
  0xc80-0xcaf
  0xcbc-0xcbf
  0xcc0-0xcff
  0x1000-0x1005
  0x1006-0x1007
  0x1008-0x1059
  0x1060-0x107f
  0x1080-0x10bf
  0x10c0-0x10df
  0xf400-0xf4fe
  I/O memory addresses:
  0x9fc00-0x9
  0xc-0xc
  0xe-0xf
  0x7fe81400-0x7fef
  0x7ff0-0x7fff
  0xf000-0xf3ff
  0xf400-0xf4003fff
  0xf4004000-0xf4004fff
  0xf4005000-0xf4005fff
  0xf4006000-0xf4006fff
  0xf4008000-0xf400bfff
  0xfec0-0xfec0
  0xfed2-0xfed3
  0xfed45000-0xfed9
  0xfee0-0xfee0
  0xffa8-0xffa83fff
  0xffb0-0x
cpu0
ACPI I/O ports:
0x1014
0x1016
  est0
  acpi_perf0
  cpufreq0
  coretemp0
cpu1
ACPI I/O ports:
0x1014
0x1016
  est1
  acpi_perf1
  cpufreq1
  coretemp1
acpi_acad0
battery0
battery1
acpi_lid0
acpi_button0
acpi_button1
acpi_sysresource0
pcib0
  pci0
hostb0
pcib1
I/O memory addresses:
0xd000-0xdfff
0xed00-0xefef
  pci1
vgapci0
Interrupt request lines:
16
pcib1 memory window:
0xed00-0xedff
0xee00-0xeeff
pcib1 prefetch window:
0xd000-0xdfff
  vgapm0
  nvidia0
hdac0
   

Re: cardbus panic: end address is not aligned

2011-07-09 Thread Warner Losh
I'm also interested in this problem too if it is in the CardBus layer.  This 
sounds like a problem with jhb's latest pci resource stuff, since that code is 
shared with CardBus...

Another alternative to crashdups is a serial console :)

I've not seen this, but haven't tried two ATH cards in a laptop in about three 
years...  Chances are really good, however, that it has nothing to do with ath, 
other than the specific sizes and numbers of resources it tries to allocate...

Warner

On Jul 8, 2011, at 7:19 AM, John Baldwin wrote:

> On Friday, July 08, 2011 4:48:35 am Doug Barton wrote:
>> On 07/07/2011 14:20, John Baldwin wrote:
>>> On Sunday, July 03, 2011 1:39:18 am Doug Barton wrote:
 I have 2 ath-based pc-card adapters. If I put either one of them in the 
 slot while the system is up, or if I try booting with them in the slot, 
 I get an instant panic. The cards previously worked in -current, and 
 continue to work in 8-stable and windows xp. I don't have any other 
 pc-cards to compare with. Full core.txt.0 file is in my home directory 
 on freefall.
 
 This problem persists on r223732 but happened to me for the first time a 
 week or 2 ago (haven't had time to report it previously, apologies). It 
 likely originated a while before though, I don't use these cards very 
 often.
 
 panic: end address is not aligned
 
 #1  0x80426a8a in kern_reboot (howto=260)
 at /home/svn/head/sys/kern/kern_shutdown.c:430
 #2  0x80426521 in panic (fmt=Variable "fmt" is not available.
 )
 at /home/svn/head/sys/kern/kern_shutdown.c:604
 #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
 w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536, 
 flags=Variable "flags" is not available.
>>> 
>>> The line is here:
>>> 
>>> KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1,
>>> ("end address is not aligned"));
>>> 
>>> Can you run kgdb and do 'frame 3' and 'p/x *w'?
>> 
>> (kgdb) frame 3
>> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
>>w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536,
>> flags=Variable "flags" is not available.
>> )
>>at /home/svn/head/sys/dev/pci/pci_pci.c:1018
>> 1018 KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) 
>> - 1,
>> (kgdb) p/x *w
>> $1 = {base = 0x8000, limit = 0x8800, rman = {rm_list = {
>>  tqh_first = 0xfe0002702a00, tqh_last = 0xfe0002702a98},
>>rm_mtx = 0xfe00024e20e0, rm_link = {tqe_next = 0xfe0002603520,
>>  tqe_prev = 0xfe0002603448}, rm_start = 0x0, rm_end = 0x,
>>rm_type = 0x2, rm_descr = 0xfe0002608060}, res =
>> 0xfe0002702b00,
>>  reg = 0x20, valid = 0x1, mask = 0x2, step = 0x14, name =
>> 0x8071b77c}
> 
> Hmm, well that's odd.  It didn't grow it enough it seems.
> 
>>> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
>>> insert 
>>> the card and record the messages in dmesg when it does?  (You can likely 
>>> get 
>>> those out of kgdb.)
>> 
>> The system panics instantly when I insert the cards. Would a verbose
>> dmesg entry from 8.2-stable work? I can do that on the same hardware.
>> If not I can try it on -current and see if anything gets logged.
> 
> Err, if you can get a crashdump, you can use 'printf "%s", msgbufp->msg_ptr'
> in kgdb to output all of dmseg.  You can also use the 'dmesg' command against
> a crash dump directly, and if you have crashinfo enabled, the tail of the
> core.txt.N file in /var/crash will have the full dmesg in it as well.
> 
> The real messages I will want to see are in the dmesg.   Also, getting the
> output of 'devinfo -r' before you insert the card would also be helpful so
> I can see what it is growing from.
> 
> Actually, forgo all that.  Try this patch:
> 
> Index: pci_pci.c
> ===
> --- pci_pci.c (revision 223847)
> +++ pci_pci.c (working copy)
> @@ -954,7 +954,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pci
>   if (bootverbose)
>   printf("\tback candidate range: %#lx-%#lx\n",
>   start_free, back);
> - back = roundup2(back + 1, w->step) - 1;
> + back = roundup2(back + 1, 1ul << w->step) - 1;
>   back -= rman_get_end(w->res);
>   } else
>   back = 0;
> 
> -- 
> John Baldwin
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
> 
> 

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send

Re: cardbus panic: end address is not aligned

2011-07-08 Thread John Baldwin
On Friday, July 08, 2011 4:48:35 am Doug Barton wrote:
> On 07/07/2011 14:20, John Baldwin wrote:
> > On Sunday, July 03, 2011 1:39:18 am Doug Barton wrote:
> >> I have 2 ath-based pc-card adapters. If I put either one of them in the 
> >> slot while the system is up, or if I try booting with them in the slot, 
> >> I get an instant panic. The cards previously worked in -current, and 
> >> continue to work in 8-stable and windows xp. I don't have any other 
> >> pc-cards to compare with. Full core.txt.0 file is in my home directory 
> >> on freefall.
> >>
> >> This problem persists on r223732 but happened to me for the first time a 
> >> week or 2 ago (haven't had time to report it previously, apologies). It 
> >> likely originated a while before though, I don't use these cards very 
> >> often.
> >>
> >> panic: end address is not aligned
> >>
> >> #1  0x80426a8a in kern_reboot (howto=260)
> >>  at /home/svn/head/sys/kern/kern_shutdown.c:430
> >> #2  0x80426521 in panic (fmt=Variable "fmt" is not available.
> >> )
> >>  at /home/svn/head/sys/kern/kern_shutdown.c:604
> >> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
> >>  w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536, 
> >> flags=Variable "flags" is not available.
> > 
> > The line is here:
> > 
> > KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1,
> > ("end address is not aligned"));
> > 
> > Can you run kgdb and do 'frame 3' and 'p/x *w'?
> 
> (kgdb) frame 3
> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
> w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536,
> flags=Variable "flags" is not available.
> )
> at /home/svn/head/sys/dev/pci/pci_pci.c:1018
> 1018  KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) 
> - 1,
> (kgdb) p/x *w
> $1 = {base = 0x8000, limit = 0x8800, rman = {rm_list = {
>   tqh_first = 0xfe0002702a00, tqh_last = 0xfe0002702a98},
> rm_mtx = 0xfe00024e20e0, rm_link = {tqe_next = 0xfe0002603520,
>   tqe_prev = 0xfe0002603448}, rm_start = 0x0, rm_end = 0x,
> rm_type = 0x2, rm_descr = 0xfe0002608060}, res =
> 0xfe0002702b00,
>   reg = 0x20, valid = 0x1, mask = 0x2, step = 0x14, name =
> 0x8071b77c}

Hmm, well that's odd.  It didn't grow it enough it seems.

> > Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', 
> > insert 
> > the card and record the messages in dmesg when it does?  (You can likely 
> > get 
> > those out of kgdb.)
> 
> The system panics instantly when I insert the cards. Would a verbose
> dmesg entry from 8.2-stable work? I can do that on the same hardware.
> If not I can try it on -current and see if anything gets logged.

Err, if you can get a crashdump, you can use 'printf "%s", msgbufp->msg_ptr'
in kgdb to output all of dmseg.  You can also use the 'dmesg' command against
a crash dump directly, and if you have crashinfo enabled, the tail of the
core.txt.N file in /var/crash will have the full dmesg in it as well.

The real messages I will want to see are in the dmesg.   Also, getting the
output of 'devinfo -r' before you insert the card would also be helpful so
I can see what it is growing from.

Actually, forgo all that.  Try this patch:

Index: pci_pci.c
===
--- pci_pci.c   (revision 223847)
+++ pci_pci.c   (working copy)
@@ -954,7 +954,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pci
if (bootverbose)
printf("\tback candidate range: %#lx-%#lx\n",
start_free, back);
-   back = roundup2(back + 1, w->step) - 1;
+   back = roundup2(back + 1, 1ul << w->step) - 1;
back -= rman_get_end(w->res);
} else
back = 0;

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-08 Thread Doug Barton
On 07/07/2011 14:20, John Baldwin wrote:
> On Sunday, July 03, 2011 1:39:18 am Doug Barton wrote:
>> I have 2 ath-based pc-card adapters. If I put either one of them in the 
>> slot while the system is up, or if I try booting with them in the slot, 
>> I get an instant panic. The cards previously worked in -current, and 
>> continue to work in 8-stable and windows xp. I don't have any other 
>> pc-cards to compare with. Full core.txt.0 file is in my home directory 
>> on freefall.
>>
>> This problem persists on r223732 but happened to me for the first time a 
>> week or 2 ago (haven't had time to report it previously, apologies). It 
>> likely originated a while before though, I don't use these cards very 
>> often.
>>
>> panic: end address is not aligned
>>
>> #1  0x80426a8a in kern_reboot (howto=260)
>>  at /home/svn/head/sys/kern/kern_shutdown.c:430
>> #2  0x80426521 in panic (fmt=Variable "fmt" is not available.
>> )
>>  at /home/svn/head/sys/kern/kern_shutdown.c:604
>> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
>>  w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536, 
>> flags=Variable "flags" is not available.
> 
> The line is here:
> 
>   KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1,
>   ("end address is not aligned"));
> 
> Can you run kgdb and do 'frame 3' and 'p/x *w'?

(kgdb) frame 3
#3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536,
flags=Variable "flags" is not available.
)
at /home/svn/head/sys/dev/pci/pci_pci.c:1018
1018KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) 
- 1,
(kgdb) p/x *w
$1 = {base = 0x8000, limit = 0x8800, rman = {rm_list = {
  tqh_first = 0xfe0002702a00, tqh_last = 0xfe0002702a98},
rm_mtx = 0xfe00024e20e0, rm_link = {tqe_next = 0xfe0002603520,
  tqe_prev = 0xfe0002603448}, rm_start = 0x0, rm_end = 0x,
rm_type = 0x2, rm_descr = 0xfe0002608060}, res =
0xfe0002702b00,
  reg = 0x20, valid = 0x1, mask = 0x2, step = 0x14, name =
0x8071b77c}



> Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', insert 
> the card and record the messages in dmesg when it does?  (You can likely get 
> those out of kgdb.)

The system panics instantly when I insert the cards. Would a verbose
dmesg entry from 8.2-stable work? I can do that on the same hardware.
If not I can try it on -current and see if anything gets logged.


Thanks for taking a look!

Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-07 Thread John Baldwin
On Sunday, July 03, 2011 1:39:18 am Doug Barton wrote:
> I have 2 ath-based pc-card adapters. If I put either one of them in the 
> slot while the system is up, or if I try booting with them in the slot, 
> I get an instant panic. The cards previously worked in -current, and 
> continue to work in 8-stable and windows xp. I don't have any other 
> pc-cards to compare with. Full core.txt.0 file is in my home directory 
> on freefall.
> 
> This problem persists on r223732 but happened to me for the first time a 
> week or 2 ago (haven't had time to report it previously, apologies). It 
> likely originated a while before though, I don't use these cards very 
> often.
> 
> panic: end address is not aligned
> 
> #1  0x80426a8a in kern_reboot (howto=260)
>  at /home/svn/head/sys/kern/kern_shutdown.c:430
> #2  0x80426521 in panic (fmt=Variable "fmt" is not available.
> )
>  at /home/svn/head/sys/kern/kern_shutdown.c:604
> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
>  w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536, 
> flags=Variable "flags" is not available.

The line is here:

KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1,
("end address is not aligned"));

Can you run kgdb and do 'frame 3' and 'p/x *w'?

Also, can you boot your machine, then do 'sysctl debug.bootverbose=1', insert 
the card and record the messages in dmesg when it does?  (You can likely get 
those out of kgdb.)

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-04 Thread Bernhard Schmidt
On Monday, July 04, 2011 10:37:12 Doug Barton wrote:
> On 07/03/2011 03:05, Adrian Chadd wrote:
> > The obvious question - can you bisect kernel versions to find out when it 
> > broke?
> 
> Sorry, I thought the answer to that was obvious from my message. I have 
> no idea how far back the breakage goes since I don't use the cards often.

Try at least r222753, which worked for me [tm].

-- 
Bernhard
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-04 Thread Adrian Chadd
On 4 July 2011 16:37, Doug Barton  wrote:
> On 07/03/2011 03:05, Adrian Chadd wrote:
>>
>> The obvious question - can you bisect kernel versions to find out when it
>> broke?
>
> Sorry, I thought the answer to that was obvious from my message. I have no
> idea how far back the breakage goes since I don't use the cards often.

Right. Well, are you able to boot some vintage kernels going back 12
months and see whether it's still broken?



Adrian
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-04 Thread Doug Barton

On 07/03/2011 03:05, Adrian Chadd wrote:

The obvious question - can you bisect kernel versions to find out when it broke?


Sorry, I thought the answer to that was obvious from my message. I have 
no idea how far back the breakage goes since I don't use the cards often.



Doug

--

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: cardbus panic: end address is not aligned

2011-07-03 Thread Adrian Chadd
The obvious question - can you bisect kernel versions to find out when it broke?


Adrian

On 3 July 2011 13:39, Doug Barton  wrote:
> I have 2 ath-based pc-card adapters. If I put either one of them in the slot
> while the system is up, or if I try booting with them in the slot, I get an
> instant panic. The cards previously worked in -current, and continue to work
> in 8-stable and windows xp. I don't have any other pc-cards to compare with.
> Full core.txt.0 file is in my home directory on freefall.
>
> This problem persists on r223732 but happened to me for the first time a
> week or 2 ago (haven't had time to report it previously, apologies). It
> likely originated a while before though, I don't use these cards very often.
>
> panic: end address is not aligned
>
> #1  0x80426a8a in kern_reboot (howto=260)
>    at /home/svn/head/sys/kern/kern_shutdown.c:430
> #2  0x80426521 in panic (fmt=Variable "fmt" is not available.
> )
>    at /home/svn/head/sys/kern/kern_shutdown.c:604
> #3  0x8032c648 in pcib_grow_window (sc=0xfe0002603400,
>    w=0xfe0002603498, type=3, start=0, end=4294967295, count=65536,
> flags=Variable "flags" is not available.
>
> ) at /home/svn/head/sys/dev/pci/pci_pci.c:1018
> #4  0x8032c8f7 in pcib_alloc_resource (dev=0xfe00026f2600,
>    child=0xfe0002eaf800, type=Variable "type" is not available.
> )
>    at /home/svn/head/sys/dev/pci/pci_pci.c:1090
> #5  0x80325bdd in pci_alloc_resource (dev=0xfe000279bd00,
>    child=0xfe0002eaf800, type=3, rid=0xff8000309688,
>    start=2281701376, end=18446744073709551615, count=65536, flags=16384)
>    at bus_if.h:263
> #6  0x8031bd25 in cbb_alloc_resource (brdev=Variable "brdev" is not
> available.
> ) at bus_if.h:263
> #7  0x80325d8e in pci_alloc_resource (dev=0xfe000279ed00,
>    child=0xfe0002eaf800, type=3, rid=0xff8000309688, start=0,
>    end=18446744073709551615, count=1, flags=16384) at bus_if.h:263
> #8  0x80456f39 in bus_alloc_resource (dev=0xfe0002eaf800,
> type=3,
>    rid=0xff8000309688, start=0, end=18446744073709551615, count=1,
>    flags=12290) at bus_if.h:263
> #9  0x802faa60 in cardbus_parse_cis (cbdev=0xfe000279ed00,
>    child=0xfe0002eaf800, callbacks=0xff8000309af0,
>    argp=0xfe0002e2d140) at bus.h:415
> #10 0x802fb0c1 in cardbus_device_create (sc=0xfe00025d8030,
>    devi=0xfe0002e2d000, parent=Variable "parent" is not available.
> )
>    at /home/svn/head/sys/dev/cardbus/cardbus_device.c:105
> #11 0x802f9c4e in cardbus_attach_card (cbdev=0xfe000279ed00)
>    at /home/svn/head/sys/dev/cardbus/cardbus.c:191
> #12 0x8031ba44 in cbb_event_thread (arg=Variable "arg" is not
> available.
> ) at card_if.h:83
> #13 0x803fb355 in fork_exit (
>    callout=0x8031b660 , arg=0xfe0002599800,
>    frame=0xff8000309c50) at /home/svn/head/sys/kern/kern_fork.c:920
> #14 0x80666c4e in fork_trampoline ()
>    at /home/svn/head/sys/amd64/amd64/exception.S:603
>
>
>
> --
>
>        Nothin' ever doesn't change, but nothin' changes much.
>                        -- OK Go
>
>        Breadth of IT experience, and depth of knowledge in the DNS.
>        Yours for the right price.  :)  http://SupersetSolutions.com/
>
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"