aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-16target: split transport_cmd_check_stopChristoph Hellwig1-62/+62
Inline the transport_off == 0 case into target_execute_cmd to simplify the function for the remaining cases. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16tcm_qla2xxx: Remove duplicate header file inclusionSachin Kamat1-2/+0
ctype.h and string.h header files were included more than once. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16Revert "target: Do not special-case loop and iscsi fabric module loads"Nicholas Bellinger1-0/+38
Existing lio_dump.py code expects this to be in place for /iscsi. Revert for now to avoid userspace breakage in lio-utils This reverts commit fd88a785f9ac5d6be437c528571ccd85cdf2d493. Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move unmap to struct spc_opsChristoph Hellwig3-64/+50
Having all the unmap payload parsing in the backed is a bit ugly, but until more drivers support it and we can find a good interface for all of them that seems the way to go. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move write_same to struct spc_opsChristoph Hellwig3-34/+38
Add spc_ops->execute_write_same() caller for ->execute_cmd() setup, and update IBLOCK backends to use it. (nab: add export of spc_get_write_same_sectors symbol) (roland: Carry forward: Fix range calculation in WRITE SAME emulation when num blocks == 0) Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move sync_cache to struct spc_opsChristoph Hellwig4-20/+13
Add spc_ops->execute_sync_cache() caller for ->execute_cmd() setup, and update IBLOCK + FILEIO backends to use it. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: add struct spc_ops + initial ->execute_rw pointer usageChristoph Hellwig7-25/+66
Remove the execute_cmd method in struct se_subsystem_api, and always use the one directly in struct se_cmd. To make life simpler for SBC virtual backends a struct spc_ops that is passed to sbc_parse_cmd is added. For now it only contains an execute_rw member, but more will follow with the subsequent commits. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: remove dead SCF_ flagsChristoph Hellwig2-3/+0
Remove the dead SCF_SE_ALLOW_EOO and SCF_DELAYED_CMD_FROM_SAM_ATTR from se_cmd_flags_table. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target/iscsi: Remove dead code in lio_get_tpg_from_tpg_item()Roland Dreier1-22/+0
It's got no callers... Signed-off-by: Roland Dreier <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target/iblock: Add parameter to specify read-only devicesAndy Grover2-7/+29
see https://bugzilla.redhat.com/show_bug.cgi?id=818855 Adds a parameter so read-only block devices may be registered as LIO backstores. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: Do not special-case loop and iscsi fabric module loadsAndy Grover1-38/+0
These modules, along with other fabrics, should be loaded as-needed by the LIO userspace tools. Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move ref_cmd from the generic se_tmr_req into iscsi codeChristoph Hellwig3-26/+21
Also remove the unused ref_task_lun field in struct se_tmr_req. (nab: Add missing TASK_REASSIGN ref_lun vs. ref_cmd orig_fe_lun checks in iscsit_tmr_task_reassign) Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: remove the execute listChristoph Hellwig4-239/+98
Since "target: Drop se_device TCQ queue_depth usage from I/O path" we always submit all commands (or back then, tasks) from __transport_execute_tasks. That means the the execute list has lots its purpose, as we can simply submit the commands that are restarted in transport_complete_task_attr directly while we walk the list. In fact doing so also solves a race in the way it currently walks to delayed_cmd_list as well. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target/pscsi: Only emulate REPORT_LUNS for passthroughNicholas Bellinger1-9/+3
This patch changes back the pSCSI backend to follow pre 3.6-queue code to passthrough SPC-3 persistent reservations + SPC-2 legacy reservation handling to the underlying LLD / physical hardware. For folks who really need this for their own SPC-3 emulation logic, avoid changing the functionality of this beyond what is exported for REPORT_LUNS for existing code, and to avoid problems with SPC-3 PR/ALUA as INQUIRY EVPD=0x83 emulation needs to be in place in order for this to work as expected with spc_parse_cdb() code.. Cc: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: Move MAINTENANCE_[IN,OUT] from pscsi_parse_cdb -> spc_parse_cdbNicholas Bellinger1-1/+41
The MAINTENANCE_[IN,OUT] CDB parsing required for generic ALUA emulation needs to be in spc_parse_cdb() to function for virtual TYPE_DISK exports, instead of in backend pscsi_parse_cdb() code used only for passthrough ops. Cc: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move transport_generic_prepare_cdb into pscsiChristoph Hellwig2-29/+26
The virtual drivers don't need to clear cdb fields they never look at, so move this code into the pscsi backend. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move code for CDB emulationChristoph Hellwig8-1661/+1155
Move the existing code in target_core_cdb.c into the files for the command sets that the emulations implement. (roland + nab: Squash patch: Fix range calculation in WRITE SAME emulation when num blocks == 0s) Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: add a parse_cdb method to the backend driversChristoph Hellwig10-733/+936
Instead of trying to handle all SCSI command sets in one function (transport_generic_cmd_sequencer) call out to the backend driver to perform this functionality. For pSCSI a copy of the existing code is used, but for all virtual backends we can use a new parse_sbc_cdb helper is used to provide a simple SBC emulation. For now this setups means a fair amount of duplication between pSCSI and the SBC library, but patches later in this series will sort out that problem. (nab: Fix up build failure in target_core_pscsi.c) Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: split parsing of SPC commands into a separate helperChristoph Hellwig4-109/+176
(nab: Add EXPORT_SYMBOL usage for spc_parse_cdb) Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: split overflow and underflow checks into a helperChristoph Hellwig1-37/+53
Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: remove control CDB flagsChristoph Hellwig5-101/+56
We don't need three flags to classifiy the CDB as we can check for a NULL S/G list for a dataless command, and can infer from the absence of the data flag that we deal with a control CDB. Also remove the _SG_IO from the data CDB flag as all I/O is dont on S/G lists now. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: move unrelated code out of transport_generic_cmd_sequencerChristoph Hellwig1-77/+66
Move all code not related to cdb parsing from transport_generic_cmd_sequencer into target_setup_cmd_from_cdb. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: Fix range calculation in WRITE SAME emulation when num blocks == 0Roland Dreier1-1/+1
When NUMBER OF LOGICAL BLOCKS is 0, WRITE SAME is supposed to write all the blocks from the specified LBA through the end of the device. However, dev->transport->get_blocks(dev) (perhaps confusingly) returns the last valid LBA rather than the number of blocks, so the correct number of blocks to write starting with lba is dev->transport->get_blocks(dev) - lba + 1 (nab: Backport roland's for-3.6 patch to for-3.5) Signed-off-by: Roland Dreier <[email protected]> Cc: Cc: <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16target: Clean up returning errors in PR handling codeRoland Dreier1-3/+4
- instead of (PTR_ERR(file) < 0) just use IS_ERR(file) - return -EINVAL instead of EINVAL - all other error returns in target_scsi3_emulate_pr_out() use "goto out" -- get rid of the one remaining straight "return." Signed-off-by: Roland Dreier <[email protected]> Cc: <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2012-07-16ARM: imx: clk-imx31: Fix clock id for rnga driverFabio Estevam1-1/+1
Fix clock id for rnga driver. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16ARM: imx: add missing item to the list of clock event modesUwe Kleine-König1-1/+2
This prevents an out-of-bounds access to the clock_event_mode_label when debugging. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16ARM: i.MX5x CSPI: Fixed clock name for CSPIAlexander Shiyan2-2/+2
This patch also includes fix CSPI ID for i.MX53. ID should be 2, because IDs 0 and 1 are occupied by eCSPI. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16ARM: i.MX5x clocks: Fix GPT clocksAlexander Shiyan1-4/+4
This patch fix incorrect defined bits for GPT clocks according to datasheet. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16ARM: i.MX5x clocks: Fix parent for PWM clocksAlexander Shiyan1-2/+2
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16ARM: i.MX5x clocks: Add EPIT supportAlexander Shiyan1-0/+9
This patch adds support for Enhanced Periodic Interrupt Timer (EPIT) to clock subsystem. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Sascha Hauer <[email protected]>
2012-07-16regulator: lp872x: Simplify implementation of lp872x_find_regulator_init_data()Axel Lin1-21/+7
Pass regulator id rahter than the index to lp872x_find_regulator_init_data(), then the code can be simpler. We can also get max_regulators by lp->num_regulators. Signed-off-by: Axel Lin <[email protected]> Acked-by: Milo(Woogyom) Kim <[email protected]> Tested-by: Milo(Woogyom) Kim <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-16regulator: twl: Fix list_voltate for twl6030ldo_opsAxel Lin1-7/+24
According to the datasheet, the voltage for twl6030ldo_ops is not linear for all cases. Linear mapping is only for the selection code from 00000001 to 00011000. Table 9. LDO Output Voltage Selection Code CODE VOUT(V) COD VOUT(V) CODE VOUT(V) CODE VOUT(V) 00000000 0 00001000 1.7 00010000 2.5 00011000 3.3 00000001 1.0 00001001 1.8 00010001 2.6 00011001 Reserved 00000010 1.1 00001010 1.9 00010010 2.7 00011010 Reserved 00000011 1.2 00001011 2.0 00010011 2.8 00011011 Reserved 00000100 1.3 00001100 2.1 00010100 2.9 00011100 Reserved 00000101 1.4 00001101 2.2 00010101 3.0 00011101 Reserved 00000110 1.5 00001110 2.3 00010110 3.1 00011110 Reserved 00000111 1.6 00001111 2.4 00010111 3.2 00011111 2.75 This patch implements the list_voltage callback based on above table. Signed-off-by: Axel Lin <[email protected]> Tested-by: Rajendra Nayak <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-16Merge branch 'gma500' (Alan's GMA patches)Linus Torvalds5-29/+32
Merge gma500 patches from Alan Cox. * Merge emailed patches from Alan Cox <[email protected]>: (3 commits) gma500,cdv: Fix the brightness base gma500: move the ASLE enable gma500: Fix lid related crash
2012-07-16Merge tag 'for-linus-v3.5-rc7' of git://oss.sgi.com/xfs/xfsLinus Torvalds4-37/+38
Pull xfs regression fixes from Ben Myers: - Really fix a cursor leak in xfs_alloc_ag_vextent_near - Fix a performance regression related to doing allocation in workqueues - Prevent recursion in xfs_buf_iorequest which is causing stack overflows - Don't call xfs_bdstrat_cb in xfs_buf_iodone callbacks * tag 'for-linus-v3.5-rc7' of git://oss.sgi.com/xfs/xfs: xfs: do not call xfs_bdstrat_cb in xfs_buf_iodone_callbacks xfs: prevent recursion in xfs_buf_iorequest xfs: don't defer metadata allocation to the workqueue xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near
2012-07-16timekeeping: Add missing update call in timekeeping_resume()Thomas Gleixner1-0/+1
The leap second rework unearthed another issue of inconsistent data. On timekeeping_resume() the timekeeper data is updated, but nothing calls timekeeping_update(), so now the update code in the timer interrupt sees stale values. This has been the case before those changes, but then the timer interrupt was using stale data as well so this went unnoticed for quite some time. Add the missing update call, so all the data is consistent everywhere. Reported-by: Andreas Schwab <[email protected]> Reported-and-tested-by: "Rafael J. Wysocki" <[email protected]> Reported-and-tested-by: Martin Steigerwald <[email protected]> Cc: LKML <[email protected]> Cc: Linux PM list <[email protected]> Cc: John Stultz <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]>, Cc: Prarit Bhargava <[email protected]> Cc: [email protected] Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-16gma500,cdv: Fix the brightness baseAlan Cox1-16/+19
Some desktop environments carefully save and restore the brightness settings from the previous boot. Unfortunately they don't all check to see if the range has changed. The end result is that they restore a brightness of 100/lots not 100/100. As the old driver and the non-free GMA36xx driver both use 0-100 we thus need to go back doing the same thing to avoid users getting a mysterious black screen after boot. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-16gma500: move the ASLE enableAlan Cox3-5/+9
Otherwise we end up getting the masks wrong, can get events before we are doing power control and other ungood things. Again this is a regression fix where the ordering of handling was disturbed by other work, and the user experience on some boxes is a blank screen. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-16gma500: Fix lid related crashAlan Cox1-8/+4
We now set up the lid timer before we set up the backlight. On some devices that causes a crash as we do a backlight change before or during the setup. As this fixes a crash on boot regression on some setups it ought to go in ASAP, especially as all the user gets is a blank screen. Signed-off-by: Alan Cox <[email protected]> Tested-by: Mattia Dongili <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-07-16Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86Linus Torvalds3-50/+114
Pull x86 platform tree fixes from Matthew Garrett: "Small fixes to a couple of drivers plus a slightly larger number for sony-laptop that the maintainer thinks are appropriate, most of which fix problems with the earlier 3.5 updates. These have been in -next for a while without complaint." * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: intel_ips: blacklist HP ProBook laptops ideapad: uninitialized data in ideapad_acpi_add() sony-laptop: correct find_snc_handle failure checks sony-laptop: fix a couple signedness bugs sony-laptop: fix sony_nc_sysfs_store() sony-laptop: input initialization should be done before SNC sony-laptop: add lid backlight support for handle 0x143 sony-laptop: store battery care limits on batteries sony-laptop: notify userspace of GFX switch position changes sony-laptop: use an enum for SNC event types
2012-07-16fifo: Do not restart open() if it already found a partnerAnders Kaseorg1-5/+4
If a parent and child process open the two ends of a fifo, and the child immediately exits, the parent may receive a SIGCHLD before its open() returns. In that case, we need to make sure that open() will return successfully after the SIGCHLD handler returns, instead of throwing EINTR or being restarted. Otherwise, the restarted open() would incorrectly wait for a second partner on the other end. The following test demonstrates the EINTR that was wrongly thrown from the parent’s open(). Change .sa_flags = 0 to .sa_flags = SA_RESTART to see a deadlock instead, in which the restarted open() waits for a second reader that will never come. (On my systems, this happens pretty reliably within about 5 to 500 iterations. Others report that it manages to loop ~forever sometimes; YMMV.) #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define CHECK(x) do if ((x) == -1) {perror(#x); abort();} while(0) void handler(int signum) {} int main() { struct sigaction act = {.sa_handler = handler, .sa_flags = 0}; CHECK(sigaction(SIGCHLD, &act, NULL)); CHECK(mknod("fifo", S_IFIFO | S_IRWXU, 0)); for (;;) { int fd; pid_t pid; putc('.', stderr); CHECK(pid = fork()); if (pid == 0) { CHECK(fd = open("fifo", O_RDONLY)); _exit(0); } CHECK(fd = open("fifo", O_WRONLY)); CHECK(close(fd)); CHECK(waitpid(pid, NULL, 0)); } } This is what I suspect was causing the Git test suite to fail in t9010-svn-fe.sh: http://bugs.debian.org/678852 Signed-off-by: Anders Kaseorg <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
2012-07-16Merge tag 'fixes-for-v3.5-rc6' of ↵Linus Torvalds3-0/+6
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull late pinctrl fixes from Linus Walleij: - Two fixes to the i.MX driver * tag 'fixes-for-v3.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: pinctrl-imx6q: add missed mux function for USBOTG_ID pinctrl: pinctrl-imx: only print debug message when DEBUG is defined
2012-07-16net: respect GFP_DMA in __netdev_alloc_skb()Eric Dumazet1-1/+1
Few drivers use GFP_DMA allocations, and netdev_alloc_frag() doesn't allocate pages in DMA zone. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-07-16ARM: dma-mapping: modify condition check while freeing pagesPrathyush K1-2/+2
WARNING: at mm/vmalloc.c:1471 __iommu_free_buffer+0xcc/0xd0() Trying to vfree() nonexistent vm area (ef095000) Modules linked in: [<c0015a18>] (unwind_backtrace+0x0/0xfc) from [<c0025a94>] (warn_slowpath_common+0x54/0x64) [<c0025a94>] (warn_slowpath_common+0x54/0x64) from [<c0025b38>] (warn_slowpath_fmt+0x30/0x40) [<c0025b38>] (warn_slowpath_fmt+0x30/0x40) from [<c0016de0>] (__iommu_free_buffer+0xcc/0xd0) [<c0016de0>] (__iommu_free_buffer+0xcc/0xd0) from [<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138) [<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138) from [<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc) [<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc) from [<c0211230>] (drm_gem_object_free+0x28/0x34) [<c0211230>] (drm_gem_object_free+0x28/0x34) from [<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8) [<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8) from [<c01abe10>] (idr_for_each+0x74/0xb8) [<c01abe10>] (idr_for_each+0x74/0xb8) from [<c02114e4>] (drm_gem_release+0x1c/0x30) [<c02114e4>] (drm_gem_release+0x1c/0x30) from [<c0210ae8>] (drm_release+0x608/0x694) [<c0210ae8>] (drm_release+0x608/0x694) from [<c00b75a0>] (fput+0xb8/0x228) [<c00b75a0>] (fput+0xb8/0x228) from [<c00b40c4>] (filp_close+0x64/0x84) [<c00b40c4>] (filp_close+0x64/0x84) from [<c0029d54>] (put_files_struct+0xe8/0x104) [<c0029d54>] (put_files_struct+0xe8/0x104) from [<c002b930>] (do_exit+0x608/0x774) [<c002b930>] (do_exit+0x608/0x774) from [<c002bae4>] (do_group_exit+0x48/0xb4) [<c002bae4>] (do_group_exit+0x48/0xb4) from [<c002bb60>] (sys_exit_group+0x10/0x18) [<c002bb60>] (sys_exit_group+0x10/0x18) from [<c000ee80>] (ret_fast_syscall+0x0/0x30) This patch modifies the condition while freeing to match the condition used while allocation. This fixes the above warning which arises when array size is equal to PAGE_SIZE where allocation is done using kzalloc but free is done using vfree. Signed-off-by: Prathyush K <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]>
2012-07-16SELinux: do not check open perms if they are not known to policyEric Paris1-1/+1
When I introduced open perms policy didn't understand them and I implemented them as a policycap. When I added the checking of open perm to truncate I forgot to conditionalize it on the userspace defined policy capability. Running an old policy with a new kernel will not check open on open(2) but will check it on truncate. Conditionalize the truncate check the same as the open check. Signed-off-by: Eric Paris <[email protected]> Cc: [email protected] # 3.4.x Signed-off-by: James Morris <[email protected]>
2012-07-16SELinux: include definition of new capabilitiesEric Paris1-1/+3
The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP. We need to define these in SELinux so they can be mediated by policy. Signed-off-by: Eric Paris <[email protected]> Signed-off-by: James Morris <[email protected]>
2012-07-15regulator: twl: Convert twl6030ldo_ops to [get|set]_voltage_selAxel Lin1-17/+7
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-15regulator: twl: Fix the formula to calculate vsel and voltage for twl6030ldoAxel Lin1-13/+4
In twl6030ldo_set_voltage, current code use below formula to calculate vsel: vsel = (min_uV/1000 - 1000)/100 + 1; This is worng because when min_uV is 1000000 uV, vsel is 1. It should be 0 in this case. Fix it by change the equation to: (This equation is common for linear mapping) vsel = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step); In twl6030ldo_get_voltage, current code use below formula to calculate voltage: mV = 1000mv + 100mv * (vsel - 1) This is worng because when vsel is 0, mV is 900mV. Note the min_uV is 1000mV. Fix it by change the equation to: (This equation is common for linear mapping) return rdev->desc->min_uV + vsel * rdev->desc->uV_step; Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-15regulator: s5m8767: Properly handle gpio_request failureAxel Lin1-25/+24
Convert to devm_gpio_request to save a few error handling code. This patch properly handle the gpio_request failure, we should return error when gpio_request fails rather than just show warning. I think one of the reason we got -EBUSY is because current code does not free gpios in s5m8767_pmic_remove(). So it got -EBUSY when reload the module. Yest another reason is in current code if gpio_request() returns error, the rest of the code still calls gpio_direction_output to config buck_gpios and buck_ds gpios. This looks wrong to me. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-15regulator: max8997: Properly handle gpio_request failureAxel Lin1-31/+9
Convert to devm_gpio_request to save a few error handling code. This patch properly handle the gpio_request failure with -EBUSY, we should return error rather than ommit the gpio_request failure with -EBUSY. I think one of the reason we got -EBUSY is because current code does not free gpios in max8997_pmic_remove(). So it got -EBUSY when reload the module. Yest another reason is in current code if gpio_request() returns -EBUSY, the rest of the code still calls gpio_direction_output to config buck125_gpios and set gpio value in max8997_set_gpio(). This looks wrong to me. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-15regulator: tps62360: use devm_* for gpio requestLaxman Dewangan1-22/+6
Use devm_ version of gpio APIs gpio_request_one() for requesting gpios. This avoid extra code for freeing gpios. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Mark Brown <[email protected]>