2011-03-02 10:00:05

by Pavan Savoy

[permalink] [raw]
Subject: [PATCH] drivers:misc: ti-st: fix debugging code

From: Pavan Savoy <[email protected]>

debug code in TI-ST driver can be enabled by #defining
DEBUG in the first line of the code and in case debugfs
is mounted, the 2 entries in /sys/kernel/debug/ti-st/ will
also provide useful information.
These 2 were broken because of the recent changes to the parsing
logic and the registration mechanism of the protocol drivers,
this patch fixes them.

Signed-off-by: Pavan Savoy <[email protected]>
---
drivers/misc/ti-st/st_core.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 1847c47..486117f 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -475,9 +475,9 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf)
{
seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n",
st_gdata->protos_registered,
- st_gdata->list[ST_BT] != NULL ? 'R' : 'U',
- st_gdata->list[ST_FM] != NULL ? 'R' : 'U',
- st_gdata->list[ST_GPS] != NULL ? 'R' : 'U');
+ st_gdata->list[0x04] != NULL ? 'R' : 'U',
+ st_gdata->list[0x08] != NULL ? 'R' : 'U',
+ st_gdata->list[0x09] != NULL ? 'R' : 'U');
}

/********************************************************************/
@@ -644,9 +644,6 @@ long st_unregister(struct st_proto_s *proto)
long st_write(struct sk_buff *skb)
{
struct st_data_s *st_gdata;
-#ifdef DEBUG
- unsigned char chnl_id = ST_MAX_CHANNELS;
-#endif
long len;

st_kim_ref(&st_gdata, 0);
@@ -655,14 +652,7 @@ long st_write(struct sk_buff *skb)
pr_err("data/tty unavailable to perform write");
return -EINVAL;
}
-#ifdef DEBUG /* open-up skb to read the 1st byte */
- chnl_id = skb->data[0];
- if (unlikely(st_gdata->list[chnl_id] == NULL)) {
- pr_err(" chnl_id %d not registered, and writing? ",
- chnl_id);
- return -EINVAL;
- }
-#endif
+
pr_debug("%d to be written", skb->len);
len = skb->len;

--
1.7.0.4


2011-03-03 05:41:47

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] drivers:misc: ti-st: fix debugging code

On Wed, Mar 02, 2011 at 03:59:56AM -0600, [email protected] wrote:
> From: Pavan Savoy <[email protected]>
>
> debug code in TI-ST driver can be enabled by #defining
> DEBUG in the first line of the code and in case debugfs
> is mounted, the 2 entries in /sys/kernel/debug/ti-st/ will
> also provide useful information.
> These 2 were broken because of the recent changes to the parsing
> logic and the registration mechanism of the protocol drivers,
> this patch fixes them.
>
> Signed-off-by: Pavan Savoy <[email protected]>
> ---
> drivers/misc/ti-st/st_core.c | 18 ++++--------------
> 1 files changed, 4 insertions(+), 14 deletions(-)

What tree was this made against? I can't seem to apply it to my
staging-next tree.

confused,

greg k-h

2011-03-03 06:51:19

by Pavan Savoy

[permalink] [raw]
Subject: Re: [PATCH] drivers:misc: ti-st: fix debugging code



>What tree was this made against? I can't seem to apply it to my
>staging-next tree.
>confused,

Made against linux-next as usual.
However I see that your staging-next has these for drivers/misc/ti-st/

73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/

and the linux-next has these for drivers/misc/ti-st/

bb6a7d53d52ec5b574467c48159677904d34a56a drivers:misc: ti-st: fix debugging code
781a7395d239dbdb59738ca7fe08e71641bf583c drivers:misc: ti-st: remove multiple gpio handling
6d71ba2105a1d8c1712cdfcf46fc6040e4707cb9 drivers:misc: ti-st: fix hci-ll on wake_ind collision
ef04d121f030329aae0c2d3ec22beea0c5cbcfd3 drivers:misc: ti-st: firmware download optimization
6710fcff66ef0330cdc458557271ee86026745d0 drivers:misc: ti-st: set right debug levels for logs
704426649dd4324b34cefea322f4333e5280f852 drivers:misc: ti-st: fix error codes
ec60d0ad20ff8796dc41b30a9dce485478ccd263 drivers:misc: ti-st: move from rfkill to sysfs
5c88b02196a99332dacf305c8757674dd7a303ff drivers:misc: ti-st: register with channel IDs
73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/

So, I am not sure how the 8 patches on top of "drivers: misc: ti-st: fix review comments" made it to linux-next without making to
staging-next ....
when I received the automated mail of these 8 patches I got the tree link as
"git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git" unlike the usual staging-next !!

So make be you should apply them on driver-core-2.6 ?
Can you help me understand the flow ?

>greg k-h

2011-03-03 16:37:28

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] drivers:misc: ti-st: fix debugging code

On Thu, Mar 03, 2011 at 12:34:17PM +0530, Pavan Savoy wrote:
>
>
> >What tree was this made against? I can't seem to apply it to my
> >staging-next tree.
> >confused,
>
> Made against linux-next as usual.
> However I see that your staging-next has these for drivers/misc/ti-st/
>
> 73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
> 2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
> a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/
>
> and the linux-next has these for drivers/misc/ti-st/
>
> bb6a7d53d52ec5b574467c48159677904d34a56a drivers:misc: ti-st: fix debugging code
> 781a7395d239dbdb59738ca7fe08e71641bf583c drivers:misc: ti-st: remove multiple gpio handling
> 6d71ba2105a1d8c1712cdfcf46fc6040e4707cb9 drivers:misc: ti-st: fix hci-ll on wake_ind collision
> ef04d121f030329aae0c2d3ec22beea0c5cbcfd3 drivers:misc: ti-st: firmware download optimization
> 6710fcff66ef0330cdc458557271ee86026745d0 drivers:misc: ti-st: set right debug levels for logs
> 704426649dd4324b34cefea322f4333e5280f852 drivers:misc: ti-st: fix error codes
> ec60d0ad20ff8796dc41b30a9dce485478ccd263 drivers:misc: ti-st: move from rfkill to sysfs
> 5c88b02196a99332dacf305c8757674dd7a303ff drivers:misc: ti-st: register with channel IDs
> 73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
> 2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
> a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/
>
> So, I am not sure how the 8 patches on top of "drivers: misc: ti-st:
> fix review comments" made it to linux-next without making to
> staging-next ....
> when I received the automated mail of these 8 patches I got the tree link as
> "git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git" unlike the usual staging-next !!
>
> So make be you should apply them on driver-core-2.6 ?
> Can you help me understand the flow ?

Ah crap, I think I messed this up by applying the patches to the wrong
tree. I'll work out the issues and get it resolved later today.

Sorry for the noise, this is what I get for applying patches on long
flights...

greg k-h

2011-03-10 00:10:56

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] drivers:misc: ti-st: fix debugging code

On Thu, Mar 03, 2011 at 08:31:45AM -0800, Greg KH wrote:
> On Thu, Mar 03, 2011 at 12:34:17PM +0530, Pavan Savoy wrote:
> >
> >
> > >What tree was this made against? I can't seem to apply it to my
> > >staging-next tree.
> > >confused,
> >
> > Made against linux-next as usual.
> > However I see that your staging-next has these for drivers/misc/ti-st/
> >
> > 73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
> > 2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
> > a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/
> >
> > and the linux-next has these for drivers/misc/ti-st/
> >
> > bb6a7d53d52ec5b574467c48159677904d34a56a drivers:misc: ti-st: fix debugging code
> > 781a7395d239dbdb59738ca7fe08e71641bf583c drivers:misc: ti-st: remove multiple gpio handling
> > 6d71ba2105a1d8c1712cdfcf46fc6040e4707cb9 drivers:misc: ti-st: fix hci-ll on wake_ind collision
> > ef04d121f030329aae0c2d3ec22beea0c5cbcfd3 drivers:misc: ti-st: firmware download optimization
> > 6710fcff66ef0330cdc458557271ee86026745d0 drivers:misc: ti-st: set right debug levels for logs
> > 704426649dd4324b34cefea322f4333e5280f852 drivers:misc: ti-st: fix error codes
> > ec60d0ad20ff8796dc41b30a9dce485478ccd263 drivers:misc: ti-st: move from rfkill to sysfs
> > 5c88b02196a99332dacf305c8757674dd7a303ff drivers:misc: ti-st: register with channel IDs
> > 73f12e8d3d94828b9efe2b8b8a34b4ad6d14ee47 drivers: misc: ti-st: fix review comments
> > 2bb32e84a17fab547c7a746c7888e846c9cd88cc misc: ti-st: Kconfig & Makefile for TI_ST
> > a0cc2f3b51a8649da5262aba7501dc21738e1b8d staging: ti-st: move TI_ST from staging to misc/
> >
> > So, I am not sure how the 8 patches on top of "drivers: misc: ti-st:
> > fix review comments" made it to linux-next without making to
> > staging-next ....
> > when I received the automated mail of these 8 patches I got the tree link as
> > "git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git" unlike the usual staging-next !!
> >
> > So make be you should apply them on driver-core-2.6 ?
> > Can you help me understand the flow ?
>
> Ah crap, I think I messed this up by applying the patches to the wrong
> tree. I'll work out the issues and get it resolved later today.

Now resolved, thanks.

greg k-h