public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavan Savoy <pavan_savoy@ti.com>
To: alan@lxorguk.ukuu.org.uk, pavan_savoy@ti.com, gregkh@suse.de,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] drivers:misc: sources for ST core
Date: Tue, 23 Mar 2010 10:42:16 -0500	[thread overview]
Message-ID: <4BA8E158.6040102@ti.com> (raw)

comments inline...
 > +/* all debug macros go in here */
 > +#define ST_DRV_ERR(fmt, arg...)  printk(KERN_ERR "(stc):"fmt"\n" , 
## arg)
 > +#if defined(DEBUG)           /* limited debug messages */
 > +#define ST_DRV_DBG(fmt, arg...)  printk(KERN_INFO "(stc):"fmt"\n" , 
## arg)
 > +#define ST_DRV_VER(fmt, arg...)
 > +#elif defined(VERBOSE)               /* very verbose */
 > +#define ST_DRV_DBG(fmt, arg...)  printk(KERN_INFO "(stc):"fmt"\n" , 
## arg)
 > +#define ST_DRV_VER(fmt, arg...)  printk(KERN_INFO "(stc):"fmt"\n" , 
## arg)
 > +#else /* error msgs only */
 > +#define ST_DRV_DBG(fmt, arg...)
 > +#define ST_DRV_VER(fmt, arg...)
 > +#endif

 >Use the existing debug macros

[pavan]
Wanted a module level debugging code - and hence the usage of these
debug macros. Like printing out of all UART data, etc..
Apparently most UART problems surfaced during firmware download in 
st_kim.c so the module level debug macros.
All printk's also do have their own KERN_ level already.
Will change it if you want it.


 > +/* function pointer pointing to either,
 > + * st_kim_recv during registration to receive fw download responses
 > + * st_int_recv after registration to receive proto stack responses
 > + */
 > +void (*st_recv) (const unsigned char *data, long count);

[alan]
 >What if you have multiple devices at once one in each state ?
 >Why is this global ?

[pavan]
st_gdata required in non-tty calls as well.

[pavan]
Can't happen, The chip on doing a UART write will either write whole of 
BT data or whole of FM, so it can't be in multiple states.

 > +     if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) {

[alan]
 >Again shouldn't be using globals and needs to support multiple devices.
 >See the tty_struct - there is a field for an ldisc pointer, stuff
 >st_gdata in there at open time and pass tty around ?

[pavan]
st_gdata not in tty priv data or ldisc_data because there are entry 
points like st_register/unregister which are EXPORTed requires it.



 > +             ST_DRV_ERR("tty unavailable to perform write");
 > +             return ST_ERR_FAILURE;
 > +     }
 > +     tty = st_gdata->tty;

[alan]
 >Explain the locking on this NULL test - what stops it becoming NULL
 >between the if and the assignment ?

[pavan]
Calls to int_write in itself are safe, locked before being called.
Will recheck.
Up until now the same code has worked fine on UP and SMP.

[alan]
 >I think this code needs a fair bit of work at this point - locking,
 >supporting multiple devices at once etc.

 >Staging perhaps ?

[pavan]
If the rest seems fine, please consider it for staging,
Will keep reworking on it.


On Mon, 22 Mar 2010 14:35:30 -0700
Greg KH <gregkh@suse.de> wrote:

 > On Mon, Mar 22, 2010 at 04:19:12PM -0500, pavan_savoy@ti.com wrote:
 > > From: Pavan Savoy <pavan_savoy@ti.com>
 > >
 > > This change adds the Kconfig and Make file for TI's
 > > ST line discipline driver and the BlueZ driver for BT
 > > core of the TI BT/FM/GPS combo chip.
 > >
 > > Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
 > > ---
 > >  drivers/misc/Kconfig        |    1 +
 >
 > Why 'misc'?  Why not 'char' like all the other ldiscs?
 >
 > Or 'drivers/ldisc' to be more specific?

We've discussed having /tty or drivers/tty for a while. The ldiscs are
currently everywhere - drivers/net, isdn, char ....

I am not sure an ldisc directory helps though - slip and ppp are in
drivers/net for example and clearly belong there.
 >  #define N_V253               19      /* Codec control over voice 
modem */
 > +#define N_TI_SHARED  20      /* for TI's WL7 connectivity chips */

Be more specific or some future TI shared bus protocol might cause
confusion N_TI_WL7 sounds fine.

Alan

             reply	other threads:[~2010-03-23 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 15:42 Pavan Savoy [this message]
2010-03-23 19:59 ` [PATCH 3/6] drivers:misc: sources for ST core Pavan Savoy
2010-03-23 20:28   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2010-03-23 16:44 Pavan Savoy
2010-03-22 21:19 [re-worked] New ldisc for WiLink7.0 pavan_savoy
2010-03-22 21:19 ` [PATCH 1/6] serial: TTY: new ldisc for TI BT/FM/GPS chips pavan_savoy
2010-03-22 21:19   ` [PATCH 2/6] drivers:misc: Kconfig, Makefile for TI's ST ldisc pavan_savoy
2010-03-22 21:19     ` [PATCH 3/6] drivers:misc: sources for ST core pavan_savoy
2010-03-22 21:34       ` Greg KH
2010-03-23 15:24       ` Alan Cox

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=4BA8E158.6040102@ti.com \
    --to=pavan_savoy@ti.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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