- 21 12月, 2017 1 次提交
-
-
由 Bartosz Golaszewski 提交于
We currently silently omit creating the debugfs entries when regmap locking is disabled. Users may not be aware of the reason for which regmap files don't show up in debugfs. Add a dev_dbg() message explaining that. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 12月, 2017 1 次提交
-
-
由 Mark Brown 提交于
The recently added support for disabling the regmap internal locking left debugfs enabled for devices with the locking disabled. This is a problem since debugfs allows userspace to do things like initiate reads from the hardware which will use the scratch buffers protected by the regmap locking so could cause data corruption. For safety address this by just disabling debugfs for these devices. That is overly conservative since some of the debugfs files just read internal data structures but it's much simpler to implmement and less likely to lead to problems with tooling that works with debugfs. Reported-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 09 8月, 2016 1 次提交
-
-
由 Cristian Birsan 提交于
Add support for dumping write only device registers in debugfs. This is useful for audio codecs that have write only registers (like WM8731). The logic that decides if a value can be printed is moved to regmap_printable() function to allow for easier future updates. Signed-off-by: NCristian Birsan <cristian.birsan@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 06 1月, 2016 1 次提交
-
-
由 Mark Brown 提交于
Unlike the registers file we don't have any substantial performance concerns rendering the entire file (it involves no device accesses) so just use seq_printf() to simplify the code. Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 10月, 2015 3 次提交
-
-
由 Rasmus Villemoes 提交于
By printing the newline character to entry, we can avoid accounting for it manually in several places. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Rasmus Villemoes 提交于
Since we know the length of entry and that there's room enough in the output buffer, using memcpy instead of snprintf is simpler and cheaper. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Rasmus Villemoes 提交于
Calling strlen() no less than three times on entry is silly. Since we're formatting into a buffer with plenty of room, there's no chance of truncation, so snprintf() has actually returned the value we want, meaning we don't even have to call strlen once. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 9月, 2015 3 次提交
-
-
由 Mark Brown 提交于
Now we no longer use the scratch buffer for register length calculation there is no need for callers to supply one. Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
The in kernel snprintf() will conveniently return the actual length of the printed string even if not given an output beffer at all so just do that rather than relying on the user to pass in a suitable buffer, ensuring that we don't need to worry if the buffer was truncated due to the size of the buffer passed in. Reported-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
由 Mark Brown 提交于
If a read is attempted which is smaller than the line length then we may underflow the subtraction we're doing with the unsigned size_t type so move some of the calculation to be additions on the right hand side instead in order to avoid this. Reported-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 07 8月, 2015 1 次提交
-
-
由 Axel Lin 提交于
IS_ENABLED should only be used for CONFIG_* symbols. I have done a small test: #define REGMAP_ALLOW_WRITE_DEBUGFS IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. #define REGMAP_ALLOW_WRITE_DEBUGFS 0 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. #define REGMAP_ALLOW_WRITE_DEBUGFS 1 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 1. #define REGMAP_ALLOW_WRITE_DEBUGFS 2 IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0. So fix the misuse of IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) and switch to use #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) instead. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 7月, 2015 1 次提交
-
-
由 Richard Fitzgerald 提交于
Allow the user to write the cache_only and cache_bypass settings. This can be useful for debugging. Since this can lead to the hardware getting out-of-sync with the cache, at least for the period that the cache state is forced, the kernel is tainted and the action is recorded in the kernel log. When disabling cache_only through debugfs a cache sync will be performed. Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 9月, 2014 1 次提交
-
-
由 Markus Pargmann 提交于
The macro "REGMAP_ALLOW_WRITE_DEBUGFS" can be used to enable write support on the registers file in the debugfs. The mode of the file is fixed to 0400 so it is not possible to write the file ever. This patch fixes the mode by setting it to the correct value depending on the macro. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 9月, 2014 1 次提交
-
-
由 Xiubo Li 提交于
If 'map->dev' is NULL and there will lead dev_name() to be NULL pointer dereference. So before dev_name(), we need to have check of the map->dev pionter. We also should make sure that the 'name' pointer shouldn't be NULL for debugfs_create_dir(). So here using one default "dummy" debugfs name when the 'name' pointer and 'map->dev' are both NULL. Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 08 9月, 2014 1 次提交
-
-
由 Markus Pargmann 提交于
The macro "REGMAP_ALLOW_WRITE_DEBUGFS" can be used to enable write support on the registers file in the debugfs. The mode of the file is fixed to 0400 so it is not possible to write the file ever. This patch fixes the mode by setting it to the correct value depending on the macro. Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 26 8月, 2014 1 次提交
-
-
由 Lars-Peter Clausen 提交于
Commit 6cfec04b ("regmap: Separate regmap dev initialization") moved the regmap debugfs initialization after regcache initialization. This means that the regmap debugfs directory is not created yet when the cache initialization runs and so any debugfs files registered by the regcache are created in the debugfs root directory rather than the debugfs directory of the regmap instance. Fix this by adding a separate callback for the regcache debugfs initialization which will be called after the parent debugfs entry has been created. Fixes: 6cfec04b (regmap: Separate regmap dev initialization) Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
-
- 03 2月, 2014 1 次提交
-
-
由 Pawel Moll 提交于
When a map covers a single register, max_register is equal to 0, so the "registers" & "access" files were not created. Now they will be, as register 0 must be readable for such map to make sense. Signed-off-by: NPawel Moll <pawel.moll@arm.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 24 10月, 2013 1 次提交
-
-
由 Tero Kristo 提交于
If called early enough, regmap_debugfs_init causes a crash, if the fs subsystem does not have its mount cache created yet. Even if this would work, the root node for the regmap debugfs is still missing, thus postpone the regmap_debugfs_init in this case until the root node is created. A special regmap_debugfs_early list is created for this purpose which is parsed later in the boot. Signed-off-by: NTero Kristo <t-kristo@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 29 8月, 2013 1 次提交
-
-
由 Lars-Peter Clausen 提交于
The regmap_debugfs_get_dump_start() function maps from a file offset to the register that can be found at that position in the file. This is done using a look-up table. Commit d6814a7d ("regmap: debugfs: Suppress cache for partial register files") added a check to bypass the look-up table for partial register files, since the offsets in that table are only correct for the full register file. The check incorrectly uses the file offset instead of the register base address and returns it. This will cause the file offset to be interpreted as a register address which will result in a incorrect output from the registers file for all reads except at position 0. The issue can easily be reproduced by doing small reads the registers file, e.g. `dd if=registers bs=10 count=5`. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
-
- 27 7月, 2013 1 次提交
-
-
由 Jingoo Han 提交于
The usage of strict_strto*() is not preferred, because strict_strto*() is obsolete. Thus, kstrto*() should be used. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 19 6月, 2013 1 次提交
-
-
由 Mark Brown 提交于
The cache is based on the full register map so confuses things if used for a partial map. Reported-by: NBard Liao <bardliao@realtek.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 14 5月, 2013 1 次提交
-
-
由 Srinivas Kandagatla 提交于
regmap_debugfs_get_dump_start should return the offset of the register it should start reading from, However in the current code at one point the code does not return correct register offset. With this patch all the returns from this function takes reg_stride in to consideration to return correct offset. Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 12 5月, 2013 2 次提交
-
-
由 Mark Brown 提交于
A register write to hardware is reasonably unlikely to cause locking dependency issues, the reason we're tainting is that unexpected changes in the hardware configuration may confuse drivers. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Dimitris Papastamos 提交于
Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 04 3月, 2013 2 次提交
-
-
由 Dimitris Papastamos 提交于
This file lists the register ranges in the register map. The condition to split the range is based on whether the block is readable or not. Ensure that we lock the `debugfs_off_cache' list whenever we access and modify the list. There is a possible race otherwise between the read() operations of the `registers' file and the `range' file. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Dimitris Papastamos 提交于
We don't need to use any of the file position information to calculate the base and max register of each block. Just use the counter directly. Set `i = base' at the top to avoid GCC flow analysis bugs. The value of `i' can never be undefined or 0 in the if (c) { ... }. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 11 2月, 2013 3 次提交
-
-
由 Dimitris Papastamos 提交于
In preparation to support the regmap debugfs ranges functionality factor this code out to a separate function. We'll need to ensure that the value has been correctly calculated from two separate places in the code. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Dimitris Papastamos 提交于
Optimize this so that we can better guess where to start scanning from. We know the length of the register field format, therefore given the file pointer position align to the nearest register field and scan from there onwards. We round down in this calculation and we let the rest of the code figure out where to start scanning from. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Dimitris Papastamos 提交于
We are keeping track of the maximum register as well, this will make things easier for us in sharing this code with the code implementing the register ranges functionality. It also simplifies a bit the calculations when looking for the relevant block:offset from within the cache. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 08 2月, 2013 1 次提交
-
-
由 Dimitris Papastamos 提交于
At the moment, if the length of the register field format is N bytes, we can only get anything meaningful back to userspace by providing a buffer that is N + 2 bytes large. Fix this so we that we only need to provide a buffer of N bytes. Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 27 1月, 2013 1 次提交
-
-
由 Russell King 提交于
Gcc warns about the case where regmap_read_debugfs tries to walk an empty map->debugfs_off_cache list, which would results in uninitialized variable getting returned, if we hadn't checked the same condition just before that. After an originally suggested inferior patch from Arnd Bergmann, this is the solution that Russell King came up with, sidestepping the problem by merging the error case for an empty list with the normal path. Without this patch, building mxs_defconfig results in: drivers/base/regmap/regmap-debugfs.c: In function 'regmap_read_debugfs': drivers/base/regmap/regmap-debugfs.c:147:9: : warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Reported-by: NVincent Stehle <v-stehle@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 21 1月, 2013 1 次提交
-
-
由 Rusty Russell 提交于
Fix up all callers as they were before, with make one change: an unsigned module taints the kernel, but doesn't turn off lockdep. Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 16 1月, 2013 1 次提交
-
-
由 Mark Brown 提交于
We don't want to bomb out early if we failed to get the cache any more, just soldier on instead and we won't get confused and always return the first block. Reported-by: Philipp Zabel <p.zabel@pengutronix.de Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 09 1月, 2013 5 次提交
-
-
由 Mark Brown 提交于
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Mark Brown 提交于
This should never happen in the real world. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Mark Brown 提交于
Rather than trying to soldier on with a partially allocated cache just throw the cache away and pretend we don't have one in case we can get a full cache next time around. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Mark Brown 提交于
Check for the block we were asked to start from, not the position we're in. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Mark Brown 提交于
Return the start of the last block we tried to read rather than a position, and also make sure we update the byte position while we're at it. Without this reads that go into nonexistant areas get confused. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
- 11 12月, 2012 2 次提交
-
-
由 Mark Brown 提交于
Avoid doing a linear scan of the entire register map for each read() of the debugfs register dump by recording the offsets where valid registers exist when we first read the registers file. This assumes the set of valid registers never changes, if this is not the case invalidation of the cache will be required. This could be further improved for large blocks of contiguous registers by calculating the register we will read from within the block - currently we do a linear scan of the block. An rbtree may also be worthwhile. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-
由 Mark Brown 提交于
In preparation for doing things a bit more quickly than a linear scan factor out the initial seek from the debugfs register dump. Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
-