18 Mar, 2020

2 commits


04 Sep, 2019

1 commit

  • Instead of using to_pci_dev + pci_get_drvdata,
    use dev_get_drvdata to make code simpler.

    Signed-off-by: Chuhong Yuan
    Link: https://lore.kernel.org/r/20190724131825.1875-1-hslester96@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Chuhong Yuan
     

12 Feb, 2019

1 commit

  • Use pci_iomap instead of ioremap_nocache in nozomi_card_init(). This
    is a cleaner way to do PCI MMIO (performs additional checks) and
    allows to drop the manual call to pci_resource_start.

    pci_iomap relies on ioremap for MMIO and thus has uncached behavior.

    Signed-off-by: Hugo Lefeuvre
    Signed-off-by: Greg Kroah-Hartman

    Hugo Lefeuvre
     

25 Apr, 2018

2 commits


23 Apr, 2018

1 commit


08 Nov, 2017

2 commits

  • Now that the SPDX tag is in all tty files, that identifies the license
    in a specific and legally-defined manner. So the extra GPL text wording
    can be removed as it is no longer needed at all.

    This is done on a quest to remove the 700+ different ways that files in
    the kernel describe the GPL license text. And there's unneeded stuff
    like the address (sometimes incorrect) for the FSF which is never
    needed.

    No copyright headers or other non-license-description text was removed.

    Cc: Jiri Slaby
    Cc: James Hogan
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • It's good to have SPDX identifiers in all files to make it easier to
    audit the kernel tree for correct licenses.

    Update the drivers/tty files files with the correct SPDX license
    identifier based on the license text in the file itself. The SPDX
    identifier is a legally binding shorthand, which can be used instead of
    the full boiler plate text.

    This work is based on a script and data from Thomas Gleixner, Philippe
    Ombredanne, and Kate Stewart.

    Cc: Jiri Slaby
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Chris Metcalf
    Cc: Jiri Kosina
    Cc: David Sterba
    Cc: James Hogan
    Cc: Rob Herring
    Cc: Eric Anholt
    Cc: Stefan Wahren
    Cc: Florian Fainelli
    Cc: Ray Jui
    Cc: Scott Branden
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Joachim Eastwood
    Cc: Matthias Brugger
    Cc: Masahiro Yamada
    Cc: Tobias Klauser
    Cc: Russell King
    Cc: Vineet Gupta
    Cc: Richard Genoud
    Cc: Alexander Shiyan
    Cc: Baruch Siach
    Cc: "Maciej W. Rozycki"
    Cc: "Uwe Kleine-König"
    Cc: Pat Gefre
    Cc: "Guilherme G. Piccoli"
    Cc: Jason Wessel
    Cc: Vladimir Zapolskiy
    Cc: Sylvain Lemieux
    Cc: Carlo Caione
    Cc: Kevin Hilman
    Cc: Liviu Dudau
    Cc: Sudeep Holla
    Cc: Lorenzo Pieralisi
    Cc: Andy Gross
    Cc: David Brown
    Cc: "Andreas Färber"
    Cc: Kevin Cernekee
    Cc: Laxman Dewangan
    Cc: Thierry Reding
    Cc: Jonathan Hunter
    Cc: Barry Song
    Cc: Patrice Chotard
    Cc: Maxime Coquelin
    Cc: Alexandre Torgue
    Cc: "David S. Miller"
    Cc: Peter Korsgaard
    Cc: Timur Tabi
    Cc: Tony Prisk
    Cc: Michal Simek
    Cc: "Sören Brinkmann"
    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Cc: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 Nov, 2016

1 commit

  • Testing with a gcc-7 snapshot produced an internal compiler error
    for this file:

    drivers/tty/nozomi.c: In function 'receive_flow_control':
    drivers/tty/nozomi.c:919:12: internal compiler error: in get_substring_ranges_for_loc, at input.c:1388
    static int receive_flow_control(struct nozomi *dc)

    I've reported this at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78569
    but also noticed that the code line contains a stack overflow, as it prints
    a string into a slightly shorter fixed-length 'tmp' variable.

    A lot of the code here is unnecessary and can be expressed in a simpler
    way, relying on the fact that removing the 'DEBUG' macro will also get
    rid of all pr_debug() calls. This change should not change any of the
    output but avoids both the stack overflow and the gcc crash.

    The stack overflow will not happen unless a module load parameter is
    also set to enable the debug messages.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

10 Nov, 2016

