The patch titled rapidio: fix sysfs config attribute to access 16MB of maint space has been added to the -mm tree. Its filename is rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: rapidio: fix sysfs config attribute to access 16MB of maint space From: Alexandre Bounine <alexandre.bounine@xxxxxxx> Fixes sysfs config attribute to allow access to entire 16MB maintenance space of RapidIO devices. Signed-off-by: Alexandre Bounine <alexandre.bounine@xxxxxxx> Cc: Kumar Gala <galak@xxxxxxxxxxxxxxxxxxx> Cc: Matt Porter <mporter@xxxxxxxxxxxxxxxxxxx> Cc: Li Yang <leoli@xxxxxxxxxxxxx> Cc: Thomas Moll <thomas.moll@xxxxxxxxx> Cc: Micha Nelissen <micha@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rapidio/rio-sysfs.c | 12 ++++++------ include/linux/rio_regs.h | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff -puN drivers/rapidio/rio-sysfs.c~rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space drivers/rapidio/rio-sysfs.c --- a/drivers/rapidio/rio-sysfs.c~rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space +++ a/drivers/rapidio/rio-sysfs.c @@ -110,9 +110,9 @@ rio_read_config(struct file *filp, struc /* Several chips lock up trying to read undefined config space */ if (capable(CAP_SYS_ADMIN)) - size = 0x200000; + size = RIO_MAINT_SPACE_SZ; - if (off > size) + if (off >= size) return 0; if (off + count > size) { size -= off; @@ -180,10 +180,10 @@ rio_write_config(struct file *filp, stru loff_t init_off = off; u8 *data = (u8 *) buf; - if (off > 0x200000) + if (off >= RIO_MAINT_SPACE_SZ) return 0; - if (off + count > 0x200000) { - size = 0x200000 - off; + if (off + count > RIO_MAINT_SPACE_SZ) { + size = RIO_MAINT_SPACE_SZ - off; count = size; } @@ -233,7 +233,7 @@ static struct bin_attribute rio_config_a .name = "config", .mode = S_IRUGO | S_IWUSR, }, - .size = 0x200000, + .size = RIO_MAINT_SPACE_SZ, .read = rio_read_config, .write = rio_write_config, }; diff -puN include/linux/rio_regs.h~rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space include/linux/rio_regs.h --- a/include/linux/rio_regs.h~rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space +++ a/include/linux/rio_regs.h @@ -14,10 +14,12 @@ #define LINUX_RIO_REGS_H /* - * In RapidIO, each device has a 2MB configuration space that is + * In RapidIO, each device has a 16MB configuration space that is * accessed via maintenance transactions. Portions of configuration * space are standardized and/or reserved. */ +#define RIO_MAINT_SPACE_SZ 0x1000000 /* 16MB of RapidIO mainenance space */ + #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */ _ Patches currently in -mm which might be from alexandre.bounine@xxxxxxx are rapidio-fix-sysfs-config-attribute-to-access-16mb-of-maint-space.patch rapidio-add-new-sysfs-attributes.patch rapidio-add-rapidio-documentation.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html