15 Aug, 2020

1 commit

  • Patch series "iomap: Constify ioreadX() iomem argument", v3.

    The ioread8/16/32() and others have inconsistent interface among the
    architectures: some taking address as const, some not.

    It seems there is nothing really stopping all of them to take pointer to
    const.

    This patch (of 4):

    The ioreadX() and ioreadX_rep() helpers have inconsistent interface. On
    some architectures void *__iomem address argument is a pointer to const,
    on some not.

    Implementations of ioreadX() do not modify the memory under the address so
    they can be converted to a "const" version for const-safety and
    consistency among architectures.

    [krzk@kernel.org: sh: clk: fix assignment from incompatible pointer type for ioreadX()]
    Link: http://lkml.kernel.org/r/20200723082017.24053-1-krzk@kernel.org
    [akpm@linux-foundation.org: fix drivers/mailbox/bcm-pdc-mailbox.c]
    Link: http://lkml.kernel.org/r/202007132209.Rxmv4QyS%25lkp@intel.com

    Suggested-by: Geert Uytterhoeven
    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Andrew Morton
    Reviewed-by: Geert Uytterhoeven
    Reviewed-by: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: Kalle Valo
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Cc: Dave Jiang
    Cc: Jon Mason
    Cc: Allen Hubbe
    Cc: "Michael S. Tsirkin"
    Cc: Jason Wang
    Link: http://lkml.kernel.org/r/20200709072837.5869-1-krzk@kernel.org
    Link: http://lkml.kernel.org/r/20200709072837.5869-2-krzk@kernel.org
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

22 Jan, 2019

2 commits

  • In order to provide non-atomic functions for io{read|write}64 that will
    use readq and writeq when appropriate. We define a number of variants
    of these functions in the generic iomap that will do non-atomic
    operations on pio but atomic operations on mmio.

    These functions are only defined if readq and writeq are defined. If
    they are not, then the wrappers that always use non-atomic operations
    from include/linux/io-64-nonatomic*.h will be used.

    Signed-off-by: Logan Gunthorpe
    Reviewed-by: Andy Shevchenko
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Arnd Bergmann
    Cc: Suresh Warrier
    Cc: Nicholas Piggin
    Signed-off-by: Greg Kroah-Hartman

    Logan Gunthorpe
     
  • Fix an asymmetry in the io{read|write}XXbe functions in that the
    big-endian variants make use of the raw io accessors while the
    little-endian variants use the regular accessors. Some architectures
    implement barriers to order against both spinlocks and DMA accesses
    and for these case, the big-endian variant of the API would not be
    protected.

    Thus, change the mmio_XXXXbe macros to use the appropriate swab() function
    wrapping the regular accessor. This is similar to what was done for PIO.

    When this code was originally written, barriers in the IO accessors were
    not common and the accessors simply wrapped the raw functions in a
    conversion to CPU endianness. Since then, barriers have been added in
    some architectures and are now missing in the big endian variant of the
    API.

    This also manages to silence a few sparse warnings that check
    for using the correct endian types which the original code did
    not annotate correctly.

    Signed-off-by: Logan Gunthorpe
    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Cc: Greg Kroah-Hartman
    Cc: Arnd Bergmann
    Link: http://lkml.kernel.org/r/CAK8P3a25zQDxyaY3iVv+JmSSzs7F6ssGc+HdBkGs54ZfViX+Fg@mail.gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Logan Gunthorpe
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

08 Apr, 2014

1 commit

  • If the renamed symbol is defined lib/iomap.c implements ioport_map and
    ioport_unmap and currently (nearly) all platforms define the port
    accessor functions outb/inb and friend unconditionally. So
    HAS_IOPORT_MAP is the better name for this.

    Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.

    The motivation for this change is to reintroduce a symbol HAS_IOPORT
    that signals if outb/int et al are available. I will address that at
    least one merge window later though to keep surprises to a minimum and
    catch new introductions of (HAS|NO)_IOPORT.

    The changes in this commit were done using:

    $ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'

    Signed-off-by: Uwe Kleine-König
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     

08 Mar, 2012

1 commit


29 Nov, 2011

1 commit


23 Jul, 2011

1 commit


27 Jul, 2008

1 commit

  • Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes
    part of the warning section for better reporting/collection. In addition, one
    of the if() clauses collapes into the WARN() entirely now.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

29 Apr, 2008

1 commit

  • Almost all implementations of pci_iomap() in the kernel, including the generic
    lib/iomap.c one, copies the content of a struct resource into unsigned long's
    which will break on 32 bits platforms with 64 bits resources.

    This fixes all definitions of pci_iomap() to use resource_size_t. I also
    "fixed" the 64bits arch for consistency.

    Signed-off-by: Benjamin Herrenschmidt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     

25 Mar, 2008

1 commit

  • It appears that 64-bit PCI resources cannot possibly ever have worked on
    x86-32 even when the RESOURCES_64BIT config option was set, because any
    driver that tried to [pci_]ioremap() the resource would have been unable
    to do so because the high 32 bits would have been silently dropped on
    the floor by the ioremap() routines that only used "unsigned long".

    Change them to use "resource_size_t" instead, which properly encodes the
    whole 64-bit resource data if RESOURCES_64BIT is enabled.

    Acked-by: H. Peter Anvin
    Acked-by: Stefan Richter
    Cc: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

09 Feb, 2008

1 commit


17 Oct, 2007

1 commit


23 Aug, 2007

1 commit

  • This useful interface is hardly mentioned anywhere in the in-tree
    documentation.

    Signed-off-by: Rolf Eike Beer
    Cc: Tejun Heo
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Rolf Eike Beer
     

05 May, 2007

1 commit

  • We used to BUG_ON() for a badly mapped IO port, which is certainly
    correct, but actually made it harder to debug the case where the ATA
    drivers had incorrectly mapped a nonconnected ATA port.

    So make badly mapped ports trigger a WARN_ON(), and throw the IO away
    instead (and return all ones for reads). For things like broken driver
    initialization - which is the most likely cause anyway - that should
    mean that the machine comes up and is usable (at least that was the case
    for the ATA breakage that triggered this patch).

    It tends to be a whole lot easier to do a "dmesg" on a working machine
    than to try to capture logs off a dead one.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

12 Feb, 2007

1 commit

  • * Split the implementation-agnostic stuff in separate files.
    * Make sure that targets using non-default request_irq() pull
    kernel/irq/devres.o
    * Introduce new symbols (HAS_IOPORT and HAS_IOMEM) defaulting to positive;
    allow architectures to turn them off (we needed these symbols anyway for
    dependencies of quite a few drivers).
    * protect the ioport-related parts of lib/devres.o with CONFIG_HAS_IOPORT.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

10 Feb, 2007

2 commits

  • Implement pcim_iomap_regions(). This function takes mask of BARs to
    request and iomap. No BAR should have length of zero. BARs are
    iomapped using pcim_iomap_table().

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement device resource management, in short, devres. A device
    driver can allocate arbirary size of devres data which is associated
    with a release function. On driver detach, release function is
    invoked on the devres data, then, devres data is freed.

    devreses are typed by associated release functions. Some devreses are
    better represented by single instance of the type while others need
    multiple instances sharing the same release function. Both usages are
    supported.

    devreses can be grouped using devres group such that a device driver
    can easily release acquired resources halfway through initialization
    or selectively release resources (e.g. resources for port 1 out of 4
    ports).

    This patch adds devres core including documentation and the following
    managed interfaces.

    * alloc/free : devm_kzalloc(), devm_kzfree()
    * IO region : devm_request_region(), devm_release_region()
    * IRQ : devm_request_irq(), devm_free_irq()
    * DMA : dmam_alloc_coherent(), dmam_free_coherent(),
    dmam_declare_coherent_memory(), dmam_pool_create(),
    dmam_pool_destroy()
    * PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
    * iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
    devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
    pcim_iomap(), pcim_iounmap()

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

04 Dec, 2006

1 commit


17 Apr, 2005

2 commits

  • In the new io infrastructure, all of our operators are expecting the
    underlying device to be little endian (because the PCI bus, their main
    consumer, is LE).

    However, there are a fair few devices and busses in the world that are
    actually Big Endian. There's even evidence that some of these BE bus and
    chip types are attached to LE systems. Thus, there's a need for a BE
    equivalent of our io{read,write}{16,32} operations.

    The attached patch adds this as io{read,write}{16,32}be. When it's in,
    I'll add the first consume (the 53c700 SCSI chip driver).

    Signed-off-by: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds