From: Daniel Kurtz <hidden> Date: 2011-09-15 19:41:09
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.
In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page. Therefore, this patch also
trims some redundant framing text to leave more room for actual data.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.
In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page. Therefore, this patch also
trims some redundant framing text to leave more room for actual data.
Signed-off-by: Daniel Kurtz<redacted>
This patch is working but original problem is object size is increasing
as atmel touchscreen chip updates and we should consider also the
instances of object.
How about splitting attributes to each object?
Iiro, do you have any update plans about atmel touchscreen driver?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Daniel Kurtz <hidden> Date: 2011-09-16 05:10:54
Hi Joonyoung,
Thanks for replying.
On Fri, Sep 16, 2011 at 8:52 AM, Joonyoung Shim [off-list ref] wrote:
Hi,
On 2011-09-16 오전 4:40, Daniel Kurtz wrote:
quoted
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.
In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page. Therefore, this patch also
trims some redundant framing text to leave more room for actual data.
Signed-off-by: Daniel Kurtz<redacted>
This patch is working but original problem is object size is increasing
as atmel touchscreen chip updates and we should consider also the
instances of object.
"This patch is working" = Acked-By ?
How about splitting attributes to each object?
I agree. Can we do that in another patch (with instance printing)?
Iiro, do you have any update plans about atmel touchscreen driver?
I have several more patches coming for this driver, mostly to speed up
startup time, cleanup the MT-B implementation, and optimize interrupt
handling.
Thanks,
Daniel
Iiro, do you have any update plans about atmel touchscreen driver?
yes, there are plans to update the driver. While I have been on a longish
vacation, the development work has continued in UK and new patches can be
expected in the near future.
Regards,
Iiro
From: Nick Dyer <hidden> Date: 2011-10-06 10:08:35
Hi Daniel-
Just to introduce myself, I'm working for Atmel in UK on the
atmel_mxt_ts driver.
Daniel Kurtz wrote:
> Sysfs attribute show methods are always passed a buffer of length
> PAGE_SIZE. To keep from overwriting this buffer and causing havoc,
> use snprintf() to guarantee we never write more than the buffer can
> hold.
>
> In addition, at least for my touchscreen, the number and size of
> objects was far too big to fit in a single 4K page. Therefore, this
> patch also trims some redundant framing text to leave more room for
> actual data.
Yes, I'd noticed this problem as well. I was planning to address it by
splitting up the file, but your patch looks like a good solution for now.
I've tested it successfully on several chips.
Acked-by: Nick Dyer <redacted>
--
Nick Dyer
Software Engineer, ITDev Ltd
Hardware and Software Development Consultancy
Email: nick.dyer@itdev.co.uk
Website: http://www.itdev.co.uk
From: Daniel Kurtz <hidden> Date: 2011-10-19 07:40:40
Hi Dmitry,
I fear the following patch, and its 'Acked-by' from Nick Dyer, may
have gotten lost:
On Fri, Sep 16, 2011 at 3:40 AM, Daniel Kurtz [off-list ref] wrote:
quoted hunk
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.
In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page. Therefore, this patch also
trims some redundant framing text to leave more room for actual data.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
On Thu, Oct 6, 2011 at 5:59 PM, Nick Dyer [off-list ref] wrote:
Hi Daniel-
Just to introduce myself, I'm working for Atmel in UK on the atmel_mxt_ts
driver.
Daniel Kurtz wrote:
quoted
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc,
use snprintf() to guarantee we never write more than the buffer can
hold.
In addition, at least for my touchscreen, the number and size of
objects was far too big to fit in a single 4K page. Therefore, this
patch also trims some redundant framing text to leave more room for
actual data.
Yes, I'd noticed this problem as well. I was planning to address it by
splitting up the file, but your patch looks like a good solution for now.
I've tested it successfully on several chips.
Acked-by: Nick Dyer <redacted>
--
Nick Dyer
Software Engineer, ITDev Ltd
Hardware and Software Development Consultancy
Email: nick.dyer@itdev.co.uk
Website: http://www.itdev.co.uk