All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Ronen Hod <rhod@redhat.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	bhelgaas@google.com, mst@redhat.com
Subject: Re: [PATCH] PCI/shpchp: fix a bus speed issue on hotplug
Date: Sun, 04 May 2014 17:07:26 +0300	[thread overview]
Message-ID: <1399212446.4302.13.camel@localhost.localdomain> (raw)
In-Reply-To: <5366451E.1050800@redhat.com>

On Sun, 2014-05-04 at 16:48 +0300, Ronen Hod wrote:
> On 05/01/2014 05:35 PM, Marcel Apfelbaum wrote:
> > When a board is added, the shpchp driver checks if there
> > is a mismatch between the bridge's adapter and the bus speed.
> > If there is, it sets the subordinate speed (if there is no device on it).
> 
> Since the speed is irrelevant when running in a VM, I suggest that
> you either ignore it altogether, or "normalize" the speed of all the
> devices/bridges/buses in QEMU in order to avoid any conflicts
> in the first place.
Before this patch, this would not help since the primary bus speed
is not even set by the kernel.

After this patch, normalizing the QEMU device/bus/... speed may help
avoiding future conflicts, but we should discuss it in qemu mailing list :).

Ignoring emulated/para-virt device's speed when running in a VM it is\
a good question, but I don't know if such a distinction would be feasible.

Any thoughts would be appreciated,
Thanks,
Marcel

> 
> Thanks, Ronen.
> 
> >
> > However, it takes the reference of the board speed from the primary bus
> > and not from the subordinate. If the primary bus is PCI and not PCIX/PCIe,
> > its speed is not updated and remains 0xff. As a result hotplug fails
> > with error: "Speed of bus ff and adapter 0 mismatch".
> >
> > Fixed that by checking the speed against the subordinate bus.
> >
> > Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> > Acked-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >   drivers/pci/hotplug/shpchp_ctrl.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
> > index 5849927..6efc2ec 100644
> > --- a/drivers/pci/hotplug/shpchp_ctrl.c
> > +++ b/drivers/pci/hotplug/shpchp_ctrl.c
> > @@ -282,8 +282,8 @@ static int board_added(struct slot *p_slot)
> >   		return WRONG_BUS_FREQUENCY;
> >   	}
> >   
> > -	bsp = ctrl->pci_dev->bus->cur_bus_speed;
> > -	msp = ctrl->pci_dev->bus->max_bus_speed;
> > +	bsp = ctrl->pci_dev->subordinate->cur_bus_speed;
> > +	msp = ctrl->pci_dev->subordinate->max_bus_speed;
> >   
> >   	/* Check if there are other slots or devices on the same bus */
> >   	if (!list_empty(&ctrl->pci_dev->subordinate->devices))
> 




  reply	other threads:[~2014-05-04 14:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 14:35 [PATCH] PCI/shpchp: fix a bus speed issue on hotplug Marcel Apfelbaum
2014-05-01 15:43 ` Michael S. Tsirkin
2014-05-01 18:02 ` Bjorn Helgaas
2014-05-01 18:13   ` Marcel Apfelbaum
2014-05-01 18:57     ` Marcel Apfelbaum
2014-05-01 20:00       ` Bjorn Helgaas
2014-05-01 20:36         ` Marcel Apfelbaum
2014-05-04 10:40         ` Marcel Apfelbaum
2014-05-04 13:48 ` Ronen Hod
2014-05-04 14:07   ` Marcel Apfelbaum [this message]
2014-05-15 18:41 ` Bjorn Helgaas
2014-05-17 18:47   ` Michael S. Tsirkin

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=1399212446.4302.13.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=rhod@redhat.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.