1 commit

  • Use DEVICE_ATTR_RO for read only attributes. This simplifies the
    source code, improves readbility, and reduces the chance of
    inconsistencies.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @ro@
    declarer name DEVICE_ATTR;
    identifier x,x_show;
    @@

    DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL);

    @script:ocaml@
    x << ro.x;
    x_show << ro.x_show;
    @@

    if not (x^"_show" = x_show) then Coccilib.include_match false

    @@
    declarer name DEVICE_ATTR_RO;
    identifier ro.x,ro.x_show;
    @@

    - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL);
    + DEVICE_ATTR_RO(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

01 May, 2016

1 commit


07 Feb, 2016

1 commit

  • The nozomi wireless data driver has its own helper function to
    transfer data from a FIFO, doing an extra byte swap on big-endian
    architectures, presumably to bring the data back into byte-serial
    order after readw() or readl() perform their implicit byteswap.

    This helper function is used in the receive_data() function to
    first read the length into a 32-bit variable, which causes
    a compile-time warning:

    drivers/tty/nozomi.c: In function 'receive_data':
    drivers/tty/nozomi.c:857:9: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized]

    The problem is that gcc is unsure whether the data was actually
    read or not. We know that it is at this point, so we can replace
    it with a single readl() to shut up that warning.

    I am leaving the byteswap in there, to preserve the existing
    behavior, even though this seems fishy: Reading the length of
    the data into a cpu-endian variable should normally not use
    a second byteswap on big-endian systems, unless the hardware
    is aware of the CPU endianess.

    There appears to be a lot more confusion about endianess in this
    driver, so it probably has not worked on big-endian systems in
    a long time, if ever, and I have no way to test it. It's well
    possible that this driver has not been used by anyone in a while,
    the last patch that looks like it was tested on the hardware is
    from 2008.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

11 May, 2015

1 commit


09 Sep, 2014

1 commit

  • Several architectures (e.g. microblaze, um, and score) have already have
    extern 'setup_memory', so need use 'nozomi_setup_memory' instead of, or
    will cause compiling issue.

    The related error (with allmodconfig for microblaze):

    CC [M] drivers/tty/nozomi.o
    drivers/tty/nozomi.c:526:13: error: conflicting types for 'setup_memory'
    static void setup_memory(struct nozomi *dc)
    ^
    In file included from include/linux/mm.h:51:0,
    from ./arch/microblaze/include/asm/io.h:17,
    from include/linux/io.h:22,
    from include/linux/pci.h:31,
    from drivers/tty/nozomi.c:46:
    ./arch/microblaze/include/asm/pgtable.h:569:6: note: previous declaration of 'setup_memory' was here
    void setup_memory(void);
    ^

    Signed-off-by: Chen Gang
    Acked-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Chen Gang
     

17 Oct, 2013

1 commit


19 Mar, 2013

2 commits

  • It allows for cleaning up on a considerable amount of places. They did
    port_get, hangup, kref_put. Now the only thing needed is to call
    tty_port_tty_hangup which does exactly that. And they can also decide
    whether to consider CLOCAL or completely ignore that.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • It allows for cleaning up on a considerable amount of places. They did
    port_get, wakeup, kref_put. Now the only thing needed is to call
    tty_port_tty_wakeup which does exactly that.

    One exception is ifx6x60 where tty_wakeup was open-coded. We now call
    tty_wakeup properly there.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

16 Jan, 2013

4 commits

  • We test for !dc twice, remove the second test. Coverity found this.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    Now, the one where most of tty_port_tty_get gets removed:
    tty_flip_buffer_push.

    IOW we also closed all the races in drivers not using tty_port_tty_get
    at all yet.

    Also we move tty_flip_buffer_push declaration from include/linux/tty.h
    to include/linux/tty_flip.h to all others while we are changing it
    anyway.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    tty_insert_flip_string this time.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    tty_insert_flip_char is the next one to proceed. This one is used all
    over the code, so the patch is huge.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

22 Nov, 2012

4 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Cc: Alan Cox
    Acked-by: Tobias Klauser
    Cc: Lucas Tavares
    Cc: Daniel Walker
    Cc: Bryan Huntsman
    Cc: "David S. Miller"
    Cc: Peter Korsgaard
    Cc: Tony Prisk
    Acked-by: David Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinitconst is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Cc: Alan Cox
    Cc: Lucas Tavares
    Cc: "David S. Miller"
    Cc: Peter Korsgaard
    Cc: Tony Prisk
    Acked-by: Tobias Klauser
    Acked-by: Nicolas Ferre
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

16 Nov, 2012

1 commit

  • After commit "TTY: move tty buffers to tty_port", the tty buffers are
    not freed in some drivers. This is because tty_port_destructor is not
    called whenever a tty_port is freed. This was an assumption I counted
    with but was unfortunately untrue. So fix the drivers to fulfil this
    assumption.

    To be sure, the TTY buffers (and later some stuff) are gone along with
    the tty_port, we have to call tty_port_destroy at tear-down places.
    This is mostly where the structure containing a tty_port is freed.
    This patch does exactly that -- put tty_port_destroy at those places.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

14 Aug, 2012

1 commit

  • Currently we have no way to assign tty->port while performing tty
    installation. There are two ways to provide the link tty_struct =>
    tty_port. Either by calling tty_port_install from tty->ops->install or
    tty_port_register_device called instead of tty_register_device when
    the device is being set up after connected.

    In this patch we modify most of the drivers to do the latter. When the
    drivers use tty_register_device and we have tty_port already, we
    switch to tty_port_register_device. So we have the tty_struct =>
    tty_port link for free for those.

    Signed-off-by: Jiri Slaby
    Acked-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

09 Mar, 2012

1 commit

  • All num, magic and owner are set by alloc_tty_driver. No need to
    re-set them on each allocation site.

    pti driver sets something different to what it passes to
    alloc_tty_driver. It is not a bug, since we don't use the lines
    parameter in any way. Anyway this is fixed, and now we do the right
    thing.

    Signed-off-by: Jiri Slaby
    Acked-by: Tilman Schmidt
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

03 Feb, 2012

1 commit


27 May, 2011

1 commit

  • * 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    gfs2: Drop __TIME__ usage
    isdn/diva: Drop __TIME__ usage
    atm: Drop __TIME__ usage
    dlm: Drop __TIME__ usage
    wan/pc300: Drop __TIME__ usage
    parport: Drop __TIME__ usage
    hdlcdrv: Drop __TIME__ usage
    baycom: Drop __TIME__ usage
    pmcraid: Drop __DATE__ usage
    edac: Drop __DATE__ usage
    rio: Drop __DATE__ usage
    scsi/wd33c93: Drop __TIME__ usage
    scsi/in2000: Drop __TIME__ usage
    aacraid: Drop __TIME__ usage
    media/cx231xx: Drop __TIME__ usage
    media/radio-maxiradio: Drop __TIME__ usage
    nozomi: Drop __TIME__ usage
    cyclades: Drop __TIME__ usage

    Linus Torvalds
     

26 Apr, 2011

3 commits

  • tty_sem used to protect tty open count. This was removed in 33dd474a
    but the lock remained in place.

    So remove it completely as it protects nothing now.

    Also this solves Mac's problem with inatomic operation called from
    atomic context (ppp):
    BUG: scheduling while atomic: firefox-bin/1992/0x10000800
    Modules linked in: ...
    Pid: 1992, comm: firefox-bin Not tainted 2.6.38 #1
    Call Trace:
    ...
    [] ? mutex_lock+0xe/0x21
    [] ? ntty_write+0x5d/0x192 [nozomi]
    [] ? __mod_timer.clone.30+0xbe/0xcc
    [] ? check_preempt_curr+0x60/0x6d
    [] ? __nf_ct_refresh_acct+0x75/0xbe
    [] ? ppp_async_push+0xa9/0x3bd [ppp_async]
    [] ? ppp_async_send+0x34/0x40 [ppp_async]
    [] ? ppp_push+0x6c/0x4f9 [ppp_generic]
    ...

    Signed-off-by: Jiri Slaby
    Reported-by: Mac
    Tested-by: Gerald Pfeifer
    Reviewed-by: Jack Stone
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Before 33dd474a, these were some kind of protection against race with
    HUP. They were protected with port->tty_sem at the same time.

    By that commit, the counting was switched to tty_port's one, but the
    locking remained the old one. So the count was not protected by
    any lock anymore.

    The driver should not test whether it raced with HUP or not anyways.
    With the new refcounted tty model, it just should proceed as nothing
    happened because all needed info is still there. In respect to this,
    let's drop the useless and unprotected tests (tty_port->count is
    protected by tty_port->lock).

    Signed-off-by: Jiri Slaby
    Tested-by: Gerald Pfeifer
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • The allocation was moved to probe function in 9842c38e9176. And we can
    sleep there. So allocate the 4*8192 bytes as GFP_KERNEL to mitigate
    the allocation failure.

    Signed-off-by: Jiri Slaby
    Tested-by: Gerald Pfeifer
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

19 Apr, 2011

1 commit

  • The kernel already prints its build timestamp during boot, no need to
    repeat it in random drivers and produce different object files each
    time.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Michal Marek

    Michal Marek
     

31 Mar, 2011

1 commit


26 Feb, 2011

1 commit

  • flush_scheduled_work() in tty_exit() doesn't seem to target any
    specific work. If it was to flush work items used in tty generic
    layer, they're already flushed properly during tty release.

    flush_scheduled_work() is going away. Remove the seemingly redundant
    usage.

    Signed-off-by: Tejun Heo
    Cc: Jiri Slaby
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

23 Feb, 2011

1 commit