* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST [not found] ` <6cbd00c5f2d342b573aaf9c0e533778374dd2e1e.1410273306.git.m.chehab@samsung.com> @ 2014-09-09 14:38 ` Mauro Carvalho Chehab 2014-09-09 14:58 ` Sylwester Nawrocki [not found] ` <5f850d5d45a27c50dabf3da08689cbedf986841b.1410288748.git.m.chehab@samsung.com> 1 sibling, 1 reply; 10+ messages in thread From: Mauro Carvalho Chehab @ 2014-09-09 14:38 UTC (permalink / raw) To: linux-arm-kernel ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! Yet, it sounds a bad idea to use ndelay to wait for 100 us for the device to reset. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c index e51c078360f5..01eeacf28843 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) reg = readl(base + EXYNOS4_JPEG_CNTL_REG); writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); +#ifndef CONFIG_COMPILE_TEST ndelay(100000); +#endif writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); } -- 1.9.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 14:38 ` [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST Mauro Carvalho Chehab @ 2014-09-09 14:58 ` Sylwester Nawrocki 2014-09-09 15:09 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 10+ messages in thread From: Sylwester Nawrocki @ 2014-09-09 14:58 UTC (permalink / raw) To: linux-arm-kernel On 09/09/14 16:38, Mauro Carvalho Chehab wrote: > ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! > > Yet, it sounds a bad idea to use ndelay to wait for 100 us > for the device to reset. > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> > > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > index e51c078360f5..01eeacf28843 100644 > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) > reg = readl(base + EXYNOS4_JPEG_CNTL_REG); > writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); > > +#ifndef CONFIG_COMPILE_TEST > ndelay(100000); > +#endif Wouldn't be a better fix to replace ndelay(100000); with udelay(100), rather than sticking in a not so pretty #ifndef ? I guess usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held. -- Regards, Sylwester ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 14:58 ` Sylwester Nawrocki @ 2014-09-09 15:09 ` Mauro Carvalho Chehab 2014-09-09 15:30 ` Jacek Anaszewski 2014-09-09 17:54 ` [PATCH " Arnd Bergmann 0 siblings, 2 replies; 10+ messages in thread From: Mauro Carvalho Chehab @ 2014-09-09 15:09 UTC (permalink / raw) To: linux-arm-kernel Em Tue, 09 Sep 2014 16:58:58 +0200 Sylwester Nawrocki <s.nawrocki@samsung.com> escreveu: > On 09/09/14 16:38, Mauro Carvalho Chehab wrote: > > ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! > > > > Yet, it sounds a bad idea to use ndelay to wait for 100 us > > for the device to reset. > > > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> > > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> > > > > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > index e51c078360f5..01eeacf28843 100644 > > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) > > reg = readl(base + EXYNOS4_JPEG_CNTL_REG); > > writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); > > > > +#ifndef CONFIG_COMPILE_TEST > > ndelay(100000); > > +#endif > > Wouldn't be a better fix to replace ndelay(100000); with udelay(100), > rather than sticking in a not so pretty #ifndef ? Works for me. I'll submit a new version. > I guess usleep_range() couldn't simply be used, since > exynos4_jpeg_sw_reset() is called with a spinlock held. Ok. Regards, Mauro ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 15:09 ` Mauro Carvalho Chehab @ 2014-09-09 15:30 ` Jacek Anaszewski 2014-09-09 16:10 ` [PATCHv2 " Mauro Carvalho Chehab 2014-09-09 17:54 ` [PATCH " Arnd Bergmann 1 sibling, 1 reply; 10+ messages in thread From: Jacek Anaszewski @ 2014-09-09 15:30 UTC (permalink / raw) To: linux-arm-kernel Hi Mauro, Sylwester, On 09/09/2014 05:09 PM, Mauro Carvalho Chehab wrote: > Em Tue, 09 Sep 2014 16:58:58 +0200 > Sylwester Nawrocki <s.nawrocki@samsung.com> escreveu: > >> On 09/09/14 16:38, Mauro Carvalho Chehab wrote: >>> ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! >>> >>> Yet, it sounds a bad idea to use ndelay to wait for 100 us >>> for the device to reset. >>> >>> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> >>> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> >>> >>> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c >>> index e51c078360f5..01eeacf28843 100644 >>> --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c >>> +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c >>> @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) >>> reg = readl(base + EXYNOS4_JPEG_CNTL_REG); >>> writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); >>> >>> +#ifndef CONFIG_COMPILE_TEST >>> ndelay(100000); >>> +#endif >> >> Wouldn't be a better fix to replace ndelay(100000); with udelay(100), >> rather than sticking in a not so pretty #ifndef ? > > Works for me. I'll submit a new version. > >> I guess usleep_range() couldn't simply be used, since >> exynos4_jpeg_sw_reset() is called with a spinlock held. > > Ok. Within few days I will perform some hardware tests, to verify if there is more room for improvement here. Best Regards, Jacek Anaszewski ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCHv2 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 15:30 ` Jacek Anaszewski @ 2014-09-09 16:10 ` Mauro Carvalho Chehab 2014-09-09 17:10 ` Sylwester Nawrocki 2014-09-09 17:19 ` Fabio Estevam 0 siblings, 2 replies; 10+ messages in thread From: Mauro Carvalho Chehab @ 2014-09-09 16:10 UTC (permalink / raw) To: linux-arm-kernel ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! That happens because asm-generic doesn't like any ndelay time bigger than 20us. Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held. So, let's use ndelay() instead. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c index e51c078360f5..ab6d6f43c96f 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c @@ -23,7 +23,7 @@ void exynos4_jpeg_sw_reset(void __iomem *base) reg = readl(base + EXYNOS4_JPEG_CNTL_REG); writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); - ndelay(100000); + udelay(100); writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); } ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCHv2 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 16:10 ` [PATCHv2 " Mauro Carvalho Chehab @ 2014-09-09 17:10 ` Sylwester Nawrocki 2014-09-09 17:19 ` Fabio Estevam 1 sibling, 0 replies; 10+ messages in thread From: Sylwester Nawrocki @ 2014-09-09 17:10 UTC (permalink / raw) To: linux-arm-kernel On 09/09/14 18:10, Mauro Carvalho Chehab wrote: > ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! > > That happens because asm-generic doesn't like any ndelay time > bigger than 20us. > > Currently, usleep_range() couldn't simply be used, since > exynos4_jpeg_sw_reset() is called with a spinlock held. > > So, let's use ndelay() instead. > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> -- Thanks, Sylwester ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCHv2 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 16:10 ` [PATCHv2 " Mauro Carvalho Chehab 2014-09-09 17:10 ` Sylwester Nawrocki @ 2014-09-09 17:19 ` Fabio Estevam 1 sibling, 0 replies; 10+ messages in thread From: Fabio Estevam @ 2014-09-09 17:19 UTC (permalink / raw) To: linux-arm-kernel On Tue, Sep 9, 2014 at 1:10 PM, Mauro Carvalho Chehab <m.chehab@samsung.com> wrote: > ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! > > That happens because asm-generic doesn't like any ndelay time > bigger than 20us. > > Currently, usleep_range() couldn't simply be used, since > exynos4_jpeg_sw_reset() is called with a spinlock held. > > So, let's use ndelay() instead. You meant 'udelay() instead'. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 15:09 ` Mauro Carvalho Chehab 2014-09-09 15:30 ` Jacek Anaszewski @ 2014-09-09 17:54 ` Arnd Bergmann 2014-09-09 18:40 ` Mauro Carvalho Chehab 1 sibling, 1 reply; 10+ messages in thread From: Arnd Bergmann @ 2014-09-09 17:54 UTC (permalink / raw) To: linux-arm-kernel On Tuesday 09 September 2014 12:09:36 Mauro Carvalho Chehab wrote: > -exynos4.c > > > index e51c078360f5..01eeacf28843 100644 > > > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > > @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) > > > reg = readl(base + EXYNOS4_JPEG_CNTL_REG); > > > writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); > > > > > > +#ifndef CONFIG_COMPILE_TEST > > > ndelay(100000); > > > +#endif > > > > Wouldn't be a better fix to replace ndelay(100000); with udelay(100), > > rather than sticking in a not so pretty #ifndef ? > > Works for me. I'll submit a new version. New version looks good to me. On a more general level, I would argue that we should not disable code based on COMPILE_TEST. The typical use of this symbol is to make it possible to compile more code, not to change the behavior of code on machines that were able to build it already. Arnd ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST 2014-09-09 17:54 ` [PATCH " Arnd Bergmann @ 2014-09-09 18:40 ` Mauro Carvalho Chehab 0 siblings, 0 replies; 10+ messages in thread From: Mauro Carvalho Chehab @ 2014-09-09 18:40 UTC (permalink / raw) To: linux-arm-kernel Em Tue, 09 Sep 2014 19:54:19 +0200 Arnd Bergmann <arnd@arndb.de> escreveu: > On Tuesday 09 September 2014 12:09:36 Mauro Carvalho Chehab wrote: > > -exynos4.c > > > > index e51c078360f5..01eeacf28843 100644 > > > > --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > > > +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c > > > > @@ -23,7 +23,9 @@ void exynos4_jpeg_sw_reset(void __iomem *base) > > > > reg = readl(base + EXYNOS4_JPEG_CNTL_REG); > > > > writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); > > > > > > > > +#ifndef CONFIG_COMPILE_TEST > > > > ndelay(100000); > > > > +#endif > > > > > > Wouldn't be a better fix to replace ndelay(100000); with udelay(100), > > > rather than sticking in a not so pretty #ifndef ? > > > > Works for me. I'll submit a new version. > > New version looks good to me. On a more general level, I would argue > that we should not disable code based on COMPILE_TEST. The typical > use of this symbol is to make it possible to compile more code, not > to change the behavior of code on machines that were able to build > it already. Yeah, agreed as a general concept. In this case, however, it were causing a compilation breakage on X86 (as it generates a non-existing _bad_ndelay() symbol, if the time is bigger than 20000). See include/asm-generic/delay.h. Btw, I suspect that the only reason why ndelay(100000) causes a compilation breakage is to avoid a big number, as the maximum limit check ndelay() code (20000) at asm-generic is identical to the one for udelay(). So, for ndelay, it means 20us, while, for udelay, it means 20ms. Even so, both calls the very same implementation code. Perhaps we should fix it, for both to accept a maximum time of 20ms. Regards, Mauro ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <5f850d5d45a27c50dabf3da08689cbedf986841b.1410288748.git.m.chehab@samsung.com>]
* [PATCHv3 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST [not found] ` <5f850d5d45a27c50dabf3da08689cbedf986841b.1410288748.git.m.chehab@samsung.com> @ 2014-09-09 18:54 ` Mauro Carvalho Chehab 0 siblings, 0 replies; 10+ messages in thread From: Mauro Carvalho Chehab @ 2014-09-09 18:54 UTC (permalink / raw) To: linux-arm-kernel ERROR: "__bad_ndelay" [drivers/media/platform/s5p-jpeg/s5p-jpeg.ko] undefined! That happens because asm-generic doesn't like any ndelay time bigger than 20us. Currently, usleep_range() couldn't simply be used, since exynos4_jpeg_sw_reset() is called with a spinlock held. So, let's use udelay() instead. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c index e51c078360f5..ab6d6f43c96f 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c @@ -23,7 +23,7 @@ void exynos4_jpeg_sw_reset(void __iomem *base) reg = readl(base + EXYNOS4_JPEG_CNTL_REG); writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); - ndelay(100000); + udelay(100); writel(reg | EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); } -- 1.9.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-09-09 18:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20140909124306.2d5a0d76@canb.auug.org.au>
[not found] ` <6cbd00c5f2d342b573aaf9c0e533778374dd2e1e.1410273306.git.m.chehab@samsung.com>
2014-09-09 14:38 ` [PATCH 2/3] [media] s5p-jpeg: Fix compilation with COMPILE_TEST Mauro Carvalho Chehab
2014-09-09 14:58 ` Sylwester Nawrocki
2014-09-09 15:09 ` Mauro Carvalho Chehab
2014-09-09 15:30 ` Jacek Anaszewski
2014-09-09 16:10 ` [PATCHv2 " Mauro Carvalho Chehab
2014-09-09 17:10 ` Sylwester Nawrocki
2014-09-09 17:19 ` Fabio Estevam
2014-09-09 17:54 ` [PATCH " Arnd Bergmann
2014-09-09 18:40 ` Mauro Carvalho Chehab
[not found] ` <5f850d5d45a27c50dabf3da08689cbedf986841b.1410288748.git.m.chehab@samsung.com>
2014-09-09 18:54 ` [PATCHv3 " Mauro Carvalho Chehab
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).