mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Par-Gunnar Hjalmdahl <pghatwork@gmail.com>
Cc: linus.walleij@stericsson.com, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, Lukasz.Rymanowski@tieto.com
Subject: Re: [PATCH 5/9] mfd: Add UART support for the ST-Ericsson CG2900.
Date: Fri, 22 Oct 2010 16:33:59 +0100	[thread overview]
Message-ID: <20101022163359.5b22a61b@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <AANLkTik-S50ZX6mFG+vWhBv0x_WmipP=t+4VqmAgssRC@mail.gmail.com>

> The existence of the callback is checked in the function
> uart_tty_open. If either break_ctl or tiocmget is NULL we do not allow
> sleep and this code will never run.

OK yes see this now.

> >> +             CG2900_ERR("Failed to alloc memory for uart_work_struct!");
> >
> > Please use the standard dev_dbg etc functionality - or pr_err etc when
> > you have no device pointer. The newest kernel tty object has a device
> > pointer added so you could use that.
> >
> 
> OK. I like the debug system we have now (using module parameter to set
> debug level in runtime), but I've received comments regarding this
> before so I assume we will have to switch to standard printouts.
> Is it OK to use defines or inline functions to add "CG2900" before and
> '\n' after (as BT_INFO in include/net/bluetooth/bluetooth.h)?

The pr_fmt bit will do what you want for a non dev_dbg type thing. See
include/linux/kernel.h

> >> + * unset_cts_irq() - Disable interrupt on CTS.
> >> + */
> >> +static void unset_cts_irq(void)
> >
> > And no ability to support multiple devices
> >
> 
> OK. We will try to fix this.

That may go away when you clean up the device side. The line discipline
can be attached to any device so must be multi-device aware, the hardware
driver can certainly be single device only if you can only ever have one

[Although its a good idea to design it so it can be fixed because you
 never know when you'll find your sales team just sold someone a two
 device solution ;) ]

> >> +             set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
> >> +             len = tty->ops->write(tty, skb->data, skb->len);
> >
> > A tty isn't required to have a write function
> 
> I don't quite understand your comment here. This particular code is
> inspired of the Bluetooth ldisc code and there it is used like. It
> seems to work fine so we do it the same way.

You copied a security hole from the bluetooth driver which we found a
couple of weeks ago

> How would you prefer it to be?

Check it is valid, in your case probably on open just refuse to attach to
a read only port.

> OK. We will try to figure out a new design.
> I'm not too happy about putting the ldisc part in Bluetooth though
> since it is only partly Bluetooth, it is also GPS and FM. Better could
> maybe be under char/?

Works for me - there is an ongoing "we must move tty ldiscs and core tty
code somewhere more sensible of their own" discussion, so if it is
dropped into char, it'll move with them just fine.

Alan

  reply	other threads:[~2010-10-22 15:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 10:38 Par-Gunnar Hjalmdahl
2010-10-22 12:51 ` Alan Cox
2010-10-22 14:54   ` Par-Gunnar Hjalmdahl
2010-10-22 15:33     ` Alan Cox [this message]
2010-10-28 10:37       ` Par-Gunnar Hjalmdahl
2010-10-28 12:22     ` Arnd Bergmann
2010-10-29 11:58       ` Par-Gunnar Hjalmdahl
2010-10-29 12:08         ` Par-Gunnar Hjalmdahl
2010-10-30  0:09           ` Arnd Bergmann
2010-10-29 16:22         ` Alan Cox
2010-10-30  0:01           ` Arnd Bergmann
2010-10-31 12:04             ` Alan Cox
2010-11-05 17:02               ` Par-Gunnar Hjalmdahl
2010-11-05 17:19                 ` Alan Cox
2010-11-08  5:24                 ` Arnd Bergmann
2010-11-11 14:28                   ` Par-Gunnar Hjalmdahl
2010-11-11 14:40                     ` Par-Gunnar Hjalmdahl
2010-11-11 15:12                       ` Arnd Bergmann
2010-10-29 11:53   ` Par-Gunnar Hjalmdahl
2010-10-29 16:24     ` Alan Cox
2010-12-03  9:16       ` Par-Gunnar Hjalmdahl
2010-12-03 11:42         ` Vitaly Wool
2010-12-06  9:06           ` Par-Gunnar Hjalmdahl
2010-12-06  9:46             ` Vitaly Wool
2010-12-06 12:01               ` Par-Gunnar Hjalmdahl
2010-12-06 12:25                 ` Vitaly Wool
2010-12-06 14:49                   ` Arnd Bergmann
2010-12-06 14:57                     ` Vitaly Wool
2010-12-06 14:06               ` Arnd Bergmann
2010-12-06 14:54                 ` Vitaly Wool
2010-12-06 15:15                   ` Arnd Bergmann
2010-12-06 15:28                     ` Vitaly Wool
2010-12-06 16:54                       ` Arnd Bergmann
2010-12-06 21:24                         ` Vitaly Wool
2010-12-06 23:07                           ` Arnd Bergmann
2010-12-08  7:41                             ` Pavan Savoy
2010-12-08 12:21                               ` Par-Gunnar Hjalmdahl
2010-12-08 12:51                                 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101022163359.5b22a61b@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=Lukasz.Rymanowski@tieto.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pghatwork@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®