* [PATCH 0/3] cell fixes 2.6.19
@ 2006-10-24 16:01 Arnd Bergmann
2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2006-10-24 16:01 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, linux-kernel
A few small updates that I'd like to see get into 2.6.19.
tested against the powerpc.git merge branch.
Please apply,
Arnd <><
--
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read 2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann @ 2006-10-24 16:01 ` Arnd Bergmann 2006-10-24 18:42 ` Pekka Enberg 2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann 2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann 2 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2006-10-24 16:01 UTC (permalink / raw) To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, linux-kernel, Arnd Bergmann [-- Attachment #1: spufs-mbox-fix-fix.diff --] [-- Type: text/plain, Size: 664 bytes --] Next try, the previous one did not do what I expected. Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Index: linux-2.6/arch/powerpc/platforms/cell/spufs/file.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/file.c +++ linux-2.6/arch/powerpc/platforms/cell/spufs/file.c @@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct fi udata = (void __user *)buf; spu_acquire(ctx); - for (count = 0; count <= len; count += 4, udata++) { + for (count = 0; (count + 4) <= len; count += 4, udata++) { int ret; ret = ctx->ops->mbox_read(ctx, &mbox_data); if (ret == 0) -- ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read 2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann @ 2006-10-24 18:42 ` Pekka Enberg 2006-10-24 19:07 ` Arnd Bergmann 0 siblings, 1 reply; 8+ messages in thread From: Pekka Enberg @ 2006-10-24 18:42 UTC (permalink / raw) To: Arnd Bergmann Cc: Paul Mackerras, linuxppc-dev, cbe-oss-dev, linux-kernel, Arnd Bergmann Hi Arnd, On 10/24/06, Arnd Bergmann <arnd@arndb.de> wrote: > spu_acquire(ctx); > - for (count = 0; count <= len; count += 4, udata++) { > + for (count = 0; (count + 4) <= len; count += 4, udata++) { Wouldn't this be more obvious as for (count = 0, count < (len / 4); count++, udata++) { And then do count * 4 if you need the actual index somewhere. Hmm? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read 2006-10-24 18:42 ` Pekka Enberg @ 2006-10-24 19:07 ` Arnd Bergmann 2006-10-24 19:53 ` Will Schmidt 0 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2006-10-24 19:07 UTC (permalink / raw) To: Pekka Enberg Cc: Paul Mackerras, linuxppc-dev, cbe-oss-dev, linux-kernel, Arnd Bergmann On Tuesday 24 October 2006 20:42, Pekka Enberg wrote: > On 10/24/06, Arnd Bergmann <arnd@arndb.de> wrote: > > spu_acquire(ctx); > > - for (count = 0; count <= len; count += 4, udata++) { > > + for (count = 0; (count + 4) <= len; count += 4, udata++) { > > Wouldn't this be more obvious as > > for (count = 0, count < (len / 4); count++, udata++) { > > And then do count * 4 if you need the actual index somewhere. Hmm? Count is the return value from a write() file operation. I find it more readable to update that every time I do one put_user(), to the exact value, than calculating the return code later. Arnd <>< ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read 2006-10-24 19:07 ` Arnd Bergmann @ 2006-10-24 19:53 ` Will Schmidt 2006-10-24 19:58 ` Arnd Bergmann 0 siblings, 1 reply; 8+ messages in thread From: Will Schmidt @ 2006-10-24 19:53 UTC (permalink / raw) To: Arnd Bergmann Cc: Pekka Enberg, linuxppc-dev, Paul Mackerras, cbe-oss-dev, linux-kernel On Tue, 2006-24-10 at 21:07 +0200, Arnd Bergmann wrote: > On Tuesday 24 October 2006 20:42, Pekka Enberg wrote: > > On 10/24/06, Arnd Bergmann <arnd@arndb.de> wrote: > > > spu_acquire(ctx); > > > - for (count = 0; count <= len; count += 4, udata++) { > > > + for (count = 0; (count + 4) <= len; count += 4, udata++) { > > > > Wouldn't this be more obvious as > > > > for (count = 0, count < (len / 4); count++, udata++) { > > > > And then do count * 4 if you need the actual index somewhere. Hmm? > > Count is the return value from a write() file operation. I find it > more readable to update that every time I do one put_user(), to > the exact value, than calculating the return code later. Hey Arnd, just curiosity.. What was the behavior before this patch? just leaving a few (0 - 3) characters behind? > > Arnd <>< > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read 2006-10-24 19:53 ` Will Schmidt @ 2006-10-24 19:58 ` Arnd Bergmann 0 siblings, 0 replies; 8+ messages in thread From: Arnd Bergmann @ 2006-10-24 19:58 UTC (permalink / raw) To: will_schmidt Cc: Pekka Enberg, linuxppc-dev, Paul Mackerras, cbe-oss-dev, linux-kernel On Tuesday 24 October 2006 21:53, Will Schmidt wrote: > Hey Arnd, > just curiosity.. What was the behavior before this patch? just > leaving a few (0 - 3) characters behind? It transfers more bytes than requested on a read. If you asked for four bytes, you got eight. Note: one nasty property of this file in spufs is that you can only read multiples of four bytes in the first place, there is no way to atomically put back a few bytes into the hardware register, so reading less than four bytes returns -EINVAL. Asking for more than four should return the largest possible multiple of four. Arnd <>< ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] cell: update defconfig 2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann 2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann @ 2006-10-24 16:01 ` Arnd Bergmann 2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann 2 siblings, 0 replies; 8+ messages in thread From: Arnd Bergmann @ 2006-10-24 16:01 UTC (permalink / raw) To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, linux-kernel, Arnd Bergmann [-- Attachment #1: cell-defconfig.diff --] [-- Type: text/plain, Size: 2264 bytes --] =================================================================== --- linux-2.6.orig/arch/powerpc/configs/cell_defconfig +++ linux-2.6/arch/powerpc/configs/cell_defconfig @@ -254,6 +254,7 @@ CONFIG_SYN_COOKIES=y CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y +# CONFIG_INET_XFRM_MODE_BEET is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set @@ -275,7 +276,9 @@ CONFIG_INET6_XFRM_TUNNEL=m CONFIG_INET6_TUNNEL=m CONFIG_INET6_XFRM_MODE_TRANSPORT=y CONFIG_INET6_XFRM_MODE_TUNNEL=y +# CONFIG_INET6_XFRM_MODE_BEET is not set # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +# CONFIG_IPV6_SIT is not set CONFIG_IPV6_TUNNEL=m # CONFIG_IPV6_SUBTREES is not set # CONFIG_IPV6_MULTIPLE_TABLES is not set @@ -406,6 +409,12 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_ATA_OVER_ETH is not set # +# Misc devices +# +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set + +# # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y @@ -738,7 +747,6 @@ CONFIG_GEN_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -802,6 +810,7 @@ CONFIG_I2C_ALGOBIT=y # # Dallas's 1-wire bus # +# CONFIG_W1 is not set # # Hardware Monitoring support @@ -810,14 +819,9 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_HWMON_VID is not set # -# Misc devices -# - -# # Multimedia devices # # CONFIG_VIDEO_DEV is not set -CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -923,6 +927,7 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y # CONFIG_EXT3_FS_POSIX_ACL is not set # CONFIG_EXT3_FS_SECURITY is not set +# CONFIG_EXT4DEV_FS is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y @@ -930,6 +935,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -1129,6 +1135,7 @@ CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set # CONFIG_FORCED_INLINING is not set +# CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_STACK_USAGE is not set -- ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] spufs: fix signal2 file to report signal2 2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann 2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann 2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann @ 2006-10-24 16:27 ` Arnd Bergmann 2 siblings, 0 replies; 8+ messages in thread From: Arnd Bergmann @ 2006-10-24 16:27 UTC (permalink / raw) To: Paul Mackerras Cc: linuxppc-dev, cbe-oss-dev, linux-kernel, Dwayne Grant Mcconnell, Arnd Bergmann From: Dwayne Grant Mcconnell <decimal@us.ibm.com> Here is a simple patch that fixes the /signal2 file to actually give signal2 data. Signed-off-by: Dwayne Grant Mcconnell <decimal@us.ibm.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Index: linux-2.6/arch/powerpc/platforms/cell/spufs/hw_ops.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/hw_ops.c +++ linux-2.6/arch/powerpc/platforms/cell/spufs/hw_ops.c @@ -147,7 +147,7 @@ static void spu_hw_signal1_write(struct static u32 spu_hw_signal2_read(struct spu_context *ctx) { - return in_be32(&ctx->spu->problem->signal_notify1); + return in_be32(&ctx->spu->problem->signal_notify2); } static void spu_hw_signal2_write(struct spu_context *ctx, u32 data) -- ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-10-24 19:58 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann 2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann 2006-10-24 18:42 ` Pekka Enberg 2006-10-24 19:07 ` Arnd Bergmann 2006-10-24 19:53 ` Will Schmidt 2006-10-24 19:58 ` Arnd Bergmann 2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann 2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox