public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] PCI: fix cardbus and sriov regressions
@ 2011-06-20 22:47 Ram Pai
  0 siblings, 0 replies; 5+ messages in thread
From: Ram Pai @ 2011-06-20 22:47 UTC (permalink / raw)
  To: jbarnes
  Cc: linux-kernel, linux-mmc, svenkatr, yinghai, cjb, linux-pci,
	linux-net-drivers, bhutchings, Ram Pai

The following patch-set fixes regressions caused by:

the commit "PCI: update bridge resources to get more big ranges when allocating space (again)"
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=da7822e5ad71ec9b745b412639f1e5e0ba795a20

patch 1/4: correctly calculates the additional resource size for hotplug bridges.
patch 2/4: ability to resize assigned pci-resource.
patch 3/4: makes SRIOV BARs a nice-to-have resource, which means resources will
		be attempted to assign, but not gauranteed to succeed.
patch 4/4: makes cardbus bridge resources nice-to-have resource.


The regression was caused because on some platforms with limited i/o and mem
resources, the nice-to-have resources were allocated ahead of
absolutely-required resources, thus starving the latter. The patchset will
ensure that all the mandatory resource requirements are satisfied before any
nice-to-have resource requirements are satisfied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/4] PCI: fix cardbus and sriov regressions
       [not found]       ` <4DFFC2FC.5050502@hartkopp.net>
@ 2011-06-23 14:55         ` Oliver Hartkopp
  2011-06-24 19:29           ` Ram Pai
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Hartkopp @ 2011-06-23 14:55 UTC (permalink / raw)
  To: Ram Pai; +Cc: yinghai, jbarnes, linux-kernel

Hello RP,

unfortunately i noticed the discussion on linux-kernel ML a bit late, as i did
not subscribe it due to the traffic.

Did you get further with the unusual alignment?

Even if i did not see any problems (i did not test the CardBus slot but only
the sdhci_pci), i wonder if the register layout of some adapters would get
into problems with this alignment shown below?!?

Regards,
Oliver

ps. pls put me in CC in the next patch servies. tnx

On 21.06.2011 00:00, Oliver Hartkopp wrote:

>>>
>>> When comparing the logs with mgdiff, i found
>>>
>>> in revered:
>>>
>>> pci_bus 0000:04: resource 0 [io  0x2000-0x20ff]
>>> pci_bus 0000:04: resource 1 [io  0x2400-0x24ff]
>>>
>>> in the fixed version (4 patches)
>>>
>>> pci_bus 0000:04: resource 0 [io  0x2400-0x24ff]
>>> pci_bus 0000:04: resource 1 [io  0x2001-0x2100]
>>>
>>> Don't you think that the ressource 0x2001-0x2100 looks a bit weird?
>>>
>>> off-by-one problem?
>>
>> The resource location has slid by 1. That is because a reassign of
>> resource unfortunately does not let me realign it at the same location.
>>
>> ALIGN() macro is causing that weirdness.
>>
>> However is that slide by 1 causing you any problem?
> 
> No. I don't have a PCMCIA card here to test but the SD-Card is working
> properly. I just wondered about the unusual alignment ...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/4] PCI: fix cardbus and sriov regressions
  2011-06-23 14:55         ` [PATCH 0/4] PCI: fix cardbus and sriov regressions Oliver Hartkopp
@ 2011-06-24 19:29           ` Ram Pai
  2011-06-25 11:35             ` Oliver Hartkopp
  2011-06-27 17:34             ` Bjorn Helgaas
  0 siblings, 2 replies; 5+ messages in thread
From: Ram Pai @ 2011-06-24 19:29 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: yinghai, jbarnes, linux-kernel

On Thu, Jun 23, 2011 at 04:55:06PM +0200, Oliver Hartkopp wrote:
> Hello RP,
> 
> unfortunately i noticed the discussion on linux-kernel ML a bit late, as i did
> not subscribe it due to the traffic.

sorry, did not see this mail earlier.


> >>> When comparing the logs with mgdiff, i found
> >>>
> >>> in revered:
> >>>
> >>> pci_bus 0000:04: resource 0 [io  0x2000-0x20ff]
> >>> pci_bus 0000:04: resource 1 [io  0x2400-0x24ff]
> >>>
> >>> in the fixed version (4 patches)
> >>>
> >>> pci_bus 0000:04: resource 0 [io  0x2400-0x24ff]
> >>> pci_bus 0000:04: resource 1 [io  0x2001-0x2100]
>
> Did you get further with the unusual alignment?

No. i was thinking this alignment  should be ok, since that cardbus resource
has to be SIZE aligned and not START aligned.

However if it is not acceptable, i will figure out a way
to get it aligned on the right boundaries.

RP

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/4] PCI: fix cardbus and sriov regressions
  2011-06-24 19:29           ` Ram Pai
@ 2011-06-25 11:35             ` Oliver Hartkopp
  2011-06-27 17:34             ` Bjorn Helgaas
  1 sibling, 0 replies; 5+ messages in thread
From: Oliver Hartkopp @ 2011-06-25 11:35 UTC (permalink / raw)
  To: Ram Pai, yinghai; +Cc: jbarnes, linux-kernel

On 24.06.2011 21:29, Ram Pai wrote:
> On Thu, Jun 23, 2011 at 04:55:06PM +0200, Oliver Hartkopp wrote:
>> Hello RP,
>>
>> unfortunately i noticed the discussion on linux-kernel ML a bit late, as i did
>> not subscribe it due to the traffic.
> 
> sorry, did not see this mail earlier.
> 
> 
>>>>> When comparing the logs with mgdiff, i found
>>>>>
>>>>> in revered:
>>>>>
>>>>> pci_bus 0000:04: resource 0 [io  0x2000-0x20ff]
>>>>> pci_bus 0000:04: resource 1 [io  0x2400-0x24ff]
>>>>>
>>>>> in the fixed version (4 patches)
>>>>>
>>>>> pci_bus 0000:04: resource 0 [io  0x2400-0x24ff]
>>>>> pci_bus 0000:04: resource 1 [io  0x2001-0x2100]
>>
>> Did you get further with the unusual alignment?
> 
> No. i was thinking this alignment  should be ok, since that cardbus resource
> has to be SIZE aligned and not START aligned.
> 
> However if it is not acceptable, i will figure out a way
> to get it aligned on the right boundaries.

I'm not sure how drivers expect to access the register layouts of their
specific hardware. E.g. if you have a 32-bit register at the beginning of the
io resource and the driver accesses this with a 32-bit write operation, the
misalignment would be handled (by the CPU) very expensive at runtime, which is
definitely a big drawback in performance. I know the networking people
re-arranging structs to get less cycles in accessing data structures ...

I tried to understand the reason for the original commit in 3.0.0-rc1 that
broke my system - very ambitious :-)

But IMHO you should meet analogue starting boundaries as we had before to make
sure that you don't brake things on machines that did not show up yet.

Best regards,
Oliver

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/4] PCI: fix cardbus and sriov regressions
  2011-06-24 19:29           ` Ram Pai
  2011-06-25 11:35             ` Oliver Hartkopp
@ 2011-06-27 17:34             ` Bjorn Helgaas
  1 sibling, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2011-06-27 17:34 UTC (permalink / raw)
  To: Ram Pai; +Cc: Oliver Hartkopp, yinghai, jbarnes, linux-kernel, linux-pci

[+linux-pci again]

On Fri, Jun 24, 2011 at 1:29 PM, Ram Pai <linuxram@us.ibm.com> wrote:
> On Thu, Jun 23, 2011 at 04:55:06PM +0200, Oliver Hartkopp wrote:
>> Hello RP,
>>
>> unfortunately i noticed the discussion on linux-kernel ML a bit late, as i did
>> not subscribe it due to the traffic.
>
> sorry, did not see this mail earlier.
>
>
>> >>> When comparing the logs with mgdiff, i found
>> >>>
>> >>> in revered:
>> >>>
>> >>> pci_bus 0000:04: resource 0 [io  0x2000-0x20ff]
>> >>> pci_bus 0000:04: resource 1 [io  0x2400-0x24ff]
>> >>>
>> >>> in the fixed version (4 patches)
>> >>>
>> >>> pci_bus 0000:04: resource 0 [io  0x2400-0x24ff]
>> >>> pci_bus 0000:04: resource 1 [io  0x2001-0x2100]
>>
>> Did you get further with the unusual alignment?
>
> No. i was thinking this alignment  should be ok, since that cardbus resource
> has to be SIZE aligned and not START aligned.
>
> However if it is not acceptable, i will figure out a way
> to get it aligned on the right boundaries.

Does the bridge leading to bus 04 really support a window starting at 0x2001?

I assume this is a CardBus bridge because it has two I/O windows.  My
interpretation of the MindShare CardBus book (I don't have the PC Card
Standard) is that the low two bits of the I/O base address register
tell you whether 16- or 32-bit addressing is supported (00b means
16-bit decoding is used, 01b means 32-bit decoding is used), and that
the actual window starts on a four-byte aligned address.

If that's correct, an I/O base register containing 0x2001 would mean a
window starting at 0x2000 and supporting 32-bit decoding, and it would
be impossible to have a window starting at 0x2001, i.e., one that
contains 0x2001 but not 0x2000.

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-27 17:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1308561849-3223-1-git-send-email-linuxram@us.ibm.com>
     [not found] ` <4DFFB6B0.6090307@hartkopp.net>
     [not found]   ` <4DFFB945.5090203@hartkopp.net>
     [not found]     ` <20110620214127.GA22917@ram-laptop>
     [not found]       ` <4DFFC2FC.5050502@hartkopp.net>
2011-06-23 14:55         ` [PATCH 0/4] PCI: fix cardbus and sriov regressions Oliver Hartkopp
2011-06-24 19:29           ` Ram Pai
2011-06-25 11:35             ` Oliver Hartkopp
2011-06-27 17:34             ` Bjorn Helgaas
2011-06-20 22:47 Ram Pai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox