Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634489

Re: [PATCH 2/4] PCI: add functionality for resizing resources v3

Path csiph.com!goblin3!goblin.stu.neva.ru!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Christian König <deathsimple@vodafone.de>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] PCI: add functionality for resizing resources v3
Date Tue, 02 May 2017 18:00:01 +0200
Message-ID <tCInv-ek-1@gated-at.bofh.it> (permalink)
References <tA8Hv-5gk-3@gated-at.bofh.it> <tA8Hw-5gk-33@gated-at.bofh.it> <tAyBY-5dH-21@gated-at.bofh.it>
X-Spam-Flag NO
X-Spam-Score -0.045
Authentication-Results rohrpostix2.prod.vfnet.de (amavisd-new); dkim=pass header.i=@vodafone.de
X-Dkim OpenDKIM Filter v2.6.8 pegasos-out.vodafone.de D21F6564B0D
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafone.de; s=mail; t=1493740298; bh=Hczt6/GjYO+DCAhosA56m7zTW8L8hYaBkbJFvEluKwg=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=288Z74+cZ+kroMTXCzPWmNPWmeEGA0TtcAk1sp0i7arPUH3q1zoDBSXWghV1WVOxy UgAp1uLpQkFETsfEsSY7oxW0rPW/l5BSOE2uZ4L9UDWDG8Wcj8nRVdlw10NC4UsRXn Jr96dqosMifEtBP2zSgujOP+8ve5JWxcjbu0McVg=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
Organization linux.* mail to news gateway
X-Original-Cc helgaas@kernel.org, "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, dri-devel@lists.freedesktop.org, Platform Driver <platform-driver-x86@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
X-Original-Date Tue, 2 May 2017 17:51:36 +0200
X-Original-Message-ID <6238d127-1c70-8235-e247-bb6cb3f4c040@vodafone.de>
X-Original-References <1493126394-1239-1-git-send-email-deathsimple@vodafone.de> <1493126394-1239-3-git-send-email-deathsimple@vodafone.de> <CAHp75VfSFBYgHRsX2JSH0zdSEW8VvXbNMVvBBsD9kKgzGr-v2w@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1634489

Show key headers only | View raw


Am 26.04.2017 um 19:00 schrieb Andy Shevchenko:
> On Tue, Apr 25, 2017 at 4:19 PM, Christian König
> <deathsimple@vodafone.de> wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> This allows device drivers to request resizing their BARs.
>>
>> The function only tries to reprogram the windows of the bridge directly above
>> the requesting device and only the BAR of the same type (usually mem, 64bit,
>> prefetchable). This is done to make sure not to disturb other drivers by
>> changing the BARs of their devices.
>>
>> If reprogramming the bridge BAR fails the old status is restored and -ENOSPC
>> returned to the calling device driver.
>> +int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
>> +{
>> +       const unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
>> +               IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
>> +
> Redundant.

Redundant, but also a reminder to myself that I wanted to ask something 
about that.

This type_mask is used already three times in this file, shouldn't we 
add a define for that?

> [SNIP]
>> +       list_for_each_entry(dev_res, &saved, list) {
>> +               /* Skip the bridge we just assigned resources for. */
>> +               if (bridge == dev_res->dev)
>> +                       continue;
>> +
>> +               bridge = dev_res->dev;
>> +               pci_setup_bridge(bridge->subordinate);
>> +       }
>> +
>> +       free_list(&saved);
>> +       free_list(&failed);
>> +       return ret;
> You might re-use two lines with below, but perhaps better to show
> which case returns 0 explicitly and drop assignment ret = 0 above.

Good point, but actually the free_list(&failed) is superfluous here 
since when the failed list isn't empty we end up in the cleanup path.

Going to fix all other comments in the next version.

Regards,
Christian.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Resizeable PCI BAR support V4 Christian König <deathsimple@vodafone.de> - 2017-04-25 15:30 +0200
  [PATCH 1/4] PCI: add resizeable BAR infrastructure v4 Christian König <deathsimple@vodafone.de> - 2017-04-25 15:30 +0200
    Re: [PATCH 1/4] PCI: add resizeable BAR infrastructure v4 Alex Deucher <alexdeucher@gmail.com> - 2017-04-25 17:10 +0200
    Re: [PATCH 1/4] PCI: add resizeable BAR infrastructure v4 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-26 18:50 +0200
      Re: [PATCH 1/4] PCI: add resizeable BAR infrastructure v4 Christian König <deathsimple@vodafone.de> - 2017-05-02 17:00 +0200
  [PATCH 2/4] PCI: add functionality for resizing resources v3 Christian König <deathsimple@vodafone.de> - 2017-04-25 15:30 +0200
    Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-26 19:10 +0200
      Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Christian König <deathsimple@vodafone.de> - 2017-05-02 18:00 +0200
        Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-02 22:30 +0200
      Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Christian König <deathsimple@vodafone.de> - 2017-05-04 11:30 +0200
        Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-04 12:20 +0200
          Re: [PATCH 2/4] PCI: add functionality for resizing resources v3 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-04 18:50 +0200
  [PATCH 3/4] x86/PCI: Enable a 64bit BAR on AMD Family 15h (Models 30h-3fh) Processors v2 Christian König <deathsimple@vodafone.de> - 2017-04-25 15:30 +0200
    Re: [PATCH 3/4] x86/PCI: Enable a 64bit BAR on AMD Family 15h (Models  30h-3fh) Processors v2 Alex Deucher <alexdeucher@gmail.com> - 2017-04-25 17:10 +0200
    Re: [PATCH 3/4] x86/PCI: Enable a 64bit BAR on AMD Family 15h (Models  30h-3fh) Processors v2 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-26 19:20 +0200
  Re: Resizeable PCI BAR support V4 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-25 16:30 +0200

csiph-web