summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2012-02-14USB/xhci: Enable remote wakeup for USB3 devices.Sarah Sharp
When the USB 3.0 hub support went in, I disabled selective suspend for all external USB 3.0 hubs because they used a different mechanism to enable remote wakeup. In fact, other USB 3.0 devices that could signal remote wakeup would have been prevented from going into suspend because they would have stalled the SetFeature Device Remote Wakeup request. This patch adds support for the USB 3.0 way of enabling remote wake up (with a SetFeature Function Suspend request), and enables selective suspend for all hubs during hub_probe. It assumes that all USB 3.0 have only one "function" as defined by the interface association descriptor, which is true of all the USB 3.0 devices I've seen so far. FIXME if that turns out to change later. After a device signals a remote wakeup, it is supposed to send a Device Notification packet to the host controller, signaling which function sent the remote wakeup. The host can then put any other functions back into function suspend. Since we don't have support for function suspend (and no devices currently support it), we'll just assume the hub function will resume the device properly when it received the port status change notification, and simply ignore any device notification events from the xHCI host controller. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2012-02-14xHCI: Kick khubd when USB3 resume really completes.Sarah Sharp
xHCI roothubs go through slightly different port state machines when either a device initiates a remote wakeup and signals resume, or when the host initiates a resume. According to section 4.19.1.2.13 of the xHCI 1.0 spec, on host-initiated resume, the xHC port state machine automatically goes through the U3Exit state into the U0 state, setting the port link state change (PLC) bit in the process. When a device initiates resume, the xHCI port state machine goes into the "Resume" state and sets the PLC bit. Then the xHCI driver writes U0 into the port link state register to transition the port to U0 from the Resume state. We can't be sure the device is actually in the U0 state until we receive the next port status change event with the PLC bit set. We really don't want khubd to be polling the roothub port status bits until the device is really in U0. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Acked-by: Andiry Xu <andiry.xu@amd.com>
2012-02-13Merge branch 'usb-linus' into usb-nextGreg Kroah-Hartman
This is needed so that Sarah can queue up some xhci changes for 3.4 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13usb: Fix typo in imx21-dbg.cMasanari Iida
Correct spelling "alocate" to "allocate" in drivers/usb/host/imx21-dbg.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10xhci: Fix oops caused by more USB2 ports than USB3 ports.Sarah Sharp
The code to set the device removable bits in the USB 2.0 roothub descriptor was accidentally looking at the USB 3.0 port registers instead of the USB 2.0 registers. This can cause an oops if there are more USB 2.0 registers than USB 3.0 registers. This should be backported to kernels as old as 2.6.39, that contain the commit 4bbb0ace9a3de8392527e3c87926309d541d3b00 "xhci: Return a USB 3.0 hub descriptor for USB3 roothub." Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
2012-02-10usb: cdc-wdm: make reset work with blocking IOBjørn Mork
Add a flag to tell wdm_read/wdm_write that a reset is in progress, and wake any blocking read/write before taking the mutexes. This allows the device to reset without waiting for blocking IO to finish. Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10Merge tag 'usb-3.3-rc3' into usb-nextGreg Kroah-Hartman
This is done to resolve a merge conflict with: drivers/usb/class/cdc-wdm.c and to better handle future patches for this driver as it is under active development at the moment. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10USB: serial: use dev_err_console in custom write pathsJohan Hovold
Use dev_err_console in write paths for devices which can be used as a console but do not use the generic write implementation. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10USB: serial: use dev_err_console in generic writeJohan Hovold
Use dev_err_console in write path so that an error at least gets reported once. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10USB: serial: fix console error reportingJohan Hovold
Do not report errors in write path if port is used as a console as this may trigger the same error (and error report) resulting in a loop. Reported-by: Stephen Hemminger <shemminger@vyatta.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09Merge tag 'usb-3.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb USB fixes for 3.3-rc3 Here are a few minor USB fixes and a bunch of device id updates for the USB drivers. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * tag 'usb-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: usbserial: add new PID number (0xa951) to the ftdi driver usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu() usb: musb: fix a build error on mips uwb & wusb & usb wireless controllers: fix kconfig error & build errors usb: Skip PCI USB quirk handling for Netlogic XLP powerpc/usb: fix issue of CPU halt when missing USB PHY clock usb: otg: mv_otg: Add dependence usb: host: Distinguish Kconfig text for Freescale controllers USB: add new zte 3g-dongle's pid to option.c usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu() USB: qcserial: don't enable autosuspend USB: qcserial: add several new serial devices usb: otg: mv_otg: Add dependence usb: gadget: zero: fix bug in loopback autoresume handling
2012-02-09usb: Use hub port data to determine whether a port is removableMatthew Garrett
Hubs have a flag to indicate whether a given port carries removable devices or not. This is not strictly accurate in that some built-in devices will be flagged as removable, but followup patches will make use of platform data to make this more reliable. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09usb: Add support for indicating whether a port is removableMatthew Garrett
Userspace may want to make policy decisions based on whether or not a given USB device is removable. Add a per-device member and support for exposing it in sysfs. Information sources to populate it will be added later. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09Merge branch 'iommu/fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu One patch fixes an bug in the ARM/MSM IOMMU code which returned sucess in the unmap function even when an error occured and the other patch adds a workaround into the AMD IOMMU driver to better handle broken IVRS ACPI tables (this patch fixes the case when a device is not listed in the table but actually translated by the iommu). * 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/msm: Fix error handling in msm_iommu_unmap() iommu/amd: Work around broken IVRS tables
2012-02-09Merge branch '3.3-rc-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending This series contains pending target bug-fixes and cleanups for v3.3-rc3 that have been addressed the past weeks in lio-core.git. Some of the highlights include: - Fix handling for control CDBs with data greater than PAGE_SIZE (andy) - Use IP_FREEBIND for iscsi-target to address network portal creation issues with systemd (dax) - Allow PERSISTENT RESERVE IN for non-reservation holder (marco) - Fix iblock se_dev_attrib.unmap_granularity (marco) - Fix unsupported WRITE_SAME sense payload handling (martin) - Add workaround for zero-length control CDB handling (nab) - Fix discovery with INADDR_ANY and IN6ADDR_ANY_INIT (nab) - Fix target_submit_cmd() exception handling (nab) - Return correct ASC for unimplemented VPD pages (roland) - Don't zero pages used for data buffers (roland) - Fix return code of core_tpg_.*_lun (sebastian) * '3.3-rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (26 commits) target: Fix unsupported WRITE_SAME sense payload iscsi: use IP_FREEBIND socket option iblock: fix handling of large requests target: handle empty string writes in sysfs iscsi_target: in_aton needs linux/inet.h target: Fix iblock se_dev_attrib.unmap_granularity target: Fix target_submit_cmd() exception handling target: Change target_submit_cmd() to return void target: accept REQUEST_SENSE with 18bytes target: Fail INQUIRY commands with EVPD==0 but PAGE CODE!=0 target: Return correct ASC for unimplemented VPD pages iscsi-target: Fix discovery with INADDR_ANY and IN6ADDR_ANY_INIT target: Allow control CDBs with data > 1 page iscsi-target: Fix up a few assignments iscsi-target: make one-bit bitfields unsigned iscsi-target: Fix double list_add with iscsit_alloc_buffs reject iscsi-target: Fix reject release handling in iscsit_free_cmd() target: fix return code of core_tpg_.*_lun target: use save/restore lock primitive in core_dec_lacl_count() target: avoid multiple outputs in scsi_dump_inquiry() ...
2012-02-09Merge tag 'md-3.3-fixes' of git://neil.brown.name/mdLinus Torvalds
Some simple md-related fixes. 1/ two small fixes to ensure we handle an interrupted resync properly. 2/ avoid loading the bitmap multiple times in dm-raid * tag 'md-3.3-fixes' of git://neil.brown.name/md: md: two small fixes to handling interrupt resync. Prevent DM RAID from loading bitmap twice.
2012-02-09Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
SPI bug fixes for v3.3-rc2 Minor SPI device driver changes. A rename of the pch_spi_pcidev symbol that merely eliminates a modpost warning, and a Kconfig change to allow the Samsung spi driver to build on EXYNOS. * tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6: spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver spi: Add spi-s3c64xx driver dependency on ARCH_EXYNOS4
2012-02-09pcmcia: fix socket refcount decrementing on each resumeRussell King
This fixes a memory-corrupting bug: not only does it cause the warning, but as a result of dropping the refcount to zero, it causes the pcmcia_socket0 device structure to be freed while it still has references, causing slab caches corruption. A fatal oops quickly follows this warning - often even just a 'dmesg' following the warning causes the kernel to oops. While testing suspend/resume on an ARM device with PCMCIA support, and a CF card inserted, I found that after five suspend and resumes, the kernel would complain, and shortly die after with slab corruption. WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50() As the message doesn't give a clue about which kobject, and the built-in debugging in drivers/base/power/main.c happens too late, this was added right before each get_device(): printk("%s: %p [%s] %u\n", __func__, dev, kobject_name(&dev->kobj), atomic_read(&dev->kobj.kref.refcount)); and on the 3rd s2ram cycle, the following behaviour observed: On the 3rd suspend/resume cycle: dpm_prepare: c1a0d998 [pcmcia_socket0] 3 dpm_suspend: c1a0d998 [pcmcia_socket0] 3 dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 3 dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 3 dpm_resume: c1a0d998 [pcmcia_socket0] 3 dpm_complete: c1a0d998 [pcmcia_socket0] 2 4th: dpm_prepare: c1a0d998 [pcmcia_socket0] 2 dpm_suspend: c1a0d998 [pcmcia_socket0] 2 dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 2 dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 2 dpm_resume: c1a0d998 [pcmcia_socket0] 2 dpm_complete: c1a0d998 [pcmcia_socket0] 1 5th: dpm_prepare: c1a0d998 [pcmcia_socket0] 1 dpm_suspend: c1a0d998 [pcmcia_socket0] 1 dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 1 dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 1 dpm_resume: c1a0d998 [pcmcia_socket0] 1 dpm_complete: c1a0d998 [pcmcia_socket0] 0 ------------[ cut here ]------------ WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50() Modules linked in: ucb1x00_core Backtrace: [<c0212090>] (dump_backtrace+0x0/0x110) from [<c04799dc>] (dump_stack+0x18/0x1c) [<c04799c4>] (dump_stack+0x0/0x1c) from [<c021cba0>] (warn_slowpath_common+0x50/0x68) [<c021cb50>] (warn_slowpath_common+0x0/0x68) from [<c021cbdc>] (warn_slowpath_null+0x24/0x28) [<c021cbb8>] (warn_slowpath_null+0x0/0x28) from [<c0335374>] (kobject_get+0x28/0x50) [<c033534c>] (kobject_get+0x0/0x50) from [<c03804f4>] (get_device+0x1c/0x24) [<c0388c90>] (dpm_complete+0x0/0x1a0) from [<c0389cc0>] (dpm_resume_end+0x1c/0x20) ... Looking at commit 7b24e7988263 ("pcmcia: split up central event handler"), the following change was made to cs.c: return 0; } #endif - - send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW); + if (!(skt->state & SOCKET_CARDBUS) && (skt->callback)) + skt->callback->early_resume(skt); return 0; } And the corresponding change in ds.c is from: -static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) -{ - struct pcmcia_socket *s = pcmcia_get_socket(skt); ... - switch (event) { ... - case CS_EVENT_PM_RESUME: - if (verify_cis_cache(skt) != 0) { - dev_dbg(&skt->dev, "cis mismatch - different card\n"); - /* first, remove the card */ - ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH); - mutex_lock(&s->ops_mutex); - destroy_cis_cache(skt); - kfree(skt->fake_cis); - skt->fake_cis = NULL; - s->functions = 0; - mutex_unlock(&s->ops_mutex); - /* now, add the new card */ - ds_event(skt, CS_EVENT_CARD_INSERTION, - CS_EVENT_PRI_LOW); - } - break; ... - } - pcmcia_put_socket(s); - return 0; -} /* ds_event */ to: +static int pcmcia_bus_early_resume(struct pcmcia_socket *skt) +{ + if (!verify_cis_cache(skt)) { + pcmcia_put_socket(skt); + return 0; + } + dev_dbg(&skt->dev, "cis mismatch - different card\n"); + /* first, remove the card */ + pcmcia_bus_remove(skt); + mutex_lock(&skt->ops_mutex); + destroy_cis_cache(skt); + kfree(skt->fake_cis); + skt->fake_cis = NULL; + skt->functions = 0; + mutex_unlock(&skt->ops_mutex); + /* now, add the new card */ + pcmcia_bus_add(skt); + return 0; +} As can be seen, the original function called pcmcia_get_socket() and pcmcia_put_socket() around the guts, whereas the replacement code calls pcmcia_put_socket() only in one path. This creates an imbalance in the refcounting. Testing with pcmcia_put_socket() put removed shows that the bug is gone: dpm_suspend: c1a10998 [pcmcia_socket0] 5 dpm_suspend_noirq: c1a10998 [pcmcia_socket0] 5 dpm_resume_noirq: c1a10998 [pcmcia_socket0] 5 dpm_resume: c1a10998 [pcmcia_socket0] 5 dpm_complete: c1a10998 [pcmcia_socket0] 5 Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-02-09drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmaxAxel Lin
In current code, pltfm->als_vmin is set to LM3530_ALS_WINDOW_mV and pltfm->als_vmax is 0. This does not make sense. I think what we want here is setting pltfm->als_vmax to LM3530_ALS_WINDOW_mV. Both als_vmin and als_vmax local variables will be set to pltfm->als_vmin and pltfm->als_vmax by a few lines latter. Thus also remove a redundant assignment for als_vmin and als_vmax in this patch. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-02-09usb-storage: reorganize target-specific codeAlan Stern
Now that usb-storage has a target_alloc() routine, this patch (as1508) moves some existing target-specific code out of the slave_alloc() routine to where it really belongs. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09SCSI & usb-storage: add flags for VPD pages and REPORT LUNSAlan Stern
This patch (as1507) adds a skip_vpd_pages flag to struct scsi_device and a no_report_luns flag to struct scsi_target. The first is used to control whether sd will look at VPD pages for information on block provisioning, limits, and characteristics. The second prevents scsi_report_lun_scan() from issuing a REPORT LUNS command. The patch also modifies usb-storage to set the new flag bits for all USB devices and targets, and to stop adjusting the scsi_level value. Historically we have seen that USB mass-storage devices often don't support VPD pages or REPORT LUNS properly. Until now we have avoided these things by setting the scsi_level to SCSI_2 for all USB devices. But this has the side effect of storing the LUN bits into the second byte of each CDB, and now we have a report of a device which doesn't like that. The best solution is to stop abusing scsi_level and instead have separate flags for VPD pages and REPORT LUNS. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Perry Wagle <wagle@mac.com> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-07Merge tag 'fbdev-fixes-for-3.3-1' of git://github.com/schandinat/linux-2.6Linus Torvalds
fbdev fixes for 3.3 It includes: - compile fix for fsl-diu-fb - fix for a suspend/resume issue in atmel_lcdfb - fix for a suspend/resume issue in OMAP - workaround for a hardware bug to avoid physical damage in OMAP - really trivial dead code removal in intelfb * tag 'fbdev-fixes-for-3.3-1' of git://github.com/schandinat/linux-2.6: atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume intelfb: remove some dead code drivers/video: compile fixes for fsl-diu-fb.c OMAPDSS: HDMI: PHY burnout fix OMAP: 4430SDP/Panda: add HDMI HPD gpio OMAP: 4430SDP/Panda: setup HDMI GPIO muxes OMAPDSS: remove wrong HDMI HPD muxing OMAP: 4430SDP/Panda: rename HPD GPIO to CT_CP_HPD OMAP: 4430SDP/Panda: use gpio_free_array to free HDMI gpios OMAPDSS: use sync versions of pm_runtime_put
2012-02-07Merge tag 'ib-srpt-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband Cleanups and error path fixes for the new SRP (SCSI RDMA protocol) target. * tag 'ib-srpt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/srpt: Don't return freed pointer from srpt_alloc_ioctx_ring() IB/srpt: Fix ERR_PTR() vs. NULL checking confusion IB/srpt: Remove unneeded <linux/version.h> include IB/srpt: Use ARRAY_SIZE() instead of open-coding IB/srpt: Use DEFINE_SPINLOCK()/LIST_HEAD()
2012-02-07ACPI: remove duplicated lines of merging problems with acpi_processor_addYinghai Lu
Those lines have two copies. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-02-07Merge branch 'upstream-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: wiimote: fix invalid power_supply_powers call HID: wacom: Fix invalid power_supply_powers calls HID: hyperv: Properly disconnect the input device HID: usbhid: fix dead lock between open and disconect
2012-02-07Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: mfd: Avoid twl6040-codec PLL reconfiguration when not needed mfd: Store twl6040-codec mclk configuration
2012-02-07HID: wiimote: fix invalid power_supply_powers callJiri Kosina
Analogically to d7cb3dbd1 ("HID: wacom: Fix invalid power_supply_powers calls"), fix also the same occurence in wiimote driver. Reported-by: przemo@firszt.eu Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-07target: Fix unsupported WRITE_SAME sense payloadMartin Svec
This patch fixes a bug in target-core where unsupported WRITE_SAME ops from a target_check_write_same_discard() failure was incorrectly returning CHECK_CONDITION w/ TCM_INVALID_CDB_FIELD sense data. This was causing some clients to not properly fall back, so go ahead and use the correct TCM_UNSUPPORTED_SCSI_OPCODE sense for this case. Reported-by: Martin Svec <martin.svec@zoner.cz> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07iscsi: use IP_FREEBIND socket optionDax Kelson
Use IP_FREEBIND socket option so that iscsi portal configuration with explicit IP addresses can happen during boot, before network interfaces have been assigned IPs. This is especially important on systemd based Linux boxes where system boot happens asynchronously and non-trivial configuration must be done to get targetcli.service to start synchronously after the network is configured. Reference: http://lists.fedoraproject.org/pipermail/devel/2011-October/158025.html Signed-off-by: Dax Kelson <dkelson@gurulabs.com> Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org> Cc: "Andy Grover" <agrover@redhat.com> Cc: "Lennart Poettering" <lennart@poettering.net> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07iblock: fix handling of large requestsChristoph Hellwig
Requesting to many bvecs upsets bio_alloc_bioset, so limit the number we ask for to the amount it can handle. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07target: handle empty string writes in sysfsDan Carpenter
These are root only and we're not likely to hit the problem in practise, but it makes the static checkers happy. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07iscsi_target: in_aton needs linux/inet.hStephen Rothwell
Fixes this error after a recent nfs cleanup: drivers/target/iscsi/iscsi_target_configfs.c: In function 'lio_target_call_addnptotpg': drivers/target/iscsi/iscsi_target_configfs.c:214:3: error: implicit declaration of function 'in6_pton' [-Werror=implicit-function-declaration] drivers/target/iscsi/iscsi_target_configfs.c:239:3: error: implicit declaration of function 'in_aton' [-Werror=implicit-function-declaration] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07target: Fix iblock se_dev_attrib.unmap_granularityMarco Sanvido
The block layer keeps q->limits.discard_granularity in bytes, but iblock (and the SCSI Block Limits VPD page) keep unmap_granularity in blocks. Report the correct value when exporting block devices by dividing to convert bytes to blocks. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07target: Fix target_submit_cmd() exception handlingNicholas Bellinger
This patch fixes a bug in target_submit_cmd() where the failure path for transport_generic_allocate_tasks() made a direct call to transport_send_check_condition_and_sense() and not calling the final target_put_sess_cmd() release callback. For transport_generic_allocate_tasks() failures, use the proper call to transport_generic_request_failure() to handle kref_put() along with potential internal queue full response processing. It also makes transport_lookup_cmd_lun() failures in target_submit_cmd() use transport_send_check_condition_and_sense() and target_put_sess_cmd() directly to avoid se_cmd->se_dev reference in transport_generic_request_failure() handling. Finally it drops the out_check_cond: label and use direct reference for allocate task failures, and per-se_device queue_full handling is currently not supported for transport_lookup_cmd_lun() failure descriptors due to se_device dependency. Reported-by: Roland Dreier <roland@purestorage.com> Cc: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07target: Change target_submit_cmd() to return voidAndy Grover
Retval not very useful, and may even be harmful. Once submitted, fabrics should expect a sense error if anything goes wrong. All fabrics checking of this retval are useless or broken: fc checks it just to emit more debug output. ib_srpt trickles retval up, then it is ignored. qla2xxx trickles it up, which then causes a bug because the abort goto in qla_target.c thinks cmd hasn't been sent to target. Just returning nothing is best. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07target: accept REQUEST_SENSE with 18bytesSebastian Andrzej Siewior
WindowsXP+BOT issues a MODE_SENSE request with page 0x1c which is not suppoerted by target. Target rejects that command with TCM_INVALID_CDB_FIELD, so far so good. On BOT I can't send the SENSE response back, instead I can only reply that an error occured. The next thing happens is a REQUEST_SENSE request with 18 bytes length. Since the check here is more than 18 bytes I have to NACK that request as well. This is not really required: We check for some additional room, but we never use it. The additional length is set to 0xa so the total length is 0xa + 8 = 18 which is fine with my 18 bytes. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-07md: two small fixes to handling interrupt resync.NeilBrown
1/ If a resync is aborted we should record how far we got (recovery_cp) the last request that we know has completed (->curr_resync_completed) rather than the last request that was submitted (->curr_resync). 2/ When a resync aborts we still want to update the metadata with any changes, so set MD_CHANGE_DEVS even if we 'skip'. Signed-off-by: NeilBrown <neilb@suse.de>
2012-02-06Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
GPIO fixes for v3.3-rc2 Straight forward bug fixes in this branch. A couple of x86 gpio drivers missing spinlock initialization, an API change fixup for the samsung driver and a name typo fix. * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6: gpio: Add missing spin_lock_init in gpio-ml-ioh driver gpio: Add missing spin_lock_init in gpio-pch driver gpio: samsung: adapt to changes in gpio specifier translator function declaration Correct bad gpio naming
2012-02-06Merge tag 'hwmon-fixes-for-3.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging One patch to fix fan detection on NCT6776F. * tag 'hwmon-fixes-for-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (w83627ehf) Fix number of fans for NCT6776F
2012-02-06IB/srpt: Don't return freed pointer from srpt_alloc_ioctx_ring()Jesper Juhl
Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-02-06HID: wacom: Fix invalid power_supply_powers callsPrzemo Firszt
power_supply_powers calls added in 35b4c01e2 ("power_supply: add "powers" links to self-powered HID devices") have to be called after power device is created. This patch also fixes the second call - it has to be "ac" instead of "battery" Signed-off-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06Merge branch 'master' of ↵Jiri Kosina
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into upstream-fixes Sync with Linus' tree. This is necessary to have a base for patch that fixes commit 35b4c01e29b ("power_supply: add "powers" links to self-powered HID devices") which went in through Anton's tree.
2012-02-06spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driverDanny Kukawka
Rename static struct pci_driver pch_spi_pcidev to pch_spi_pcidev_driver to get rid of warnings from modpost checks. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-02-06spi: Add spi-s3c64xx driver dependency on ARCH_EXYNOS4Sylwester Nawrocki
The spi-s3c64xx driver is also used on Exynos4 so update the dependency to enable build on those platforms. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [grant.likely: relax depends to ARCH_EXYNOS instead of ARCH_EXYNOS4] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-02-05hwmon: (w83627ehf) Fix number of fans for NCT6776FGuenter Roeck
NCT6776F can select fan input pins for fans 3 to 5 with a secondary set of chip register bits. Check that second set of bits in addition to the first set to detect if fans 3..5 are monitored. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # 3.0+ Acked-by: Jean Delvare <khali@linux-fr.org>
2012-02-04Merge tag 'fixes-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc arm-soc fixes for 3.3-rc * A series of OMAP regression fixes for merge window fallout * Two patches for Davinci, one removes some misdefined clocks, the other is a regression fix for merge window fallout * Two patches that makes Broadcom bcmring build again (and removes a bunch of unused code in the process) * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: bcmring: fix build failure in mach-bcmring/arch.c ARM: bcmring: remove unused DMA map code ARM: davinci: update mdio bus name ARM: OMAP2+: arch/arm/mach-omap2/smartreflex.c: add missing iounmap ARM: OMAP2+: arch/arm/mach-omap2/devices.c: introduce missing kfree ARM: OMAP: fix MMC2 loopback clock handling ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup ARM: OMAP2+: GPMC: fix device size setup ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter ARM: OMAP3: hwmod data: register dss hwmods after dss_core ARM: OMAP2/3: PRM: fix missing plat/irqs.h build breakage ARM: OMAP2+: io: fix compilation breakage on 2420-only configs ARM: OMAP4: hwmod data: Add names for DMIC memory address space ARM: OMAP3: hwmod data: add SYSC_HAS_ENAWAKEUP for dispc ARM: OMAP2+: hwmod data: split omap2/3 dispc hwmod class ARM: davinci: DA850: remove non-existing pll1_sysclk4-7 clocks ARM: OMAP2: fix regulator warnings ARM: OMAP2: fix omap3 touchbook kconfig warning i2c: OMAP: Fix OMAP1 build error
2012-02-04Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: i8042 - add Lenovo Ideapad U455 to 'reset' blacklist Input: serio_raw - return proper result when serio_raw_read fails Input: document device properties Input: twl4030_keypad - fix comment (trivial) Input: gpio_keys - fix struct device declared inside parameter list Input: evdev - fix variable initialisation
2012-02-04Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds
* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: i.MX SDMA: Fix burstsize settings ARM: mach-shmobile: both USB DMAC instances on sh7372 are slave-only dma: sh_dma: not all SH DMAC implementations support MEMCPY at_hdmac: bugfix for enabling channel irq dmaengine: fix missing 'cnt' in ?: in dmatest
2012-02-04Merge branch 'akpm'Linus Torvalds
* akpm: mm: compaction: check pfn_valid when entering a new MAX_ORDER_NR_PAGES block during isolation for migration readahead: fix pipeline break caused by block plug kprobes: fix a memory leak in function pre_handler_kretprobe() drivers/tty/vt/vt_ioctl.c: fix KDFONTOP 32bit compatibility layer lkdtm: avoid calling lkdtm_do_action() with spinlock held mm/filemap_xip.c: fix race condition in xip_file_fault() mm/memcontrol.c: fix warning with CONFIG_NUMA=n avr32: select generic atomic64_t support mm: postpone migrated page mapping reset xtensa: fix memscan() MAINTAINERS: update lguest F: patterns MAINTAINERS: remove staging sections MAINTAINERS: remove iMX5 section MAINTAINERS: update partitions block F: patterns
2012-02-04Merge tag 'for-linus-3.3' of git://git.infradead.org/~dwmw2/mtd-3.3Linus Torvalds
- Fix a regression in 16-bit Atmel NAND flash which was introduced in 3.1 - Fix breakage with MTD suspend caused by the API rework - Fix a problem with resetting the MX28 BCH module - A couple of other trivial fixes * tag 'for-linus-3.3-20120204' of git://git.infradead.org/~dwmw2/mtd-3.3: Revert "mtd: atmel_nand: optimize read/write buffer functions" mtd: fix MTD suspend jffs2: do not initialize variable unnecessarily mtd: gpmi-nand bugfix: reset the BCH module when it is not MX23 mtd: nand: fix typo in comment