06 Feb, 2008

40 commits

  • This adds IOMMU helper functions for the free area management. These
    functions take care of LLD's segment boundary limit for IOMMUs. They would be
    useful for IOMMUs that use bitmap for the free area management.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This sets the segment size limit properly via pci_set_dma_max_seg_size
    and remove blk_queue_max_segment_size because scsi-ml calls it.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Acked-by: "Salyzyn, Mark"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This sets the segment size limit properly via pci_set_dma_max_seg_size
    and remove blk_queue_max_segment_size because scsi-ml calls it.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • request_queue and device struct must have the same value of a segment
    size limit. This patch adds blk_queue_segment_boundary in
    __scsi_alloc_queue so LLDs don't need to call both
    blk_queue_segment_boundary and set_dma_max_seg_size. A LLD can change
    the default value (64KB) can call device_dma_parameters accessors like
    pci_set_dma_max_seg_size when allocating scsi_host.

    Signed-off-by: FUJITA Tomonori
    Acked-by: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes iommu respect segment size limits when merging sg
    lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: Kyle McMartin
    Acked-by: Grant Grundler
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes iommu respect segment size limits when merging sg
    lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes pci_iommu respect segment size limits when merging sg
    lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes sba iommu respect segment size limits when merging sg
    lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes iommu respect segment size limits when merging sg
    lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This patch makes pci-gart iommu respect segment size limits when
    merging sg lists.

    Signed-off-by: FUJITA Tomonori
    Cc: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Cc: Dave Airlie
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • This adds struct device_dma_parameters in struct pci_dev and properly
    sets up a pointer in struct device.

    The default max_segment_size is set to 64K, same to the block layer's
    default value.

    Signed-off-by: FUJITA Tomonori
    Mostly-acked-by: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • IOMMUs merges scatter/gather segments without considering a low level
    driver's restrictions. The problem is that IOMMUs can't access to the
    limitations because they are in request_queue.

    This patchset introduces a new structure, device_dma_parameters,
    including dma information. A pointer to device_dma_parameters is added
    to struct device. The bus specific structures (like pci_dev) includes
    device_dma_parameters. Low level drivers can use dma_set_max_seg_size
    to tell IOMMUs about the restrictions.

    We can move more dma stuff in struct device (like dma_mask) to struct
    device_dma_parameters later (needs some cleanups before that).

    This includes patches for all the IOMMUs that could merge sg (x86_64,
    ppc, IA64, alpha, sparc64, and parisc) though only the ppc patch was
    tested. The patches for other IOMMUs are only compile tested.

    This patch:

    Add a new structure, device_dma_parameters, including dma information. A
    pointer to device_dma_parameters is added to struct device.

    - there are only max_segment_size and segment_boundary_mask there but we'll
    move more dma stuff in struct device (like dma_mask) to struct
    device_dma_parameters later. segment_boundary_mask is not supported yet.

    - new accessors for the dma parameters are added. So we can easily change
    where to place struct device_dma_parameters in the future.

    - dma_get_max_seg_size returns 64K if dma_parms in struct device isn't set
    up properly. 64K is the default max_segment_size in the block layer.

    Signed-off-by: FUJITA Tomonori
    Acked-by: Jeff Garzik
    Cc: James Bottomley
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • The clock to generate the desired baudrate with the MPSC is first divided
    by the Baud Rate Generator (BRG) and then by the MPSC itself. So, when the
    BRG divider is changed, the MPSC divider must also be changed to generate
    the correct baudrate. During MPSC initialization, the BRG divider is
    changed but the MPSC divider isn't changed until much later. This results
    in some printk's coming out garbled. To fix that, set the MPSC divider at
    the same time that the BRG divider is changed.

    Signed-off-by: Mark A. Greer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark A. Greer
     
  • Coding style tweaks and printk levels.

    Signed-off-by: Alan Cox

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

    Alan Cox
     
  • Invalid speeds are forced to 9600. Update the code for this to encode new
    style baud rates properly.

    Signed-off-by: Alan Cox
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Some ports seem to be unable to drain their transmitters on shut down. Such a
    problem can occur if the port is programmed for hardware imposed flow control,
    characters are in the FIFO but the CTS signal is inactive.

    Normally, this isn't a problem because most places where we wait for the
    transmitter to drain have a time-out. However, there is no timeout in the
    suspend path.

    Give a port 30ms to drain; this is an arbitary value chosen to avoid long
    delays if there are many such ports in the system, while giving a reasonable
    chance for a single port to drain. Should a port not drain within this
    timeout, issue a warning.

    Signed-off-by: Russell King
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     
  • When we boot, serial ports remain in low power mode until they're used either
    by userspace or for the kernel console.

    However, if you suspend the system, and then resume, all serial ports will be
    taken out of low power mode. This is bad news for embedded devices where this
    can mean higher power consumption.

    Only bring a serial port out of low power mode if the port is being used as
    the kernel console, or is in use by userspace.

    Signed-off-by: Russell King
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     
  • Allow the private_data field to be specified in platform_data for the
    standard 8250/16550 UART. This field is used by DW APB type UARTs and
    without this patch it's only possible to set this field when registering
    the port by hand. If private_data is not set then the driver will
    potentially oops with a NULL pointer dereference.

    Signed-off-by: Will Newton
    Acked-by: Alan Cox
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     
  • Add ADDI-DATA GmbH communication cards to 8250_pci driver. Supported cards
    are:

    APCI-7300, APCI-7420, APCI-7500, APCI-7800 APCI-7300-2, APCI-7420-2,
    APCI-7500-2 APCI-7300-3, APCI-7420-3, APCI-7500-3, APCI-7800-3

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Krauth J.
    Cc: Russell King
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krauth.Julien
     
  • Remove dead config symbol.

    Signed-off-by: Jiri Olsa
    Cc: Russell King
    Cc: Ben Dooks
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Olsa
     
  • with reverting "x86, serial: convert legacy COM ports to platform devices",
    we will have the serial console before the port is probled again.

    uart_add_one_port==>uart_configure_port==>set_mcttrl(port, 0) will clear
    the DTR setting by uart_set_options(). then I will lose my output from
    serial console again.

    So try to keep DTR in uart_configure_port()

    Signed-off-by: Yinghai Lu
    Cc: Russell King
    Cc: Alan Cox
    Cc: Andi Kleen
    Cc: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     
  • pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an
    error case.

    An extract of the semantic match used to find the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type find1.T,T1,T2;
    identifier find1.E;
    statement find1.S;
    expression x1,x2,x3;
    expression find1.test;
    int ret != 0;
    @@

    T E;
    ...
    (
    * E = pci_get_slot(...);
    if (E == NULL) S
    |
    * if ((E = pci_get_slot(...)) == NULL)
    S
    )
    ... when != pci_dev_put(...,(T1)E,...)
    when != if (E != NULL) { ... pci_dev_put(...,(T1)E,...); ...}
    when != x1 = (T1)E
    when != E = x3;
    when any
    if (test) {
    ... when != pci_dev_put(...,(T2)E,...)
    when != if (E != NULL) { ... pci_dev_put(...,(T2)E,...); ...}
    when != x2 = (T2)E
    (
    * return;
    |
    * return ret;
    )
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • of_iomap calls ioremap, and so should be matched with an iounmap. At the
    two error returns, the result of calling of_iomap is only stored in a local
    variable, so these error paths need to call iounmap. Furthermore, this
    function ultimately stores the result of of_iomap in an array that is local
    to the file. These values should be iounmapped at some point. I have
    added a corresponding call to iounmap at the end of the function
    m8xx_remove.

    The problem was found using the following semantic match.
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type T,T1,T2;
    identifier E;
    statement S;
    expression x1,x2,x3;
    int ret;
    @@

    T E;
    ...
    * E = of_iomap(...);
    if (E == NULL) S
    ... when != iounmap(...,(T1)E,...)
    when != if (E != NULL) { ... iounmap(...,(T1)E,...); ...}
    when != x1 = (T1)E
    when != E = x3;
    when any
    if (...) {
    ... when != iounmap(...,(T2)E,...)
    when != if (E != NULL) { ... iounmap(...,(T2)E,...); ...}
    when != x2 = (T2)E
    (
    * return;
    |
    * return ret;
    )
    }
    //

    Signed-off-by: Julia Lawall
    Vitaly Bordug
    Cc: Arnd Bergmann
    Cc: Olof Johansson
    Cc: Dominik Brodowski
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Kumar Gala
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Update the AT91 CF driver to use the generic GPIO calls instead of the
    AT91-specific ones; and request exclusive use of those signals.

    Minor tweaks to cleanup code paths: always in reverse order of how the
    resources were allocated, with remove() matching the fault paths of
    probe().

    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Fixing:
    CHECK drivers/net/pcmcia/pcnet_cs.c
    drivers/net/pcmcia/pcnet_cs.c:523:15: warning: symbol 'hw_info' shadows an earlier one
    drivers/net/pcmcia/pcnet_cs.c:148:18: originally declared here

    Signed-off-by: Richard Knutsson
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Fixing:
    CHECK drivers/net/pcmcia/fmvj18x_cs.c
    drivers/net/pcmcia/fmvj18x_cs.c:1205:6: warning: symbol 'i' shadows an earlier one
    drivers/net/pcmcia/fmvj18x_cs.c:1179:9: originally declared here

    Signed-off-by: Richard Knutsson
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Use 'max(x,y)' instead of 'x < y ? y : x'.

    Signed-off-by: Richard Knutsson
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Fixing:
    CHECK drivers/net/pcmcia/axnet_cs.c
    drivers/net/pcmcia/axnet_cs.c:994:5: warning: symbol 'ax_close' was not declared. Should it be static?
    drivers/net/pcmcia/axnet_cs.c:1017:6: warning: symbol 'ei_tx_timeout' was not declared. Should it be static?

    Signed-off-by: Richard Knutsson
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • Fixing:
    CHECK drivers/net/pcmcia/3c574_cs.c
    drivers/net/pcmcia/3c574_cs.c:695:7: warning: symbol 'i' shadows an earlier one
    drivers/net/pcmcia/3c574_cs.c:636:6: originally declared here

    Signed-off-by: Richard Knutson
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     
  • - Print the invalid CIS filename in the invalid filename message.
    - Use sizeof() instead of hard-coded constant for buffer size.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • This stops the pcmcia core from using dev->power.power_state; that field is
    deprecated (overdue for removal) and the only reason to update it was to make
    the /sys/devices/.../power/state files (now removed) work better.

    Signed-off-by: David Brownell
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Remove kio_addr_t, and replace it with unsigned int. No known architecture
    needs more than 32 bits for IO addresses and ports and having a separate type
    for it is just messy.

    Signed-off-by: Olof Johansson
    Cc: Christoph Hellwig
    Cc: Matthew Wilcox
    Cc: Alan Cox
    Cc: Dominik Brodowski
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • Convert the io_req_t members to unsigned int, to allow use on machines with
    more than 16 bits worth of IO ports (i.e. secondary busses on ppc64, etc).

    There was only a couple of places in drivers where a change was needed. I
    left printk formats alone (there are lots of %04x-style formats in there),
    mostly to not change the format on the platforms that only have 16-bit io
    addresses, but also because the padding doesn't really add all that much value
    most of the time.

    I found only one sprintf of an address, and upsized the string accordingly (I
    doubt anyone will have anywhere near INT_MAX as irq value, but at least
    there's room for it now).

    Signed-off-by: Olof Johansson
    Cc: Christoph Hellwig
    Cc: Matthew Wilcox
    Cc: Alan Cox
    Cc: Dominik Brodowski
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • remove dead config symbols from M32R code

    Signed-off-by: Jiri Olsa
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Olsa
     
  • CC [M] sound/ppc/awacs.o
    In file included from sound/ppc/awacs.c:24:
    include/asm/nvram.h:62: error: field 'partition' has incomplete type

    Reported-by: Mariusz Kozlowski
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • FATAL: drivers/bluetooth/btsdio: sizeof(struct sdio_device_id)=12 is not a modulo of the size of section __mod_sdio_device_table=30.
    Fix definition of struct sdio_device_id in mod_devicetable.h

    m68k has 16bit alignment for unsigned long.

    Cc: Geert Uytterhoeven
    Cc: Sam Ravnborg
    Cc: Pierre Ossman
    CC: Marcel Holtmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Remove the broken status to CONFIG_TIMERFD.

    Signed-off-by: Davide Libenzi
    Cc: Michael Kerrisk
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • Wires up the new timerfd API to the x86 family.

    Signed-off-by: Davide Libenzi
    Cc: Michael Kerrisk
    Cc: Thomas Gleixner
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • This is the new timerfd API as it is implemented by the following patch:

    int timerfd_create(int clockid, int flags);
    int timerfd_settime(int ufd, int flags,
    const struct itimerspec *utmr,
    struct itimerspec *otmr);
    int timerfd_gettime(int ufd, struct itimerspec *otmr);

    The timerfd_create() API creates an un-programmed timerfd fd. The "clockid"
    parameter can be either CLOCK_MONOTONIC or CLOCK_REALTIME.

    The timerfd_settime() API give new settings by the timerfd fd, by optionally
    retrieving the previous expiration time (in case the "otmr" parameter is not
    NULL).

    The time value specified in "utmr" is absolute, if the TFD_TIMER_ABSTIME bit
    is set in the "flags" parameter. Otherwise it's a relative time.

    The timerfd_gettime() API returns the next expiration time of the timer, or
    {0, 0} if the timerfd has not been set yet.

    Like the previous timerfd API implementation, read(2) and poll(2) are
    supported (with the same interface). Here's a simple test program I used to
    exercise the new timerfd APIs:

    http://www.xmailserver.org/timerfd-test2.c

    [akpm@linux-foundation.org: coding-style cleanups]
    [akpm@linux-foundation.org: fix ia64 build]
    [akpm@linux-foundation.org: fix m68k build]
    [akpm@linux-foundation.org: fix mips build]
    [akpm@linux-foundation.org: fix alpha, arm, blackfin, cris, m68k, s390, sparc and sparc64 builds]
    [heiko.carstens@de.ibm.com: fix s390]
    [akpm@linux-foundation.org: fix powerpc build]
    [akpm@linux-foundation.org: fix sparc64 more]
    Signed-off-by: Davide Libenzi
    Cc: Michael Kerrisk
    Cc: Thomas Gleixner
    Cc: Davide Libenzi
    Cc: Michael Kerrisk
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Cc: Michael Kerrisk
    Cc: Davide Libenzi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • I think that advancing the timer against the timer's current "now" can be a
    pretty common usage, so, w/out exposing hrtimer's internals, we add a new
    hrtimer_forward_now() function.

    Signed-off-by: Davide Libenzi
    Cc: Michael Kerrisk
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi