* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend @ 2009-10-20 14:19 Vasily Khoruzhick 2009-10-22 11:10 ` Vasily Khoruzhick 2009-10-22 19:05 ` Ben Dooks 0 siblings, 2 replies; 10+ messages in thread From: Vasily Khoruzhick @ 2009-10-20 14:19 UTC (permalink / raw) To: linux-arm-kernel Fix for a bug that shows when the s3c2410 TS driver requests a conversion from the s3c-adc driver and the machine goes into suspend. In this case the touchscreen stops working. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-s3c24xx-adc-resume-convertions-interrupted-by-going-.patch Type: text/x-patch Size: 3617 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091020/e97caad8/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091020/e97caad8/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-20 14:19 [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend Vasily Khoruzhick @ 2009-10-22 11:10 ` Vasily Khoruzhick 2009-10-22 11:46 ` Mark Brown ` (2 more replies) 2009-10-22 19:05 ` Ben Dooks 1 sibling, 3 replies; 10+ messages in thread From: Vasily Khoruzhick @ 2009-10-22 11:10 UTC (permalink / raw) To: linux-arm-kernel ? ????????? ?? 20 ??????? 2009 17:19:30 ????? Vasily Khoruzhick ???????: > Fix for a bug that shows when the s3c2410 TS driver requests > a conversion from the s3c-adc driver and the machine goes into suspend. > In this case the touchscreen stops working. Does anyone on maillist interested in this bugfix? I got no response for 2 days... Regards Vasily -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091022/3eabe1d6/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-22 11:10 ` Vasily Khoruzhick @ 2009-10-22 11:46 ` Mark Brown 2009-10-22 18:59 ` Ben Dooks 2009-10-24 6:59 ` Nelson Castillo 2 siblings, 0 replies; 10+ messages in thread From: Mark Brown @ 2009-10-22 11:46 UTC (permalink / raw) To: linux-arm-kernel On Thu, Oct 22, 2009 at 02:10:23PM +0300, Vasily Khoruzhick wrote: > Does anyone on maillist interested in this bugfix? I got no response for 2 > days... Two days isn't an unreasonable length of time to wait - it would be worth chasing up if it takes more than a week or two but a few days is nothing to worry about, people have days off and other work to do. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-22 11:10 ` Vasily Khoruzhick 2009-10-22 11:46 ` Mark Brown @ 2009-10-22 18:59 ` Ben Dooks 2009-10-23 6:01 ` Vasily Khoruzhick 2009-10-24 6:59 ` Nelson Castillo 2 siblings, 1 reply; 10+ messages in thread From: Ben Dooks @ 2009-10-22 18:59 UTC (permalink / raw) To: linux-arm-kernel On Thu, Oct 22, 2009 at 02:10:23PM +0300, Vasily Khoruzhick wrote: > ?? ?????????????????? ???? 20 ?????????????? 2009 17:19:30 ?????????? Vasily Khoruzhick ??????????????: > > Fix for a bug that shows when the s3c2410 TS driver requests > > a conversion from the s3c-adc driver and the machine goes into suspend. > > In this case the touchscreen stops working. > > Does anyone on maillist interested in this bugfix? I got no response for 2 > days... I've been in and out of bed feeling ill, I can't sit on this list 24x7 looking at bugfixes. -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-22 18:59 ` Ben Dooks @ 2009-10-23 6:01 ` Vasily Khoruzhick 0 siblings, 0 replies; 10+ messages in thread From: Vasily Khoruzhick @ 2009-10-23 6:01 UTC (permalink / raw) To: linux-arm-kernel ? ????????? ?? 22 ??????? 2009 21:59:54 ?? ????????: > On Thu, Oct 22, 2009 at 02:10:23PM +0300, Vasily Khoruzhick wrote: > > Does anyone on maillist interested in this bugfix? I got no response for > > 2 days... > > I've been in and out of bed feeling ill, I can't sit on this list > 24x7 looking at bugfixes. Sorry for impatience, I just want to make sure that my patch wasn't ignored or lost. Regards Vasily -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091023/4f1f13de/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-22 11:10 ` Vasily Khoruzhick 2009-10-22 11:46 ` Mark Brown 2009-10-22 18:59 ` Ben Dooks @ 2009-10-24 6:59 ` Nelson Castillo 2009-10-29 7:49 ` Vasily Khoruzhick 2 siblings, 1 reply; 10+ messages in thread From: Nelson Castillo @ 2009-10-24 6:59 UTC (permalink / raw) To: linux-arm-kernel On Thu, Oct 22, 2009 at 6:10 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote: > ? ????????? ?? 20 ??????? 2009 17:19:30 ????? Vasily Khoruzhick ???????: >> Fix for a bug that shows when the s3c2410 TS driver requests >> a conversion from the s3c-adc driver and the machine goes into suspend. >> In this case the touchscreen stops working. >@@ -224,6 +225,7 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, > client->is_ts = is_ts; > client->select_cb = select; > client->convert_cb = conv; >+ client->selected = 0; You don't need to clear client->selected. kzalloc takes care of this. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-24 6:59 ` Nelson Castillo @ 2009-10-29 7:49 ` Vasily Khoruzhick 2009-11-04 18:27 ` Vasily Khoruzhick 0 siblings, 1 reply; 10+ messages in thread From: Vasily Khoruzhick @ 2009-10-29 7:49 UTC (permalink / raw) To: linux-arm-kernel ? ????????? ?? 24 ??????? 2009 09:59:25 ????? Nelson Castillo ???????: > >@@ -224,6 +225,7 @@ struct s3c_adc_client *s3c_adc_register(struct > > platform_device *pdev, > > > > client->is_ts = is_ts; > > > > client->select_cb = select; > > > > client->convert_cb = conv; > > > >+ client->selected = 0; > > You don't need to clear client->selected. kzalloc takes care of this. Ok, here's a fixed version. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-s3c24xx-adc-resume-convertions-interrupted-by-going-.patch Type: text/x-patch Size: 3397 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091029/d4ae5fc6/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091029/d4ae5fc6/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-29 7:49 ` Vasily Khoruzhick @ 2009-11-04 18:27 ` Vasily Khoruzhick 0 siblings, 0 replies; 10+ messages in thread From: Vasily Khoruzhick @ 2009-11-04 18:27 UTC (permalink / raw) To: linux-arm-kernel ? ????????? ?? 29 ??????? 2009 09:49:20 ????? Vasily Khoruzhick ???????: > ? ????????? ?? 24 ??????? 2009 09:59:25 ????? Nelson Castillo ???????: > > >@@ -224,6 +225,7 @@ struct s3c_adc_client *s3c_adc_register(struct > > > platform_device *pdev, > > > > > > client->is_ts = is_ts; > > > > > > client->select_cb = select; > > > > > > client->convert_cb = conv; > > > > > >+ client->selected = 0; > > > > You don't need to clear client->selected. kzalloc takes care of this. > > Ok, here's a fixed version. Any chance to get review/comments on this patch? Regards Vasily -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091104/077489aa/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-20 14:19 [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend Vasily Khoruzhick 2009-10-22 11:10 ` Vasily Khoruzhick @ 2009-10-22 19:05 ` Ben Dooks 2009-10-23 5:57 ` Vasily Khoruzhick 1 sibling, 1 reply; 10+ messages in thread From: Ben Dooks @ 2009-10-22 19:05 UTC (permalink / raw) To: linux-arm-kernel On Tue, Oct 20, 2009 at 05:19:30PM +0300, Vasily Khoruzhick wrote: > Fix for a bug that shows when the s3c2410 TS driver requests > a conversion from the s3c-adc driver and the machine goes into suspend. > In this case the touchscreen stops working. Ok, thanks for pointing this out. > From ff091bbc781c7182611be3de3e9b3a078d770336 Mon Sep 17 00:00:00 2001 > From: Vasily Khoruzhick <anarsoul@gmail.com> > Date: Tue, 20 Oct 2009 17:14:26 +0300 > Subject: [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend > > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> > --- > arch/arm/plat-s3c24xx/adc.c | 47 ++++++++++++++++++++++++++++++++++++------ > 1 files changed, 40 insertions(+), 7 deletions(-) > > diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c > index 4d36b78..45024e6 100644 > --- a/arch/arm/plat-s3c24xx/adc.c > +++ b/arch/arm/plat-s3c24xx/adc.c > @@ -46,6 +46,7 @@ struct s3c_adc_client { > int result; > unsigned char is_ts; > unsigned char channel; > + unsigned int selected; > > void (*select_cb)(struct s3c_adc_client *c, unsigned selected); > void (*convert_cb)(struct s3c_adc_client *c, > @@ -67,6 +68,7 @@ struct adc_device { > }; > > static struct adc_device *adc_dev; > +static struct work_struct resume_work; > > static LIST_HEAD(adc_pending); > > @@ -85,7 +87,10 @@ static inline void s3c_adc_select(struct adc_device *adc, > { > unsigned con = readl(adc->regs + S3C2410_ADCCON); > > - client->select_cb(client, 1); > + if (!client->selected) { > + client->selected = 1; > + client->select_cb(client, 1); > + } You seem to have added something other than just a bugfix to this patch, you've changed the behaviour of the select callback. Is this really necessary for the function of the fix or something that dropped in by accident? > con &= ~S3C2410_ADCCON_MUXMASK; > con &= ~S3C2410_ADCCON_STDBM; > @@ -109,13 +114,9 @@ static void s3c_adc_try(struct adc_device *adc) > { > struct s3c_adc_client *next = adc->ts_pend; > > - if (!next && !list_empty(&adc_pending)) { > + if (!next && !list_empty(&adc_pending)) > next = list_first_entry(&adc_pending, > struct s3c_adc_client, pend); > - list_del(&next->pend); > - } else > - adc->ts_pend = NULL; > - > if (next) { > adc_dbg(adc, "new client is %p\n", next); > adc->cur = next; > @@ -224,6 +225,7 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, > client->is_ts = is_ts; > client->select_cb = select; > client->convert_cb = conv; > + client->selected = 0; > > return client; > } > @@ -278,13 +280,20 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) > if (client->nr_samples > 0) { > /* fire another conversion for this */ > > + client->selected = 1; > client->select_cb(client, 1); > s3c_adc_convert(adc); > } else { > local_irq_save(flags); > - (client->select_cb)(client, 0); > + client->selected = 0; > + if (!adc->cur->is_ts) > + list_del(&adc->cur->pend); > + else > + adc->ts_pend = NULL; > adc->cur = NULL; > > + (client->select_cb)(client, 0); > + > s3c_adc_try(adc); > local_irq_restore(flags); > } > @@ -389,18 +398,42 @@ static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state) > writel(con, adc->regs + S3C2410_ADCCON); > > clk_disable(adc->clk); > + disable_irq(IRQ_ADC); > + if (!list_empty(&adc_pending) || adc->ts_pend) > + dev_info(&pdev->dev, "We still have adc clients pending\n"); > > return 0; > } > > +static void adc_resume_work(struct work_struct *work) > +{ > + if (!adc_dev) { > + /* Have no ADC here */ > + return; > + } > + > + if (!list_empty(&adc_pending) || adc_dev->ts_pend) > + /* We still have adc clients pending */ > + s3c_adc_try(adc_dev); > +} > + > + > static int s3c_adc_resume(struct platform_device *pdev) > { > struct adc_device *adc = platform_get_drvdata(pdev); > > + enable_irq(IRQ_ADC); > clk_enable(adc->clk); > > writel(adc->prescale | S3C2410_ADCCON_PRSCEN, > adc->regs + S3C2410_ADCCON); > + /* Schedule task if there are clients pending. */ > + if (!list_empty(&adc_pending) || adc_dev->ts_pend) { > + INIT_WORK(&resume_work, adc_resume_work); > + if (!schedule_work(&resume_work)) > + dev_err(&pdev->dev, > + "Failed to schedule adc_resume work!\n"); > + } Is the work being used here to avoid trying to do things that may sleep? IIRC, none of the calls should need to sleep. I was just wondering whether it would be better to abort any calls in progress before sleep and get the clients themselves to restart once they themselves have been resumed. We may end up with the case where the callbacks are being triggered before the client has been resumed. -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend 2009-10-22 19:05 ` Ben Dooks @ 2009-10-23 5:57 ` Vasily Khoruzhick 0 siblings, 0 replies; 10+ messages in thread From: Vasily Khoruzhick @ 2009-10-23 5:57 UTC (permalink / raw) To: linux-arm-kernel ? ????????? ?? 22 ??????? 2009 22:05:24 ????? Ben Dooks ???????: > > - client->select_cb(client, 1); > > + if (!client->selected) { > > + client->selected = 1; > > + client->select_cb(client, 1); > > + } > > You seem to have added something other than just a bugfix to this patch, > you've changed the behaviour of the select callback. Is this really > necessary for the function of the fix or something that dropped in by > accident? No, select callback behaviour is not changed, this check is necessary to avoid calling select callback when client was already selected (for example, after resuming from suspend) > > writel(adc->prescale | S3C2410_ADCCON_PRSCEN, > > adc->regs + S3C2410_ADCCON); > > + /* Schedule task if there are clients pending. */ > > + if (!list_empty(&adc_pending) || adc_dev->ts_pend) { > > + INIT_WORK(&resume_work, adc_resume_work); > > + if (!schedule_work(&resume_work)) > > + dev_err(&pdev->dev, > > + "Failed to schedule adc_resume work!\n"); > > + } > > Is the work being used here to avoid trying to do things that may > sleep? IIRC, none of the calls should need to sleep. It's used to prevent calling callbacks (that may sleep) in atomic context (AFAIK resume handler is in atomic context) > I was just wondering whether it would be better to abort any calls in > progress before sleep and get the clients themselves to restart once > they themselves have been resumed. We may end up with the case where the > callbacks are being triggered before the client has been resumed. Maybe, but sometimes it's tricky to abort waiting for callback in client driver. Anyway, resume_work will be called only after all drivers has been resumed, so situation when callbacks are being triggered before the client has been resumed is impossible. Regards, Vasily -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091023/d2de15d2/attachment.sig> ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-11-04 18:27 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-20 14:19 [PATCH] s3c24xx-adc: resume convertions interrupted by going to suspend Vasily Khoruzhick 2009-10-22 11:10 ` Vasily Khoruzhick 2009-10-22 11:46 ` Mark Brown 2009-10-22 18:59 ` Ben Dooks 2009-10-23 6:01 ` Vasily Khoruzhick 2009-10-24 6:59 ` Nelson Castillo 2009-10-29 7:49 ` Vasily Khoruzhick 2009-11-04 18:27 ` Vasily Khoruzhick 2009-10-22 19:05 ` Ben Dooks 2009-10-23 5:57 ` Vasily Khoruzhick
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).