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


Groups > linux.kernel > #1674061

Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource
Date Sat, 24 Jun 2017 11:50:01 +0200
Message-ID <tVPRv-69X-3@gated-at.bofh.it> (permalink)
References <tVIGl-1JB-3@gated-at.bofh.it> <tVIGl-1JB-5@gated-at.bofh.it>
X-Original-To Palmer Dabbelt <palmer@dabbelt.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GVptt8Rz2LBD/fmtUR7FFPBDRQzVdDKtF4ecqd7yfMc=; b=HmR1rIPZYGwZQyQvmcS1L1+zj09PO9UfUFCPbws34etvBSICAy91DBaNTiaSYDWb8f v79VkqBJcMfOcZ+M8ZkyjhMPmOkQTrgdXvIyixbVeCXPARbzlNJO9JhJLSFRXbDcmsBW awq532QaT5X6XKW4IqEWhI81l8kU5ndghex9O5aBVJoZ5O3GWApIOpfr8fU1a19rc14N n1Ilo7kVEnEbf4avJRNuUTsbIoC2jnUXeHvawkt3BtD77GjJYD6a2bFIuBouDaYX1PVI cNMxoMuDQOxpbbqUSrubjSaSsTUtzgCfrEd//4ZAsqmGUxp4izP92UR1Mcuzp3ONYyON dMdg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GVptt8Rz2LBD/fmtUR7FFPBDRQzVdDKtF4ecqd7yfMc=; b=TXK10V565l5yvHIkKPaVH4KHvFBMoj3iwveYpC+Sg4aLchK+mZTobsGpvBhkdKF13o H9MRRjQlOoAmSgO2rPhE+CGEtcbJXrmpHj5J3nahTH0oQ5Rs7MNqHDEBLfAYmzaM/TA5 m76rSnE4rRIrugKxPySAgGcgNsewFHPhrBKzwmj9F0C5Mw/kUKRqAuMTVfNwW/bJx5kw ZRLid4nstSYRy/MltdH5FdPrBdAU8f7AmbLGwzSIm6GsaDU78wzdHx79cCEdDsO19xSB 9n8pQ91ZXbi2pau8kJ5h+PO0A8wQL8N3XoG8Rt+zFwiNh4M4yixNLaVtTJ4/UfI90hBm EQBg==
X-Gm-Message-State AKS2vOxzP6fhmFh26vJqFv5mFDy8uRyCDBscVhU3cOyGGSXHIJ4TtwHJ 2iFFEOgZznKoLdnfpmDf/k/yGZwpRg==
X-Received by 10.107.170.80 with SMTP id t77mr12382711ioe.77.1498297302967; Sat, 24 Jun 2017 02:41:42 -0700 (PDT)
MIME-Version 1.0
X-Google-Sender-Auth rv-0G6bDIhMqcLgcC5UIQCrMyNc
Content-Type text/plain; charset="UTF-8"
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 44
Organization linux.* mail to news gateway
X-Original-Cc linux-pci <linux-pci@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Christoph Hellwig <hch@infradead.org>, Arnd Bergmann <arnd@arndb.de>, arcml <linux-snps-arc@lists.infradead.org>, Cris <linux-cris-kernel@axis.com>, "linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>, linux-s390 <linux-s390@vger.kernel.org>, Linux-sh list <linux-sh@vger.kernel.org>, sparclinux <sparclinux@vger.kernel.org>
X-Original-Date Sat, 24 Jun 2017 11:41:42 +0200
X-Original-Message-ID <CAMuHMdWrn4C5nwRSrA8i_8sFtpRbuQH9vtNWjq5rM5_Si15kbw@mail.gmail.com>
X-Original-References <20170624015044.16746-1-palmer@dabbelt.com> <20170624015044.16746-3-palmer@dabbelt.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1674061

Show key headers only | View raw


Hi Palmer,

On Sat, Jun 24, 2017 at 3:50 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> Multiple architectures define this as trivial function, and I'm adding
> another one as part of the RISC-V port.  This adds a __weak version of
> pcibios_align_resource and deletes the now obselete ones in a handful of
> ports.
>
> The only functional change should be that a handful of ports used to
> export pcibios_fixup_bus.  Only some architectures export this, so I
> just dropped it.
>
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>

This function is only ever used as a pointer passed to
pci_bus_alloc_resource()?

What about having

    #ifndef pcibios_fixup_bus
    #define pcibios_fixup_bus NULL
    #endif

in asm-generic/pci.h, letting the architecture with a non-trivial
implementation predefine the preprocessor symbol, and teaching
pci_bus_alloc_resource() to handle NULL?

[...]

Oh, the latter eventually calls into allocate_resource(), which already falls
back to simple_align_resource() if the alignment function is NULL, which
does the same thing.
So NULL should already work.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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


Thread

pci: Add generic pcibios_{fixup_bus,align_resource} Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
  [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
    Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-24 11:50 +0200
      Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 23:40 +0200
  [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
    Re: [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-24 11:40 +0200
      Re: [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 23:40 +0200
  [PATCH 3/3] arc: kernel/pcibios.c is empty, delete it Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200

csiph-web