* Re: [PATCH 0/4] drivers:misc: ti-st: platform specifics [not found] <1310486113-29081-1-git-send-email-pavan_savoy@ti.com> @ 2011-07-15 16:50 ` Pavan Savoy 0 siblings, 0 replies; 3+ messages in thread From: Pavan Savoy @ 2011-07-15 16:50 UTC (permalink / raw) To: Savoy, Pavan Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, pavan_savoy@sify.com On 7/12/2011 10:55 AM, Savoy, Pavan wrote: > Greg, > > resending, > since I didn't see these up on lkml.org > > These are the some of the patches which have gone on top of Texas Instrument's > shared transport driver which fixes issues found during field testing. > These include: > a. removing an annoying and misleading debug message > b. various platform hooks for enabling/disabling chip and communicating PM > states of the WiLink chip. > c. Re-initializing completion for make sure failed firmware download doesn't > create a problem the next time around. > d. fail-safe fix which happens upon corner cases when UART drops > bytes or chip is too busy and hence sends across h/w error events. Greg, I hope you find some time to have a look at these. Thanks & Regards, Pavan Savoy. > > > Pavan Savoy (3): > drivers:misc: ti-st: avoid a misleading dbg msg > drivers:misc:ti-st: platform hooks for chip states > drivers:misc: ti-st: reinit completion on ver read > > Vijay Badawadagi (1): > drivers:misc: ti-st: fail-safe on wrong pkt type > > drivers/misc/ti-st/st_core.c | 9 ++++++++- > drivers/misc/ti-st/st_kim.c | 13 +++++++++++++ > drivers/misc/ti-st/st_ll.c | 19 +++++++++++++++++++ > include/linux/ti_wilink_st.h | 27 ++++++++++++++++++++++++++- > 4 files changed, 66 insertions(+), 2 deletions(-) > ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/4] drivers:misc: ti-st: platform specifics @ 2011-07-20 14:30 pavan_savoy 2011-07-20 14:30 ` [PATCH 1/4] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy 0 siblings, 1 reply; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Pavan Savoy From: Pavan Savoy <pavan_savoy@ti.com> Greg, resending, since I didn't see these up on lkml.org (issues with my git send-email configuration) These are the some of the patches which have gone on top of Texas Instrument's shared transport driver which fixes issues found during field testing. These include: a. removing an annoying and misleading debug message b. various platform hooks for enabling/disabling chip and communicating PM states of the WiLink chip. c. Re-initializing completion for make sure failed firmware download doesn't create a problem the next time around. d. fail-safe fix which happens upon corner cases when UART drops bytes or chip is too busy and hence sends across h/w error events. Pavan Savoy (3): drivers:misc: ti-st: avoid a misleading dbg msg drivers:misc:ti-st: platform hooks for chip states drivers:misc: ti-st: reinit completion on ver read Vijay Badawadagi (1): drivers:misc: ti-st: fail-safe on wrong pkt type drivers/misc/ti-st/st_core.c | 9 ++++++++- drivers/misc/ti-st/st_kim.c | 13 +++++++++++++ drivers/misc/ti-st/st_ll.c | 19 +++++++++++++++++++ include/linux/ti_wilink_st.h | 27 ++++++++++++++++++++++++++- 4 files changed, 66 insertions(+), 2 deletions(-) -- 1.7.4.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/4] drivers:misc: ti-st: avoid a misleading dbg msg 2011-07-20 14:30 pavan_savoy @ 2011-07-20 14:30 ` pavan_savoy 2011-07-20 14:30 ` [PATCH 2/4] drivers:misc:ti-st: platform hooks for chip states pavan_savoy 0 siblings, 1 reply; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Pavan Savoy From: Pavan Savoy <pavan_savoy@ti.com> Previously the private data of each protocol registered to use ST was used to determine whether the protocol was registered to use shared transport or otherwise. However, now a flag is_registered is maintained to identify whether a protocol intends to use ST. Upon closing of the UART the error message relevant to this lack of un-registration was misleading and this patch fixes that. Change-Id: Ieddf828c5fa9ceabcbf9346ebdfde797916ac1f3 Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> --- drivers/misc/ti-st/st_core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 54c91ff..c8e335d 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -717,7 +717,7 @@ static void st_tty_close(struct tty_struct *tty) */ spin_lock_irqsave(&st_gdata->lock, flags); for (i = ST_BT; i < ST_MAX_CHANNELS; i++) { - if (st_gdata->list[i] != NULL) + if (st_gdata->is_registered[i] == true) pr_err("%d not un-registered", i); st_gdata->list[i] = NULL; } -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/4] drivers:misc:ti-st: platform hooks for chip states 2011-07-20 14:30 ` [PATCH 1/4] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy @ 2011-07-20 14:30 ` pavan_savoy 2011-07-20 14:30 ` [PATCH 3/4] drivers:misc: ti-st: reinit completion on ver read pavan_savoy 0 siblings, 1 reply; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Pavan Savoy From: Pavan Savoy <pavan_savoy@ti.com> Certain platform specific or Host-WiLink Interface specific actions would be required to be taken when the chip is being enabled and after the chip is disabled such as configuration of the mux modes for the GPIO of host connected to the nshutdown of the chip or relinquishing UART after the chip is disabled. Similar actions can also be taken when the chip is in deep sleep or when the chip is awake. Performance enhancements such as configuring the host to run faster when chip is awake and slower when chip is asleep can also be made here. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> --- drivers/misc/ti-st/st_kim.c | 12 ++++++++++++ drivers/misc/ti-st/st_ll.c | 19 +++++++++++++++++++ include/linux/ti_wilink_st.h | 27 ++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletions(-) diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 38fd2f0..6884dd1 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c @@ -434,11 +434,17 @@ long st_kim_start(void *kim_data) { long err = 0; long retry = POR_RETRY_COUNT; + struct ti_st_plat_data *pdata; struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; pr_info(" %s", __func__); + pdata = kim_gdata->kim_pdev->dev.platform_data; do { + /* platform specific enabling code here */ + if (pdata->chip_enable) + pdata->chip_enable(kim_gdata); + /* Configure BT nShutdown to HIGH state */ gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); mdelay(5); /* FIXME: a proper toggle */ @@ -489,6 +495,8 @@ long st_kim_stop(void *kim_data) { long err = 0; struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; + struct ti_st_plat_data *pdata = + kim_gdata->kim_pdev->dev.platform_data; INIT_COMPLETION(kim_gdata->ldisc_installed); @@ -515,6 +523,10 @@ long st_kim_stop(void *kim_data) gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH); mdelay(1); gpio_set_value(kim_gdata->nshutdown, GPIO_LOW); + + /* platform specific disable */ + if (pdata->chip_disable) + pdata->chip_disable(kim_gdata); return err; } diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c index 3f24951..1ff460a 100644 --- a/drivers/misc/ti-st/st_ll.c +++ b/drivers/misc/ti-st/st_ll.c @@ -22,6 +22,7 @@ #define pr_fmt(fmt) "(stll) :" fmt #include <linux/skbuff.h> #include <linux/module.h> +#include <linux/platform_device.h> #include <linux/ti_wilink_st.h> /**********************************************************************/ @@ -37,6 +38,9 @@ static void send_ll_cmd(struct st_data_s *st_data, static void ll_device_want_to_sleep(struct st_data_s *st_data) { + struct kim_data_s *kim_data; + struct ti_st_plat_data *pdata; + pr_debug("%s", __func__); /* sanity check */ if (st_data->ll_state != ST_LL_AWAKE) @@ -46,10 +50,19 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data) send_ll_cmd(st_data, LL_SLEEP_ACK); /* update state */ st_data->ll_state = ST_LL_ASLEEP; + + /* communicate to platform about chip asleep */ + kim_data = st_data->kim_data; + pdata = kim_data->kim_pdev->dev.platform_data; + if (pdata->chip_asleep) + pdata->chip_asleep(NULL); } static void ll_device_want_to_wakeup(struct st_data_s *st_data) { + struct kim_data_s *kim_data; + struct ti_st_plat_data *pdata; + /* diff actions in diff states */ switch (st_data->ll_state) { case ST_LL_ASLEEP: @@ -70,6 +83,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data) } /* update state */ st_data->ll_state = ST_LL_AWAKE; + + /* communicate to platform about chip wakeup */ + kim_data = st_data->kim_data; + pdata = kim_data->kim_pdev->dev.platform_data; + if (pdata->chip_asleep) + pdata->chip_awake(NULL); } /**********************************************************************/ diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index b004e55..2ef4385 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h @@ -410,7 +410,28 @@ struct gps_event_hdr { u16 plen; } __attribute__ ((packed)); -/* platform data */ +/** + * struct ti_st_plat_data - platform data shared between ST driver and + * platform specific board file which adds the ST device. + * @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected. + * @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1) + * @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM + * purposes. + * @baud_rate: The baud rate supported by the Host UART controller, this will + * be shared across with the chip via a HCI VS command from User-Space Init + * Mgr application. + * @suspend: + * @resume: legacy PM routines hooked to platform specific board file, so as + * to take chip-host interface specific action. + * @chip_enable: + * @chip_disable: Platform/Interface specific mux mode setting, GPIO + * configuring, Host side PM disabling etc.. can be done here. + * @chip_asleep: + * @chip_awake: Chip specific deep sleep states is communicated to Host + * specific board-xx.c to take actions such as cut UART clocks when chip + * asleep or run host faster when chip awake etc.. + * + */ struct ti_st_plat_data { long nshutdown_gpio; unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ @@ -418,6 +439,10 @@ struct ti_st_plat_data { unsigned long baud_rate; int (*suspend)(struct platform_device *, pm_message_t); int (*resume)(struct platform_device *); + int (*chip_enable) (struct kim_data_s *); + int (*chip_disable) (struct kim_data_s *); + int (*chip_asleep) (struct kim_data_s *); + int (*chip_awake) (struct kim_data_s *); }; #endif /* TI_WILINK_ST_H */ -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/4] drivers:misc: ti-st: reinit completion on ver read 2011-07-20 14:30 ` [PATCH 2/4] drivers:misc:ti-st: platform hooks for chip states pavan_savoy @ 2011-07-20 14:30 ` pavan_savoy 2011-07-20 14:30 ` [PATCH 4/4] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy 0 siblings, 1 reply; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Pavan Savoy From: Pavan Savoy <pavan_savoy@ti.com> After the version information has been read, the completion which assists in wait_for_completion during the firmware send/wait sequence is being re-used and hence this needs to be re-initialised for fool proof firmware download retries. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> --- drivers/misc/ti-st/st_kim.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 6884dd1..e5639ca 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c @@ -210,6 +210,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name) pr_err(" waiting for ver info- timed out "); return -ETIMEDOUT; } + INIT_COMPLETION(kim_gdata->kim_rcvd); version = MAKEWORD(kim_gdata->resp_buffer[13], -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 4/4] drivers:misc: ti-st: fail-safe on wrong pkt type 2011-07-20 14:30 ` [PATCH 3/4] drivers:misc: ti-st: reinit completion on ver read pavan_savoy @ 2011-07-20 14:30 ` pavan_savoy 2011-07-20 14:30 ` [PATCH 0/4] drivers:misc: ti-st: platform specifics pavan_savoy 0 siblings, 1 reply; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Vijay Badawadagi, Pavan Savoy From: Vijay Badawadagi <bvijay@ti.com> Texas Instrument's shared transport driver interpret incoming data from the UART based on the various protocol drivers registered to the driver such as btwilink driver or FM or GPS driver which provide logical channel IDs. In case of bad-behavior from chip such as HCI Event response for a GPS command or a HCI Event (h/w error event) for a FM response & In case of bad-behavior from UART driver such as dropping data bytes a fail-safe is required to avoid kernel panic. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Vijay Badawadagi <bvijay@ti.com> --- drivers/misc/ti-st/st_core.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index c8e335d..1f973ce 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -338,6 +338,12 @@ void st_int_recv(void *disc_data, /* Unknow packet? */ default: type = *ptr; + if (st_gdata->list[type] == NULL) { + pr_err("chip/interface misbehavior dropping" + " frame starting with 0x%02x", type); + goto done; + + } st_gdata->rx_skb = alloc_skb( st_gdata->list[type]->max_frame_size, GFP_ATOMIC); @@ -354,6 +360,7 @@ void st_int_recv(void *disc_data, ptr++; count--; } +done: spin_unlock_irqrestore(&st_gdata->lock, flags); pr_debug("done %s", __func__); return; -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 0/4] drivers:misc: ti-st: platform specifics 2011-07-20 14:30 ` [PATCH 4/4] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy @ 2011-07-20 14:30 ` pavan_savoy 0 siblings, 0 replies; 3+ messages in thread From: pavan_savoy @ 2011-07-20 14:30 UTC (permalink / raw) To: greg, linux-kernel; +Cc: pavan_savoy, Pavan Savoy From: Pavan Savoy <pavan_savoy@ti.com> Greg, resending, since I didn't see these up on lkml.org (issues with my git send-email configuration) These are the some of the patches which have gone on top of Texas Instrument's shared transport driver which fixes issues found during field testing. These include: a. removing an annoying and misleading debug message b. various platform hooks for enabling/disabling chip and communicating PM states of the WiLink chip. c. Re-initializing completion for make sure failed firmware download doesn't create a problem the next time around. d. fail-safe fix which happens upon corner cases when UART drops bytes or chip is too busy and hence sends across h/w error events. Pavan Savoy (3): drivers:misc: ti-st: avoid a misleading dbg msg drivers:misc:ti-st: platform hooks for chip states drivers:misc: ti-st: reinit completion on ver read Vijay Badawadagi (1): drivers:misc: ti-st: fail-safe on wrong pkt type drivers/misc/ti-st/st_core.c | 9 ++++++++- drivers/misc/ti-st/st_kim.c | 13 +++++++++++++ drivers/misc/ti-st/st_ll.c | 19 +++++++++++++++++++ include/linux/ti_wilink_st.h | 27 ++++++++++++++++++++++++++- 4 files changed, 66 insertions(+), 2 deletions(-) -- 1.7.4.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-20 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1310486113-29081-1-git-send-email-pavan_savoy@ti.com>
2011-07-15 16:50 ` [PATCH 0/4] drivers:misc: ti-st: platform specifics Pavan Savoy
2011-07-20 14:30 pavan_savoy
2011-07-20 14:30 ` [PATCH 1/4] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
2011-07-20 14:30 ` [PATCH 2/4] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
2011-07-20 14:30 ` [PATCH 3/4] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
2011-07-20 14:30 ` [PATCH 4/4] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
2011-07-20 14:30 ` [PATCH 0/4] drivers:misc: ti-st: platform specifics pavan_savoy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox